text
stringlengths 2
100k
| meta
dict |
---|---|
$coord
2.82781861325240 2.96439280874170 3.12827803849279 o
7.19124230791576 0.98723342603994 4.89004701836746 o
4.95491880597601 4.82830910314898 8.74847811174740 o
0.19290883043307 2.30645007856310 8.72969832061507 o
-2.01592208020090 6.16478744235115 4.87273962147340 o
0.66183062221384 7.07392578563696 0.27767968372345 o
4.55701736204879 0.06291337111965 3.31745840478609 si
-2.10064209975148 3.63969476409878 6.81014625000326 si
2.31009832827224 4.12572862149043 0.08842485276656 si
$user-defined bonds
$cell
9.28422449595511046 9.28422449595511046 10.21434769907115 90.0000 90.0000 120.0000
$periodic 3
$end
| {
"pile_set_name": "Github"
} |
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 2015 Intel Corporation. All rights reserved. */
#include <linux/device.h>
#include <linux/io.h>
#include <linux/kasan.h>
#include <linux/memory_hotplug.h>
#include <linux/mm.h>
#include <linux/pfn_t.h>
#include <linux/swap.h>
#include <linux/mmzone.h>
#include <linux/swapops.h>
#include <linux/types.h>
#include <linux/wait_bit.h>
#include <linux/xarray.h>
static DEFINE_XARRAY(pgmap_array);
/*
* The memremap() and memremap_pages() interfaces are alternately used
* to map persistent memory namespaces. These interfaces place different
* constraints on the alignment and size of the mapping (namespace).
* memremap() can map individual PAGE_SIZE pages. memremap_pages() can
* only map subsections (2MB), and at least one architecture (PowerPC)
* the minimum mapping granularity of memremap_pages() is 16MB.
*
* The role of memremap_compat_align() is to communicate the minimum
* arch supported alignment of a namespace such that it can freely
* switch modes without violating the arch constraint. Namely, do not
* allow a namespace to be PAGE_SIZE aligned since that namespace may be
* reconfigured into a mode that requires SUBSECTION_SIZE alignment.
*/
#ifndef CONFIG_ARCH_HAS_MEMREMAP_COMPAT_ALIGN
unsigned long memremap_compat_align(void)
{
return SUBSECTION_SIZE;
}
EXPORT_SYMBOL_GPL(memremap_compat_align);
#endif
#ifdef CONFIG_DEV_PAGEMAP_OPS
DEFINE_STATIC_KEY_FALSE(devmap_managed_key);
EXPORT_SYMBOL(devmap_managed_key);
static atomic_t devmap_managed_enable;
static void devmap_managed_enable_put(void)
{
if (atomic_dec_and_test(&devmap_managed_enable))
static_branch_disable(&devmap_managed_key);
}
static int devmap_managed_enable_get(struct dev_pagemap *pgmap)
{
if (pgmap->type == MEMORY_DEVICE_PRIVATE &&
(!pgmap->ops || !pgmap->ops->page_free)) {
WARN(1, "Missing page_free method\n");
return -EINVAL;
}
if (atomic_inc_return(&devmap_managed_enable) == 1)
static_branch_enable(&devmap_managed_key);
return 0;
}
#else
static int devmap_managed_enable_get(struct dev_pagemap *pgmap)
{
return -EINVAL;
}
static void devmap_managed_enable_put(void)
{
}
#endif /* CONFIG_DEV_PAGEMAP_OPS */
static void pgmap_array_delete(struct resource *res)
{
xa_store_range(&pgmap_array, PHYS_PFN(res->start), PHYS_PFN(res->end),
NULL, GFP_KERNEL);
synchronize_rcu();
}
static unsigned long pfn_first(struct dev_pagemap *pgmap)
{
return PHYS_PFN(pgmap->res.start) +
vmem_altmap_offset(pgmap_altmap(pgmap));
}
static unsigned long pfn_end(struct dev_pagemap *pgmap)
{
const struct resource *res = &pgmap->res;
return (res->start + resource_size(res)) >> PAGE_SHIFT;
}
static unsigned long pfn_next(unsigned long pfn)
{
if (pfn % 1024 == 0)
cond_resched();
return pfn + 1;
}
#define for_each_device_pfn(pfn, map) \
for (pfn = pfn_first(map); pfn < pfn_end(map); pfn = pfn_next(pfn))
static void dev_pagemap_kill(struct dev_pagemap *pgmap)
{
if (pgmap->ops && pgmap->ops->kill)
pgmap->ops->kill(pgmap);
else
percpu_ref_kill(pgmap->ref);
}
static void dev_pagemap_cleanup(struct dev_pagemap *pgmap)
{
if (pgmap->ops && pgmap->ops->cleanup) {
pgmap->ops->cleanup(pgmap);
} else {
wait_for_completion(&pgmap->done);
percpu_ref_exit(pgmap->ref);
}
/*
* Undo the pgmap ref assignment for the internal case as the
* caller may re-enable the same pgmap.
*/
if (pgmap->ref == &pgmap->internal_ref)
pgmap->ref = NULL;
}
void memunmap_pages(struct dev_pagemap *pgmap)
{
struct resource *res = &pgmap->res;
struct page *first_page;
unsigned long pfn;
int nid;
dev_pagemap_kill(pgmap);
for_each_device_pfn(pfn, pgmap)
put_page(pfn_to_page(pfn));
dev_pagemap_cleanup(pgmap);
/* make sure to access a memmap that was actually initialized */
first_page = pfn_to_page(pfn_first(pgmap));
/* pages are dead and unused, undo the arch mapping */
nid = page_to_nid(first_page);
mem_hotplug_begin();
remove_pfn_range_from_zone(page_zone(first_page), PHYS_PFN(res->start),
PHYS_PFN(resource_size(res)));
if (pgmap->type == MEMORY_DEVICE_PRIVATE) {
__remove_pages(PHYS_PFN(res->start),
PHYS_PFN(resource_size(res)), NULL);
} else {
arch_remove_memory(nid, res->start, resource_size(res),
pgmap_altmap(pgmap));
kasan_remove_zero_shadow(__va(res->start), resource_size(res));
}
mem_hotplug_done();
untrack_pfn(NULL, PHYS_PFN(res->start), resource_size(res));
pgmap_array_delete(res);
WARN_ONCE(pgmap->altmap.alloc, "failed to free all reserved pages\n");
devmap_managed_enable_put();
}
EXPORT_SYMBOL_GPL(memunmap_pages);
static void devm_memremap_pages_release(void *data)
{
memunmap_pages(data);
}
static void dev_pagemap_percpu_release(struct percpu_ref *ref)
{
struct dev_pagemap *pgmap =
container_of(ref, struct dev_pagemap, internal_ref);
complete(&pgmap->done);
}
/*
* Not device managed version of dev_memremap_pages, undone by
* memunmap_pages(). Please use dev_memremap_pages if you have a struct
* device available.
*/
void *memremap_pages(struct dev_pagemap *pgmap, int nid)
{
struct resource *res = &pgmap->res;
struct dev_pagemap *conflict_pgmap;
struct mhp_params params = {
/*
* We do not want any optional features only our own memmap
*/
.altmap = pgmap_altmap(pgmap),
.pgprot = PAGE_KERNEL,
};
int error, is_ram;
bool need_devmap_managed = true;
switch (pgmap->type) {
case MEMORY_DEVICE_PRIVATE:
if (!IS_ENABLED(CONFIG_DEVICE_PRIVATE)) {
WARN(1, "Device private memory not supported\n");
return ERR_PTR(-EINVAL);
}
if (!pgmap->ops || !pgmap->ops->migrate_to_ram) {
WARN(1, "Missing migrate_to_ram method\n");
return ERR_PTR(-EINVAL);
}
if (!pgmap->owner) {
WARN(1, "Missing owner\n");
return ERR_PTR(-EINVAL);
}
break;
case MEMORY_DEVICE_FS_DAX:
if (!IS_ENABLED(CONFIG_ZONE_DEVICE) ||
IS_ENABLED(CONFIG_FS_DAX_LIMITED)) {
WARN(1, "File system DAX not supported\n");
return ERR_PTR(-EINVAL);
}
break;
case MEMORY_DEVICE_GENERIC:
need_devmap_managed = false;
break;
case MEMORY_DEVICE_PCI_P2PDMA:
params.pgprot = pgprot_noncached(params.pgprot);
need_devmap_managed = false;
break;
default:
WARN(1, "Invalid pgmap type %d\n", pgmap->type);
break;
}
if (!pgmap->ref) {
if (pgmap->ops && (pgmap->ops->kill || pgmap->ops->cleanup))
return ERR_PTR(-EINVAL);
init_completion(&pgmap->done);
error = percpu_ref_init(&pgmap->internal_ref,
dev_pagemap_percpu_release, 0, GFP_KERNEL);
if (error)
return ERR_PTR(error);
pgmap->ref = &pgmap->internal_ref;
} else {
if (!pgmap->ops || !pgmap->ops->kill || !pgmap->ops->cleanup) {
WARN(1, "Missing reference count teardown definition\n");
return ERR_PTR(-EINVAL);
}
}
if (need_devmap_managed) {
error = devmap_managed_enable_get(pgmap);
if (error)
return ERR_PTR(error);
}
conflict_pgmap = get_dev_pagemap(PHYS_PFN(res->start), NULL);
if (conflict_pgmap) {
WARN(1, "Conflicting mapping in same section\n");
put_dev_pagemap(conflict_pgmap);
error = -ENOMEM;
goto err_array;
}
conflict_pgmap = get_dev_pagemap(PHYS_PFN(res->end), NULL);
if (conflict_pgmap) {
WARN(1, "Conflicting mapping in same section\n");
put_dev_pagemap(conflict_pgmap);
error = -ENOMEM;
goto err_array;
}
is_ram = region_intersects(res->start, resource_size(res),
IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE);
if (is_ram != REGION_DISJOINT) {
WARN_ONCE(1, "%s attempted on %s region %pr\n", __func__,
is_ram == REGION_MIXED ? "mixed" : "ram", res);
error = -ENXIO;
goto err_array;
}
error = xa_err(xa_store_range(&pgmap_array, PHYS_PFN(res->start),
PHYS_PFN(res->end), pgmap, GFP_KERNEL));
if (error)
goto err_array;
if (nid < 0)
nid = numa_mem_id();
error = track_pfn_remap(NULL, ¶ms.pgprot, PHYS_PFN(res->start),
0, resource_size(res));
if (error)
goto err_pfn_remap;
mem_hotplug_begin();
/*
* For device private memory we call add_pages() as we only need to
* allocate and initialize struct page for the device memory. More-
* over the device memory is un-accessible thus we do not want to
* create a linear mapping for the memory like arch_add_memory()
* would do.
*
* For all other device memory types, which are accessible by
* the CPU, we do want the linear mapping and thus use
* arch_add_memory().
*/
if (pgmap->type == MEMORY_DEVICE_PRIVATE) {
error = add_pages(nid, PHYS_PFN(res->start),
PHYS_PFN(resource_size(res)), ¶ms);
} else {
error = kasan_add_zero_shadow(__va(res->start), resource_size(res));
if (error) {
mem_hotplug_done();
goto err_kasan;
}
error = arch_add_memory(nid, res->start, resource_size(res),
¶ms);
}
if (!error) {
struct zone *zone;
zone = &NODE_DATA(nid)->node_zones[ZONE_DEVICE];
move_pfn_range_to_zone(zone, PHYS_PFN(res->start),
PHYS_PFN(resource_size(res)), params.altmap);
}
mem_hotplug_done();
if (error)
goto err_add_memory;
/*
* Initialization of the pages has been deferred until now in order
* to allow us to do the work while not holding the hotplug lock.
*/
memmap_init_zone_device(&NODE_DATA(nid)->node_zones[ZONE_DEVICE],
PHYS_PFN(res->start),
PHYS_PFN(resource_size(res)), pgmap);
percpu_ref_get_many(pgmap->ref, pfn_end(pgmap) - pfn_first(pgmap));
return __va(res->start);
err_add_memory:
kasan_remove_zero_shadow(__va(res->start), resource_size(res));
err_kasan:
untrack_pfn(NULL, PHYS_PFN(res->start), resource_size(res));
err_pfn_remap:
pgmap_array_delete(res);
err_array:
dev_pagemap_kill(pgmap);
dev_pagemap_cleanup(pgmap);
devmap_managed_enable_put();
return ERR_PTR(error);
}
EXPORT_SYMBOL_GPL(memremap_pages);
/**
* devm_memremap_pages - remap and provide memmap backing for the given resource
* @dev: hosting device for @res
* @pgmap: pointer to a struct dev_pagemap
*
* Notes:
* 1/ At a minimum the res and type members of @pgmap must be initialized
* by the caller before passing it to this function
*
* 2/ The altmap field may optionally be initialized, in which case
* PGMAP_ALTMAP_VALID must be set in pgmap->flags.
*
* 3/ The ref field may optionally be provided, in which pgmap->ref must be
* 'live' on entry and will be killed and reaped at
* devm_memremap_pages_release() time, or if this routine fails.
*
* 4/ res is expected to be a host memory range that could feasibly be
* treated as a "System RAM" range, i.e. not a device mmio range, but
* this is not enforced.
*/
void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
{
int error;
void *ret;
ret = memremap_pages(pgmap, dev_to_node(dev));
if (IS_ERR(ret))
return ret;
error = devm_add_action_or_reset(dev, devm_memremap_pages_release,
pgmap);
if (error)
return ERR_PTR(error);
return ret;
}
EXPORT_SYMBOL_GPL(devm_memremap_pages);
void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap)
{
devm_release_action(dev, devm_memremap_pages_release, pgmap);
}
EXPORT_SYMBOL_GPL(devm_memunmap_pages);
unsigned long vmem_altmap_offset(struct vmem_altmap *altmap)
{
/* number of pfns from base where pfn_to_page() is valid */
if (altmap)
return altmap->reserve + altmap->free;
return 0;
}
void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns)
{
altmap->alloc -= nr_pfns;
}
/**
* get_dev_pagemap() - take a new live reference on the dev_pagemap for @pfn
* @pfn: page frame number to lookup page_map
* @pgmap: optional known pgmap that already has a reference
*
* If @pgmap is non-NULL and covers @pfn it will be returned as-is. If @pgmap
* is non-NULL but does not cover @pfn the reference to it will be released.
*/
struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
struct dev_pagemap *pgmap)
{
resource_size_t phys = PFN_PHYS(pfn);
/*
* In the cached case we're already holding a live reference.
*/
if (pgmap) {
if (phys >= pgmap->res.start && phys <= pgmap->res.end)
return pgmap;
put_dev_pagemap(pgmap);
}
/* fall back to slow path lookup */
rcu_read_lock();
pgmap = xa_load(&pgmap_array, PHYS_PFN(phys));
if (pgmap && !percpu_ref_tryget_live(pgmap->ref))
pgmap = NULL;
rcu_read_unlock();
return pgmap;
}
EXPORT_SYMBOL_GPL(get_dev_pagemap);
#ifdef CONFIG_DEV_PAGEMAP_OPS
void free_devmap_managed_page(struct page *page)
{
/* notify page idle for dax */
if (!is_device_private_page(page)) {
wake_up_var(&page->_refcount);
return;
}
/* Clear Active bit in case of parallel mark_page_accessed */
__ClearPageActive(page);
__ClearPageWaiters(page);
mem_cgroup_uncharge(page);
/*
* When a device_private page is freed, the page->mapping field
* may still contain a (stale) mapping value. For example, the
* lower bits of page->mapping may still identify the page as an
* anonymous page. Ultimately, this entire field is just stale
* and wrong, and it will cause errors if not cleared. One
* example is:
*
* migrate_vma_pages()
* migrate_vma_insert_page()
* page_add_new_anon_rmap()
* __page_set_anon_rmap()
* ...checks page->mapping, via PageAnon(page) call,
* and incorrectly concludes that the page is an
* anonymous page. Therefore, it incorrectly,
* silently fails to set up the new anon rmap.
*
* For other types of ZONE_DEVICE pages, migration is either
* handled differently or not done at all, so there is no need
* to clear page->mapping.
*/
page->mapping = NULL;
page->pgmap->ops->page_free(page);
}
#endif /* CONFIG_DEV_PAGEMAP_OPS */
| {
"pile_set_name": "Github"
} |
/*
* Summary: macros for marking symbols as exportable/importable.
* Description: macros for marking symbols as exportable/importable.
*
* Copy: See Copyright for the status of this software.
*
* Author: Igor Zlatkovic <[email protected]>
*/
#ifndef __XSLT_EXPORTS_H__
#define __XSLT_EXPORTS_H__
/**
* XSLTPUBFUN:
* XSLTPUBFUN, XSLTPUBVAR, XSLTCALL
*
* Macros which declare an exportable function, an exportable variable and
* the calling convention used for functions.
*
* Please use an extra block for every platform/compiler combination when
* modifying this, rather than overlong #ifdef lines. This helps
* readability as well as the fact that different compilers on the same
* platform might need different definitions.
*/
/**
* XSLTPUBFUN:
*
* Macros which declare an exportable function
*/
#define XSLTPUBFUN
/**
* XSLTPUBVAR:
*
* Macros which declare an exportable variable
*/
#define XSLTPUBVAR extern
/**
* XSLTCALL:
*
* Macros which declare the called convention for exported functions
*/
#define XSLTCALL
/** DOC_DISABLE */
/* Windows platform with MS compiler */
#if defined(_WIN32) && defined(_MSC_VER)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with Borland compiler */
#if defined(_WIN32) && defined(__BORLANDC__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport) extern
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Windows platform with GNU compiler (Mingw) */
#if defined(_WIN32) && defined(__MINGW32__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
/*
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
*/
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport) extern
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR extern
#endif
#endif
#define XSLTCALL __cdecl
#if !defined _REENTRANT
#define _REENTRANT
#endif
#endif
/* Cygwin platform, GNU compiler */
#if defined(_WIN32) && defined(__CYGWIN__)
#undef XSLTPUBFUN
#undef XSLTPUBVAR
#undef XSLTCALL
#if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC)
#define XSLTPUBFUN __declspec(dllexport)
#define XSLTPUBVAR __declspec(dllexport)
#else
#define XSLTPUBFUN
#if !defined(LIBXSLT_STATIC)
#define XSLTPUBVAR __declspec(dllimport) extern
#else
#define XSLTPUBVAR
#endif
#endif
#define XSLTCALL __cdecl
#endif
/* Compatibility */
#if !defined(LIBXSLT_PUBLIC)
#define LIBXSLT_PUBLIC XSLTPUBVAR
#endif
#endif /* __XSLT_EXPORTS_H__ */
| {
"pile_set_name": "Github"
} |
## Base configurations.
INCS=-Ilua
DEFS=-DNDEBUG
CFLAGS=-Wall -O2 -fno-plt -fno-stack-protector -flto
LDFLAGS=-s
LIBS=-lm
SRCS=lua/onelua.c rpmalloc/rpmalloc.c lfs.c sys.c hasher.c lpeglabel/*.c
HDRS=lua/*.h lpeglabel/*.h
EXE=nelua-lua
RM=rm -f
PREFIX=/usr/local
## Tune some values for the Lua interpreter
DEFS+=-DLUA_COMPAT_5_3 -DLUAI_MAXCSTACK=16384 -DLUA_USE_RPMALLOC
## Tune rpmalloc
DEFS+=-DENABLE_GLOBAL_CACHE=0 -DBUILD_DYNAMIC_LINK
## Host system detection.
SYS:=$(shell uname -s)
ifneq (,$(findstring MINGW,$(SYS)))
SYS=Windows
endif
ifneq (,$(findstring MSYS,$(SYS)))
SYS=Windows
endif
## Install path
DEFS+=-DLUA_ROOT='"$(PREFIX)/"'
## Setup flags for the host system.
ifeq ($(SYS), Linux)
CC=gcc
LDFLAGS+=-Wl,-E
LIBS+=-ldl
DEFS+=-DLUA_USE_LINUX
else ifeq ($(SYS), Windows)
CC=x86_64-w64-mingw32-gcc
EXE=nelua-lua.exe
else ifeq ($(SYS), Darwin)
CC=clang
LDFLAGS=-rdynamic
DEFS+=-DLUA_USE_MACOSX
else # probably POSIX
CC=cc
LDFLAGS+=-Wl,-E
DEFS+=LUA_USE_POSIX
endif
default: $(EXE)
## Target to compile the Lua interpreter.
$(EXE): $(SRCS) $(HDRS) lua/*.c Makefile
$(CC) -o $(EXE) \
$(DEFS) \
$(INCS) \
$(CFLAGS) $(MYCFLAGS) \
$(LDFLAGS) $(MYLDFLAGS) \
$(SRCS) $(MYSRCS) \
$(LIBS) $(MYLIBS)
clean:
$(RM) $(EXE)
| {
"pile_set_name": "Github"
} |
package linearmodel
import (
"flag"
"fmt"
"image/color"
"log"
"math"
"os"
"os/exec"
"time"
"github.com/pa-m/sklearn/base"
"github.com/pa-m/sklearn/datasets"
"gonum.org/v1/gonum/diff/fd"
"gonum.org/v1/gonum/mat"
"gonum.org/v1/gonum/optimize"
"gonum.org/v1/plot"
"gonum.org/v1/plot/plotter"
"gonum.org/v1/plot/vg"
"gonum.org/v1/plot/vg/draw"
)
var _ base.Predicter = &LogisticRegression{}
var visualDebug = flag.Bool("visual", false, "output images for benchmarks and test data")
func ExampleLogisticRegression() {
// adapted from http://scikit-learn.org/stable/_downloads/plot_iris_logistic.ipynb
ds := datasets.LoadIris()
// we only take the first _ features.
nSamples, _ := ds.X.Dims()
X, YTrueClasses := ds.X.Slice(0, nSamples, 0, 2).(*mat.Dense), ds.Y
h := .02 // step size in the mesh
regr := NewLogisticRegression()
regr.Alpha = 1e-5
regr.beforeMinimize = func(problem optimize.Problem, initX []float64) {
// check gradients
settings := &fd.Settings{Step: 1e-8}
gradFromModel := make([]float64, len(initX))
gradFromFD := make([]float64, len(initX))
problem.Func(initX)
problem.Grad(gradFromModel, initX)
fd.Gradient(gradFromFD, problem.Func, initX, settings)
for i := range initX {
if math.Abs(gradFromFD[i]-gradFromModel[i]) > 1e-4 {
panic(fmt.Errorf("bad gradient, expected:\n%.3f\ngot:\n%.3f", gradFromFD, gradFromModel))
}
}
}
log.SetPrefix("ExampleLogisticRegression_Fit_iris:")
defer log.SetPrefix("")
// we create an instance of our Classifier and fit the data.
regr.Fit(X, YTrueClasses)
accuracy := regr.Score(X, YTrueClasses)
if accuracy >= 0.833 {
fmt.Println("ok")
} else {
fmt.Printf("Accuracy:%.3f\n", accuracy)
}
// Put the result into a color plot
if *visualDebug {
// Plot the decision boundary. For that, we will assign a color to each point in the mesh [x_min, x_max]x[y_min, y_max].
var xmin, xmax = mat.Min(X.ColView(0)) - .5, mat.Max(X.ColView(0)) + .5
var ymin, ymax = mat.Min(X.ColView(1)) - .5, mat.Max(X.ColView(1)) + .5
// xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
nparange := func(min, max, h float64) []float64 {
c := make([]float64, 0)
for v := min; v <= max; v += h {
c = append(c, v)
}
return c
}
npmeshgrid := func(xrange, yrange []float64) (xx, yy []float64) {
for y := ymin; y <= ymax; y += h {
for x := xmin; x <= xmax; x += h {
xx = append(xx, x)
yy = append(yy, y)
}
}
return
}
npc := func(c ...[]float64) (XZ *mat.Dense) {
XZ = mat.NewDense(len(c[0]), len(c), nil)
for j, src := range c {
XZ.SetCol(j, src)
}
return
}
var xx, yy = npmeshgrid(nparange(xmin, xmax, h), nparange(ymin, ymax, h))
Xgrid := npc(xx, yy)
Z := regr.Predict(Xgrid, nil)
plt, _ := plot.New()
xys := func(X, Y mat.Matrix, cls int) (xy plotter.XYs) {
imax, _ := Y.Dims()
for i := 0; i < imax; i++ {
if int(Y.At(i, 0)) == cls {
xy = append(xy, struct{ X, Y float64 }{X.At(i, 0), X.At(i, 1)})
}
}
return
}
colors1 := []color.RGBA{{166, 206, 227, 255}, {253, 191, 111, 255}, {177, 89, 40, 255}}
for cls := 0; cls <= 2; cls++ {
s, _ := plotter.NewScatter(xys(Xgrid, Z, cls))
s.GlyphStyle.Shape = draw.BoxGlyph{}
s.GlyphStyle.Color = colors1[cls]
s.GlyphStyle.Radius = 1
plt.Add(s)
s1, _ := plotter.NewScatter(xys(X, YTrueClasses, cls))
s1.GlyphStyle.Shape = draw.CircleGlyph{}
s1.GlyphStyle.Radius = 4
s1.GlyphStyle.Color = colors1[cls]
plt.Add(s1)
plt.Legend.Add(ds.TargetNames[cls], s1)
}
plt.X.Label.Text = ds.FeatureNames[0]
plt.Y.Label.Text = ds.FeatureNames[1]
// Save the plot to a PNG file.
pngfile := "/tmp/ExampleLogisticRegression.png"
os.Remove(pngfile)
if err := plt.Save(7*vg.Inch, 7*vg.Inch, pngfile); err != nil {
panic(err)
}
cmd := exec.Command("display", pngfile)
err := cmd.Start()
if err != nil {
fmt.Println(err.Error())
}
time.Sleep(200 * time.Millisecond)
os.Remove(pngfile)
}
// Output:
// ok
}
| {
"pile_set_name": "Github"
} |
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
// Hinnant & John Maddock 2000.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.lslboost.org/LICENSE_1_0.txt).
//
// See http://www.lslboost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_ADD_CV_HPP_INCLUDED
#define BOOST_TT_ADD_CV_HPP_INCLUDED
#include <lslboost/config.hpp>
// should be the last #include
#include <lslboost/type_traits/detail/type_trait_def.hpp>
namespace lslboost {
// * convert a type T to a const volatile type - add_cv<T>
// this is not required since the result is always
// the same as "T const volatile", but it does suppress warnings
// from some compilers:
#if defined(BOOST_MSVC)
// This bogus warning will appear when add_volatile is applied to a
// const volatile reference because we can't detect const volatile
// references with MSVC6.
# pragma warning(push)
# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
#endif
BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_cv,T,T const volatile)
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&)
#endif
} // namespace lslboost
#include <lslboost/type_traits/detail/type_trait_undef.hpp>
#endif // BOOST_TT_ADD_CV_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
/*!
@file
Forward declares `boost::hana::slice` and `boost::hana::slice_c`.
@copyright Louis Dionne 2013-2016
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_FWD_SLICE_HPP
#define BOOST_HANA_FWD_SLICE_HPP
#include <boost/hana/config.hpp>
#include <boost/hana/core/when.hpp>
#include <cstddef>
BOOST_HANA_NAMESPACE_BEGIN
//! Extract the elements of a `Sequence` at the given indices.
//! @ingroup group-Sequence
//!
//! Given an arbitrary sequence of `indices`, `slice` returns a new
//! sequence of the elements of the original sequence that appear at
//! those indices. In other words,
//! @code
//! slice([x1, ..., xn], [i1, ..., ik]) == [x_i1, ..., x_ik]
//! @endcode
//!
//! The indices do not have to be ordered or contiguous in any particular
//! way, but they must not be out of the bounds of the sequence. It is
//! also possible to specify the same index multiple times, in which case
//! the element at this index will be repeatedly included in the resulting
//! sequence.
//!
//!
//! @param xs
//! The sequence from which a subsequence is extracted.
//!
//! @param indices
//! A compile-time `Foldable` containing non-negative `IntegralConstant`s
//! representing the indices. The indices are 0-based, and they must all
//! be in bounds of the `xs` sequence. Note that any `Foldable` will
//! really do (no need for an `Iterable`, for example); the linearization
//! of the `indices` is used to determine the order of the elements
//! included in the slice.
//!
//!
//! Example
//! -------
//! @include example/slice.cpp
#ifdef BOOST_HANA_DOXYGEN_INVOKED
constexpr auto slice = [](auto&& xs, auto&& indices) {
return tag-dispatched;
};
#else
template <typename S, typename = void>
struct slice_impl : slice_impl<S, when<true>> { };
struct slice_t {
template <typename Xs, typename Indices>
constexpr auto operator()(Xs&& xs, Indices&& indices) const;
};
constexpr slice_t slice{};
#endif
//! Shorthand to `slice` a contiguous range of elements.
//! @ingroup group-Sequence
//!
//! `slice_c` is simply a shorthand to slice a contiguous range of
//! elements. In particular, `slice_c<from, to>(xs)` is equivalent to
//! `slice(xs, range_c<std::size_t, from, to>)`, which simply slices
//! all the elements of `xs` contained in the half-open interval
//! delimited by `[from, to)`. Like for `slice`, the indices used with
//! `slice_c` are 0-based and they must be in the bounds of the sequence
//! being sliced.
//!
//!
//! @tparam from
//! The index of the first element in the slice.
//!
//! @tparam to
//! One-past the index of the last element in the slice. It must hold
//! that `from <= to`.
//!
//!
//! Example
//! -------
//! @include example/slice_c.cpp
#ifdef BOOST_HANA_DOXYGEN_INVOKED
template <std::size_t from, std::size_t to>
constexpr auto slice_c = [](auto&& xs) {
return hana::slice(forwarded(xs), hana::range_c<std::size_t, from, to>);
};
#else
template <std::size_t from, std::size_t to>
struct slice_c_t;
template <std::size_t from, std::size_t to>
constexpr slice_c_t<from, to> slice_c{};
#endif
BOOST_HANA_NAMESPACE_END
#endif // !BOOST_HANA_FWD_SLICE_HPP
| {
"pile_set_name": "Github"
} |
PREFIX : <http://example.org/>
SELECT ?s ?num WHERE {
?s ?p ?num
FILTER isNumeric(?num)
}
| {
"pile_set_name": "Github"
} |
namespace MarshmallowPie.GraphQL.Schemas
{
public class MarkSchemaPublishedInput
{
public MarkSchemaPublishedInput(
string environmentName,
string schemaName,
string externalId,
string? clientMutationId)
{
EnvironmentName = environmentName;
SchemaName = schemaName;
ExternalId = externalId;
ClientMutationId = clientMutationId;
}
public string EnvironmentName { get; }
public string SchemaName { get; }
public string ExternalId { get; }
public string? ClientMutationId { get; }
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
* <p>
* Describes an elastic inference accelerator.
* </p>
*
* @see <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/LaunchTemplateElasticInferenceAcceleratorResponse"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LaunchTemplateElasticInferenceAcceleratorResponse implements Serializable, Cloneable {
/**
* <p>
* The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
* </p>
*/
private String type;
/**
* <p>
* The number of elastic inference accelerators to attach to the instance.
* </p>
* <p>
* Default: 1
* </p>
*/
private Integer count;
/**
* <p>
* The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
* </p>
*
* @param type
* The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and
* eia1.xlarge.
*/
public void setType(String type) {
this.type = type;
}
/**
* <p>
* The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
* </p>
*
* @return The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and
* eia1.xlarge.
*/
public String getType() {
return this.type;
}
/**
* <p>
* The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.
* </p>
*
* @param type
* The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and
* eia1.xlarge.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchTemplateElasticInferenceAcceleratorResponse withType(String type) {
setType(type);
return this;
}
/**
* <p>
* The number of elastic inference accelerators to attach to the instance.
* </p>
* <p>
* Default: 1
* </p>
*
* @param count
* The number of elastic inference accelerators to attach to the instance. </p>
* <p>
* Default: 1
*/
public void setCount(Integer count) {
this.count = count;
}
/**
* <p>
* The number of elastic inference accelerators to attach to the instance.
* </p>
* <p>
* Default: 1
* </p>
*
* @return The number of elastic inference accelerators to attach to the instance. </p>
* <p>
* Default: 1
*/
public Integer getCount() {
return this.count;
}
/**
* <p>
* The number of elastic inference accelerators to attach to the instance.
* </p>
* <p>
* Default: 1
* </p>
*
* @param count
* The number of elastic inference accelerators to attach to the instance. </p>
* <p>
* Default: 1
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchTemplateElasticInferenceAcceleratorResponse withCount(Integer count) {
setCount(count);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getCount() != null)
sb.append("Count: ").append(getCount());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LaunchTemplateElasticInferenceAcceleratorResponse == false)
return false;
LaunchTemplateElasticInferenceAcceleratorResponse other = (LaunchTemplateElasticInferenceAcceleratorResponse) obj;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getCount() == null ^ this.getCount() == null)
return false;
if (other.getCount() != null && other.getCount().equals(this.getCount()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getCount() == null) ? 0 : getCount().hashCode());
return hashCode;
}
@Override
public LaunchTemplateElasticInferenceAcceleratorResponse clone() {
try {
return (LaunchTemplateElasticInferenceAcceleratorResponse) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| {
"pile_set_name": "Github"
} |
/**
* collectd - src/utils_fbhash.c
* Copyright (C) 2009 Florian octo Forster
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Florian octo Forster <octo at collectd.org>
**/
#include "collectd.h"
#include "plugin.h"
#include "utils/avltree/avltree.h"
#include "utils_fbhash.h"
struct fbhash_s {
char *filename;
time_t mtime;
pthread_mutex_t lock;
c_avl_tree_t *tree;
};
/*
* Private functions
*/
static void fbh_free_tree(c_avl_tree_t *tree) /* {{{ */
{
int status;
if (tree == NULL)
return;
while (42) {
char *key = NULL;
char *value = NULL;
status = c_avl_pick(tree, (void *)&key, (void *)&value);
if (status != 0)
break;
free(key);
free(value);
}
c_avl_destroy(tree);
} /* }}} void fbh_free_tree */
static int fbh_read_file(fbhash_t *h) /* {{{ */
{
FILE *fh;
char buffer[4096];
struct flock fl = {0};
c_avl_tree_t *tree;
int status;
fh = fopen(h->filename, "r");
if (fh == NULL)
return -1;
fl.l_type = F_RDLCK;
fl.l_whence = SEEK_SET;
/* TODO: Lock file? -> fcntl */
status = fcntl(fileno(fh), F_SETLK, &fl);
if (status != 0) {
fclose(fh);
return -1;
}
tree = c_avl_create((int (*)(const void *, const void *))strcmp);
if (tree == NULL) {
fclose(fh);
return -1;
}
/* Read `fh' into `tree' */
while (fgets(buffer, sizeof(buffer), fh) != NULL) /* {{{ */
{
size_t len;
char *key;
char *value;
char *key_copy;
char *value_copy;
buffer[sizeof(buffer) - 1] = '\0';
len = strlen(buffer);
/* Remove trailing newline characters. */
while ((len > 0) &&
((buffer[len - 1] == '\n') || (buffer[len - 1] == '\r'))) {
len--;
buffer[len] = 0;
}
/* Seek first non-space character */
key = buffer;
while ((*key != 0) && isspace((int)*key))
key++;
/* Skip empty lines and comments */
if ((key[0] == 0) || (key[0] == '#'))
continue;
/* Seek first colon */
value = strchr(key, ':');
if (value == NULL)
continue;
/* Null-terminate `key'. */
*value = 0;
value++;
/* Skip leading whitespace */
while ((*value != 0) && isspace((int)*value))
value++;
/* Skip lines without value */
if (value[0] == 0)
continue;
key_copy = strdup(key);
value_copy = strdup(value);
if ((key_copy == NULL) || (value_copy == NULL)) {
free(key_copy);
free(value_copy);
continue;
}
status = c_avl_insert(tree, key_copy, value_copy);
if (status != 0) {
free(key_copy);
free(value_copy);
continue;
}
DEBUG("utils_fbhash: fbh_read_file: key = %s; value = %s;", key, value);
} /* }}} while (fgets) */
fclose(fh);
fbh_free_tree(h->tree);
h->tree = tree;
return 0;
} /* }}} int fbh_read_file */
static int fbh_check_file(fbhash_t *h) /* {{{ */
{
struct stat statbuf = {0};
int status;
status = stat(h->filename, &statbuf);
if (status != 0)
return -1;
if (h->mtime >= statbuf.st_mtime)
return 0;
status = fbh_read_file(h);
if (status == 0)
h->mtime = statbuf.st_mtime;
return status;
} /* }}} int fbh_check_file */
/*
* Public functions
*/
fbhash_t *fbh_create(const char *file) /* {{{ */
{
fbhash_t *h;
int status;
if (file == NULL)
return NULL;
h = calloc(1, sizeof(*h));
if (h == NULL)
return NULL;
h->filename = strdup(file);
if (h->filename == NULL) {
free(h);
return NULL;
}
h->mtime = 0;
pthread_mutex_init(&h->lock, /* attr = */ NULL);
status = fbh_check_file(h);
if (status != 0) {
fbh_destroy(h);
free(h);
return NULL;
}
return h;
} /* }}} fbhash_t *fbh_create */
void fbh_destroy(fbhash_t *h) /* {{{ */
{
if (h == NULL)
return;
pthread_mutex_destroy(&h->lock);
free(h->filename);
fbh_free_tree(h->tree);
} /* }}} void fbh_destroy */
char *fbh_get(fbhash_t *h, const char *key) /* {{{ */
{
char *value;
char *value_copy;
int status;
if ((h == NULL) || (key == NULL))
return NULL;
value = NULL;
value_copy = NULL;
pthread_mutex_lock(&h->lock);
/* TODO: Checking this every time may be a bit much..? */
fbh_check_file(h);
status = c_avl_get(h->tree, key, (void *)&value);
if (status == 0) {
assert(value != NULL);
value_copy = strdup(value);
}
pthread_mutex_unlock(&h->lock);
return value_copy;
} /* }}} char *fbh_get */
| {
"pile_set_name": "Github"
} |
require_relative '../../../spec_helper'
ruby_version_is ''...'2.5' do
require 'mathn'
describe "Integer#prime_division" do
it "performs a prime factorization of a positive integer" do
100.prime_division.should == [[2, 2], [5, 2]]
end
# Proper handling of negative integers has been added to MRI trunk
# in revision 24091. Prior to that, all versions of MRI returned nonsense.
it "performs a prime factorization of a negative integer" do
-26.prime_division.should == [[-1, 1], [2, 1], [13, 1]]
end
it "raises a ZeroDivisionError when is called on zero" do
-> { 0.prime_division }.should raise_error(ZeroDivisionError)
end
end
end
| {
"pile_set_name": "Github"
} |
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-custom-interpolation-markup-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script>
</head>
<body ng-app="customInterpolationApp">
<script>
var customInterpolationApp = angular.module('customInterpolationApp', []);
customInterpolationApp.config(function($interpolateProvider) {
$interpolateProvider.startSymbol('//');
$interpolateProvider.endSymbol('//');
});
customInterpolationApp.controller('DemoController', function() {
this.label = "This binding is brought you by // interpolation symbols.";
});
</script>
<div ng-controller="DemoController as demo">
//demo.label//
</div>
</body>
</html> | {
"pile_set_name": "Github"
} |
var MockDisposable = Rx.MockDisposable = function (scheduler) {
this.scheduler = scheduler;
this.disposes = [];
this.disposes.push(this.scheduler.clock);
};
MockDisposable.prototype.dispose = function () {
this.disposes.push(this.scheduler.clock);
};
| {
"pile_set_name": "Github"
} |
class C
{ cAttr; }
class E {
isA C;
cAttr;
}
| {
"pile_set_name": "Github"
} |
let f (x : < a:int; .. > as 'me1) = (x : < b:bool; .. > as 'me2);;
let f (x : < a:int; .. > as 'me1) = (x : < a:int; b:bool; .. > as 'me2);;
let f (x : [> `A of int] as 'me1) = (x : [> `B of bool] as 'me2);;
let f (x : [> `A of int] as 'me1) = (x : [`A of int | `B of 'me2] as 'me2);;
| {
"pile_set_name": "Github"
} |
<template>
<section class="container">
<div class="leader_said_wrap">
<div class="leader_said_box">
<div class="leader_said_position">
<div class="leader_said_first">
<div class="leader_said_con leader_said_con1">
<div class="leader_said_con_img">
<img src="~/assets/images/leader/leader_said_01.jpg" alt="">
</div>
<div class="leader_said_video">
<video id="leader_video" controls="controls" preload="auto" poster="http://img.visney.cn/img/banner_img/leader_said_video.jpg">
<source src="http://img.visney.cn/img/video/leader_said_video.mp4">
</video>
</div>
</div>
</div>
<div class="leader_said_sec">
<div class="leader_said_con leader_said_con2">
<img src="~/assets/images/leader/leader_said_02.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con3">
<img src="~/assets/images/leader/leader_said_03.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con4">
<img src="~/assets/images/leader/leader_said_04.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con5">
<img src="~/assets/images/leader/leader_said_05.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con6">
<img src="~/assets/images/leader/leader_said_06.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con7">
<img src="~/assets/images/leader/leader_said_07.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con8">
<img src="~/assets/images/leader/leader_said_08.jpg" alt="">
</div>
</div>
<div class="leader_said_third">
<div class="leader_said_con leader_said_con9">
<img src="~/assets/images/leader/leader_said_09.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con10">
<img src="~/assets/images/leader/leader_said_10.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con11">
<img src="~/assets/images/leader/leader_said_11.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con12">
<img src="~/assets/images/leader/leader_said_12.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con13">
<img src="~/assets/images/leader/leader_said_13.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con14">
<img src="~/assets/images/leader/leader_said_14.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con15">
<img src="~/assets/images/leader/leader_said_15.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con16">
<img src="~/assets/images/leader/leader_said_16.jpg" alt="">
</div>
</div>
<div class="leader_said_fou">
<div class="leader_said_con leader_said_con17">
<img src="~/assets/images/leader/leader_said_17.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con18">
<img src="~/assets/images/leader/leader_said_18.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con19">
<img src="~/assets/images/leader/leader_said_19.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con20">
<img src="~/assets/images/leader/leader_said_20.jpg" alt="">
</div>
<div class="leader_said_con leader_said_con21">
<img src="~/assets/images/leader/leader_said_21.jpg" alt="">
</div>
<div class="leader_said_con22_box">
<div class="leader_said_con leader_said_con22">
<img src="~/assets/images/leader/leader_said_22.jpg" alt="">
</div>
<div class="leader_said_letter_btn">
<div class="leader_said_letter_btn1" @click="changeLetter1"></div>
<div class="leader_said_letter_btn2" @click="changeLetter2"></div>
</div>
<div class="leader_said_letter1_con" v-if="showLetter1">
<div class="leader_said_letter_img">
<div @click="changeLetter1">
<img src="~/assets/images/leader/leader_said_letter1.jpg" alt="" >
</div>
</div>
</div>
<div class="leader_said_letter2_con" v-if="showLetter2">
<div class="leader_said_letter_img">
<div @click="changeLetter2">
<img src="~/assets/images/leader/leader_said_letter2.jpg" alt="" >
</div>
</div>
</div>
</div>
<div class="leader_said_con leader_said_con23">
<img src="~/assets/images/leader/leader_said_23.jpg" alt="">
</div>
</div>
<div class="leader_said_fiv">
<div class="leader_said_con leader_said_con24">
<img src="~/assets/images/leader/leader_said_24.jpg" alt="">
</div>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
export default {
data (){
return {
showLetter1: false,
showLetter2: false,
}
},
methods: {
changeLetter1 (){
this.showLetter1 = !this.showLetter1;
},
changeLetter2 (){
this.showLetter2 = !this.showLetter2;
}
},
head () {
return {
title:'创始人说',
meta: [
{name:'keywords',hid: 'keywords',content:'创始人说'},
{name:'description',hid:'description',content:'创始人说'}
]
}
}
}
</script>
<style scoped>
.leader_said_wrap {
overflow: hidden;
width: 100%;
}
.leader_said_box {
position: relative;
width: 1200px;
min-height: 26830px;
margin: 0 auto;
}
.leader_said_first, .leader_said_third, .leader_said_fiv {
background-color: #f5f6fb;
}
.leader_said_sec, .leader_said_fou {
background-color: #fff;
}
.leader_said_position {
position: absolute;
top: 0;
left: 50%;
overflow: hidden;
width: 1920px;
margin-left: -960px;
}
.leader_said_con1 {
position: relative;
}
.leader_said_video {
position: absolute;
left: 50%;
bottom: -252px;
width: 921px;
height: 505px;
margin-left: -460px;
}
#leader_video {
widows: 100%;
height: 100%;
}
.leader_said_con22_box {
position: relative;
}
.leader_said_letter1_con {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.7);
z-index: 10086;
cursor: pointer;
}
.leader_said_letter2_con {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.7);
z-index: 10086;
cursor: pointer;
}
.leader_said_letter_img {
overflow-y: auto;
width: 1600px;
height: 1000px;
margin: 0 auto;
}
.leader_said_letter_btn {
position: absolute;
top: 0;
width: 100%;
height: 392px;
z-index: 6;
}
.leader_said_letter_btn1 {
position: absolute;
top: 0;
right: 46.7%;
width: 660px;
height: 390px;
cursor: pointer;
}
.leader_said_letter_btn2 {
position: absolute;
top: 0;
left: 53.7%;
width: 530px;
height: 390px;
cursor: pointer;
}
</style>
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env newlisp
;; @module IRC
;; @description a basic irc library
;; @version early alpha! 0.1 2013-01-02 20:11:22
;; @author cormullion
;; Usage:
;; (IRC:init "newlithper") ; a username/nick (not that one obviously :-)
;; (IRC:connect "irc.freenode.net" 6667) ; irc/server
;; (IRC:join-channel {#newlisp}) ; join a room
;; either (IRC:read-irc-loop) ; loop - monitor only, no input
;; or (IRC:session) ; a command-line session, end with /QUIT
(context 'IRC)
(define Inickname)
(define Ichannels)
(define Iserver)
(define Iconnected)
(define Icallbacks '())
(define Idle-time 400) ; seconds
(define Itime-stamp) ; time since last message was processed
(define (register-callback callback-name callback-function)
(println {registering callback for } callback-name { : } (sym (term callback-function) (prefix callback-function)))
(push (list callback-name (sym (term callback-function) (prefix callback-function))) Icallbacks))
(define (deregister-callback callback-name)
(println {deregistering callback for } callback-name)
(setf (assoc "idle-event" Icallbacks) nil)
(println {current callbacks: } Icallbacks))
(define (do-callback callback-name data)
(when (set 'func (lookup callback-name Icallbacks)) ; find first callback
(if-not (catch (apply func (list data)) 'error)
(println {error in callback } callback-name {: } error))))
(define (do-callbacks callback-name data)
(dolist (rf (ref-all callback-name Icallbacks))
(set 'callback-entry (Icallbacks (first rf)))
(when (set 'func (last callback-entry))
(if-not (catch (apply func (list data)) 'error)
(println {error in callback } callback-name {: } error)))))
(define (init str)
(set 'Inickname str)
(set 'Iconnected nil)
(set 'Ichannels '())
(set 'Itime-stamp (time-of-day)))
(define (connect server port)
(set 'Iserver (net-connect server port))
(net-send Iserver (format "USER %s %s %s :%s\r\n" Inickname Inickname Inickname Inickname))
(net-send Iserver (format "NICK %s \r\n" Inickname))
(set 'Iconnected true)
(do-callbacks "connect" (list (list "server" server) (list "port" port))))
(define (identify password)
(net-send Iserver (format "PRIVMSG nickserv :identify %s\r\n" password)))
(define (join-channel channel)
(when (net-send Iserver (format "JOIN %s \r\n" channel))
(push channel Ichannels)
(do-callbacks "join-channel" (list (list "channel" channel) (list "nickname" Inickname)))))
(define (part chan)
(if-not (empty? chan)
; leave specified
(begin
(net-send Iserver (format "PART %s\r\n" chan))
(replace channel Ichannels)
(do-callbacks "part" (list (list "channel" channel))))
; leave all
(begin
(dolist (channel Ichannels)
(net-send Iserver (format "PART %s\r\n" channel))
(replace channel Ichannels)
(do-callbacks "part" (list (list "channel" channel)))))))
(define (do-quit message)
(do-callbacks "quit" '()) ; chance to do stuff before quit...
(net-send Iserver (format "QUIT :%s\r\n" message))
(sleep 1000)
(set 'Ichannels '())
(close Iserver)
(set 'Iconnected nil))
(define (privmsg user message)
(net-send Iserver (format "PRIVMSG %s :%s\r\n" user message)))
(define (notice user message)
(net-send Iserver (format "NOTICE %s :%s\r\n" user message)))
(define (send-to-server message (channel nil))
(cond
((starts-with message {/}) ; default command character
(set 'the-message (replace "^/" (copy message) {} 0)) ; keep original
(net-send Iserver (format "%s \r\n" the-message)) ; send it
; do a quit
(if (starts-with (lower-case the-message) "quit")
(do-quit { enough})))
(true
(if (nil? channel)
; say to all channels
(dolist (c Ichannels)
(net-send Iserver (format "PRIVMSG %s :%s\r\n" c message)))
; say to specified channel
(if (find channel Ichannels)
(net-send Iserver (format "PRIVMSG %s :%s\r\n" channel message))))))
(do-callbacks "send-to-server" (list (list "channel" channel) (list "message" message))))
(define (process-command sender command text)
(cond
((= sender "PING")
(net-send Iserver (format "PONG %s\r\n" command)))
((or (= command "NOTICE") (= command "PRIVMSG"))
(process-message sender command text))
((= command "JOIN")
(set 'username (first (clean empty? (parse sender {!|:} 0))))
(set 'channel (last (clean empty? (parse sender {!|:} 0))))
(println {username } username { joined } channel)
(do-callbacks "join" (list (list "channel" channel) (list "username" username))))
(true
nil)))
(define (process-message sender command text)
(let ((username {} target {} message {}))
(set 'username (first (clean empty? (parse sender {!|:} 0))))
(set 'target (trim (first (clean empty? (parse text {!|:} 0)))))
(set 'message (slice text (+ (find {:} text) 1)))
(cond
((starts-with message "\001")
(process-ctcp username target message))
((find target Ichannels)
(cond
((= command {PRIVMSG})
(do-callbacks "channel-message" (list (list "channel" target) (list "username" username) (list "message" message))))
((= command {NOTICE})
(do-callbacks "channel-notice" (list (list "channel" target) (list "username" username) (list "message" message))))))
((= target Inickname)
(cond
((= command {PRIVMSG})
(do-callbacks "private-message" (list (list "username" username) (list "message" message))))
((= command {NOTICE})
(do-callbacks "private-notice" (list (list "username" username) (list "message" message))))))
(true
nil))))
(define (process-ctcp username target message)
(cond
((starts-with message "\001VERSION\001")
(net-send Iserver (format "NOTICE %s :\001VERSION %s\001\r\n" username message)))
((starts-with message "\001PING")
(set 'data (first (rest (clean empty? (parse message { } 0)))))
(set 'data (trim data "\001" "\001"))
(net-send Iserver (format "NOTICE %s :\001PING %s\001\r\n" username data)))
((starts-with message "\001ACTION")
; (set 'data (first (rest (clean empty? (parse message { } 0)))))
; (set 'data (join data { }))
; (set 'data (trim data "\001" "\001"))
(if (find target Ichannels)
(do-callbacks "channel-action" (list (list "username" username) (list "message" message))))
(if (= target Inickname)
(do-callbacks "private-action" (list (list "username" username) (list "message" message)))))
((starts-with message "\001TIME\001")
(net-send Iserver (format "NOTICE %s:\001TIME :%s\001\r\n" username (date))))))
(define (parse-buffer raw-buffer)
(let ((messages (clean empty? (parse raw-buffer "\r\n" 0)))
(sender {} command {} text {}))
; check for elapsed time since last activity
(when (> (sub (time-of-day) Itime-stamp) (mul Idle-time 1000))
(do-callbacks "idle-event")
(set 'Itime-stamp (time-of-day)))
(dolist (message messages)
(set 'message-parts (parse message { }))
(unless (empty? message-parts)
(set 'sender (first message-parts))
(catch (set 'command (first (rest message-parts))) 'error)
(catch (set 'text (join (rest (rest message-parts)) { })) 'error))
(process-command sender command text))))
(define (read-irc)
(let ((buffer {}))
(when (!= (net-peek Iserver) 0)
(net-receive Iserver buffer 8192 "\n")
(unless (empty? buffer)
(parse-buffer buffer)))))
(define (read-irc-loop) ; monitoring
(let ((buffer {}))
(while Iconnected
(read-irc)
(sleep 1000))))
(define (print-raw-message data) ; example of using a callback
(set 'raw-data (lookup "message" data))
(set 'channel (lookup "channel" data))
(set 'message-text raw-data)
(println (date (date-value) 0 {%H:%M:%S }) username {> } message-text))
(define (print-outgoing-message data)
(set 'raw-data (lookup "message" data))
(set 'channel (lookup "channel" data))
(set 'message-text raw-data)
(println (date (date-value) 0 {%H:%M:%S }) Inickname {> } message-text))
(define (session); interactive terminal
; must add callbacks to display messages
(register-callback "channel-message" 'print-raw-message)
(register-callback "send-to-server" 'print-outgoing-message)
(while Iconnected
(while (zero? (peek 0))
(read-irc)
(sleep 1000))
(send-to-server (string (read-line 0))))
(println {finished session } (date))
(exit))
; end of IRC code
[text]
simple bot code:
(load (string (env {HOME}) {/projects/programming/newlisp-projects/irc.lsp}))
(context 'BOT)
(define bot-name "bot")
(define (join-channel data)
(println {in BOT:join-channel with data: } data))
(define (process-message data)
????)
(IRC:register-callback "join-channel" 'join-channel)
(IRC:register-callback "channel-message" 'process-message)
(IRC:register-callback "idle-event" 'do-idle-event)
(IRC:register-callback "send-to-server" 'do-send-event)
(IRC:init bot-name)
(IRC:connect "irc.freenode.net" 6667)
(IRC:join-channel {#newlisp})
(IRC:read-irc-loop)
[/text] | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
</assembly> | {
"pile_set_name": "Github"
} |
using System;
using System.IO;
using System.Threading.Tasks;
using InstaSharper.API;
using InstaSharper.Classes;
using InstaSharper.Tests.Utils;
namespace InstaSharper.Tests.Classes
{
public class AuthenticatedTestFixture
{
private readonly string _password = Environment.GetEnvironmentVariable("instaapiuserpassword");
private readonly string _username = "alex_codegarage";
public AuthenticatedTestFixture()
{
ApiInstance =
TestHelpers.GetDefaultInstaApiInstance(UserSessionData.ForUsername(_username).WithPassword(_password));
const string stateFile = "state.bin";
try
{
if (File.Exists(stateFile))
{
Stream fs = File.OpenRead(stateFile);
fs.Seek(0, SeekOrigin.Begin);
ApiInstance.LoadStateDataFromStream(fs);
if (ApiInstance.IsUserAuthenticated)
return;
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
var loginTask = Task.Run(ApiInstance.LoginAsync);
if (!loginTask.Wait(TimeSpan.FromSeconds(30)))
throw new Exception($"Unable to login, user: {_username}, password: {_password}.");
if (!loginTask.Result.Succeeded) return;
var state = ApiInstance.GetStateDataAsStream();
using (var fileStream = File.Create(stateFile))
{
state.Seek(0, SeekOrigin.Begin);
state.CopyTo(fileStream);
}
}
public IInstaApi ApiInstance { get; }
public string GetUsername()
{
return _username;
}
public string GetPassword()
{
return _password;
}
}
} | {
"pile_set_name": "Github"
} |
#pragma once
#include "scene/node.h"
namespace render {
struct RenderState;
};
namespace scene {
class PlaneNode : public Node {
public:
const render::RenderState* material;
float minRad, maxRad;
PlaneNode(const render::RenderState* material, double size);
virtual bool preRender(render::RenderDriver& driver);
virtual void render(render::RenderDriver& driver);
};
};
| {
"pile_set_name": "Github"
} |
\name{plot.lpp}
\alias{plot.lpp}
\title{
Plot Point Pattern on Linear Network
}
\description{
Plots a point pattern on a linear network.
Plot method for the class \code{"lpp"} of point patterns on a linear network.
}
\usage{
\method{plot}{lpp}(x, \dots, main, add = FALSE,
use.marks=TRUE, which.marks=NULL,
show.all = !add, show.window=FALSE, show.network=TRUE,
do.plot = TRUE, multiplot=TRUE)
}
\arguments{
\item{x}{
Point pattern on a linear network (object of class \code{"lpp"}).
}
\item{\dots}{
Additional arguments passed to \code{\link{plot.linnet}}
or \code{\link{plot.ppp}}.
}
\item{main}{
Main title for plot.
}
\item{add}{
Logical value indicating whether the plot is to be added to the
existing plot (\code{add=TRUE}) or whether a new plot should be
initialised (\code{add=FALSE}, the default).
}
\item{use.marks}{
logical flag; if \code{TRUE}, plot points using a different
plotting symbol for each mark;
if \code{FALSE}, only the locations of the points will be plotted,
using \code{\link{points}()}.
}
\item{which.marks}{
Index determining which column of marks to use,
if the marks of \code{x} are a data frame.
A character or integer vector identifying one or more
columns of marks.
If \code{add=FALSE} then
the default is to plot all columns of marks, in a series of separate
plots.
If \code{add=TRUE} then only one column of marks can be plotted,
and the default is \code{which.marks=1}
indicating the first column of marks.
}
\item{show.all}{
Logical value indicating whether to plot everything
including the main title and the window containing the network.
}
\item{show.window}{
Logical value indicating whether to plot the
window containing the network. Overrides \code{show.all}.
}
\item{show.network}{
Logical value indicating whether to plot the network.
}
\item{do.plot}{
Logical value determining whether to actually perform the plotting.
}
\item{multiplot}{
Logical value giving permission to display multiple plots.
}
}
\details{
The linear network is plotted by \code{\link{plot.linnet}},
then the points are plotted by \code{\link{plot.ppp}}.
Commonly-used arguments include:
\itemize{
\item \code{col} and \code{lwd} for the colour and width of lines
in the linear network
\item \code{cols} for the colour or colours of the points
\item \code{chars} for the plot characters representing different
types of points
\item \code{legend} and \code{leg.side} to control the graphics
legend
}
Note that the linear network will be plotted
even when \code{add=TRUE}, unless \code{show.network=FALSE}.
}
\value{
(Invisible) object of class \code{"symbolmap"}
giving the correspondence between
mark values and plotting characters.
}
\seealso{
\code{\link{lpp}}.
See \code{\link{plot.ppp}} for options for representing the points.
See also \code{\link{points.lpp}}, \code{\link{text.lpp}}.
}
\examples{
plot(chicago, cols=1:6)
}
\author{
\spatstatAuthors.
}
\keyword{spatial}
\keyword{hplot}
| {
"pile_set_name": "Github"
} |
import Vue from 'vue'
// global event bus used for refreshing codemirror instance
export default new Vue()
| {
"pile_set_name": "Github"
} |
package main
import (
"bytes"
"context"
"io"
"os"
"strings"
"testing"
"github.com/fatih/color"
"github.com/gopasspw/gopass/internal/gptest"
"github.com/gopasspw/gopass/internal/out"
"github.com/gopasspw/gopass/internal/termio"
"github.com/gopasspw/gopass/pkg/ctxutil"
"github.com/gopasspw/gopass/pkg/gopass/apimock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGitCredentialFormat(t *testing.T) {
data := []io.Reader{
strings.NewReader("" +
"protocol=https\n" +
"host=example.com\n" +
"username=bob\n" +
"foo=bar\n" +
"path=test\n" +
"password=secr3=t\n",
),
strings.NewReader("" +
"protocol=https\n" +
"host=example.com\n" +
"username=bob\n" +
"foo=bar\n" +
"password=secr3=t\n" +
"test=",
),
strings.NewReader("" +
"protocol=https\n" +
"host=example.com\n" +
"username=bob\n" +
"foo=bar\n" +
"password=secr3=t\n" +
"test",
),
}
results := []gitCredentials{
{
Host: "example.com",
Password: "secr3=t",
Path: "test",
Protocol: "https",
Username: "bob",
},
{},
{},
}
expectsErr := []bool{false, true, true}
for i := range data {
result, err := parseGitCredentials(data[i])
if expectsErr[i] {
assert.Error(t, err)
} else {
assert.NoError(t, err)
}
if err != nil {
continue
}
assert.Equal(t, results[i], *result)
buf := &bytes.Buffer{}
n, err := result.WriteTo(buf)
assert.NoError(t, err, "could not serialize credentials")
assert.Equal(t, buf.Len(), int(n))
parseback, err := parseGitCredentials(buf)
assert.NoError(t, err, "failed parsing my own output")
assert.Equal(t, results[i], *parseback, "failed parsing my own output")
}
}
func TestGitCredentialHelper(t *testing.T) {
ctx := context.Background()
act := &gc{
gp: apimock.New(),
}
require.NoError(t, act.gp.Set(ctx, "foo", &apimock.Secret{Buf: []byte("bar")}))
stdout := &bytes.Buffer{}
out.Stdout = stdout
color.NoColor = true
defer func() {
out.Stdout = os.Stdout
termio.Stdin = os.Stdin
}()
c := gptest.CliCtx(ctx, t)
// before without stdin
assert.Error(t, act.Before(c))
// before with stdin
ctx = ctxutil.WithStdin(ctx, true)
c.Context = ctx
assert.NoError(t, act.Before(c))
s := "protocol=https\n" +
"host=example.com\n" +
"username=bob\n"
termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
assert.Equal(t, "", stdout.String())
termio.Stdin = strings.NewReader(s + "password=secr3=t\n")
assert.NoError(t, act.Store(c))
stdout.Reset()
termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
read, err := parseGitCredentials(stdout)
assert.NoError(t, err)
assert.Equal(t, "secr3=t", read.Password)
stdout.Reset()
termio.Stdin = strings.NewReader("host=example.com\n")
assert.NoError(t, act.Get(c))
read, err = parseGitCredentials(stdout)
assert.NoError(t, err)
assert.Equal(t, "secr3=t", read.Password)
assert.Equal(t, "bob", read.Username)
stdout.Reset()
termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Erase(c))
assert.Equal(t, "", stdout.String())
termio.Stdin = strings.NewReader(s)
assert.NoError(t, act.Get(c))
assert.Equal(t, "", stdout.String())
termio.Stdin = strings.NewReader("a")
assert.Error(t, act.Get(c))
termio.Stdin = strings.NewReader("a")
assert.Error(t, act.Store(c))
termio.Stdin = strings.NewReader("a")
assert.Error(t, act.Erase(c))
}
| {
"pile_set_name": "Github"
} |
# vim:set ft= ts=4 sw=4 et fdm=marker:
use Test::Nginx::Socket::Lua;
use t::StapThread;
our $GCScript = $t::StapThread::GCScript;
our $StapScript = $t::StapThread::StapScript;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 4);
$ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8';
$ENV{TEST_NGINX_MEMCACHED_PORT} ||= '11211';
$ENV{TEST_NGINX_REDIS_PORT} ||= '6379';
#no_shuffle();
no_long_string();
run_tests();
__DATA__
=== TEST 1: exit in user thread (entry thread is still pending to run)
--- config
location /lua {
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
ngx.sleep(1)
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
M(timer-add) {
if ($arg2 == 1000) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 1000) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 1000) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
terminate 2: ok
delete thread 2
delete thread 1
--- response_body
before
hello in thread
--- no_error_log
[error]
=== TEST 2: exit in user thread (entry thread is still pending on ngx.sleep)
--- config
location /lua {
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
ngx.sleep(1)
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 1000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 1000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
/*
if (tm == 1000) {
print_ubacktrace()
}
*/
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 1000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_sleep_cleanup) {
println("lua sleep cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 1000
expire timer 100
terminate 2: ok
delete thread 2
lua sleep cleanup
delete timer 1000
delete thread 1
free request
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 3: exit in a user thread (another user thread is still pending on ngx.sleep)
--- config
location /lua {
content_by_lua '
function f()
ngx.sleep(0.1)
ngx.say("f")
ngx.exit(0)
end
function g()
ngx.sleep(1)
ngx.say("g")
end
ngx.thread.spawn(f)
ngx.thread.spawn(g)
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 1000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 1000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
/*
if (tm == 1000) {
print_ubacktrace()
}
*/
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 1000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_sleep_cleanup) {
println("lua sleep cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
create 3 in 1
spawn user thread 3 in 1
add timer 1000
terminate 1: ok
delete thread 1
expire timer 100
terminate 2: ok
delete thread 2
lua sleep cleanup
delete timer 1000
delete thread 3
free request
--- response_body
end
f
--- no_error_log
[error]
=== TEST 4: exit in user thread (entry already quits)
--- config
location /lua {
content_by_lua '
function f()
ngx.sleep(0.1)
ngx.say("exiting the user thread")
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval: $::GCScript
--- stap_out
create 2 in 1
spawn user thread 2 in 1
terminate 1: ok
delete thread 1
terminate 2: ok
delete thread 2
--- wait: 0.1
--- response_body
before
after
exiting the user thread
--- no_error_log
[error]
=== TEST 5: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.tcp)
--- config
location /lua {
resolver agentzh.org;
resolver_timeout 12s;
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.001)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
local sock = ngx.socket.tcp()
local ok, err = sock:connect("agentzh.org", 80)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
F(ngx_resolve_name) {
printf("resolving %s\n", user_string_n($ctx->name->data, $ctx->name->len))
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 1) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 1) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
/*
if (tm == 12000) {
print_ubacktrace()
}
*/
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 1) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_tcp_resolve_cleanup) {
println("lua tcp resolve cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 1
resolving agentzh.org
add timer 12000
expire timer 1
terminate 2: ok
delete thread 2
lua tcp resolve cleanup
delete timer 12000
delete thread 1
free request
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 6: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.udp)
--- config
location /lua {
resolver agentzh.org;
resolver_timeout 12s;
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.001)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
local sock = ngx.socket.udp()
local ok, err = sock:setpeername("agentzh.org", 80)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
F(ngx_resolve_name) {
printf("resolving %s\n", user_string_n($ctx->name->data, $ctx->name->len))
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 1) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 1) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
/*
if (tm == 12000) {
print_ubacktrace()
}
*/
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 1) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_udp_resolve_cleanup) {
println("lua udp resolve cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 1
resolving agentzh.org
add timer 12000
expire timer 1
terminate 2: ok
delete thread 2
lua udp resolve cleanup
delete timer 12000
delete thread 1
free request
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 7: exit in user thread (entry thread is still pending on tcpsock:connect)
--- config
location /lua {
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
local sock = ngx.socket.tcp()
sock:settimeout(12000)
local ok, err = sock:connect("106.184.1.99", 12345)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
/*
if (tm == 12000) {
print_ubacktrace()
}
*/
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_coctx_cleanup) {
println("lua tcp socket cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 12000
expire timer 100
terminate 2: ok
delete thread 2
lua tcp socket cleanup
delete timer 12000
delete thread 1
free request
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 8: exit in user thread (entry thread is still pending on tcpsock:receive)
--- config
location /lua {
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
local sock = ngx.socket.tcp()
local ok, err = sock:connect("127.0.0.1", $TEST_NGINX_REDIS_PORT)
if not ok then
ngx.say("failed to connect: ", err)
return
end
local bytes, ok = sock:send("blpop not_exists 2\\r\\n")
if not bytes then
ngx.say("failed to send: ", err)
return
end
sock:settimeout(12000)
local data, err = sock:receive()
if not data then
ngx.say("failed to receive: ", err)
return
end
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_coctx_cleanup) {
println("lua tcp socket cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 12000
expire timer 100
terminate 2: ok
delete thread 2
lua tcp socket cleanup
delete timer 12000
delete thread 1
free request
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 9: exit in user thread (entry thread is still pending on tcpsock:receiveuntil's iterator)
--- config
location /lua {
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
local sock = ngx.socket.tcp()
local ok, err = sock:connect("127.0.0.1", $TEST_NGINX_REDIS_PORT)
if not ok then
ngx.say("failed to connect: ", err)
return
end
local bytes, ok = sock:send("blpop not_exists 2\\r\\n")
if not bytes then
ngx.say("failed to send: ", err)
return
end
local it, err = sock:receiveuntil("\\r\\n")
if not it then
ngx.say("failed to receive until: ", err)
return
end
sock:settimeout(12000)
local data, err = it()
if not data then
ngx.say("failed to receive: ", err)
return
end
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_coctx_cleanup) {
println("lua tcp socket cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 12000
expire timer 100
terminate 2: ok
delete thread 2
lua tcp socket cleanup
delete timer 12000
delete thread 1
free request
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 10: exit in user thread (entry thread is still pending on udpsock:receive)
--- config
location /lua {
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
local sock = ngx.socket.udp()
local ok, err = sock:setpeername("8.8.8.8", 12345)
if not ok then
ngx.say("failed to connect: ", err)
return
end
sock:settimeout(12000)
local data, err = sock:receive()
if not data then
ngx.say("failed to receive: ", err)
return
end
ngx.say("end")
';
}
--- request
GET /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_udp_socket_cleanup) {
println("lua udp socket cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 12000
expire timer 100
terminate 2: ok
delete thread 2
lua udp socket cleanup
delete timer 12000
delete thread 1
free request
--- wait: 0.1
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 11: exit in user thread (entry thread is still pending on reqsock:receive)
--- config
location /lua {
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
local sock = ngx.req.socket()
sock:settimeout(12000)
local data, err = sock:receive(1024)
if not data then
ngx.say("failed to receive: ", err)
return
end
ngx.say("end")
';
}
--- request
POST /lua
--- more_headers
Content-Length: 1024
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_coctx_cleanup) {
println("lua tcp socket cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 12000
expire timer 100
terminate 2: ok
delete thread 2
lua tcp socket cleanup
delete timer 12000
delete thread 1
free request
--- wait: 0.1
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 12: exit in user thread (entry thread is still pending on ngx.req.read_body)
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
ngx.req.read_body()
ngx.say("end")
';
}
--- request
POST /lua
--- more_headers
Content-Length: 1024
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 12000 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 12000 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_req_body_cleanup) {
println("lua req body cleanup")
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 12000
expire timer 100
terminate 2: ok
delete thread 2
lua req body cleanup
delete timer 12000
delete thread 1
free request
--- wait: 0.1
--- response_body
before
hello in thread
after
--- no_error_log
[error]
=== TEST 13: exit(0) in user thread (entry thread is still pending on ngx.location.capture), with pending output
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
ngx.location.capture("/sleep")
ngx.say("end")
';
}
location = /sleep {
echo_sleep 0.2;
}
--- request
POST /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 200 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 200
expire timer 100
terminate 2: fail
expire timer 200
terminate 1: ok
delete thread 2
delete thread 1
free request
--- wait: 0.1
--- ignore_response
--- error_log
attempt to abort with pending subrequests
--- no_error_log
[alert]
[warn]
=== TEST 14: exit in user thread (entry thread is still pending on ngx.location.capture), without pending output
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.thread.spawn(f)
ngx.location.capture("/sleep")
ngx.say("end")
';
}
location = /sleep {
echo_sleep 0.2;
}
--- request
POST /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 200 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_post_subrequest) {
printf("post subreq %s\n", ngx_http_req_uri($r))
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 200
expire timer 100
terminate 2: fail
expire timer 200
post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
free request
--- wait: 0.1
--- response_body
end
--- error_log
attempt to abort with pending subrequests
=== TEST 15: exit in user thread (entry thread is still pending on ngx.location.capture_multi), without pending output
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.sleep(0.1)
ngx.exit(0)
end
ngx.thread.spawn(f)
ngx.location.capture_multi{
{"/echo"},
{"/sleep"}
}
ngx.say("end")
';
}
location = /echo {
echo hello;
}
location = /sleep {
echo_sleep 0.2;
}
--- request
POST /lua
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 200 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_post_subrequest) {
printf("post subreq %s\n", ngx_http_req_uri($r))
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
post subreq /echo
add timer 200
expire timer 100
terminate 2: fail
expire timer 200
post subreq /sleep
terminate 1: ok
delete thread 2
delete thread 1
free request
--- wait: 0.1
--- response_body
end
--- error_log
attempt to abort with pending subrequests
=== TEST 16: exit in entry thread (user thread is still pending on ngx.location.capture_multi), without pending output
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.location.capture_multi{
{"/echo"},
{"/sleep"}
}
ngx.say("end")
end
ngx.thread.spawn(f)
ngx.sleep(0.1)
ngx.exit(0)
';
}
location = /echo {
echo hello;
}
location = /sleep {
echo_sleep 0.2;
}
--- request
POST /lua
--- more_headers
Content-Length: 1024
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 200 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
F(ngx_http_lua_post_subrequest) {
printf("post subreq %s\n", ngx_http_req_uri($r))
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
post subreq /echo
add timer 200
expire timer 100
terminate 1: fail
delete thread 2
delete thread 1
delete timer 200
free request
--- wait: 0.1
--- ignore_response
--- error_log
attempt to abort with pending subrequests
--- no_error_log
[alert]
[warn]
=== TEST 17: exit(444) in user thread (entry thread is still pending on ngx.location.capture), with pending output
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(444)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
ngx.location.capture("/sleep")
ngx.say("end")
';
}
location = /sleep {
echo_sleep 0.2;
}
--- request
POST /lua
--- more_headers
Content-Length: 1024
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 200 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 200
expire timer 100
terminate 2: ok
delete thread 2
delete thread 1
delete timer 200
free request
--- wait: 0.1
--- ignore_response
--- no_error_log
[alert]
[error]
[warn]
=== TEST 18: exit(408) in user thread (entry thread is still pending on ngx.location.capture), with pending output
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(408)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
ngx.location.capture("/sleep")
ngx.say("end")
';
}
location = /sleep {
echo_sleep 0.2;
}
--- request
POST /lua
--- more_headers
Content-Length: 1024
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 200 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 200
expire timer 100
terminate 2: ok
delete thread 2
delete thread 1
delete timer 200
free request
--- wait: 0.1
--- ignore_response
--- no_error_log
[alert]
[error]
[warn]
=== TEST 19: exit(499) in user thread (entry thread is still pending on ngx.location.capture), with pending output
--- config
location /lua {
client_body_timeout 12000ms;
content_by_lua '
function f()
ngx.say("hello in thread")
ngx.sleep(0.1)
ngx.exit(499)
end
ngx.say("before")
ngx.thread.spawn(f)
ngx.say("after")
ngx.location.capture("/sleep")
ngx.say("end")
';
}
location = /sleep {
echo_sleep 0.2;
}
--- request
POST /lua
--- more_headers
Content-Length: 1024
--- stap2 eval: $::StapScript
--- stap eval
<<'_EOC_' . $::GCScript;
global timers
F(ngx_http_free_request) {
println("free request")
}
M(timer-add) {
if ($arg2 == 200 || $arg2 == 100) {
timers[$arg1] = $arg2
printf("add timer %d\n", $arg2)
}
}
M(timer-del) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("delete timer %d\n", tm)
delete timers[$arg1]
}
}
M(timer-expire) {
tm = timers[$arg1]
if (tm == 200 || tm == 100) {
printf("expire timer %d\n", timers[$arg1])
delete timers[$arg1]
}
}
_EOC_
--- stap_out
create 2 in 1
spawn user thread 2 in 1
add timer 100
add timer 200
expire timer 100
terminate 2: ok
delete thread 2
delete thread 1
delete timer 200
free request
--- wait: 0.1
--- ignore_response
--- no_error_log
[alert]
[error]
[warn]
| {
"pile_set_name": "Github"
} |
# Copyright (c) 2015 RIPE NCC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from ripe.atlas.sagan import Result
from ripe.atlas.tools.renderers.http import Renderer
class TestHttpRenderer(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.basic = Result.get('{"lts":64,"from":"217.13.64.36","msm_id":2841267,"fw":4720,"timestamp":1450185727,"uri":"http://at-vie-as1120.anchors.atlas.ripe.net:80/4096","prb_id":1,"result":[{"rt":45.953289,"src_addr":"217.13.64.36","hsize":131,"af":4,"bsize":1668618,"res":200,"method":"GET","ver":"1.1","dst_addr":"193.171.255.2"}],"group_id":2841267,"type":"http","msm_name":"HTTPGet"}')
self.multiple = Result.get('{"lts":64,"from":"217.13.64.36","msm_id":2841267,"fw":4720,"timestamp":1450185727,"uri":"http://at-vie-as1120.anchors.atlas.ripe.net:80/4096","prb_id":1,"result":[{"rt":45.953289,"src_addr":"217.13.64.36","hsize":131,"af":4,"bsize":1668618,"res":200,"method":"GET","ver":"1.1","dst_addr":"193.171.255.2"},{"rt":45.953289,"src_addr":"217.13.64.36","hsize":131,"af":4,"bsize":1668618,"res":200,"method":"GET","ver":"1.1","dst_addr":"193.171.255.2"}],"group_id":2841267,"type":"http","msm_name":"HTTPGet"}')
def test_basic(self):
expected = (
'#Version: 1.0\n'
'#Date: 2015-12-15 13:22:07\n'
'#Fields: cs-method cs-uri c-ip s-ip sc-status time-taken http-version header-bytes body-bytes\n'
'GET http://at-vie-as1120.anchors.atlas.ripe.net:80/4096 217.13.64.36 193.171.255.2 200 45.953289 1.1 131 1668618\n\n'
)
self.assertEqual(Renderer().on_result(self.basic), expected)
def test_multiple(self):
expected = (
'#Version: 1.0\n'
'#Date: 2015-12-15 13:22:07\n'
'#Fields: cs-method cs-uri c-ip s-ip sc-status time-taken http-version header-bytes body-bytes\n'
'GET http://at-vie-as1120.anchors.atlas.ripe.net:80/4096 217.13.64.36 193.171.255.2 200 45.953289 1.1 131 1668618\n'
'GET http://at-vie-as1120.anchors.atlas.ripe.net:80/4096 217.13.64.36 193.171.255.2 200 45.953289 1.1 131 1668618\n\n'
)
self.assertEqual(Renderer().on_result(self.multiple), expected)
| {
"pile_set_name": "Github"
} |
// <auto-generated />
namespace IronJS.Tests.UnitTests.Sputnik.Conformance.LexicalConventions.Literals
{
using System;
using NUnit.Framework;
[TestFixture]
public class NumericLiteralsTests : SputnikTestFixture
{
public NumericLiteralsTests()
: base(@"Conformance\07_Lexical_Conventions\7.8_Literals\7.8.3_Numeric_Literals")
{
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A1.1_T1.js", Description = "DecimalLiteral :: DecimalIntegerLiteral")]
[TestCase("S7.8.3_A1.1_T2.js", Description = "DecimalLiteral :: DecimalIntegerLiteral")]
[TestCase("S7.8.3_A3.1_T1.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ")]
[TestCase("S7.8.3_A3.1_T2.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ")]
public void DecimalLiteralDecimalIntegerLiteral(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A1.2_T1.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A1.2_T2.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A1.2_T3.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A1.2_T4.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A1.2_T5.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A1.2_T6.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A1.2_T7.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A1.2_T8.js", Description = "DecimalLiteral :: DecimalIntegerLiteral ExponentPart")]
[TestCase("S7.8.3_A3.3_T1.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
[TestCase("S7.8.3_A3.3_T2.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
[TestCase("S7.8.3_A3.3_T3.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
[TestCase("S7.8.3_A3.3_T4.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
[TestCase("S7.8.3_A3.3_T5.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
[TestCase("S7.8.3_A3.3_T6.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
[TestCase("S7.8.3_A3.3_T7.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
[TestCase("S7.8.3_A3.3_T8.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. ExponentPart")]
public void DecimalLiteralDecimalIntegerLiteralExponentPart(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A2.1_T1.js", Description = "DecimalLiteral :: .DecimalDigits")]
[TestCase("S7.8.3_A2.1_T2.js", Description = "DecimalLiteral :: .DecimalDigits")]
[TestCase("S7.8.3_A2.1_T3.js", Description = "DecimalLiteral :: .DecimalDigits")]
public void DecimalLiteralDecimalDigits(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A2.2_T1.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
[TestCase("S7.8.3_A2.2_T2.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
[TestCase("S7.8.3_A2.2_T3.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
[TestCase("S7.8.3_A2.2_T4.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
[TestCase("S7.8.3_A2.2_T5.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
[TestCase("S7.8.3_A2.2_T6.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
[TestCase("S7.8.3_A2.2_T7.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
[TestCase("S7.8.3_A2.2_T8.js", Description = "DecimalLiteral :: .DecimalDigits ExponentPart")]
public void DecimalLiteralDecimalDigitsExponentPart(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A3.2_T1.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigits")]
[TestCase("S7.8.3_A3.2_T2.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigits")]
[TestCase("S7.8.3_A3.2_T3.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigits")]
public void DecimalLiteralDecimalIntegerLiteralDecimalDigits(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A3.4_T1.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
[TestCase("S7.8.3_A3.4_T2.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
[TestCase("S7.8.3_A3.4_T3.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
[TestCase("S7.8.3_A3.4_T4.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
[TestCase("S7.8.3_A3.4_T5.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
[TestCase("S7.8.3_A3.4_T6.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
[TestCase("S7.8.3_A3.4_T7.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
[TestCase("S7.8.3_A3.4_T8.js", Description = "DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart")]
public void DecimalLiteralDecimalIntegerLiteralDecimalDigigtsExponentPart(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A4.1_T1.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A4.1_T2.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A4.1_T3.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A4.1_T4.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A4.1_T5.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A4.1_T6.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A4.1_T7.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A4.1_T8.js", Description = "DecimalLiteral :: ExponentPart is incorrect", ExpectedException = typeof(Exception))]
public void DecimalLiteralExponentPartIsIncorrect(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A4.2_T1.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
[TestCase("S7.8.3_A4.2_T2.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
[TestCase("S7.8.3_A4.2_T3.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
[TestCase("S7.8.3_A4.2_T4.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
[TestCase("S7.8.3_A4.2_T5.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
[TestCase("S7.8.3_A4.2_T6.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
[TestCase("S7.8.3_A4.2_T7.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
[TestCase("S7.8.3_A4.2_T8.js", Description = "ExponentPart :: ExponentIndicator ( /+/-) 0 DecimalDigits is allowed")]
public void ExponentPartExponentIndicator0DecimalDigitsIsAllowed(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A5.1_T1.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
[TestCase("S7.8.3_A5.1_T2.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
[TestCase("S7.8.3_A5.1_T3.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
[TestCase("S7.8.3_A5.1_T4.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
[TestCase("S7.8.3_A5.1_T5.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
[TestCase("S7.8.3_A5.1_T6.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
[TestCase("S7.8.3_A5.1_T7.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
[TestCase("S7.8.3_A5.1_T8.js", Description = "DecimalLiteral :: HexIntegerLiteral")]
public void DecimalLiteralHexIntegerLiteral(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A6.1_T1.js", Description = "HexIntegerLiteral :: 0(x/X) is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A6.1_T2.js", Description = "HexIntegerLiteral :: 0(x/X) is incorrect", ExpectedException = typeof(Exception))]
public void HexIntegerLiteral0XXIsIncorrect(string file)
{
RunFile(file);
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 7.8.3")]
[TestCase("S7.8.3_A6.2_T1.js", Description = "0xG is incorrect", ExpectedException = typeof(Exception))]
[TestCase("S7.8.3_A6.2_T2.js", Description = "0xG is incorrect", ExpectedException = typeof(Exception))]
public void _0xGIsIncorrect(string file)
{
RunFile(file);
}
}
} | {
"pile_set_name": "Github"
} |
// @flow
import { defineMessages } from 'react-intl';
const messages = defineMessages({
securityControlsLabel: {
defaultMessage: 'Restrictions',
description:
'Label displayed above the security restrictions on the file due to the classification label and associated policies.',
id: 'boxui.securityControls.securityControlsLabel',
},
shortSharing: {
defaultMessage: 'Sharing restriction applies',
description: 'Short summary displayed for classification when a sharing restriction is applied to it',
id: 'boxui.securityControls.shortSharing',
},
shortDownload: {
defaultMessage: 'Download restrictions apply',
description: 'Short summary displayed for classification when a download restriction is applied to it',
id: 'boxui.securityControls.shortDownload',
},
shortApp: {
defaultMessage: 'Application restrictions apply',
description:
'Short summary displayed for classification when an application download restriction is applied to it',
id: 'boxui.securityControls.shortApp',
},
shortSharingDownload: {
defaultMessage: 'Sharing and download restrictions apply',
description:
'Short summary displayed for classification when both sharing and download restrictions are applied to it',
id: 'boxui.securityControls.shortSharingDownload',
},
shortSharingApp: {
defaultMessage: 'Sharing and app restrictions apply',
description:
'Short summary displayed for classification when both sharing and app download restrictions are applied to it',
id: 'boxui.securityControls.shortSharingApp',
},
shortDownloadApp: {
defaultMessage: 'Download and app restrictions apply',
description:
'Short summary displayed for classification when both download and app download restrictions are applied to it',
id: 'boxui.securityControls.shortDownloadApp',
},
shortAllRestrictions: {
defaultMessage: 'Sharing, download and app restrictions apply',
description:
'Short summary displayed for classification when sharing, download and app download restrictions are applied to it',
id: 'boxui.securityControls.shortAllRestrictions',
},
sharingCollabOnly: {
defaultMessage: 'Shared links allowed for collaborators only.',
description: 'Bullet point that summarizes shared link restriction applied to classification',
id: 'boxui.securityControls.sharingCollabOnly',
},
sharingCollabAndCompanyOnly: {
defaultMessage: 'Shared links cannot be made publicly accessible.',
description: 'Bullet point that summarizes collaborators shared link restriction applied to classification',
id: 'boxui.securityControls.sharingCollabAndCompanyOnly',
},
externalCollabBlock: {
defaultMessage: 'External collaboration restricted.',
description:
'Bullet point that summarizes external collaboration blocked restriction applied to classification',
id: 'boxui.securityControls.externalCollabBlock',
},
externalCollabDomainList: {
defaultMessage: 'External collaboration limited to approved domains.',
description: 'Bullet point that summarizes external collaboration restriction applied to classification',
id: 'boxui.securityControls.externalCollabDomainList',
},
appDownloadBlock: {
defaultMessage: 'Some application restrictions apply.',
description: 'Bullet point that summarizes application download blocked restriction applied to classification',
id: 'boxui.securityControls.appDownloadBlock',
},
appDownloadBlacklist: {
defaultMessage: 'Download restricted for some applications: {appNames}',
description: 'Bullet point that summarizes application download restriction applied to classification',
id: 'boxui.securityControls.appDownloadBlacklist',
},
appDownloadBlacklistOverflow: {
defaultMessage: 'Download restricted for some applications: {appNames} +{remainingAppCount} more',
description:
'Bullet point that summarizes application download restriction applied to classification. This variation is used when the list of applications is longer than the configured threshold',
id: 'boxui.securityControls.appDownloadBlacklistOverflow',
},
appDownloadWhitelist: {
defaultMessage: 'Only select applications are allowed: {appNames}',
description: 'Bullet point that summarizes application download restriction applied to classification',
id: 'boxui.securityControls.appDownloadWhitelist',
},
appDownloadWhitelistOverflow: {
defaultMessage: 'Only select applications are allowed: {appNames} +{remainingAppCount} more',
description:
'Bullet point that summarizes application download restriction applied to classification. This variation is used when the list of applications is longer than the configured threshold',
id: 'boxui.securityControls.appDownloadWhitelistOverflow',
},
allAppNames: {
defaultMessage: 'All applications: {appsList}',
description: 'Name list of all applications download restriction applied to classification',
id: 'boxui.securityControls.allAppNames',
},
// Web Download Restrictions
webDownloadOwners: {
defaultMessage: 'Download restricted on web, except Owners/Co-Owners.',
description:
'Bullet point that summarizes web download restrictions applied to classification, when restriction applies to managed users except Owners/Co-Owners',
id: 'boxui.securityControls.webDownloadOwners',
},
webDownloadOwnersEditors: {
defaultMessage: 'Download restricted on web, except Owners/Co-Owners/Editors.',
description:
'Bullet point that summarizes web download restrictions applied to classification, when restriction applies to managed users except Owners/Co-Owners/Editors',
id: 'boxui.securityControls.webDownloadOwnersEditors',
},
webDownloadExternalOwners: {
defaultMessage: 'Download restricted on web, except Owners/Co-Owners. Also restricted for external users.',
description:
'Bullet point that summarizes web download restrictions applied to classification, when restriction applies to external users and managed users except Owners/Co-Owners',
id: 'boxui.securityControls.webDownloadExternalOwners',
},
webDownloadExternalOwnersEditors: {
defaultMessage:
'Download restricted on web, except Owners/Co-Owners/Editors. Also restricted for external users.',
description:
'Bullet point that summarizes web download restrictions applied to classification, when restriction applies to external users and managed users except Owners/Co-Owners/Editors',
id: 'boxui.securityControls.webDownloadExternalOwnersEditors',
},
webDownloadExternal: {
defaultMessage: 'Download restricted on web for external users.',
description:
'Bullet point that summarizes web download restrictions applied to classification, when restriction applies to external users',
id: 'boxui.securityControls.webDownloadExternal',
},
// Mobile Download Restrictions
mobileDownloadOwners: {
defaultMessage: 'Download restricted on mobile, except Owners/Co-Owners.',
description:
'Bullet point that summarizes mobile download restrictions applied to classification, when restriction applies to managed users except Owners/Co-Owners',
id: 'boxui.securityControls.mobileDownloadOwners',
},
mobileDownloadOwnersEditors: {
defaultMessage: 'Download restricted on mobile, except Owners/Co-Owners/Editors.',
description:
'Bullet point that summarizes mobile download restrictions applied to classification, when restriction applies to managed users except Owners/Co-Owners/Editors',
id: 'boxui.securityControls.mobileDownloadOwnersEditors',
},
mobileDownloadExternalOwners: {
defaultMessage: 'Download restricted on mobile, except Owners/Co-Owners. Also restricted for external users.',
description:
'Bullet point that summarizes mobile download restrictions applied to classification, when restriction applies to external users and managed users except Owners/Co-Owners',
id: 'boxui.securityControls.mobileDownloadExternalOwners',
},
mobileDownloadExternalOwnersEditors: {
defaultMessage:
'Download restricted on mobile, except Owners/Co-Owners/Editors. Also restricted for external users.',
description:
'Bullet point that summarizes mobile download restrictions applied to classification, when restriction applies to external users and managed users except Owners/Co-Owners/Editors',
id: 'boxui.securityControls.mobileDownloadExternalOwnersEditors',
},
mobileDownloadExternal: {
defaultMessage: 'Download restricted on mobile for external users.',
description:
'Bullet point that summarizes mobile download restrictions applied to classification, when restriction applies to external users',
id: 'boxui.securityControls.mobileDownloadExternal',
},
// Desktop Download Restrictions
desktopDownloadOwners: {
defaultMessage: 'Download restricted on Box Drive, except Owners/Co-Owners.',
description:
'Bullet point that summarizes desktop download restrictions applied to classification, when restriction applies to managed users except Owners/Co-Owners. Box Drive is a product name and not translated',
id: 'boxui.securityControls.desktopDownloadOwners',
},
desktopDownloadOwnersEditors: {
defaultMessage: 'Download restricted on Box Drive, except Owners/Co-Owners/Editors.',
description:
'Bullet point that summarizes desktop download restrictions applied to classification, when restriction applies to managed users except Owners/Co-Owners/Editors. Box Drive is a product name and not translated',
id: 'boxui.securityControls.desktopDownloadOwnersEditors',
},
desktopDownloadExternalOwners: {
defaultMessage:
'Download restricted on Box Drive, except Owners/Co-Owners. Also restricted for external users.',
description:
'Bullet point that summarizes desktop download restrictions applied to classification, when restriction applies to external users and managed users except Owners/Co-Owners. Box Drive is a product name and not translated',
id: 'boxui.securityControls.desktopDownloadExternalOwners',
},
desktopDownloadExternalOwnersEditors: {
defaultMessage:
'Download restricted on Box Drive, except Owners/Co-Owners/Editors. Also restricted for external users.',
description:
'Bullet point that summarizes desktop download restrictions applied to classification, when restriction applies to external users and managed users except Owners/Co-Owners/Editors. Box Drive is a product name and not translated',
id: 'boxui.securityControls.desktopDownloadExternalOwnersEditors',
},
desktopDownloadExternal: {
defaultMessage: 'Download restricted on Box Drive for external users.',
description:
'Bullet point that summarizes desktop download restrictions applied to classification, when restriction applies to external users. Box Drive is a product name and not translated',
id: 'boxui.securityControls.downloadExternal',
},
// Security Constrols Modal
viewAll: {
defaultMessage: 'View All',
description: 'Button to display security controls modal',
id: 'boxui.securityControls.viewAll',
},
modalTitle: {
defaultMessage: "View Classification for '{itemName}'",
description: 'Title for modal to display classification and security controls details',
id: 'boxui.securityControls.modalTitle',
},
modalDescription: {
defaultMessage:
'Classification labels defined by your administrator can be used to label content and apply security policies.',
description: 'Description for modal to display classification and security controls details',
id: 'boxui.securityControls.modalDescription',
},
});
export default messages;
| {
"pile_set_name": "Github"
} |
package widget;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import javax.swing.BorderFactory;
import javax.swing.JToolBar;
/**
*
* @author usu
*/
public class Toolbar extends JToolBar {
private static final long serialVersionUID = 1L;
private BufferedImage gradientImage;
private BufferedImage ligthImage;
private final Color light = new Color(1F, 1F, 1F, 0.5F);
private final Color dark = new Color(1F, 1F, 1F, 0.0F);
private final Color black = Color.BLACK;
private final Color warna = Color.MAGENTA;
/**
*
*/
public Toolbar() {
super();
setFloatable(false);
setBorder(BorderFactory.createEmptyBorder(3, 3, 4, 3));
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
setUpGradientImage();
setUpLigthImage();
if (isOpaque()) {
g.drawImage(gradientImage, 0, 0, getWidth(), getHeight(), null);
g.drawImage(ligthImage, 0, 0, getWidth(), getHeight() / 2, null);
}
}
/**
* membuat gambar gradient background
*/
private void setUpGradientImage() {
gradientImage = new BufferedImage(1, getHeight(), BufferedImage.TYPE_INT_ARGB);
GradientPaint paint = new GradientPaint(0, 0, warna, 0, getHeight(), black);
Graphics2D g = (Graphics2D) gradientImage.getGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setPaint(paint);
g.fillRect(0, 0, 1, getHeight());
g.dispose();
}
/**
* membuat gambar glass
*/
private void setUpLigthImage() {
ligthImage = new BufferedImage(1, getHeight() / 2, BufferedImage.TYPE_INT_ARGB);
GradientPaint paint = new GradientPaint(0, 0, light, 0, getHeight(), dark);
Graphics2D g = (Graphics2D) ligthImage.getGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setPaint(paint);
g.fillRect(2, 2, 5, getHeight() / 2);
g.dispose();
}
}
| {
"pile_set_name": "Github"
} |
C##############################################################################
C
C EGSnrc egs_date subroutine stub
C Copyright (C) 2015 National Research Council Canada
C
C This file is part of EGSnrc.
C
C EGSnrc is free software: you can redistribute it and/or modify it under
C the terms of the GNU Affero General Public License as published by the
C Free Software Foundation, either version 3 of the License, or (at your
C option) any later version.
C
C EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
C WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
C FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
C more details.
C
C You should have received a copy of the GNU Affero General Public License
C along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
C
C##############################################################################
C
C Author: Iwan Kawrakow, 2003
C
C Contributors:
C
C##############################################################################
C*************************************************************************
C
C egs_date(ounit): print a 11 char string in the form
C '18-Mar-2003'
C to the unit specified by ounit
C No end of line character is inserted
C
C Your compiler does not support the fdate or date_and_time intrinsics,
C even not the date intrinsic => we are providing a stub.
C Fix it if you want to have the date printed to your output files.
C
C*************************************************************************
subroutine egs_date(ounit)
integer ounit
write(ounit,'(a,$)') 'egs_date: fixme'
return
end
| {
"pile_set_name": "Github"
} |
/*
*
* Derby - Class CharacterStreamsTest
*
* 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.derbyTesting.functionTests.tests.jdbcapi;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import junit.framework.Test;
import org.apache.derbyTesting.functionTests.util.streams.CharAlphabet;
import org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetReader;
import org.apache.derbyTesting.junit.BaseJDBCTestCase;
import org.apache.derbyTesting.junit.TestConfiguration;
/**
* Tests the following PreparedStatement methods:
* -> setCharacterStream(int parameterIndex, InputStream x, int length)
* -> setAsciiStream(int parameterIndex, Reader reader, int length)
*/
public class CharacterStreamsTest extends BaseJDBCTestCase {
public static Test suite() {
// Run only in embedded mode until DERBY-2017 is fixed.
return TestConfiguration.embeddedSuite(CharacterStreamsTest.class);
}
/** Creates a new instance of CharacterStreamsTest */
public CharacterStreamsTest(String name) {
super(name);
}
/**
* Test PreparedStatement.setAsciiStream() with column of type CHAR
*/
public void testSetAsciiStreamIntoChar() throws Exception {
runTestSetAsciiStream(1);
}
/**
* Test PreparedStatement.setAsciiStream() with column of type VARCHAR
*/
public void testSetAsciiStreamIntoVarchar() throws Exception {
runTestSetAsciiStream(2);
}
/**
* Test PreparedStatement.setAsciiStream() with column of type LONG VARCHAR
*/
public void testSetAsciiStreamIntoLongVarchar() throws Exception {
runTestSetAsciiStream(3);
}
/**
* Test PreparedStatement.setAsciiStream() with column of type CLOB
*/
public void testSetAsciiStreamIntoClob() throws Exception {
runTestSetAsciiStream(4);
}
/**
* Test PreparedStatement.setCharacterStream() with column of type CHAR
*/
public void testSetCharacterStreamIntoChar() throws Exception {
runTestSetCharacterStream(1);
}
/**
* Test PreparedStatement.setCharacterStream() with column of type VARCHAR
*/
public void testSetCharacterStreamIntoVarchar() throws Exception {
runTestSetCharacterStream(2);
}
/**
* Test PreparedStatement.setCharacterStream() with column of type
* LONG VARCHAR
*/
public void testSetCharacterStreamIntoLongVarchar() throws Exception {
runTestSetCharacterStream(3);
}
/**
* Test PreparedStatement.setCharacterStream() with column of type CLOB
*/
public void testSetCharacterStreamIntoClob() throws Exception {
runTestSetCharacterStream(4);
}
/**
* Test PreparedStatement.setAsciiStream() with streams with sizes from
* 60characters to 32K characters
*/
public void testSetAsciiStreamLongValues() throws Exception {
runTestSetAsciiStreamLongValues();
}
/**
* Test PreparedStatement.setCharacterStream() with streams with sizes from
* 60 characters to 32K characters
*/
public void testSetCharacterStreamLongValues() throws Exception {
runTestSetCharacterStreamLongValues();
}
private void runTestSetAsciiStream(int col) throws Exception {
PreparedStatement psi = prepareStatement(
"insert into charstream(c, vc, lvc, lob) " +
"values(?,?,?,?)");
PreparedStatement psq = prepareStatement(
"select id, c, {fn length(c)} AS CLEN, " +
"cast (vc as varchar(25)) AS VC, " +
"{fn length(vc)} AS VCLEN, " +
"cast (lvc as varchar(25)) AS LVC, " +
"{fn length(lvc)} AS LVCLEN, " +
"cast (lob as varchar(25)) AS LOB, " +
"{fn length(lob)} AS LOBLEN " +
"from charstream " +
"where id > ? order by 1");
// test setAsciiStream into CHAR
println("\nTest setAsciiStream into CHAR");
psi.setString(1, null);
psi.setString(2, null);
psi.setString(3, null);
psi.setString(4, null);
int maxid = getMaxId();
setAscii(psi, col);
psq.setInt(1, maxid);
verifyAsciiStreamResults(psq.executeQuery(), col);
// Show results as various streams
PreparedStatement psStreams = prepareStatement(
"SELECT id, c, vc, lvc, lob " +
"FROM charstream where id > ? order by 1");
psStreams.setInt(1, maxid);
verifyResultsUsingAsciiStream(psStreams.executeQuery(), col);
verifyResultsUsingCharacterStream(psStreams.executeQuery(), col);
verifyResultsUsingCharacterStreamBlock(psStreams.executeQuery(), col);
psStreams.close();
psi.close();
psq.close();
}
private void runTestSetCharacterStream(int col) throws Exception {
PreparedStatement psi = prepareStatement(
"insert into charstream(c, vc, lvc, lob) " +
"values(?,?,?,?)");
PreparedStatement psq = prepareStatement(
"select id, c, {fn length(c)} AS CLEN, " +
"cast (vc as varchar(25)) AS VC, " +
"{fn length(vc)} AS VCLEN, " +
"cast (lvc as varchar(25)) AS LVC, " +
"{fn length(lvc)} AS LVCLEN, " +
"cast (lob as varchar(25)) AS LOB, " +
"{fn length(lob)} AS LOBLEN " +
"from charstream " +
"where id > ? order by 1");
// test setCharacterStream into CHAR
println("\nTest setCharacterStream into CHAR");
psi.setString(1, null);
psi.setString(2, null);
psi.setString(3, null);
psi.setString(4, null);
int maxid = getMaxId();
setCharacter(psi, col);
psq.setInt(1, maxid);
verifyCharStreamResults(psq.executeQuery(), col);
psi.close();
psq.close();
}
private void runTestSetAsciiStreamLongValues() throws Exception {
// now insert long values using streams and check them programatically.
PreparedStatement psi = prepareStatement(
"insert into charstream(c, vc, lvc, lob) " +
"values(?,?,?,?)");
PreparedStatement psDel = prepareStatement("DELETE FROM charstream");
PreparedStatement psq2 =
prepareStatement("select c, vc, lvc, lob from charstream");
// now insert long values using streams and check them programatically.
println("setAsciiStream(LONG ASCII STREAMS)");
checkAsciiStreams(psDel, psi, psq2, 18, 104, 67, 67);
checkAsciiStreams(psDel, psi, psq2, 25, 16732, 14563, 14563);
checkAsciiStreams(psDel, psi, psq2, 1, 32433, 32673, 32673);
checkAsciiStreams(psDel, psi, psq2, 0, 32532, 32700, 32700);
psi.close();
psDel.close();
psq2.close();
}
private void runTestSetCharacterStreamLongValues() throws Exception {
// now insert long values using streams and check them programatically.
PreparedStatement psi = prepareStatement(
"insert into charstream(c, vc, lvc, lob) " +
"values(?,?,?,?)");
PreparedStatement psDel = prepareStatement("DELETE FROM charstream");
PreparedStatement psqSQLLength = prepareStatement(
"select length(c), length(vc), length(lvc), length(lob) " +
"from charstream");
PreparedStatement psq2 =
prepareStatement("select c, vc, lvc, lob from charstream");
println("setCharacterStream(LONG CHARACTER STREAMS WITH UNICODE)");
checkCharacterStreams(
psDel, psi, psq2, psqSQLLength, 14, 93, 55, 55, 0);
checkCharacterStreams(
psDel, psi, psq2, psqSQLLength, 21, 10887, 10887, 10887, 3);
checkCharacterStreams(
psDel, psi, psq2, psqSQLLength, 25, 19332, 18733, 18733, 0);
checkCharacterStreams(
psDel, psi, psq2, psqSQLLength, 1, 32433, 32673, 32673, 0);
checkCharacterStreams(
psDel, psi, psq2, psqSQLLength, 0, 32532, 32700, 32700, 0);
psi.close();
psDel.close();
psq2.close();
}
private int getMaxId() throws SQLException {
Statement stmt = createStatement();
ResultSet rs = stmt.executeQuery("select max(id) from charstream");
rs.next();
int maxid = rs.getInt(1);
rs.close();
stmt.close();
return maxid;
}
private void setAscii(PreparedStatement ps, int targetCol)
throws Exception {
byte[] asciiBytes = null;
// correct byte count
println("CORRECT NUMBER OF BYTES IN STREAM");
asciiBytes = ASCII_VALUE.getBytes("US-ASCII");
ps.setAsciiStream(targetCol,
new ByteArrayInputStream(asciiBytes), LEN_ASCII_VALUE);
ps.executeUpdate();
// less bytes than stream contains. JDBC 3.0 indicates it should throw
// an exception (in Tutorial & reference book)
println("MORE BYTES IN STREAM THAN PASSED IN VALUE");
try {
asciiBytes = "against Republicans George W. Bush ".
getBytes("US-ASCII");
ps.setAsciiStream(targetCol,
new ByteArrayInputStream(asciiBytes), 19);
ps.executeUpdate();
fail("FAIL - MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH");
} catch (SQLException sqle) {
assertSQLState("XJ001", sqle);
}
// more bytes than the stream contains JDBC 3.0 changed to indicate an
// exception should be thrown. (in Tutorial & reference book)
println("LESS BYTES IN STREAM THAN PASSED IN VALUE");
try {
asciiBytes = "and Dick Cheney.".getBytes("US-ASCII");
ps.setAsciiStream(targetCol,
new ByteArrayInputStream(asciiBytes), 17);
ps.executeUpdate();
fail("FAIL - LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH");
} catch (SQLException sqle) {
assertSQLState("XJ001", sqle);
}
// null
println("NULL ASCII STREAM");
ps.setAsciiStream(targetCol, null, 1);
ps.executeUpdate();
}
private void setCharacter(PreparedStatement ps, int targetCol)
throws Exception {
Reader reader = null;
// correct character count
reader = new StringReader(CHAR_VALUE1);
ps.setCharacterStream(targetCol, reader, LEN_CHAR_VALUE1);
ps.executeUpdate();
reader = new StringReader(CHAR_VALUE2);
ps.setCharacterStream(targetCol, reader, LEN_CHAR_VALUE2);
ps.executeUpdate();
// less bytes than stream contains.
try {
reader = new StringReader("for comments he made at");
ps.setCharacterStream(targetCol, reader, 20);
ps.executeUpdate();
fail("FAIL - MORE CHARACTERS IN READER THAN SPECIFIED LENGTH");
} catch (SQLException sqle) {
assertSQLState("XJ001", sqle);
}
// more bytes than the stream contains,
// JDBC 3.0 changed to indicate an exception should be thrown.
try {
reader = new StringReader("a birthday party");
ps.setCharacterStream(targetCol, reader, 17);
ps.executeUpdate();
fail("FAIL - LESS CHARACTERS IN READER THAN SPECIFIED LENGTH");
} catch (SQLException sqle) {
assertSQLState("XJ001", sqle);
}
// null
ps.setCharacterStream(targetCol, null, 1);
ps.executeUpdate();
}
private void verifyAsciiStreamResults(ResultSet rs, int col)
throws Exception
{
String value;
int length;
// First row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col * 2);
assertFalse("FAIL - value should not be null", rs.wasNull());
length = rs.getInt((col * 2) + 1);
assertFalse("FAIL - length should not be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col,
ASCII_VALUE, value.trim());
assertEquals("FAIL - wrong length " + col, LEN_ASCII_VALUE, length);
// null row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col * 2);
assertTrue("FAIL - value should be null", rs.wasNull());
length = rs.getInt((col * 2) + 1);
assertTrue("FAIL - length should be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col, null, value);
assertEquals("FAIL - wrong length " + col, 0, length);
assertFalse("FAIL - more rows than expected", rs.next());
}
private void verifyCharStreamResults(ResultSet rs, int col)
throws Exception {
String value;
int length;
// First row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col * 2);
assertFalse("FAIL - value should not be null", rs.wasNull());
length = rs.getInt((col * 2) + 1);
assertFalse("FAIL - length should not be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col,
CHAR_VALUE1, value.trim());
assertEquals("FAIL - wrong length " + col, LEN_CHAR_VALUE1, length);
// Second row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col * 2);
assertFalse("FAIL - value should not be null", rs.wasNull());
length = rs.getInt((col * 2) + 1);
assertFalse("FAIL - length should not be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col,
CHAR_VALUE2, value.trim());
assertEquals("FAIL - wrong length " + col, LEN_CHAR_VALUE2, length);
// null row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col * 2);
assertTrue("FAIL - value should be null", rs.wasNull());
length = rs.getInt((col * 2) + 1);
assertTrue("FAIL - length should be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col, null, value);
assertEquals("FAIL - wrong length " + col, 0, length);
assertFalse("FAIL - more rows than expected", rs.next());
rs.close();
}
private void verifyResultsUsingAsciiStream(ResultSet rs, int col)
throws Exception
{
InputStream valueStream;
String value;
// First row
assertTrue("FAIL - row not found", rs.next());
valueStream = rs.getAsciiStream(col + 1);
assertFalse("FAIL - value should not be null", rs.wasNull());
byte[] valueBytes = new byte[LEN_ASCII_VALUE];
assertEquals("FAIL - wrong length read from stream", LEN_ASCII_VALUE,
valueStream.read(valueBytes));
assertEquals("FAIL - wrong value on column " + col,
ASCII_VALUE, new String(valueBytes, "US-ASCII"));
// null row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col + 1);
assertTrue("FAIL - value should be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col, null, value);
assertFalse("FAIL - more rows than expected", rs.next());
rs.close();
}
private void verifyResultsUsingCharacterStream(ResultSet rs, int col)
throws Exception
{
Reader valueReader;
String value;
// First row
assertTrue("FAIL - row not found", rs.next());
// Read characters one by one
valueReader = rs.getCharacterStream(col + 1);
StringBuffer sb = new StringBuffer();
int c = 0;
while ((c = valueReader.read()) != -1) {
sb.append((char)c);
}
value = sb.toString().trim();
assertEquals("FAIL - wrong length read from stream", LEN_ASCII_VALUE,
value.length());
assertEquals("FAIL - wrong value on column " + col,
ASCII_VALUE, value);
// null row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col + 1);
assertTrue("FAIL - value should be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col, null, value);
assertFalse("FAIL - more rows than expected", rs.next());
rs.close();
}
private void verifyResultsUsingCharacterStreamBlock(ResultSet rs, int col)
throws Exception
{
Reader valueReader;
String value;
// First row
assertTrue("FAIL - row not found", rs.next());
valueReader = rs.getCharacterStream(col + 1);
assertFalse("FAIL - value should not be null", rs.wasNull());
// Read all characters in a block
char[] valueChars = new char[LEN_ASCII_VALUE];
assertEquals("FAIL - wrong length read from stream", LEN_ASCII_VALUE,
valueReader.read(valueChars));
assertEquals("FAIL - wrong value on column " + col,
ASCII_VALUE, new String(valueChars));
// null row
assertTrue("FAIL - row not found", rs.next());
value = rs.getString(col + 1);
assertTrue("FAIL - value should be null", rs.wasNull());
assertEquals("FAIL - wrong value on column " + col, null, value);
assertFalse("FAIL - more rows than expected", rs.next());
rs.close();
}
private void checkAsciiStreams(
PreparedStatement psDel,
PreparedStatement psi,
PreparedStatement psq2,
int cl, int vcl, int lvcl, int lob)
throws SQLException, IOException {
psDel.executeUpdate();
// now insert long values using streams and check them programatically.
psi.setAsciiStream(1, new c3AsciiStream(cl), cl);
psi.setAsciiStream(2, new c3AsciiStream(vcl), vcl);
psi.setAsciiStream(3, new c3AsciiStream(lvcl), lvcl);
psi.setAsciiStream(4, new c3AsciiStream(lob), lob);
psi.executeUpdate();
ResultSet rs = psq2.executeQuery();
rs.next();
InputStream is = rs.getAsciiStream(1);
checkAsciiStream(is, cl, 25);
is = rs.getAsciiStream(2);
checkAsciiStream(is, vcl, -1);
is = rs.getAsciiStream(3);
checkAsciiStream(is, lvcl, -1);
is = rs.getAsciiStream(4);
checkAsciiStream(is, lob, -1);
rs.close();
rs = psq2.executeQuery();
rs.next();
Reader r = rs.getCharacterStream(1);
checkAsciiStream(r, cl, 25);
r = rs.getCharacterStream(2);
checkAsciiStream(r, vcl, -1);
r = rs.getCharacterStream(3);
checkAsciiStream(r, lvcl, -1);
r = rs.getCharacterStream(4);
checkAsciiStream(r, lob, -1);
rs.close();
// and check as Strings
rs = psq2.executeQuery();
rs.next();
r = new StringReader(rs.getString(1));
checkAsciiStream(r, cl, 25);
r = new StringReader(rs.getString(2));
checkAsciiStream(r, vcl, -1);
r = new StringReader(rs.getString(3));
checkAsciiStream(r, lvcl, -1);
r = new StringReader(rs.getString(4));
checkAsciiStream(r, lob, -1);
rs.close();
}
private Reader getSourceStream(int length, int bytesPerChar) {
switch (bytesPerChar) {
case 0:
return new c3Reader(length);
case 1:
return new LoopingAlphabetReader(length,
CharAlphabet.modernLatinLowercase());
case 2:
return new LoopingAlphabetReader(length,
CharAlphabet.tamil());
case 3:
return new LoopingAlphabetReader(length,
CharAlphabet.cjkSubset());
default:
fail("Illegal value of bytesPerChar: " + bytesPerChar);
return null;
}
}
private void checkCharacterStreams(
PreparedStatement psDel,
PreparedStatement psi,
PreparedStatement psq2,
PreparedStatement psqSQLLength,
int cl, int vcl, int lvcl, int lob,
int bytesPerChar)
throws SQLException, IOException {
psDel.executeUpdate();
psi.setCharacterStream(1, getSourceStream(cl, bytesPerChar), cl);
psi.setCharacterStream(2, getSourceStream(vcl, bytesPerChar), vcl);
psi.setCharacterStream(3, getSourceStream(lvcl, bytesPerChar), lvcl);
psi.setCharacterStream(4, getSourceStream(lob, bytesPerChar), lob);
psi.executeUpdate();
ResultSet rsLength = psqSQLLength.executeQuery();
assertTrue(rsLength.next());
assertEquals(25, rsLength.getInt(1)); // CHAR
assertEquals(vcl, rsLength.getInt(2)); // VARCHAR
assertEquals(lvcl, rsLength.getInt(3)); // LONG VARCHAR
assertEquals(lob, rsLength.getInt(4)); //CLOB
assertFalse(rsLength.next());
rsLength.close();
ResultSet rs = psq2.executeQuery();
rs.next();
InputStream is = rs.getAsciiStream(1);
checkCharStream(is, cl, 25, bytesPerChar);
is = rs.getAsciiStream(2);
checkCharStream(is, vcl, -1, bytesPerChar);
is = rs.getAsciiStream(3);
checkCharStream(is, lvcl, -1, bytesPerChar);
is = rs.getAsciiStream(4);
checkCharStream(is, lob, -1, bytesPerChar);
rs.close();
rs = psq2.executeQuery();
rs.next();
Reader r = rs.getCharacterStream(1);
checkCharStream(r, cl, 25, bytesPerChar);
r = rs.getCharacterStream(2);
checkCharStream(r, vcl, -1, bytesPerChar);
r = rs.getCharacterStream(3);
checkCharStream(r, lvcl, -1, bytesPerChar);
r = rs.getCharacterStream(4);
checkCharStream(r, lob, -1, bytesPerChar);
rs.close();
// check converting them into Strings work
rs = psq2.executeQuery();
rs.next();
String suv = rs.getString(1);
r = new StringReader(suv);
checkCharStream(r, cl, 25, bytesPerChar);
suv = rs.getString(2);
r = new StringReader(suv);
checkCharStream(r, vcl, -1, bytesPerChar);
suv = rs.getString(3);
r = new StringReader(suv);
checkCharStream(r, lvcl, -1, bytesPerChar);
suv = rs.getString(4);
r = new StringReader(suv);
checkCharStream(r, lob, -1, bytesPerChar);
rs.close();
}
private void checkAsciiStream(InputStream is, int length, int fixedLen)
throws IOException
{
InputStream orig = new c3AsciiStream(length);
int count = 0;
for (;;) {
int o = orig == null ?
(count == fixedLen ? -2 : 0x20) : orig.read();
int c = is.read();
if (o == -1) {
orig = null;
if (fixedLen != -1 && fixedLen != length)
o = ' ';
}
if (o == -2)
o = -1;
assertEquals("FAIL - wrong value at position " + count, o, c);
if (orig == null) {
if (fixedLen == -1)
break;
}
if (c == -1 && fixedLen != -1)
break;
count++;
}
if (fixedLen != -1)
length = fixedLen;
assertEquals("FAIL - wrong length", length, count);
is.close();
}
private void checkAsciiStream(Reader r, int length, int fixedLen)
throws IOException
{
InputStream orig = new c3AsciiStream(length);
int count = 0;
for (;;) {
int o = orig == null ?
(count == fixedLen ? -2 : 0x20) : orig.read();
int c = r.read();
if (o == -1) {
orig = null;
if (fixedLen != -1 && fixedLen != length)
o = ' ';
}
if (o == -2)
o = -1;
assertEquals("FAIL - wrong value", o, c);
if (orig == null) {
if (fixedLen == -1)
break;
}
if (c == -1 && fixedLen != -1)
break;
count++;
}
if (fixedLen != -1)
length = fixedLen;
assertEquals("FAIL - wrong length", length, count);
r.close();
}
private void checkCharStream(InputStream is, int length, int fixedLen,
int bytesPerChar)
throws IOException
{
Reader orig = getSourceStream(length, bytesPerChar);
int count = 0;
for (;;) {
int o = orig == null ?
(count == fixedLen ? -2 : 0x20) : orig.read();
int c = is.read();
if (o == -1) {
orig = null;
if (fixedLen != -1 && fixedLen != length)
o = ' ';
}
if (o == -2)
o = -1;
if (o != -1) {
if (o <= 255)
o = o & 0xFF; // convert to single byte extended ASCII
else
o = '?'; // out of range character.
}
assertEquals("FAIL - wrong value", o, c);
if (orig == null) {
if (fixedLen == -1)
break;
}
if (c == -1 && fixedLen != -1)
break;
count++;
}
if (fixedLen != -1)
length = fixedLen;
assertEquals("FAIL - wrong length", length, count);
is.close();
}
private void checkCharStream(Reader r, int length, int fixedLen,
int bytesPerChar)
throws IOException
{
Reader orig = getSourceStream(length, bytesPerChar);
int count = 0;
for (;;) {
int o = (orig == null) ?
(count == fixedLen ? -2 : 0x20) : orig.read();
int c = r.read();
if (o == -1) {
orig = null;
if (fixedLen != -1 && fixedLen != length)
o = ' ';
}
if (o == -2)
o = -1;
assertEquals("FAIL - wrong value", o, c);
if (orig == null) {
if (fixedLen == -1)
break;
}
if (c == -1 && fixedLen != -1)
break;
count++;
}
if (fixedLen != -1)
length = fixedLen;
assertEquals("FAIL - wrong length", length, count);
r.close();
}
protected void setUp() throws Exception {
createStatement().executeUpdate(
"create table charstream(" +
"id int GENERATED ALWAYS AS IDENTITY primary key, " +
"c char(25), " +
"vc varchar(32532), " +
"lvc long varchar, " +
"lob clob(300K))");
}
protected void tearDown() throws Exception {
rollback();
createStatement().executeUpdate("DROP TABLE charstream");
commit();
super.tearDown();
}
private final static String ASCII_VALUE = "Lieberman ran with Gore";
private final static int LEN_ASCII_VALUE = 23;
private final static String CHAR_VALUE1 = "A Mississippi Republican";
private final static int LEN_CHAR_VALUE1 = 24;
private final static String CHAR_VALUE2 = "Lott has apologized";
private final static int LEN_CHAR_VALUE2 = 19;
}
class c3AsciiStream extends InputStream {
private final int size;
private int count;
c3AsciiStream(int size) {
this.size = size;
}
public int read(byte[] buf, int off, int length) {
if (count >= size)
return -1;
if (length > (size - count))
length = (size - count);
// ensure the readers don't always get a full buffer,
// makes sure they are not assuming the buffer will be filled.
if (length > 20)
length -= 17;
for (int i = 0; i < length ; i++) {
buf[off + i] = (byte) count++;
}
return length;
}
private byte[] rd = new byte[1];
public int read() {
int read = read(rd, 0, 1);
if (read == -1)
return -1;
return rd[0] & 0xFF;
}
public void close() {
}
}
class c3Reader extends Reader {
private final int size;
private int count;
c3Reader(int size) {
this.size = size;
}
public int read(char[] buf, int off, int length) {
if (count >= size)
return -1;
if (length > (size - count))
length = (size - count);
// ensure the readers don't always get a full buffer,
// makes sure they are not assuming the buffer will be filled.
if (length > 20)
length -= 17;
for (int i = 0; i < length ; i++) {
char c;
switch (count % 3) {
case 0:
c = (char) (count & 0x7F); // one byte UTF8
break;
case 1:
c = (char) ((count + 0x7F) & 0x07FF); // two byte UTF8
break;
default:
case 2:
c = (char) (count + 0x07FF); // three byte UTF8
break;
}
buf[off + i] = c;
count++;
}
return length;
}
public void close() {
}
}
| {
"pile_set_name": "Github"
} |
<script type="text/javascript">
$(function() {
$('#select_page_id').on('change', function() {
show_field($(this));
});
show_field($('#select_page_id'));
})
function show_field($select) {
if($select.val() == 0)
$('#page_level_container').show();
else
$('#page_level_container').hide();
}
</script>
<div class="panel-body">
<div class="form-group">
<label class="control-label col-md-3"><?php echo __('Page'); ?></label>
<div class="col-md-4">
<?php echo Form::select('page_id', $select, $widget->page_id, array('id' => 'select_page_id')); ?>
</div>
</div>
<div class="form-group" id="page_level_container">
<label class="control-label col-md-3" for="page_level"><?php echo __('Select page level'); ?></label>
<div class="col-md-2">
<?php echo Form::input('page_level', $widget->page_level, array('id' => 'page_level', 'class' => 'form-control')); ?>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-3 col-md-9">
<div class="checkbox">
<label><?php echo Form::checkbox('match_all_paths', 1, $widget->match_all_paths == 1); ?> <?php echo __('Match All Pages within Given Deepness'); ?></label>
</div>
<div class="checkbox">
<label><?php echo Form::checkbox('include_hidden', 1, $widget->include_hidden == 1); ?> <?php echo __('Include hidden pages'); ?></label>
</div>
</div>
</div>
</div>
<div class="panel-heading">
<span class="panel-title"><?php echo __('Exclude pages'); ?></span>
</div>
<table class="table table-noborder table-striped">
<colgroup>
<col width="50px" />
<col width="450px" />
<col />
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
<th><?php echo __('Fetched widget'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach($pages as $page): ?>
<tr>
<?php if($page['id'] > 1): ?>
<td class="text-right">
<?php echo Form::checkbox('exclude[]', $page['id'], in_array($page['id'], $widget->exclude), array('id' => 'page'.$page['id'])); ?>
</td>
<th><label for="page<?php echo $page['id']; ?>"><?php echo str_repeat(' ', $page['level'] * 10) . $page['title']; ?></label></th>
<?php else: ?>
<td></td>
<th><?php echo $page['title']; ?></th>
<?php endif; ?>
<td>
<?php
$widgets = Widget_Manager::get_related(array());
if (isset($widgets[$widget->id])) unset($widgets[$widget->id]);
if (!empty($widgets))
{
$widgets = array(__('--- Not set ---')) + $widgets;
$selected = Arr::get($widget->fetched_widgets, $page['id']);
echo Form::select('fetched_widgets['.$page['id'].']', $widgets, $selected, array(
'class' => 'form-control'
));
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table> | {
"pile_set_name": "Github"
} |
define(function () {
// Khmer
return {
errorLoading: function () {
return 'មិនអាចទាញយកទិន្នន័យ';
},
inputTooLong: function (args) {
var overChars = args.input.length - args.maximum;
var message = 'សូមលុបចេញ ' + overChars + ' អក្សរ';
return message;
},
inputTooShort: function (args) {
var remainingChars = args.minimum - args.input.length;
var message = 'សូមបញ្ចូល' + remainingChars + ' អក្សរ រឺ ច្រើនជាងនេះ';
return message;
},
loadingMore: function () {
return 'កំពុងទាញយកទិន្នន័យបន្ថែម...';
},
maximumSelected: function (args) {
var message = 'អ្នកអាចជ្រើសរើសបានតែ ' + args.maximum + ' ជម្រើសប៉ុណ្ណោះ';
return message;
},
noResults: function () {
return 'មិនមានលទ្ធផល';
},
searching: function () {
return 'កំពុងស្វែងរក...';
},
removeAllItems: function () {
return 'លុបធាតុទាំងអស់';
}
};
});
| {
"pile_set_name": "Github"
} |
# Generated by Django 2.1 on 2019-02-26 11:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0007_auto_20190226_1939'),
]
operations = [
migrations.AlterField(
model_name='articlepost',
name='avatar',
field=models.ImageField(blank=True, upload_to='article/%Y%m%d/'),
),
]
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@class NSArray, NSString;
__attribute__((visibility("hidden")))
@interface _SGTABPersonResult : NSObject
{
NSString *displayName;
NSArray *values;
id representedObject;
}
@property(readonly, nonatomic) NSArray *values; // @synthesize values;
@property(readonly, nonatomic) id representedObject; // @synthesize representedObject;
@property(readonly, nonatomic) NSString *displayName; // @synthesize displayName;
- (void)dealloc;
- (void)addValue:(id)arg1;
- (id)initWithPerson:(id)arg1 includeAllScreenNames:(BOOL)arg2;
- (id)initWithDisplayName:(id)arg1 values:(id)arg2;
- (id)initWithDisplayName:(id)arg1 representedObject:(id)arg2 values:(id)arg3;
@end
| {
"pile_set_name": "Github"
} |
# frozen_string_literal: true
module ApplicationHelper
def google_maps_api_source
if APP_CONFIG.google_maps_api_key
"https://maps.googleapis.com/maps/api/js?libraries=geometry&key=#{APP_CONFIG.google_maps_api_key}"
else
'https://maps.googleapis.com/maps/api/js?libraries=geometry'
end
end
def map_config_attributes
{
'data-map-center': APP_CONFIG.map.center,
'data-map-zoom': APP_CONFIG.map.zoom
}
end
def title(page_title)
content_for(:title) { page_title.to_s }
end
def meta_title(options = {})
title = content_for(:title) || options[:fallback]
title << " | #{APP_CONFIG.app_name}" unless user_signed_in? || title.blank?
title
end
def twitterized_type(type)
case type
when 'alert' then 'warning'
when 'error' then 'danger'
when 'notice' then 'info'
else type
end
end
def transparent_gif_image_data
'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='
end
def options_for_array_collection(model, attr_name, *_args)
"#{model}::#{attr_name.to_s.upcase}".safe_constantize.map { |e| [model.human_attribute_name("#{attr_name}_#{e}"), e] }
end
end
| {
"pile_set_name": "Github"
} |
#!/bin/bash
# this recipe will overlink libraries without the --as-needed/-dead_strip_dylibs linker arg
re='^(.*)-Wl,--as-needed(.*)$'
if [[ ${LDFLAGS} =~ $re ]]; then
export LDFLAGS="${BASH_REMATCH[1]}${BASH_REMATCH[2]}"
fi
re='^(.*)-Wl,-dead_strip_dylibs(.*)$'
if [[ ${LDFLAGS} =~ $re ]]; then
export LDFLAGS="${BASH_REMATCH[1]}${BASH_REMATCH[2]}"
fi
echo "int main() { return 0; }" | ${CC} ${CFLAGS} ${LDFLAGS} -o ${PREFIX}/bin/overlinking -lbz2 -x c -
| {
"pile_set_name": "Github"
} |
include Build.mk
CWD != realpath --relative-to=$(SRCDIR) .
all: builtin.o $(elf)
builtin.o: $(obj-y) $(dirs-y)
@$(ECHO) " LD " $(CWD)/builtin.o;
@$(LD) $(LDFLAGS) -r $(obj-y) $(patsubst %/,%/builtin.o, $(dirs-y)) -o builtin.o;
.PHONY: $(dirs-y)
$(dirs-y): $(patsubst %/,%/Makefile, $(dirs-y))
@$(ECHO) " MK " $(CWD)/$@;
@$(MAKE) -C $@ $(param)
%.o:%.c
@$(ECHO) " CC " $(CWD)/$@;
@$(CC) $(CFLAGS) -c $< -o $@
%.o:%.S
@$(ECHO) " AS " $(CWD)/$@;
@$(AS) $(ASFLAGS) -c $< -o $@
.PHONY: clean
clean: param = clean
clean: $(dirs-y)
@$(ECHO) " RM " $(obj-y) $(elf) builtin.o
@$(RM) $(obj-y) $(elf) builtin.o
| {
"pile_set_name": "Github"
} |
package prometheus
import (
"runtime"
"testing"
"time"
dto "github.com/prometheus/client_model/go"
)
func TestGoCollector(t *testing.T) {
var (
c = NewGoCollector()
ch = make(chan Metric)
waitc = make(chan struct{})
closec = make(chan struct{})
old = -1
)
defer close(closec)
go func() {
c.Collect(ch)
go func(c <-chan struct{}) {
<-c
}(closec)
<-waitc
c.Collect(ch)
}()
for {
select {
case metric := <-ch:
switch m := metric.(type) {
// Attention, this also catches Counter...
case Gauge:
pb := &dto.Metric{}
m.Write(pb)
if pb.GetGauge() == nil {
continue
}
if old == -1 {
old = int(pb.GetGauge().GetValue())
close(waitc)
continue
}
if diff := int(pb.GetGauge().GetValue()) - old; diff != 1 {
// TODO: This is flaky in highly concurrent situations.
t.Errorf("want 1 new goroutine, got %d", diff)
}
// GoCollector performs two sends per call.
// On line 27 we need to receive the second send
// to shut down cleanly.
<-ch
return
}
case <-time.After(1 * time.Second):
t.Fatalf("expected collect timed out")
}
}
}
func TestGCCollector(t *testing.T) {
var (
c = NewGoCollector()
ch = make(chan Metric)
waitc = make(chan struct{})
closec = make(chan struct{})
oldGC uint64
oldPause float64
)
defer close(closec)
go func() {
c.Collect(ch)
// force GC
runtime.GC()
<-waitc
c.Collect(ch)
}()
first := true
for {
select {
case metric := <-ch:
switch m := metric.(type) {
case *constSummary, *value:
pb := &dto.Metric{}
m.Write(pb)
if pb.GetSummary() == nil {
continue
}
if len(pb.GetSummary().Quantile) != 5 {
t.Errorf("expected 4 buckets, got %d", len(pb.GetSummary().Quantile))
}
for idx, want := range []float64{0.0, 0.25, 0.5, 0.75, 1.0} {
if *pb.GetSummary().Quantile[idx].Quantile != want {
t.Errorf("bucket #%d is off, got %f, want %f", idx, *pb.GetSummary().Quantile[idx].Quantile, want)
}
}
if first {
first = false
oldGC = *pb.GetSummary().SampleCount
oldPause = *pb.GetSummary().SampleSum
close(waitc)
continue
}
if diff := *pb.GetSummary().SampleCount - oldGC; diff != 1 {
t.Errorf("want 1 new garbage collection run, got %d", diff)
}
if diff := *pb.GetSummary().SampleSum - oldPause; diff <= 0 {
t.Errorf("want moar pause, got %f", diff)
}
return
}
case <-time.After(1 * time.Second):
t.Fatalf("expected collect timed out")
}
}
}
| {
"pile_set_name": "Github"
} |
{
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
#include <iostream>
#include <vector>
using namespace std;
int main(){
int N, num, score, sum;
cin >> N;
vector<int> v(N + 1);
for(int i = 0; i < N; i++){
cin >> num >> score;
v[num] += score;
}
int max = v[1], t = 1;
for(int i = 2; i <= N; i++){
if(max < v[i]){
max = v[i];
t = i;
}
}
cout << t << " " << max;
return 0;
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8" ?>
<rss version="0.91"
xmlns:dc="http://purl.org/dc/elements/1.0/">
<channel>
<item>
<dc:date>2009-03-07T08:03:50Z</dc:date>
</item>
</channel>
</rss>
| {
"pile_set_name": "Github"
} |
using CSRedis.Internal;
using CSRedis.Internal.Fakes;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace CSRedis.Tests
{
[TestClass]
public class ListTests
{
[TestMethod, TestCategory("Lists")]
public void TestBLPopWithKey()
{
string reply = "*2\r\n$4\r\ntest\r\n$5\r\ntest1\r\n";
using (var mock = new FakeRedisSocket(reply, reply))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
var response1 = redis.BLPopWithKey(60, "test");
Assert.AreEqual("test", response1.Item1);
Assert.AreEqual("test1", response1.Item2);
Assert.AreEqual("*3\r\n$5\r\nBLPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
var response2 = redis.BLPopWithKey(TimeSpan.FromMinutes(1), "test");
Assert.AreEqual("*3\r\n$5\r\nBLPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestBLPop()
{
string reply = "*2\r\n$4\r\ntest\r\n$5\r\ntest1\r\n";
using (var mock = new FakeRedisSocket(reply, reply))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("test1", redis.BLPop(60, "test"));
Assert.AreEqual("*3\r\n$5\r\nBLPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
Assert.AreEqual("test1", redis.BLPop(TimeSpan.FromMinutes(1), "test"));
Assert.AreEqual("*3\r\n$5\r\nBLPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestBRPopWithKey()
{
string reply = "*2\r\n$4\r\ntest\r\n$5\r\ntest1\r\n";
using (var mock = new FakeRedisSocket(reply, reply))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
var response1 = redis.BRPopWithKey(60, "test");
Assert.AreEqual("test", response1.Item1);
Assert.AreEqual("test1", response1.Item2);
Assert.AreEqual("*3\r\n$5\r\nBRPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
var response2 = redis.BRPopWithKey(TimeSpan.FromMinutes(1), "test");
Assert.AreEqual("*3\r\n$5\r\nBRPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestBRPop()
{
string reply = "*2\r\n$4\r\ntest\r\n$5\r\ntest1\r\n";
using (var mock = new FakeRedisSocket(reply, reply))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("test1", redis.BRPop(60, "test"));
Assert.AreEqual("*3\r\n$5\r\nBRPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
Assert.AreEqual("test1", redis.BRPop(TimeSpan.FromMinutes(1), "test"));
Assert.AreEqual("*3\r\n$5\r\nBRPOP\r\n$4\r\ntest\r\n$2\r\n60\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestBRPopLPush()
{
string reply = "$5\r\ntest1\r\n";
using (var mock = new FakeRedisSocket(reply, reply))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("test1", redis.BRPopLPush("test", "new", 60));
Assert.AreEqual("*4\r\n$10\r\nBRPOPLPUSH\r\n$4\r\ntest\r\n$3\r\nnew\r\n$2\r\n60\r\n", mock.GetMessage());
Assert.AreEqual("test1", redis.BRPopLPush("test", "new", TimeSpan.FromMinutes(1)));
Assert.AreEqual("*4\r\n$10\r\nBRPOPLPUSH\r\n$4\r\ntest\r\n$3\r\nnew\r\n$2\r\n60\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLIndex()
{
using (var mock = new FakeRedisSocket("$5\r\ntest1\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("test1", redis.LIndex("test", 0));
Assert.AreEqual("*3\r\n$6\r\nLINDEX\r\n$4\r\ntest\r\n$1\r\n0\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLInsert()
{
string reply = ":2\r\n";
using (var mock = new FakeRedisSocket(reply, reply))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual(2, redis.LInsert("test", RedisInsert.Before, "field1", "test1"));
Assert.AreEqual("*5\r\n$7\r\nLINSERT\r\n$4\r\ntest\r\n$6\r\nBEFORE\r\n$6\r\nfield1\r\n$5\r\ntest1\r\n", mock.GetMessage());
Assert.AreEqual(2, redis.LInsert("test", RedisInsert.After, "field1", "test1"));
Assert.AreEqual("*5\r\n$7\r\nLINSERT\r\n$4\r\ntest\r\n$5\r\nAFTER\r\n$6\r\nfield1\r\n$5\r\ntest1\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLLen()
{
using (var mock = new FakeRedisSocket(":3\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual(3, redis.LLen("test"));
Assert.AreEqual("*2\r\n$4\r\nLLEN\r\n$4\r\ntest\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLPop()
{
using (var mock = new FakeRedisSocket("$5\r\ntest1\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("test1", redis.LPop("test"));
Assert.AreEqual("*2\r\n$4\r\nLPOP\r\n$4\r\ntest\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLPush()
{
using (var mock = new FakeRedisSocket(":2\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual(2, redis.LPush("test", "test1", "test2"));
Assert.AreEqual("*4\r\n$5\r\nLPUSH\r\n$4\r\ntest\r\n$5\r\ntest1\r\n$5\r\ntest2\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLPushX()
{
using (var mock = new FakeRedisSocket(":2\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual(2, redis.LPushX("test", "test1"));
Assert.AreEqual("*3\r\n$6\r\nLPUSHX\r\n$4\r\ntest\r\n$5\r\ntest1\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLRange()
{
using (var mock = new FakeRedisSocket("*2\r\n$5\r\ntest1\r\n$5\r\ntest2\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
var response = redis.LRange("test", -10, 10);
Assert.AreEqual(2, response.Length);
Assert.AreEqual("test1", response[0]);
Assert.AreEqual("test2", response[1]);
Assert.AreEqual("*4\r\n$6\r\nLRANGE\r\n$4\r\ntest\r\n$3\r\n-10\r\n$2\r\n10\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLRem()
{
using (var mock = new FakeRedisSocket(":2\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual(2, redis.LRem("test", -2, "test1"));
Assert.AreEqual("*4\r\n$4\r\nLREM\r\n$4\r\ntest\r\n$2\r\n-2\r\n$5\r\ntest1\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLSet()
{
using (var mock = new FakeRedisSocket("+OK\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("OK", redis.LSet("test", 0, "test1"));
Assert.AreEqual("*4\r\n$4\r\nLSET\r\n$4\r\ntest\r\n$1\r\n0\r\n$5\r\ntest1\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestLTrim()
{
using (var mock = new FakeRedisSocket("+OK\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("OK", redis.LTrim("test", 0, 3));
Assert.AreEqual("*4\r\n$5\r\nLTRIM\r\n$4\r\ntest\r\n$1\r\n0\r\n$1\r\n3\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestRPop()
{
using (var mock = new FakeRedisSocket("$5\r\ntest1\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("test1", redis.RPop("test"));
Assert.AreEqual("*2\r\n$4\r\nRPOP\r\n$4\r\ntest\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestRPopLPush()
{
using (var mock = new FakeRedisSocket("$5\r\ntest1\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual("test1", redis.RPopLPush("test", "new"));
Assert.AreEqual("*3\r\n$9\r\nRPOPLPUSH\r\n$4\r\ntest\r\n$3\r\nnew\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestRPush()
{
using (var mock = new FakeRedisSocket(":3\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual(3, redis.RPush("test", "test1"));
Assert.AreEqual("*3\r\n$5\r\nRPUSH\r\n$4\r\ntest\r\n$5\r\ntest1\r\n", mock.GetMessage());
}
}
[TestMethod, TestCategory("Lists")]
public void TestRPushX()
{
using (var mock = new FakeRedisSocket(":3\r\n"))
using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999)))
{
Assert.AreEqual(3, redis.RPushX("test", "test1"));
Assert.AreEqual("*3\r\n$6\r\nRPUSHX\r\n$4\r\ntest\r\n$5\r\ntest1\r\n", mock.GetMessage());
}
}
}
}
| {
"pile_set_name": "Github"
} |
using System.Collections.Generic;
namespace Octokit
{
public class WebHookConfigComparer : IEqualityComparer<KeyValuePair<string, string>>
{
public bool Equals(KeyValuePair<string, string> x, KeyValuePair<string, string> y)
{
return x.Key == y.Key;
}
public int GetHashCode(KeyValuePair<string, string> obj)
{
return obj.Key.GetHashCode();
}
}
}
| {
"pile_set_name": "Github"
} |
// (C) Copyright John Maddock 2002.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for most recent version.
// MACRO: BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
// TITLE: Specialisation of individual member functions.
// DESCRIPTION: Verify that specializations of individual members
// of template classes work OK.
namespace boost_no_member_function_specializations{
template<class T>
class foo
{
public:
foo();
foo(const T&);
~foo();
int bar();
};
// declare specialisations:
template<> foo<int>::foo();
template<> foo<int>::foo(const int&);
template<> foo<int>::~foo();
template<> int foo<int>::bar();
// provide defaults:
template<class T> foo<T>::foo(){}
template<class T> foo<T>::foo(const T&){}
template<class T> foo<T>::~foo(){}
template<class T> int foo<T>::bar(){ return 0; }
// provide defs:
template<> foo<int>::foo(){}
template<> foo<int>::foo(const int&){}
template<> foo<int>::~foo(){}
template<> int foo<int>::bar(){ return 1; }
int test()
{
foo<double> f1;
foo<int> f2;
f1.bar();
f2.bar();
return 0;
}
}
| {
"pile_set_name": "Github"
} |
For Office 365, use https://outlook.office365.com/EWS/Exchange.asmx (default) as the Server URL.
Default version is used when accessing the EWS API to determine the API version.
To fetch emails from a specific folder, folder path needs to be specified. Inbox is the default folder. | {
"pile_set_name": "Github"
} |
using System.Text.Json.Serialization;
namespace Essensoft.AspNetCore.Payment.WeChatPay.V3.Domain
{
/// <summary>
/// 错误详情
/// </summary>
public class ErrorDetail : WeChatPayObject
{
[JsonPropertyName("location")]
public string Location { get; set; }
[JsonPropertyName("value")]
public int Value { get; set; }
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ActiveLayerIndex</key>
<integer>0</integer>
<key>ApplicationVersion</key>
<array>
<string>com.omnigroup.OmniGraffle.MacAppStore</string>
<string>139.7</string>
</array>
<key>AutoAdjust</key>
<false/>
<key>BackgroundGraphic</key>
<dict>
<key>Bounds</key>
<string>{{0, 0}, {545, 450}}</string>
<key>Class</key>
<string>SolidGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>Helvetica</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>2</integer>
<key>Style</key>
<dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
</dict>
<key>BaseZoom</key>
<integer>0</integer>
<key>CanvasOrigin</key>
<string>{0, 0}</string>
<key>CanvasSize</key>
<string>{545, 450}</string>
<key>ColumnAlign</key>
<integer>1</integer>
<key>ColumnSpacing</key>
<real>24</real>
<key>CreationDate</key>
<string>2012-05-07 20:29:09 +0000</string>
<key>Creator</key>
<string>Beth Scott</string>
<key>DisplayScale</key>
<string>1 pt = 1 px</string>
<key>GraphDocumentVersion</key>
<integer>8</integer>
<key>GraphicsList</key>
<array>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>Head</key>
<dict>
<key>ID</key>
<integer>23602</integer>
<key>Info</key>
<integer>8</integer>
</dict>
<key>ID</key>
<integer>23615</integer>
<key>OrthogonalBarAutomatic</key>
<true/>
<key>OrthogonalBarPoint</key>
<string>{0, 0}</string>
<key>OrthogonalBarPosition</key>
<real>6.6000003814697266</real>
<key>Points</key>
<array>
<string>{101.99999999999997, 282.62502354003846}</string>
<string>{139, 245}</string>
<string>{262, 225}</string>
<string>{301, 233.500052102052}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>FilledArrow</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>2</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
<key>Tail</key>
<dict>
<key>ID</key>
<integer>23568</integer>
<key>Info</key>
<integer>7</integer>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>Head</key>
<dict>
<key>ID</key>
<integer>23603</integer>
<key>Info</key>
<integer>8</integer>
</dict>
<key>ID</key>
<integer>23607</integer>
<key>OrthogonalBarAutomatic</key>
<true/>
<key>OrthogonalBarPoint</key>
<string>{0, 0}</string>
<key>OrthogonalBarPosition</key>
<real>3.1000003814697266</real>
<key>Points</key>
<array>
<string>{101.99999999999997, 239.87503116943299}</string>
<string>{132, 238}</string>
<string>{266, 219}</string>
<string>{301, 113.00002158447387}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>FilledArrow</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>2</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
<key>Tail</key>
<dict>
<key>ID</key>
<integer>23569</integer>
<key>Info</key>
<integer>7</integer>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>Head</key>
<dict>
<key>ID</key>
<integer>23585</integer>
<key>Info</key>
<integer>8</integer>
</dict>
<key>ID</key>
<integer>23606</integer>
<key>Points</key>
<array>
<string>{248.66666667870044, 352.50008852443801}</string>
<string>{301, 352.50004447265746}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>FilledArrow</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>FilledArrow</string>
</dict>
</dict>
<key>Tail</key>
<dict>
<key>ID</key>
<integer>23612</integer>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{12.5, 333.50003879882752}, {89.499999999999972, 59}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>Helvetica</string>
<key>Size</key>
<real>9</real>
</dict>
<key>ID</key>
<integer>23566</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.540361</string>
<key>g</key>
<string>0.540494</string>
<key>r</key>
<string>0.540395</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>2</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs20 \cf0 Game}</string>
<key>VerticalPad</key>
<integer>2</integer>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
<dict>
<key>Bounds</key>
<string>{{12.5, 315.25002354003846}, {89.499999999999972, 18.250015258789062}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>Helvetica</string>
<key>Size</key>
<real>9</real>
</dict>
<key>ID</key>
<integer>23567</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.540361</string>
<key>g</key>
<string>0.540494</string>
<key>r</key>
<string>0.540395</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>2</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs20 \cf0 Game}</string>
<key>VerticalPad</key>
<integer>2</integer>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
<dict>
<key>Bounds</key>
<string>{{12.5, 249.00003879882752}, {89.499999999999972, 67.249969482421875}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>Helvetica</string>
<key>Size</key>
<real>9</real>
</dict>
<key>ID</key>
<integer>23568</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.540361</string>
<key>g</key>
<string>0.540494</string>
<key>r</key>
<string>0.540395</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>2</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs20 \cf0 Game}</string>
<key>VerticalPad</key>
<integer>2</integer>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
<dict>
<key>Bounds</key>
<string>{{12.5, 230.75002354003846}, {89.499999999999972, 18.250015258789062}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>Helvetica</string>
<key>Size</key>
<real>9</real>
</dict>
<key>ID</key>
<integer>23569</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.540361</string>
<key>g</key>
<string>0.540494</string>
<key>r</key>
<string>0.540395</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>2</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs20 \cf0 Game}</string>
<key>VerticalPad</key>
<integer>2</integer>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
<dict>
<key>Bounds</key>
<string>{{12.5, 212.50000828124939}, {89.499999999999972, 18.250015258789062}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>Helvetica</string>
<key>Size</key>
<real>9</real>
</dict>
<key>ID</key>
<integer>23570</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.540361</string>
<key>g</key>
<string>0.540494</string>
<key>r</key>
<string>0.540395</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>2</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs20 \cf0 Launcher}</string>
<key>VerticalPad</key>
<integer>2</integer>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
<dict>
<key>Bounds</key>
<string>{{6, 188}, {102, 214}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23571</integer>
<key>Magnets</key>
<array>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>FillType</key>
<integer>2</integer>
<key>GradientAngle</key>
<real>90</real>
<key>GradientColor</key>
<dict>
<key>b</key>
<string>0.78131</string>
<key>g</key>
<string>0.651832</string>
<key>r</key>
<string>0.627907</string>
</dict>
<key>MiddleFraction</key>
<real>0.8171502947807312</real>
</dict>
<key>shadow</key>
<dict>
<key>Color</key>
<dict>
<key>a</key>
<string>0.2</string>
<key>b</key>
<string>0</string>
<key>g</key>
<string>0</string>
<key>r</key>
<string>0</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 Main Flash}</string>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
<dict>
<key>Class</key>
<string>Group</string>
<key>Graphics</key>
<array>
<dict>
<key>Bounds</key>
<string>{{154.83333333333331, 262}, {93.333333333333371, 40}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23610</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.608438</string>
<key>g</key>
<string>0.608438</string>
<key>r</key>
<string>0.608438</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 System}</string>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{154.83333333333331, 211.99991035461426}, {93.333333333333371, 40}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23611</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.608438</string>
<key>g</key>
<string>0.608438</string>
<key>r</key>
<string>0.608438</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 \
Cache}</string>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{154.83333333333331, 312.00008894531493}, {93.333333333333371, 81}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23612</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.608438</string>
<key>g</key>
<string>0.608438</string>
<key>r</key>
<string>0.608438</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 User}</string>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{149, 188}, {104.99999999999999, 214}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23613</integer>
<key>Magnets</key>
<array>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>FillType</key>
<integer>2</integer>
<key>GradientAngle</key>
<real>90</real>
<key>GradientColor</key>
<dict>
<key>b</key>
<string>0.78131</string>
<key>g</key>
<string>0.651832</string>
<key>r</key>
<string>0.627907</string>
</dict>
<key>MiddleFraction</key>
<real>0.8171502947807312</real>
</dict>
<key>shadow</key>
<dict>
<key>Color</key>
<dict>
<key>a</key>
<string>0.2</string>
<key>b</key>
<string>0</string>
<key>g</key>
<string>0</string>
<key>r</key>
<string>0</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 Physical RAM}</string>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
</array>
<key>ID</key>
<integer>23609</integer>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 179.00007772445679}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23573</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x81000000}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 60.000108003616333}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23574</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0xC1000000}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 75.749985933303833}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23575</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0xC0FFFFFF}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 33.749985933303833}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23576</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0xFFFFFFFF}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23577</integer>
<key>Points</key>
<array>
<string>{539, 73.749969482421875}</string>
<string>{470, 73.749984741210938}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23578</integer>
<key>Points</key>
<array>
<string>{539, 31.749969482421875}</string>
<string>{470, 31.749984741210938}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{366.5, 165.50005912780762}, {20, 14}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>ID</key>
<integer>23579</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 \'95 \'95 \'95}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{367, 46.499981880187988}, {20, 14}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>ID</key>
<integer>23580</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 \'95 \'95 \'95}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>ID</key>
<integer>23581</integer>
<key>Points</key>
<array>
<string>{376, 333.25006103515625}</string>
<string>{376, 351.25006144917256}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>FilledArrow</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{305, 315.00004316894774}, {144, 18.250015258789062}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23582</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.940127</string>
<key>g</key>
<string>0.995805</string>
<key>r</key>
<string>1</string>
</dict>
</dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Color</key>
<dict>
<key>a</key>
<string>0.32</string>
<key>b</key>
<string>0</string>
<key>g</key>
<string>0</string>
<key>r</key>
<string>0</string>
</dict>
<key>Fuzziness</key>
<real>2.742051362991333</real>
<key>ShadowVector</key>
<string>{1, 1}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.608438</string>
<key>g</key>
<string>0.608438</string>
<key>r</key>
<string>0.608438</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 Stack}</string>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{366.5, 405.50002861022949}, {20, 14}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>ID</key>
<integer>23583</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 \'95 \'95 \'95}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{366.5, 285.50004482269287}, {20, 14}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>ID</key>
<integer>23584</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 \'95 \'95 \'95}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{301, 312.00004447265746}, {152, 81}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23585</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.608438</string>
<key>g</key>
<string>0.608438</string>
<key>r</key>
<string>0.608438</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 \
\
User RAM (32K)}</string>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 394.00004696846008}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23586</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x0000FFFF}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 315.00006103515625}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23587</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x00017FFF}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 274.00007629394531}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23588</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x7FFFFFFF}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 195.00010800361633}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23589</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x80FFFFFF}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 153.00010800361633}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23590</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0xBFFFFFFF}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 419.00003051757812}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23591</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x00000000}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 380.00004458427429}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23592</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x00010000}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 299.00005984306335}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23593</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x00018000}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 259.00004577636719}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23594</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0x80000000}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{470, 137.50009417533875}, {61, 13}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>YES</string>
<key>Flow</key>
<string>Resize</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23595</integer>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>shadow</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
<key>stroke</key>
<dict>
<key>Draws</key>
<string>NO</string>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Align</key>
<integer>0</integer>
<key>Pad</key>
<integer>0</integer>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs20 \cf0 0xC0000000}</string>
<key>VerticalPad</key>
<integer>0</integer>
</dict>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23596</integer>
<key>Points</key>
<array>
<string>{539, 392.00004577636719}</string>
<string>{470, 392.00006103515625}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23597</integer>
<key>Points</key>
<array>
<string>{539, 312.00004577636719}</string>
<string>{470, 312.00006103515625}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23598</integer>
<key>Points</key>
<array>
<string>{539, 272.00004577636719}</string>
<string>{470, 272.00006103515625}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23599</integer>
<key>Points</key>
<array>
<string>{539, 193.00009155273438}</string>
<string>{470, 193.00010681152344}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23600</integer>
<key>Points</key>
<array>
<string>{539, 151.00009155273438}</string>
<string>{470, 151.00010681152344}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Class</key>
<string>LineGraphic</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>CourierNewPSMT</string>
<key>Size</key>
<real>10</real>
</dict>
<key>ID</key>
<integer>23601</integer>
<key>Points</key>
<array>
<string>{539, 432.00004447265746}</string>
<string>{470, 432.00004447265746}</string>
</array>
<key>Style</key>
<dict>
<key>stroke</key>
<dict>
<key>HeadArrow</key>
<string>0</string>
<key>Legacy</key>
<true/>
<key>LineType</key>
<integer>1</integer>
<key>TailArrow</key>
<string>0</string>
</dict>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{301, 194.00005973144653}, {152, 78.999984741210938}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23602</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.608438</string>
<key>g</key>
<string>0.608438</string>
<key>r</key>
<string>0.608438</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 Primary ROM (16M)}</string>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{301, 73.999998696290277}, {152, 78.000045776367188}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23603</integer>
<key>Magnets</key>
<array>
<string>{1, 1}</string>
<string>{1, -1}</string>
<string>{-1, -1}</string>
<string>{-1, 1}</string>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.14318971335887909</real>
</dict>
<key>shadow</key>
<dict>
<key>Beneath</key>
<string>YES</string>
<key>Draws</key>
<string>NO</string>
<key>Fuzziness</key>
<real>0.82475340366363525</real>
<key>ShadowVector</key>
<string>{0, 0}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>b</key>
<string>0.608438</string>
<key>g</key>
<string>0.608438</string>
<key>r</key>
<string>0.608438</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 Secondary ROM (16M)}</string>
</dict>
</dict>
<dict>
<key>Bounds</key>
<string>{{301, 33}, {152, 399.00003051757812}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
<string>Clip</string>
<key>Flow</key>
<string>Clip</string>
<key>FontInfo</key>
<dict>
<key>Font</key>
<string>Helvetica</string>
<key>Size</key>
<real>9</real>
</dict>
<key>ID</key>
<integer>23604</integer>
<key>ImageID</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.062973484396934509</real>
<key>Scale</key>
<real>0.3437703549861908</real>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>image fill</key>
<dict>
<key>ImageSizing</key>
<integer>2</integer>
<key>Opacity</key>
<real>0.062973484396934509</real>
<key>Scale</key>
<real>0.3437703549861908</real>
</dict>
<key>shadow</key>
<dict>
<key>Color</key>
<dict>
<key>a</key>
<string>0.51</string>
<key>b</key>
<string>0</string>
<key>g</key>
<string>0</string>
<key>r</key>
<string>0</string>
</dict>
<key>Fuzziness</key>
<real>8.1470527648925781</real>
<key>ShadowVector</key>
<string>{0, 3}</string>
</dict>
<key>stroke</key>
<dict>
<key>Color</key>
<dict>
<key>a</key>
<string>0.2</string>
<key>b</key>
<string>0</string>
<key>g</key>
<string>0</string>
<key>r</key>
<string>0</string>
</dict>
</dict>
</dict>
<key>TiledImage</key>
<string>YES</string>
<key>Wrap</key>
<string>NO</string>
</dict>
<dict>
<key>Bounds</key>
<string>{{295, 8}, {163, 432}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>ID</key>
<integer>23605</integer>
<key>Magnets</key>
<array>
<string>{0, 1}</string>
<string>{0, -1}</string>
<string>{1, 0}</string>
<string>{-1, 0}</string>
</array>
<key>Shape</key>
<string>Rectangle</string>
<key>Style</key>
<dict>
<key>fill</key>
<dict>
<key>FillType</key>
<integer>2</integer>
<key>GradientAngle</key>
<real>90</real>
<key>GradientColor</key>
<dict>
<key>b</key>
<string>0.78131</string>
<key>g</key>
<string>0.651832</string>
<key>r</key>
<string>0.627907</string>
</dict>
<key>MiddleFraction</key>
<real>0.8171502947807312</real>
</dict>
<key>shadow</key>
<dict>
<key>Color</key>
<dict>
<key>a</key>
<string>0.2</string>
<key>b</key>
<string>0</string>
<key>g</key>
<string>0</string>
<key>r</key>
<string>0</string>
</dict>
</dict>
</dict>
<key>Text</key>
<dict>
<key>Text</key>
<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
\f0\fs24 \cf0 Virtual Memory}</string>
</dict>
<key>TextPlacement</key>
<integer>0</integer>
</dict>
</array>
<key>GridInfo</key>
<dict>
<key>ShowsGrid</key>
<string>YES</string>
</dict>
<key>GuidesLocked</key>
<string>NO</string>
<key>GuidesVisible</key>
<string>YES</string>
<key>HPages</key>
<integer>1</integer>
<key>ImageCounter</key>
<integer>3</integer>
<key>ImageLinkBack</key>
<array>
<dict/>
</array>
<key>ImageList</key>
<array>
<string>image2.png</string>
</array>
<key>KeepToScale</key>
<false/>
<key>Layers</key>
<array>
<dict>
<key>Lock</key>
<string>NO</string>
<key>Name</key>
<string>Layer 1</string>
<key>Print</key>
<string>YES</string>
<key>View</key>
<string>YES</string>
</dict>
</array>
<key>LayoutInfo</key>
<dict>
<key>Animate</key>
<string>NO</string>
<key>circoMinDist</key>
<real>18</real>
<key>circoSeparation</key>
<real>0.0</real>
<key>layoutEngine</key>
<string>dot</string>
<key>neatoSeparation</key>
<real>0.0</real>
<key>twopiSeparation</key>
<real>0.0</real>
</dict>
<key>LinksVisible</key>
<string>NO</string>
<key>MagnetsVisible</key>
<string>NO</string>
<key>MasterSheets</key>
<array/>
<key>ModificationDate</key>
<string>2012-07-05 19:06:37 +0000</string>
<key>Modifier</key>
<string>Beth Scott</string>
<key>NotesVisible</key>
<string>NO</string>
<key>Orientation</key>
<integer>2</integer>
<key>OriginVisible</key>
<string>NO</string>
<key>PageBreaks</key>
<string>YES</string>
<key>PrintInfo</key>
<dict>
<key>NSBottomMargin</key>
<array>
<string>float</string>
<string>41</string>
</array>
<key>NSHorizonalPagination</key>
<array>
<string>coded</string>
<string>BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG</string>
</array>
<key>NSLeftMargin</key>
<array>
<string>float</string>
<string>18</string>
</array>
<key>NSPaperSize</key>
<array>
<string>size</string>
<string>{612.00000953674316, 792}</string>
</array>
<key>NSPrintReverseOrientation</key>
<array>
<string>int</string>
<string>0</string>
</array>
<key>NSRightMargin</key>
<array>
<string>float</string>
<string>18</string>
</array>
<key>NSTopMargin</key>
<array>
<string>float</string>
<string>18</string>
</array>
</dict>
<key>PrintOnePage</key>
<false/>
<key>ReadOnly</key>
<string>NO</string>
<key>RowAlign</key>
<integer>1</integer>
<key>RowSpacing</key>
<real>24</real>
<key>SheetTitle</key>
<string>Canvas 1</string>
<key>SmartAlignmentGuidesActive</key>
<string>YES</string>
<key>SmartDistanceGuidesActive</key>
<string>YES</string>
<key>UniqueID</key>
<integer>1</integer>
<key>UseEntirePage</key>
<false/>
<key>VPages</key>
<integer>1</integer>
<key>WindowInfo</key>
<dict>
<key>CurrentSheet</key>
<integer>0</integer>
<key>ExpandedCanvases</key>
<array>
<dict>
<key>name</key>
<string>Canvas 1</string>
</dict>
</array>
<key>Frame</key>
<string>{{117, -25}, {1436, 878}}</string>
<key>ListView</key>
<true/>
<key>OutlineWidth</key>
<integer>142</integer>
<key>RightSidebar</key>
<false/>
<key>ShowRuler</key>
<true/>
<key>Sidebar</key>
<true/>
<key>SidebarWidth</key>
<integer>120</integer>
<key>VisibleRegion</key>
<string>{{-378, -144}, {1301, 739}}</string>
<key>Zoom</key>
<real>1</real>
<key>ZoomValues</key>
<array>
<array>
<string>Canvas 1</string>
<real>1</real>
<real>4</real>
</array>
</array>
</dict>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Daniel Holbert" href="mailto:[email protected]">
<link rel="author" title="Morgan Rae Reschenberg" href="mailto:[email protected]">
<style>
.basic {
display: inline-block;
overflow: scroll;
position: relative;
border: 2px solid green;
}
.height-ref {
height: 60px;
}
.width-ref {
width: 60px;
}
.innerContents {
color: transparent;
height: 100px;
width: 100px;
position: absolute;
}
</style>
</head>
<body>
<!-- NOTE: In the reference-case scenarios here, we use the same DOM as in
the testcase, and we simply use 'position: absolute' on the descendants
wherever the testcase has 'contain: size' on the container. This
produces an accurate reference rendering, because out-of-flow content
doesn't contribute to the container's sizing, but does create scrollable
overflow (i.e. it produces scrollbars of the appropriate size for the
amount of overflow). -->
<div class="basic"><div class="innerContents">inner</div></div>
<br>
outside before
<div class="basic"><div class="innerContents">inner</div></div>
outside after
<br>
<div class="basic height-ref"><div class="innerContents">inner</div></div>
<br>
<div class="basic height-ref"><div class="innerContents">inner</div></div>
<br>
<div class="basic width-ref"><div class="innerContents">inner</div></div>
<br>
<div class="basic width-ref"><div class="innerContents">inner</div></div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*************************************************************************
*
* This file is part of the SAMRAI distribution. For full copyright
* information, see COPYRIGHT and LICENSE.
*
* Copyright: (c) 1997-2020 Lawrence Livermore National Security, LLC
* Description: hier
*
************************************************************************/
#ifndef included_pdat_OuterfaceVariable_C
#define included_pdat_OuterfaceVariable_C
#include "SAMRAI/pdat/OuterfaceVariable.h"
#include "SAMRAI/pdat/OuterfaceDataFactory.h"
#include "SAMRAI/tbox/Utilities.h"
namespace SAMRAI {
namespace pdat {
/*
*************************************************************************
*
* Constructor and destructor for face variable objects
*
*************************************************************************
*/
template<class TYPE>
OuterfaceVariable<TYPE>::OuterfaceVariable(
const tbox::Dimension& dim,
const std::string& name,
int depth):
hier::Variable(name,
std::make_shared<OuterfaceDataFactory<TYPE> >(dim, depth))
{
}
#ifdef HAVE_UMPIRE
template<class TYPE>
OuterfaceVariable<TYPE>::OuterfaceVariable(
const tbox::Dimension& dim,
const std::string& name,
umpire::Allocator allocator,
int depth):
hier::Variable(name,
std::make_shared<OuterfaceDataFactory<TYPE> >(
dim, depth, allocator))
{
}
#endif
template<class TYPE>
OuterfaceVariable<TYPE>::~OuterfaceVariable()
{
}
template<class TYPE>
int OuterfaceVariable<TYPE>::getDepth() const
{
std::shared_ptr<OuterfaceDataFactory<TYPE> > factory(
SAMRAI_SHARED_PTR_CAST<OuterfaceDataFactory<TYPE>, hier::PatchDataFactory>(
getPatchDataFactory()));
TBOX_ASSERT(factory);
return factory->getDepth();
}
}
}
#endif
| {
"pile_set_name": "Github"
} |
/**
******************************************************************************
* @file stm32f30x_syscfg.c
* @author MCD Application Team
* @version V1.1.0
* @date 27-February-2014
* @brief This file provides firmware functions to manage the following
* functionalities of the SYSCFG peripheral:
* + Remapping the memory mapped at 0x00000000
* + Remapping the DMA channels
* + Enabling I2C fast mode plus driving capability for I2C plus
* + Remapping USB interrupt line
* + Configuring the EXTI lines connection to the GPIO port
* + Configuring the CLASSB requirements
*
@verbatim
===============================================================================
##### How to use this driver #####
===============================================================================
[..] The SYSCFG registers can be accessed only when the SYSCFG
interface APB clock is enabled.
[..] To enable SYSCFG APB clock use:
RCC_APBPeriphClockCmd(RCC_APBPeriph_SYSCFG, ENABLE);
@endverbatim
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* 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 STMicroelectronics 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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f30x_syscfg.h"
/** @addtogroup STM32F30x_StdPeriph_Driver
* @{
*/
/** @defgroup SYSCFG
* @brief SYSCFG driver modules
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Reset value od SYSCFG_CFGR1 register */
#define CFGR1_CLEAR_MASK ((uint32_t)0x7C000000)
/* ------------ SYSCFG registers bit address in the alias region -------------*/
#define SYSCFG_OFFSET (SYSCFG_BASE - PERIPH_BASE)
/* --- CFGR1 Register ---*/
/* Alias word address of USB_IT_RMP bit */
#define CFGR1_OFFSET (SYSCFG_OFFSET + 0x00)
#define USBITRMP_BitNumber 0x05
#define CFGR1_USBITRMP_BB (PERIPH_BB_BASE + (CFGR1_OFFSET * 32) + (USBITRMP_BitNumber * 4))
/* --- CFGR2 Register ---*/
/* Alias word address of BYP_ADDR_PAR bit */
#define CFGR2_OFFSET (SYSCFG_OFFSET + 0x18)
#define BYPADDRPAR_BitNumber 0x04
#define CFGR1_BYPADDRPAR_BB (PERIPH_BB_BASE + (CFGR2_OFFSET * 32) + (BYPADDRPAR_BitNumber * 4))
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/** @defgroup SYSCFG_Private_Functions
* @{
*/
/** @defgroup SYSCFG_Group1 SYSCFG Initialization and Configuration functions
* @brief SYSCFG Initialization and Configuration functions
*
@verbatim
===============================================================================
##### SYSCFG Initialization and Configuration functions #####
===============================================================================
@endverbatim
* @{
*/
/**
* @brief Deinitializes the SYSCFG registers to their default reset values.
* @param None
* @retval None
* @note MEM_MODE bits are not affected by APB reset.
* MEM_MODE bits took the value from the user option bytes.
*/
void SYSCFG_DeInit(void)
{
/* Reset SYSCFG_CFGR1 register to reset value without affecting MEM_MODE bits */
SYSCFG->CFGR1 &= SYSCFG_CFGR1_MEM_MODE;
/* Set FPU Interrupt Enable bits to default value */
SYSCFG->CFGR1 |= 0x7C000000;
/* Reset RAM Write protection bits to default value */
SYSCFG->RCR = 0x00000000;
/* Set EXTICRx registers to reset value */
SYSCFG->EXTICR[0] = 0;
SYSCFG->EXTICR[1] = 0;
SYSCFG->EXTICR[2] = 0;
SYSCFG->EXTICR[3] = 0;
/* Set CFGR2 register to reset value */
SYSCFG->CFGR2 = 0;
/* Set CFGR3 register to reset value */
SYSCFG->CFGR3 = 0;
}
/**
* @brief Configures the memory mapping at address 0x00000000.
* @param SYSCFG_MemoryRemap: selects the memory remapping.
* This parameter can be one of the following values:
* @arg SYSCFG_MemoryRemap_Flash: Main Flash memory mapped at 0x00000000
* @arg SYSCFG_MemoryRemap_SystemMemory: System Flash memory mapped at 0x00000000
* @arg SYSCFG_MemoryRemap_SRAM: Embedded SRAM mapped at 0x00000000
* @retval None
*/
void SYSCFG_MemoryRemapConfig(uint32_t SYSCFG_MemoryRemap)
{
uint32_t tmpcfgr1 = 0;
/* Check the parameter */
assert_param(IS_SYSCFG_MEMORY_REMAP(SYSCFG_MemoryRemap));
/* Get CFGR1 register value */
tmpcfgr1 = SYSCFG->CFGR1;
/* Clear MEM_MODE bits */
tmpcfgr1 &= (uint32_t) (~SYSCFG_CFGR1_MEM_MODE);
/* Set the new MEM_MODE bits value */
tmpcfgr1 |= (uint32_t) SYSCFG_MemoryRemap;
/* Set CFGR1 register with the new memory remap configuration */
SYSCFG->CFGR1 = tmpcfgr1;
}
/**
* @brief Configures the DMA channels remapping.
* @param SYSCFG_DMARemap: selects the DMA channels remap.
* This parameter can be one of the following values:
* @arg SYSCFG_DMARemap_TIM17: Remap TIM17 DMA requests from DMA1 channel1 to channel2
* @arg SYSCFG_DMARemap_TIM16: Remap TIM16 DMA requests from DMA1 channel3 to channel4
* @arg SYSCFG_DMARemap_TIM6DAC1Ch1: Remap TIM6/DAC1 DMA requests from DMA2 channel 3 to DMA1 channel 3
* @arg SYSCFG_DMARemap_TIM7DAC1Ch2: Remap TIM7/DAC2 DMA requests from DMA2 channel 4 to DMA1 channel 4
* @arg SYSCFG_DMARemap_ADC2ADC4: Remap ADC2 and ADC4 DMA requests from DMA2 channel1/channel3 to channel3/channel4
* @arg SYSCFG_DMARemap_DAC2Ch1: Remap DAC2 DMA requests to DMA1 channel5
* @arg SYSCFG_DMARemapCh2_SPI1_RX: Remap SPI1 RX DMA1 CH2 requests
* @arg SYSCFG_DMARemapCh4_SPI1_RX: Remap SPI1 RX DMA CH4 requests
* @arg SYSCFG_DMARemapCh6_SPI1_RX: Remap SPI1 RX DMA CH6 requests
* @arg SYSCFG_DMARemapCh3_SPI1_TX: Remap SPI1 TX DMA CH2 requests
* @arg SYSCFG_DMARemapCh5_SPI1_TX: Remap SPI1 TX DMA CH5 requests
* @arg SYSCFG_DMARemapCh7_SPI1_TX: Remap SPI1 TX DMA CH7 requests
* @arg SYSCFG_DMARemapCh7_I2C1_RX: Remap I2C1 RX DMA CH7 requests
* @arg SYSCFG_DMARemapCh3_I2C1_RX: Remap I2C1 RX DMA CH3 requests
* @arg SYSCFG_DMARemapCh5_I2C1_RX: Remap I2C1 RX DMA CH5 requests
* @arg SYSCFG_DMARemapCh6_I2C1_TX: Remap I2C1 TX DMA CH6 requests
* @arg SYSCFG_DMARemapCh2_I2C1_TX: Remap I2C1 TX DMA CH2 requests
* @arg SYSCFG_DMARemapCh4_I2C1_TX: Remap I2C1 TX DMA CH4 requests
* @arg SYSCFG_DMARemapCh4_ADC2: Remap ADC2 DMA1 Ch4 requests
* @arg SYSCFG_DMARemapCh2_ADC2: Remap ADC2 DMA1 Ch2 requests
* @param NewState: new state of the DMA channel remapping.
* This parameter can be: Enable or Disable.
* @note When enabled, DMA channel of the selected peripheral is remapped
* @note When disabled, Default DMA channel is mapped to the selected peripheral
* @note
* By default TIM17 DMA requests is mapped to channel 1
* use SYSCFG_DMAChannelRemapConfig(SYSCFG_DMARemap_TIM17, Enable)
* to remap TIM17 DMA requests to DMA1 channel 2
* use SYSCFG_DMAChannelRemapConfig(SYSCFG_DMARemap_TIM17, Disable)
* to map TIM17 DMA requests to DMA1 channel 1 (default mapping)
* @retval None
*/
void SYSCFG_DMAChannelRemapConfig(uint32_t SYSCFG_DMARemap, FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_SYSCFG_DMA_REMAP(SYSCFG_DMARemap));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if ((SYSCFG_DMARemap & 0x80000000)!= 0x80000000)
{
if (NewState != DISABLE)
{
/* Remap the DMA channel */
SYSCFG->CFGR1 |= (uint32_t)SYSCFG_DMARemap;
}
else
{
/* use the default DMA channel mapping */
SYSCFG->CFGR1 &= (uint32_t)(~SYSCFG_DMARemap);
}
}
else
{
if (NewState != DISABLE)
{
/* Remap the DMA channel */
SYSCFG->CFGR3 |= (uint32_t)SYSCFG_DMARemap;
}
else
{
/* use the default DMA channel mapping */
SYSCFG->CFGR3 &= (uint32_t)(~SYSCFG_DMARemap);
}
}
}
/**
* @brief Configures the remapping capabilities of DAC/TIM triggers.
* @param SYSCFG_TriggerRemap: selects the trigger to be remapped.
* This parameter can be one of the following values:
* @arg SYSCFG_TriggerRemap_DACTIM3: Remap DAC trigger from TIM8 to TIM3
* @arg SYSCFG_TriggerRemap_TIM1TIM17: Remap TIM1 ITR3 from TIM4 TRGO to TIM17 OC
* @arg SYSCFG_TriggerRemap_DACHRTIM1_TRIG1: Remap DAC trigger to HRTIM1 TRIG1
* @arg SYSCFG_TriggerRemap_DACHRTIM1_TRIG2: Remap DAC trigger to HRTIM1 TRIG2
* @param NewState: new state of the trigger mapping.
* This parameter can be: ENABLE or DISABLE.
* @note ENABLE: Enable fast mode plus driving capability for selected pin
* @note DISABLE: Disable fast mode plus driving capability for selected pin
* @retval None
*/
void SYSCFG_TriggerRemapConfig(uint32_t SYSCFG_TriggerRemap, FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_SYSCFG_TRIGGER_REMAP(SYSCFG_TriggerRemap));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if ((SYSCFG_TriggerRemap & 0x80000000)!= 0x80000000)
{
if (NewState != DISABLE)
{
/* Remap the trigger */
SYSCFG->CFGR1 |= (uint32_t)SYSCFG_TriggerRemap;
}
else
{
/* Use the default trigger mapping */
SYSCFG->CFGR1 &= (uint32_t)(~SYSCFG_TriggerRemap);
}
}
else
{
if (NewState != DISABLE)
{
/* Remap the trigger */
SYSCFG->CFGR3 |= (uint32_t)SYSCFG_TriggerRemap;
}
else
{
/* Use the default trigger mapping */
SYSCFG->CFGR3 &= (uint32_t)(~SYSCFG_TriggerRemap);
}
}
}
/**
* @brief Configures the remapping capabilities of encoder mode.
* @ note This feature implement the so-called M/T method for measuring speed
* and position using quadrature encoders.
* @param SYSCFG_EncoderRemap: selects the remap option for encoder mode.
* This parameter can be one of the following values:
* @arg SYSCFG_EncoderRemap_No: No remap
* @arg SYSCFG_EncoderRemap_TIM2: Timer 2 IC1 and IC2 connected to TIM15 IC1 and IC2
* @arg SYSCFG_EncoderRemap_TIM3: Timer 3 IC1 and IC2 connected to TIM15 IC1 and IC2
* @arg SYSCFG_EncoderRemap_TIM4: Timer 4 IC1 and IC2 connected to TIM15 IC1 and IC2
* @retval None
*/
void SYSCFG_EncoderRemapConfig(uint32_t SYSCFG_EncoderRemap)
{
/* Check the parameter */
assert_param(IS_SYSCFG_ENCODER_REMAP(SYSCFG_EncoderRemap));
/* Reset the encoder mode remapping bits */
SYSCFG->CFGR1 &= (uint32_t)(~SYSCFG_CFGR1_ENCODER_MODE);
/* Set the selected configuration */
SYSCFG->CFGR1 |= (uint32_t)(SYSCFG_EncoderRemap);
}
/**
* @brief Remaps the USB interrupt lines.
* @param NewState: new state of the mapping of USB interrupt lines.
* This parameter can be:
* @param ENABLE: Remap the USB interrupt line as following:
* @arg USB Device High Priority (USB_HP) interrupt mapped to line 74.
* @arg USB Device Low Priority (USB_LP) interrupt mapped to line 75.
* @arg USB Wakeup Interrupt (USB_WKUP) interrupt mapped to line 76.
* @param DISABLE: Use the default USB interrupt line:
* @arg USB Device High Priority (USB_HP) interrupt mapped to line 19.
* @arg USB Device Low Priority (USB_LP) interrupt mapped to line 20.
* @arg USB Wakeup Interrupt (USB_WKUP) interrupt mapped to line 42.
* @retval None
*/
void SYSCFG_USBInterruptLineRemapCmd(FunctionalState NewState)
{
/* Check the parameter */
assert_param(IS_FUNCTIONAL_STATE(NewState));
/* Remap the USB interupt lines */
*(__IO uint32_t *) CFGR1_USBITRMP_BB = (uint32_t)NewState;
}
/**
* @brief Configures the I2C fast mode plus driving capability.
* @param SYSCFG_I2CFastModePlus: selects the pin.
* This parameter can be one of the following values:
* @arg SYSCFG_I2CFastModePlus_PB6: Configure fast mode plus driving capability for PB6
* @arg SYSCFG_I2CFastModePlus_PB7: Configure fast mode plus driving capability for PB7
* @arg SYSCFG_I2CFastModePlus_PB8: Configure fast mode plus driving capability for PB8
* @arg SYSCFG_I2CFastModePlus_PB9: Configure fast mode plus driving capability for PB9
* @arg SYSCFG_I2CFastModePlus_I2C1: Configure fast mode plus driving capability for I2C1 pins
* @arg SYSCFG_I2CFastModePlus_I2C2: Configure fast mode plus driving capability for I2C2 pins
* @param NewState: new state of the DMA channel remapping.
* This parameter can be:
* @arg ENABLE: Enable fast mode plus driving capability for selected I2C pin
* @arg DISABLE: Disable fast mode plus driving capability for selected I2C pin
* @note For I2C1, fast mode plus driving capability can be enabled on all selected
* I2C1 pins using SYSCFG_I2CFastModePlus_I2C1 parameter or independently
* on each one of the following pins PB6, PB7, PB8 and PB9.
* @note For remaing I2C1 pins (PA14, PA15...) fast mode plus driving capability
* can be enabled only by using SYSCFG_I2CFastModePlus_I2C1 parameter.
* @note For all I2C2 pins fast mode plus driving capability can be enabled
* only by using SYSCFG_I2CFastModePlus_I2C2 parameter.
* @retval None
*/
void SYSCFG_I2CFastModePlusConfig(uint32_t SYSCFG_I2CFastModePlus, FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_SYSCFG_I2C_FMP(SYSCFG_I2CFastModePlus));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
/* Enable fast mode plus driving capability for selected I2C pin */
SYSCFG->CFGR1 |= (uint32_t)SYSCFG_I2CFastModePlus;
}
else
{
/* Disable fast mode plus driving capability for selected I2C pin */
SYSCFG->CFGR1 &= (uint32_t)(~SYSCFG_I2CFastModePlus);
}
}
/**
* @brief Enables or disables the selected SYSCFG interrupts.
* @param SYSCFG_IT: specifies the SYSCFG interrupt sources to be enabled or disabled.
* This parameter can be one of the following values:
* @arg SYSCFG_IT_IXC: Inexact Interrupt
* @arg SYSCFG_IT_IDC: Input denormal Interrupt
* @arg SYSCFG_IT_OFC: Overflow Interrupt
* @arg SYSCFG_IT_UFC: Underflow Interrupt
* @arg SYSCFG_IT_DZC: Divide-by-zero Interrupt
* @arg SYSCFG_IT_IOC: Invalid operation Interrupt
* @param NewState: new state of the specified SYSCFG interrupts.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void SYSCFG_ITConfig(uint32_t SYSCFG_IT, FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_FUNCTIONAL_STATE(NewState));
assert_param(IS_SYSCFG_IT(SYSCFG_IT));
if (NewState != DISABLE)
{
/* Enable the selected SYSCFG interrupts */
SYSCFG->CFGR1 |= SYSCFG_IT;
}
else
{
/* Disable the selected SYSCFG interrupts */
SYSCFG->CFGR1 &= ((uint32_t)~SYSCFG_IT);
}
}
/**
* @brief Selects the GPIO pin used as EXTI Line.
* @param EXTI_PortSourceGPIOx : selects the GPIO port to be used as source
* for EXTI lines where x can be (A, B, C, D, E or F).
* @param EXTI_PinSourcex: specifies the EXTI line to be configured.
* This parameter can be EXTI_PinSourcex where x can be (0..15)
* @retval None
*/
void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex)
{
uint32_t tmp = 0x00;
/* Check the parameters */
assert_param(IS_EXTI_PORT_SOURCE(EXTI_PortSourceGPIOx));
assert_param(IS_EXTI_PIN_SOURCE(EXTI_PinSourcex));
tmp = ((uint32_t)0x0F) << (0x04 * (EXTI_PinSourcex & (uint8_t)0x03));
SYSCFG->EXTICR[EXTI_PinSourcex >> 0x02] &= ~tmp;
SYSCFG->EXTICR[EXTI_PinSourcex >> 0x02] |= (((uint32_t)EXTI_PortSourceGPIOx) << (0x04 * (EXTI_PinSourcex & (uint8_t)0x03)));
}
/**
* @brief Connects the selected parameter to the break input of TIM1.
* @note The selected configuration is locked and can be unlocked by system reset
* @param SYSCFG_Break: selects the configuration to be connected to break
* input of TIM1
* This parameter can be any combination of the following values:
* @arg SYSCFG_Break_PVD: PVD interrupt is connected to the break input of TIM1.
* @arg SYSCFG_Break_SRAMParity: SRAM Parity error is connected to the break input of TIM1.
* @arg SYSCFG_Break_HardFault: Lockup output of CortexM4 is connected to the break input of TIM1.
* @retval None
*/
void SYSCFG_BreakConfig(uint32_t SYSCFG_Break)
{
/* Check the parameter */
assert_param(IS_SYSCFG_LOCK_CONFIG(SYSCFG_Break));
SYSCFG->CFGR2 |= (uint32_t) SYSCFG_Break;
}
/**
* @brief Disables the parity check on RAM.
* @note Disabling the parity check on RAM locks the configuration bit.
* To re-enable the parity check on RAM perform a system reset.
* @param None
* @retval None
*/
void SYSCFG_BypassParityCheckDisable(void)
{
/* Disable the adddress parity check on RAM */
*(__IO uint32_t *) CFGR1_BYPADDRPAR_BB = (uint32_t)0x00000001;
}
/**
* @brief Enables the ICODE SRAM write protection.
* @note Enabling the ICODE SRAM write protection locks the configuration bit.
* To disable the ICODE SRAM write protection perform a system reset.
* @param None
* @retval None
*/
void SYSCFG_SRAMWRPEnable(uint32_t SYSCFG_SRAMWRP)
{
/* Check the parameter */
assert_param(IS_SYSCFG_PAGE(SYSCFG_SRAMWRP));
/* Enable the write-protection on the selected ICODE SRAM page */
SYSCFG->RCR |= (uint32_t)SYSCFG_SRAMWRP;
}
/**
* @brief Checks whether the specified SYSCFG flag is set or not.
* @param SYSCFG_Flag: specifies the SYSCFG flag to check.
* This parameter can be one of the following values:
* @arg SYSCFG_FLAG_PE: SRAM parity error flag.
* @retval The new state of SYSCFG_Flag (SET or RESET).
*/
FlagStatus SYSCFG_GetFlagStatus(uint32_t SYSCFG_Flag)
{
FlagStatus bitstatus = RESET;
/* Check the parameter */
assert_param(IS_SYSCFG_FLAG(SYSCFG_Flag));
/* Check the status of the specified SPI flag */
if ((SYSCFG->CFGR2 & SYSCFG_CFGR2_SRAM_PE) != (uint32_t)RESET)
{
/* SYSCFG_Flag is set */
bitstatus = SET;
}
else
{
/* SYSCFG_Flag is reset */
bitstatus = RESET;
}
/* Return the SYSCFG_Flag status */
return bitstatus;
}
/**
* @brief Clears the selected SYSCFG flag.
* @param SYSCFG_Flag: selects the flag to be cleared.
* This parameter can be any combination of the following values:
* @arg SYSCFG_FLAG_PE: SRAM parity error flag.
* @retval None
*/
void SYSCFG_ClearFlag(uint32_t SYSCFG_Flag)
{
/* Check the parameter */
assert_param(IS_SYSCFG_FLAG(SYSCFG_Flag));
SYSCFG->CFGR2 |= (uint32_t) SYSCFG_Flag;
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2010 Andriy Rysin ([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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "flags.h"
#include <KLocalizedString>
#include <plasma/svg.h>
#include <plasma/theme.h>
#include <KFontUtils>
#include <QStandardPaths>
#include <QStringList>
#include <QPixmap>
#include <QPainter>
#include <QIcon>
#include <QFontDatabase>
#include <math.h>
#include "x11_helper.h"
//for text handling
#include "keyboard_config.h"
#include "xkb_rules.h"
static const int FLAG_MAX_SIZE = 22;
static const char flagTemplate[] = "kf5/locale/countries/%1/flag.png";
int iconSize(int s)
{
if (s < 16) {
return 16;
} else if (s < 22) {
return 22;
} else if (s < 32) {
return 32;
} else if (s < 48) {
return 48;
} else if (s < 64) {
return 64;
} else {
return 128;
}
}
Flags::Flags():
svg(nullptr)
{
transparentPixmap = new QPixmap(FLAG_MAX_SIZE, FLAG_MAX_SIZE);
transparentPixmap->fill(Qt::transparent);
}
Flags::~Flags()
{
if( svg != nullptr ) {
disconnect(svg, &Plasma::Svg::repaintNeeded, this, &Flags::themeChanged);
delete svg;
}
delete transparentPixmap;
}
const QIcon Flags::getIcon(const QString& layout)
{
if( ! iconMap.contains(layout) ) {
iconMap[ layout ] = createIcon(layout);
}
return iconMap[ layout ];
}
QIcon Flags::createIcon(const QString& layout)
{
QIcon icon;
if( ! layout.isEmpty() ) {
QString file;
if( layout == QLatin1String("epo") ) {
file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kcmkeyboard/pics/epo.png"));
}
else {
QString countryCode = getCountryFromLayoutName( layout );
if( ! countryCode.isEmpty() ) {
file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString(flagTemplate).arg(countryCode));
// qCDebug(KCM_KEYBOARD, ) << "Creating icon for" << layout << "with" << file;
}
}
if (!file.isEmpty()) {
QImage flagImg;
flagImg.load(file);
const int size = iconSize(qMax(flagImg.width(), flagImg.height()));
QPixmap iconPix(size, size);
iconPix.fill(Qt::transparent);
QRect dest(flagImg.rect());
dest.moveCenter(iconPix.rect().center());
QPainter painter(&iconPix);
painter.drawImage(dest, flagImg);
painter.end();
icon.addPixmap(iconPix);
}
}
return icon;
}
//static
//const QStringList NON_COUNTRY_LAYOUTS = QString("ara,brai,epo,latam,mao").split(",");
QString Flags::getCountryFromLayoutName(const QString& layout) const
{
QString countryCode = layout;
if( countryCode == QLatin1String("nec_vndr/jp") )
return QStringLiteral("jp");
// if( NON_COUNTRY_LAYOUTS.contain(layout) )
if( countryCode.length() > 2 )
return QLatin1String("");
return countryCode;
}
//TODO: move this to some other class?
QString Flags::getShortText(const LayoutUnit& layoutUnit, const KeyboardConfig& keyboardConfig)
{
if( layoutUnit.isEmpty() )
return QStringLiteral("--");
QString layoutText = layoutUnit.layout();
foreach(const LayoutUnit& lu, keyboardConfig.layouts) {
if( layoutUnit.layout() == lu.layout() && layoutUnit.variant() == lu.variant() ) {
layoutText = lu.getDisplayName();
break;
}
}
//TODO: good autolabel
// if( layoutText == layoutUnit.layout && layoutUnit.getDisplayName() != layoutUnit.layout ) {
// layoutText = layoutUnit.getDisplayName();
// }
return layoutText;
}
QString Flags::getFullText(const LayoutUnit& layoutUnit, const KeyboardConfig& keyboardConfig, const Rules* rules)
{
QString shortText = Flags::getShortText(layoutUnit, keyboardConfig);
QString longText = Flags::getLongText(layoutUnit, rules);
return i18nc("short layout label - full layout name", "%1 - %2", shortText, longText);
}
static QString getDisplayText(const QString& layout, const QString& variant, const Rules* rules)
{
if( variant.isEmpty() )
return layout;
if( rules == nullptr || rules->version == QLatin1String("1.0") )
return i18nc("layout - variant", "%1 - %2", layout, variant);
return variant;
}
QString Flags::getLongText(const LayoutUnit& layoutUnit, const Rules* rules)
{
if( rules == nullptr ) {
return getDisplayText(layoutUnit.layout(), layoutUnit.variant(), rules);
}
QString layoutText = layoutUnit.layout();
const LayoutInfo* layoutInfo = rules->getLayoutInfo(layoutUnit.layout());
if( layoutInfo != nullptr ) {
layoutText = layoutInfo->description;
if( ! layoutUnit.variant().isEmpty() ) {
const VariantInfo* variantInfo = layoutInfo->getVariantInfo(layoutUnit.variant());
QString variantText = variantInfo != nullptr ? variantInfo->description : layoutUnit.variant();
layoutText = getDisplayText(layoutText, variantText, rules);
}
}
return layoutText;
}
static
QString getPixmapKey(const KeyboardConfig& keyboardConfig)
{
switch(keyboardConfig.indicatorType) {
case KeyboardConfig::SHOW_FLAG:
return QStringLiteral("_fl");
case KeyboardConfig::SHOW_LABEL_ON_FLAG:
return QStringLiteral("_bt");
case KeyboardConfig::SHOW_LABEL:
return QStringLiteral("_lb");
}
return QStringLiteral("_"); // should not happen
}
void Flags::drawLabel(QPainter& painter, const QString& layoutText, bool flagShown)
{
QFont font = painter.font();
QRect rect = painter.window();
font.setPointSize(KFontUtils::adaptFontSize(painter, layoutText, rect.size(), rect.height()));
// we init svg so that we get notification about theme change
getSvg();
const QColor textColor = flagShown ? Qt::black : Plasma::Theme().color(Plasma::Theme::TextColor);
painter.setPen(textColor);
painter.setFont(font);
painter.drawText(rect, Qt::AlignCenter, layoutText);
}
const QIcon Flags::getIconWithText(const LayoutUnit& layoutUnit, const KeyboardConfig& keyboardConfig)
{
const QString keySuffix(getPixmapKey(keyboardConfig));
const QString key(layoutUnit.toString() + keySuffix);
if( iconOrTextMap.contains(key) ) {
return iconOrTextMap[ key ];
}
if( keyboardConfig.indicatorType == KeyboardConfig::SHOW_FLAG ) {
QIcon icon = getIcon(layoutUnit.layout());
if( ! icon.isNull() ) {
iconOrTextMap[ key ] = icon;
return icon;
}
}
QString layoutText = Flags::getShortText(layoutUnit, keyboardConfig);
const QSize TRAY_ICON_SIZE(128, 128);
QPixmap pixmap = QPixmap(TRAY_ICON_SIZE);
pixmap.fill(Qt::transparent);
QPainter painter(&pixmap);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
// p.setRenderHint(QPainter::Antialiasing);
if( keyboardConfig.indicatorType == KeyboardConfig::SHOW_LABEL_ON_FLAG ) {
QIcon iconf = createIcon(layoutUnit.layout());
painter.drawPixmap(pixmap.rect(), iconf.pixmap(TRAY_ICON_SIZE));
}
drawLabel(painter, layoutText, keyboardConfig.isFlagShown());
painter.end();
QIcon icon(pixmap);
iconOrTextMap[ key ] = icon;
return icon;
}
Plasma::Svg* Flags::getSvg()
{
if( svg == nullptr ) {
svg = new Plasma::Svg;
svg->setImagePath(QStringLiteral("widgets/labeltexture"));
svg->setContainsMultipleImages(true);
connect(svg, &Plasma::Svg::repaintNeeded, this, &Flags::themeChanged);
}
return svg;
}
void Flags::themeChanged()
{
// qCDebug(KCM_KEYBOARD, ) << "Theme changed, new text color" << Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor);
clearCache();
emit pixmapChanged();
}
void Flags::clearCache()
{
// qCDebug(KCM_KEYBOARD, ) << "Clearing flag pixmap cache";
iconOrTextMap.clear();
}
| {
"pile_set_name": "Github"
} |
# Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# tribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the fol-
# lowing conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
import boto
from datetime import datetime
from boto.resultset import ResultSet
"""
Represents a VPN Connectionn
"""
from boto.ec2.ec2object import TaggedEC2Object
class VpnConnectionOptions(object):
"""
Represents VPN connection options
:ivar static_routes_only: Indicates whether the VPN connection uses static
routes only. Static routes must be used for devices that don't support
BGP.
"""
def __init__(self, static_routes_only=None):
self.static_routes_only = static_routes_only
def __repr__(self):
return 'VpnConnectionOptions'
def startElement(self, name, attrs, connection):
pass
def endElement(self, name, value, connection):
if name == 'staticRoutesOnly':
self.static_routes_only = True if value == 'true' else False
else:
setattr(self, name, value)
class VpnStaticRoute(object):
"""
Represents a static route for a VPN connection.
:ivar destination_cidr_block: The CIDR block associated with the local
subnet of the customer data center.
:ivar source: Indicates how the routes were provided.
:ivar state: The current state of the static route.
"""
def __init__(self, destination_cidr_block=None, source=None, state=None):
self.destination_cidr_block = destination_cidr_block
self.source = source
self.available = state
def __repr__(self):
return 'VpnStaticRoute: %s' % self.destination_cidr_block
def startElement(self, name, attrs, connection):
pass
def endElement(self, name, value, connection):
if name == 'destinationCidrBlock':
self.destination_cidr_block = value
elif name == 'source':
self.source = value
elif name == 'state':
self.state = value
else:
setattr(self, name, value)
class VpnTunnel(object):
"""
Represents telemetry for a VPN tunnel
:ivar outside_ip_address: The Internet-routable IP address of the
virtual private gateway's outside interface.
:ivar status: The status of the VPN tunnel. Valid values: UP | DOWN
:ivar last_status_change: The date and time of the last change in status.
:ivar status_message: If an error occurs, a description of the error.
:ivar accepted_route_count: The number of accepted routes.
"""
def __init__(self, outside_ip_address=None, status=None, last_status_change=None,
status_message=None, accepted_route_count=None):
self.outside_ip_address = outside_ip_address
self.status = status
self.last_status_change = last_status_change
self.status_message = status_message
self.accepted_route_count = accepted_route_count
def __repr__(self):
return 'VpnTunnel: %s' % self.outside_ip_address
def startElement(self, name, attrs, connection):
pass
def endElement(self, name, value, connection):
if name == 'outsideIpAddress':
self.outside_ip_address = value
elif name == 'status':
self.status = value
elif name == 'lastStatusChange':
self.last_status_change = datetime.strptime(value,
'%Y-%m-%dT%H:%M:%S.%fZ')
elif name == 'statusMessage':
self.status_message = value
elif name == 'acceptedRouteCount':
try:
value = int(value)
except ValueError:
boto.log.warning('Error converting code (%s) to int' % value)
self.accepted_route_count = value
else:
setattr(self, name, value)
class VpnConnection(TaggedEC2Object):
"""
Represents a VPN Connection
:ivar id: The ID of the VPN connection.
:ivar state: The current state of the VPN connection.
Valid values: pending | available | deleting | deleted
:ivar customer_gateway_configuration: The configuration information for the
VPN connection's customer gateway (in the native XML format). This
element is always present in the
:class:`boto.vpc.VPCConnection.create_vpn_connection` response;
however, it's present in the
:class:`boto.vpc.VPCConnection.get_all_vpn_connections` response only
if the VPN connection is in the pending or available state.
:ivar type: The type of VPN connection (ipsec.1).
:ivar customer_gateway_id: The ID of the customer gateway at your end of
the VPN connection.
:ivar vpn_gateway_id: The ID of the virtual private gateway
at the AWS side of the VPN connection.
:ivar tunnels: A list of the vpn tunnels (always 2)
:ivar options: The option set describing the VPN connection.
:ivar static_routes: A list of static routes associated with a VPN
connection.
"""
def __init__(self, connection=None):
super(VpnConnection, self).__init__(connection)
self.id = None
self.state = None
self.customer_gateway_configuration = None
self.type = None
self.customer_gateway_id = None
self.vpn_gateway_id = None
self.tunnels = []
self.options = None
self.static_routes = []
def __repr__(self):
return 'VpnConnection:%s' % self.id
def startElement(self, name, attrs, connection):
retval = super(VpnConnection, self).startElement(name, attrs, connection)
if retval is not None:
return retval
if name == 'vgwTelemetry':
self.tunnels = ResultSet([('item', VpnTunnel)])
return self.tunnels
elif name == 'routes':
self.static_routes = ResultSet([('item', VpnStaticRoute)])
return self.static_routes
elif name == 'options':
self.options = VpnConnectionOptions()
return self.options
return None
def endElement(self, name, value, connection):
if name == 'vpnConnectionId':
self.id = value
elif name == 'state':
self.state = value
elif name == 'customerGatewayConfiguration':
self.customer_gateway_configuration = value
elif name == 'type':
self.type = value
elif name == 'customerGatewayId':
self.customer_gateway_id = value
elif name == 'vpnGatewayId':
self.vpn_gateway_id = value
else:
setattr(self, name, value)
def delete(self, dry_run=False):
return self.connection.delete_vpn_connection(
self.id,
dry_run=dry_run
)
| {
"pile_set_name": "Github"
} |
#!/bin/sh
# Normal services
for i in `seq 1 5`; do
docker run -l 'HealthCheck=HttpGet' -l 'HealthCheckArgs=http://{{ host }}:{{ tcp 9500 }}/' -l 'ServiceName=nginx' -l 'ServicePort_80=9500' -P -d -t nginx
done
# Sidecar event subscriber
docker run -l 'HealthCheck=HttpGet' -l 'HealthCheckArgs=http://{{ host }}:{{ tcp 9500 }}/' -l 'ServiceName=nginx' -l 'ServicePort_80=9500' -l "SidecarListener=9500" -P -d -t nginx
| {
"pile_set_name": "Github"
} |
Manual
Kernel_23
STL_Extension
Algebraic_foundations
Circulator
Stream_support
Triangulation_2
| {
"pile_set_name": "Github"
} |
# shellcheck shell=bash
gappsWrapperArgs=()
find_gio_modules() {
if [ -d "$1/lib/gio/modules" ] && [ -n "$(ls -A "$1/lib/gio/modules")" ] ; then
gappsWrapperArgs+=(--prefix GIO_EXTRA_MODULES : "$1/lib/gio/modules")
fi
}
addEnvHooks "${targetOffset:?}" find_gio_modules
gappsWrapperArgsHook() {
if [ -n "$GDK_PIXBUF_MODULE_FILE" ]; then
gappsWrapperArgs+=(--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE")
fi
if [ -n "$XDG_ICON_DIRS" ]; then
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS")
fi
if [ -n "$GSETTINGS_SCHEMAS_PATH" ]; then
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH")
fi
# Check for prefix as well
if [ -d "${prefix:?}/share" ]; then
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$prefix/share")
fi
if [ -d "$prefix/lib/gio/modules" ] && [ -n "$(ls -A "$prefix/lib/gio/modules")" ]; then
gappsWrapperArgs+=(--prefix GIO_EXTRA_MODULES : "$prefix/lib/gio/modules")
fi
for v in ${wrapPrefixVariables:-} GST_PLUGIN_SYSTEM_PATH_1_0 GI_TYPELIB_PATH GRL_PLUGIN_PATH; do
if [ -n "${!v}" ]; then
gappsWrapperArgs+=(--prefix "$v" : "${!v}")
fi
done
}
preFixupPhases+=" gappsWrapperArgsHook"
wrapGApp() {
local program="$1"
shift 1
wrapProgram "$program" "${gappsWrapperArgs[@]}" "$@"
}
# Note: $gappsWrapperArgs still gets defined even if ${dontWrapGApps-} is set.
wrapGAppsHook() {
# guard against running multiple times (e.g. due to propagation)
[ -z "$wrapGAppsHookHasRun" ] || return 0
wrapGAppsHookHasRun=1
if [[ -z "${dontWrapGApps:-}" ]]; then
targetDirsThatExist=()
targetDirsRealPath=()
# wrap binaries
targetDirs=("${prefix}/bin" "${prefix}/libexec")
for targetDir in "${targetDirs[@]}"; do
if [[ -d "${targetDir}" ]]; then
targetDirsThatExist+=("${targetDir}")
targetDirsRealPath+=("$(realpath "${targetDir}")/")
find "${targetDir}" -type f -executable -print0 |
while IFS= read -r -d '' file; do
echo "Wrapping program '${file}'"
wrapGApp "${file}"
done
fi
done
# wrap links to binaries that point outside targetDirs
# Note: links to binaries within targetDirs do not need
# to be wrapped as the binaries have already been wrapped
if [[ ${#targetDirsThatExist[@]} -ne 0 ]]; then
find "${targetDirsThatExist[@]}" -type l -xtype f -executable -print0 |
while IFS= read -r -d '' linkPath; do
linkPathReal=$(realpath "${linkPath}")
for targetPath in "${targetDirsRealPath[@]}"; do
if [[ "$linkPathReal" == "$targetPath"* ]]; then
echo "Not wrapping link: '$linkPath' (already wrapped)"
continue 2
fi
done
echo "Wrapping link: '$linkPath'"
wrapGApp "${linkPath}"
done
fi
fi
}
fixupOutputHooks+=(wrapGAppsHook)
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function gup( name )
{
name = name.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ) ;
var regexS = '[\\?&]' + name + '=([^&#]*)' ;
var regex = new RegExp( regexS ) ;
var results = regex.exec( window.location.href ) ;
if ( results )
return results[ 1 ] ;
else
return '' ;
}
var interval;
function sendData2Master()
{
var destination = window.parent.parent ;
try
{
if ( destination.XDTMaster )
{
var t = destination.XDTMaster.read( [ gup( 'cmd' ), gup( 'data' ) ] ) ;
window.clearInterval( interval ) ;
}
}
catch (e) {}
}
function OnMessage (event) {
var message = event.data;
var destination = window.parent.parent;
destination.XDTMaster.read( [ 'end', message, 'fpm' ] ) ;
}
function listenPostMessage() {
if (window.addEventListener) { // all browsers except IE before version 9
window.addEventListener ("message", OnMessage, false);
}else {
if (window.attachEvent) { // IE before version 9
window.attachEvent("onmessage", OnMessage);
}
}
}
function onLoad()
{
interval = window.setInterval( sendData2Master, 100 );
listenPostMessage();
}
</script>
</head>
<body onload="onLoad()"><p></p></body>
</html>
| {
"pile_set_name": "Github"
} |
/* $Id: telespci.c,v 2.23.2.3 2004/01/13 14:31:26 keil Exp $
*
* low level stuff for Teles PCI isdn cards
*
* Author Ton van Rosmalen
* Karsten Keil
* Copyright by Ton van Rosmalen
* by Karsten Keil <[email protected]>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
#include <linux/init.h>
#include "hisax.h"
#include "isac.h"
#include "hscx.h"
#include "isdnl1.h"
#include <linux/pci.h>
static const char *telespci_revision = "$Revision: 2.23.2.3 $";
#define ZORAN_PO_RQ_PEN 0x02000000
#define ZORAN_PO_WR 0x00800000
#define ZORAN_PO_GID0 0x00000000
#define ZORAN_PO_GID1 0x00100000
#define ZORAN_PO_GREG0 0x00000000
#define ZORAN_PO_GREG1 0x00010000
#define ZORAN_PO_DMASK 0xFF
#define WRITE_ADDR_ISAC (ZORAN_PO_WR | ZORAN_PO_GID0 | ZORAN_PO_GREG0)
#define READ_DATA_ISAC (ZORAN_PO_GID0 | ZORAN_PO_GREG1)
#define WRITE_DATA_ISAC (ZORAN_PO_WR | ZORAN_PO_GID0 | ZORAN_PO_GREG1)
#define WRITE_ADDR_HSCX (ZORAN_PO_WR | ZORAN_PO_GID1 | ZORAN_PO_GREG0)
#define READ_DATA_HSCX (ZORAN_PO_GID1 | ZORAN_PO_GREG1)
#define WRITE_DATA_HSCX (ZORAN_PO_WR | ZORAN_PO_GID1 | ZORAN_PO_GREG1)
#define ZORAN_WAIT_NOBUSY do { \
portdata = readl(adr + 0x200); \
} while (portdata & ZORAN_PO_RQ_PEN)
static inline u_char
readisac(void __iomem *adr, u_char off)
{
register unsigned int portdata;
ZORAN_WAIT_NOBUSY;
/* set address for ISAC */
writel(WRITE_ADDR_ISAC | off, adr + 0x200);
ZORAN_WAIT_NOBUSY;
/* read data from ISAC */
writel(READ_DATA_ISAC, adr + 0x200);
ZORAN_WAIT_NOBUSY;
return ((u_char)(portdata & ZORAN_PO_DMASK));
}
static inline void
writeisac(void __iomem *adr, u_char off, u_char data)
{
register unsigned int portdata;
ZORAN_WAIT_NOBUSY;
/* set address for ISAC */
writel(WRITE_ADDR_ISAC | off, adr + 0x200);
ZORAN_WAIT_NOBUSY;
/* write data to ISAC */
writel(WRITE_DATA_ISAC | data, adr + 0x200);
ZORAN_WAIT_NOBUSY;
}
static inline u_char
readhscx(void __iomem *adr, int hscx, u_char off)
{
register unsigned int portdata;
ZORAN_WAIT_NOBUSY;
/* set address for HSCX */
writel(WRITE_ADDR_HSCX | ((hscx ? 0x40 : 0) + off), adr + 0x200);
ZORAN_WAIT_NOBUSY;
/* read data from HSCX */
writel(READ_DATA_HSCX, adr + 0x200);
ZORAN_WAIT_NOBUSY;
return ((u_char)(portdata & ZORAN_PO_DMASK));
}
static inline void
writehscx(void __iomem *adr, int hscx, u_char off, u_char data)
{
register unsigned int portdata;
ZORAN_WAIT_NOBUSY;
/* set address for HSCX */
writel(WRITE_ADDR_HSCX | ((hscx ? 0x40 : 0) + off), adr + 0x200);
ZORAN_WAIT_NOBUSY;
/* write data to HSCX */
writel(WRITE_DATA_HSCX | data, adr + 0x200);
ZORAN_WAIT_NOBUSY;
}
static inline void
read_fifo_isac(void __iomem *adr, u_char *data, int size)
{
register unsigned int portdata;
register int i;
ZORAN_WAIT_NOBUSY;
/* read data from ISAC */
for (i = 0; i < size; i++) {
/* set address for ISAC fifo */
writel(WRITE_ADDR_ISAC | 0x1E, adr + 0x200);
ZORAN_WAIT_NOBUSY;
writel(READ_DATA_ISAC, adr + 0x200);
ZORAN_WAIT_NOBUSY;
data[i] = (u_char)(portdata & ZORAN_PO_DMASK);
}
}
static void
write_fifo_isac(void __iomem *adr, u_char *data, int size)
{
register unsigned int portdata;
register int i;
ZORAN_WAIT_NOBUSY;
/* write data to ISAC */
for (i = 0; i < size; i++) {
/* set address for ISAC fifo */
writel(WRITE_ADDR_ISAC | 0x1E, adr + 0x200);
ZORAN_WAIT_NOBUSY;
writel(WRITE_DATA_ISAC | data[i], adr + 0x200);
ZORAN_WAIT_NOBUSY;
}
}
static inline void
read_fifo_hscx(void __iomem *adr, int hscx, u_char *data, int size)
{
register unsigned int portdata;
register int i;
ZORAN_WAIT_NOBUSY;
/* read data from HSCX */
for (i = 0; i < size; i++) {
/* set address for HSCX fifo */
writel(WRITE_ADDR_HSCX | (hscx ? 0x5F : 0x1F), adr + 0x200);
ZORAN_WAIT_NOBUSY;
writel(READ_DATA_HSCX, adr + 0x200);
ZORAN_WAIT_NOBUSY;
data[i] = (u_char) (portdata & ZORAN_PO_DMASK);
}
}
static inline void
write_fifo_hscx(void __iomem *adr, int hscx, u_char *data, int size)
{
unsigned int portdata;
register int i;
ZORAN_WAIT_NOBUSY;
/* write data to HSCX */
for (i = 0; i < size; i++) {
/* set address for HSCX fifo */
writel(WRITE_ADDR_HSCX | (hscx ? 0x5F : 0x1F), adr + 0x200);
ZORAN_WAIT_NOBUSY;
writel(WRITE_DATA_HSCX | data[i], adr + 0x200);
ZORAN_WAIT_NOBUSY;
udelay(10);
}
}
/* Interface functions */
static u_char
ReadISAC(struct IsdnCardState *cs, u_char offset)
{
return (readisac(cs->hw.teles0.membase, offset));
}
static void
WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value)
{
writeisac(cs->hw.teles0.membase, offset, value);
}
static void
ReadISACfifo(struct IsdnCardState *cs, u_char *data, int size)
{
read_fifo_isac(cs->hw.teles0.membase, data, size);
}
static void
WriteISACfifo(struct IsdnCardState *cs, u_char *data, int size)
{
write_fifo_isac(cs->hw.teles0.membase, data, size);
}
static u_char
ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset)
{
return (readhscx(cs->hw.teles0.membase, hscx, offset));
}
static void
WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
{
writehscx(cs->hw.teles0.membase, hscx, offset, value);
}
/*
* fast interrupt HSCX stuff goes here
*/
#define READHSCX(cs, nr, reg) readhscx(cs->hw.teles0.membase, nr, reg)
#define WRITEHSCX(cs, nr, reg, data) writehscx(cs->hw.teles0.membase, nr, reg, data)
#define READHSCXFIFO(cs, nr, ptr, cnt) read_fifo_hscx(cs->hw.teles0.membase, nr, ptr, cnt)
#define WRITEHSCXFIFO(cs, nr, ptr, cnt) write_fifo_hscx(cs->hw.teles0.membase, nr, ptr, cnt)
#include "hscx_irq.c"
static irqreturn_t
telespci_interrupt(int intno, void *dev_id)
{
struct IsdnCardState *cs = dev_id;
u_char hval, ival;
u_long flags;
spin_lock_irqsave(&cs->lock, flags);
hval = readhscx(cs->hw.teles0.membase, 1, HSCX_ISTA);
if (hval)
hscx_int_main(cs, hval);
ival = readisac(cs->hw.teles0.membase, ISAC_ISTA);
if ((hval | ival) == 0) {
spin_unlock_irqrestore(&cs->lock, flags);
return IRQ_NONE;
}
if (ival)
isac_interrupt(cs, ival);
/* Clear interrupt register for Zoran PCI controller */
writel(0x70000000, cs->hw.teles0.membase + 0x3C);
writehscx(cs->hw.teles0.membase, 0, HSCX_MASK, 0xFF);
writehscx(cs->hw.teles0.membase, 1, HSCX_MASK, 0xFF);
writeisac(cs->hw.teles0.membase, ISAC_MASK, 0xFF);
writeisac(cs->hw.teles0.membase, ISAC_MASK, 0x0);
writehscx(cs->hw.teles0.membase, 0, HSCX_MASK, 0x0);
writehscx(cs->hw.teles0.membase, 1, HSCX_MASK, 0x0);
spin_unlock_irqrestore(&cs->lock, flags);
return IRQ_HANDLED;
}
static void
release_io_telespci(struct IsdnCardState *cs)
{
iounmap(cs->hw.teles0.membase);
}
static int
TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
u_long flags;
switch (mt) {
case CARD_RESET:
return (0);
case CARD_RELEASE:
release_io_telespci(cs);
return (0);
case CARD_INIT:
spin_lock_irqsave(&cs->lock, flags);
inithscxisac(cs, 3);
spin_unlock_irqrestore(&cs->lock, flags);
return (0);
case CARD_TEST:
return (0);
}
return (0);
}
static struct pci_dev *dev_tel = NULL;
int setup_telespci(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
char tmp[64];
strcpy(tmp, telespci_revision);
printk(KERN_INFO "HiSax: Teles/PCI driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_TELESPCI)
return (0);
if ((dev_tel = hisax_find_pci_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
if (pci_enable_device(dev_tel))
return (0);
cs->irq = dev_tel->irq;
if (!cs->irq) {
printk(KERN_WARNING "Teles: No IRQ for PCI card found\n");
return (0);
}
cs->hw.teles0.membase = ioremap(pci_resource_start(dev_tel, 0),
PAGE_SIZE);
printk(KERN_INFO "Found: Zoran, base-address: 0x%llx, irq: 0x%x\n",
(unsigned long long)pci_resource_start(dev_tel, 0),
dev_tel->irq);
} else {
printk(KERN_WARNING "TelesPCI: No PCI card found\n");
return (0);
}
/* Initialize Zoran PCI controller */
writel(0x00000000, cs->hw.teles0.membase + 0x28);
writel(0x01000000, cs->hw.teles0.membase + 0x28);
writel(0x01000000, cs->hw.teles0.membase + 0x28);
writel(0x7BFFFFFF, cs->hw.teles0.membase + 0x2C);
writel(0x70000000, cs->hw.teles0.membase + 0x3C);
writel(0x61000000, cs->hw.teles0.membase + 0x40);
/* writel(0x00800000, cs->hw.teles0.membase + 0x200); */
printk(KERN_INFO
"HiSax: Teles PCI config irq:%d mem:%p\n",
cs->irq,
cs->hw.teles0.membase);
setup_isac(cs);
cs->readisac = &ReadISAC;
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &TelesPCI_card_msg;
cs->irq_func = &telespci_interrupt;
cs->irq_flags |= IRQF_SHARED;
ISACVersion(cs, "TelesPCI:");
if (HscxVersion(cs, "TelesPCI:")) {
printk(KERN_WARNING
"TelesPCI: wrong HSCX versions check IO/MEM addresses\n");
release_io_telespci(cs);
return (0);
}
return (1);
}
| {
"pile_set_name": "Github"
} |
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build 386 amd64 amd64p32
// +build gccgo
#include <cpuid.h>
#include <stdint.h>
// Need to wrap __get_cpuid_count because it's declared as static.
int
gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf,
uint32_t *eax, uint32_t *ebx,
uint32_t *ecx, uint32_t *edx)
{
return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx);
}
// xgetbv reads the contents of an XCR (Extended Control Register)
// specified in the ECX register into registers EDX:EAX.
// Currently, the only supported value for XCR is 0.
//
// TODO: Replace with a better alternative:
//
// #include <xsaveintrin.h>
//
// #pragma GCC target("xsave")
//
// void gccgoXgetbv(uint32_t *eax, uint32_t *edx) {
// unsigned long long x = _xgetbv(0);
// *eax = x & 0xffffffff;
// *edx = (x >> 32) & 0xffffffff;
// }
//
// Note that _xgetbv is defined starting with GCC 8.
void
gccgoXgetbv(uint32_t *eax, uint32_t *edx)
{
__asm(" xorl %%ecx, %%ecx\n"
" xgetbv"
: "=a"(*eax), "=d"(*edx));
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Copyright 2011 Facebook, 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.
*/
require_once "base_facebook.php";
/**
* Extends the BaseFacebook class with the intent of using
* PHP sessions to store user ids and access tokens.
*/
class Facebook extends BaseFacebook
{
/**
* Identical to the parent constructor, except that
* we start a PHP session to store the user ID and
* access token if during the course of execution
* we discover them.
*
* @param Array $config the application configuration.
* @see BaseFacebook::__construct in facebook.php
*/
public function __construct($config) {
if (!session_id()) {
session_start();
}
parent::__construct($config);
}
protected static $kSupportedKeys =
array('state', 'code', 'access_token', 'user_id');
/**
* Provides the implementations of the inherited abstract
* methods. The implementation uses PHP sessions to maintain
* a store for authorization codes, user ids, CSRF states, and
* access tokens.
*/
protected function setPersistentData($key, $value) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to setPersistentData.');
return;
}
$session_var_name = $this->constructSessionVariableName($key);
$_SESSION[$session_var_name] = $value;
}
protected function getPersistentData($key, $default = false) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to getPersistentData.');
return $default;
}
$session_var_name = $this->constructSessionVariableName($key);
return isset($_SESSION[$session_var_name]) ?
$_SESSION[$session_var_name] : $default;
}
protected function clearPersistentData($key) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to clearPersistentData.');
return;
}
$session_var_name = $this->constructSessionVariableName($key);
unset($_SESSION[$session_var_name]);
}
protected function clearAllPersistentData() {
foreach (self::$kSupportedKeys as $key) {
$this->clearPersistentData($key);
}
}
protected function constructSessionVariableName($key) {
return implode('_', array('fb',
$this->getAppId(),
$key));
}
}
| {
"pile_set_name": "Github"
} |
// -*- mode: ObjC -*-
// This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
// Copyright (C) 1997-2019 Steve Nygard.
#import "CDVisitor.h"
// Has a mutable string for storing output, and method to write it to standard out.
// symbol references are for... ?
@interface CDTextClassDumpVisitor : CDVisitor
@property (readonly) NSMutableString *resultString;
- (void)writeResultToStandardOutput;
@end
| {
"pile_set_name": "Github"
} |
CREATE TABLE `<?php echo $table_prefix ?>attached_files` (
`rel_object_manager` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`rel_object_id` int(10) unsigned NOT NULL default '0',
`file_id` int(10) unsigned NOT NULL default '0',
`created_on` datetime NOT NULL default '0000-00-00 00:00:00',
`created_by_id` int(10) unsigned default NULL,
PRIMARY KEY (`rel_object_manager`,`rel_object_id`,`file_id`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
CREATE TABLE `<?php echo $table_prefix ?>comments` (
`id` int(10) unsigned NOT NULL auto_increment,
`rel_object_id` int(10) unsigned NOT NULL default '0',
`rel_object_manager` varchar(30) <?php echo $default_collation ?> NOT NULL default '',
`text` text <?php echo $default_collation ?>,
`is_private` tinyint(1) unsigned NOT NULL default '0',
`is_anonymous` tinyint(1) unsigned NOT NULL default '0',
`author_name` varchar(50) <?php echo $default_collation ?> default NULL,
`author_email` varchar(100) <?php echo $default_collation ?> default NULL,
`author_homepage` varchar(100) <?php echo $default_collation ?> NOT NULL default '',
`created_on` datetime NOT NULL default '0000-00-00 00:00:00',
`created_by_id` int(10) unsigned default NULL,
`updated_on` datetime NOT NULL default '0000-00-00 00:00:00',
`updated_by_id` int(10) unsigned default NULL,
PRIMARY KEY (`id`),
KEY `object_id` (`rel_object_id`,`rel_object_manager`),
KEY `created_on` (`created_on`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
CREATE TABLE `<?php echo $table_prefix ?>file_repo` (
`id` varchar(40) <?php echo $default_collation ?> NOT NULL default '',
`content` longblob NOT NULL,
`order` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `order` (`order`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
CREATE TABLE `<?php echo $table_prefix ?>file_repo_attributes` (
`id` varchar(40) <?php echo $default_collation ?> NOT NULL default '',
`attribute` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`value` text <?php echo $default_collation ?> NOT NULL,
PRIMARY KEY (`id`,`attribute`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
CREATE TABLE `<?php echo $table_prefix ?>project_file_revisions` (
`id` int(10) unsigned NOT NULL auto_increment,
`file_id` int(10) unsigned NOT NULL default '0',
`file_type_id` smallint(5) unsigned NOT NULL default '0',
`repository_id` varchar(40) <?php echo $default_collation ?> NOT NULL default '',
`thumb_filename` varchar(44) <?php echo $default_collation ?> default NULL,
`revision_number` int(10) unsigned NOT NULL default '0',
`comment` text <?php echo $default_collation ?>,
`type_string` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`filesize` int(10) unsigned NOT NULL default '0',
`created_on` datetime NOT NULL default '0000-00-00 00:00:00',
`created_by_id` int(10) unsigned default NULL,
`updated_on` datetime NOT NULL default '0000-00-00 00:00:00',
`updated_by_id` int(10) unsigned default NULL,
PRIMARY KEY (`id`),
KEY `file_id` (`file_id`),
KEY `updated_on` (`updated_on`),
KEY `revision_number` (`revision_number`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
CREATE TABLE `<?php echo $table_prefix ?>project_files` (
`id` int(10) unsigned NOT NULL auto_increment,
`project_id` int(10) unsigned NOT NULL default '0',
`folder_id` smallint(5) unsigned NOT NULL default '0',
`filename` varchar(100) <?php echo $default_collation ?> NOT NULL default '',
`description` text <?php echo $default_collation ?>,
`is_private` tinyint(1) unsigned NOT NULL default '0',
`is_important` tinyint(1) unsigned NOT NULL default '0',
`is_locked` tinyint(1) unsigned NOT NULL default '0',
`is_visible` tinyint(1) unsigned NOT NULL default '0',
`expiration_time` datetime NOT NULL default '0000-00-00 00:00:00',
`comments_enabled` tinyint(1) unsigned NOT NULL default '1',
`anonymous_comments_enabled` tinyint(1) unsigned NOT NULL default '0',
`created_on` datetime NOT NULL default '0000-00-00 00:00:00',
`created_by_id` int(10) unsigned default '0',
`updated_on` datetime NOT NULL default '0000-00-00 00:00:00',
`updated_by_id` int(10) unsigned default '0',
PRIMARY KEY (`id`),
KEY `project_id` (`project_id`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
CREATE TABLE `<?php echo $table_prefix ?>project_folders` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`project_id` int(10) unsigned NOT NULL default '0',
`name` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `project_id` (`project_id`,`name`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
ALTER TABLE `<?php echo $table_prefix ?>application_logs` CHANGE `object_id` `rel_object_id` int(10) NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>application_logs` CHANGE `object_manager_class` `rel_object_manager` varchar(50) NOT NULL;
ALTER TABLE `<?php echo $table_prefix ?>application_logs` MODIFY COLUMN `is_private` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>application_logs` ADD COLUMN `is_silent` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>companies` MODIFY COLUMN `client_of_id` smallint(5) unsigned;
ALTER TABLE `<?php echo $table_prefix ?>companies` MODIFY COLUMN `logo_file` varchar(44);
ALTER TABLE `<?php echo $table_prefix ?>companies` ADD COLUMN `timezone` float(3,1) NOT NULL DEFAULT '0.0';
ALTER TABLE `<?php echo $table_prefix ?>project_messages` ADD COLUMN `comments_enabled` tinyint(1) unsigned NOT NULL DEFAULT '1';
ALTER TABLE `<?php echo $table_prefix ?>project_messages` ADD COLUMN `anonymous_comments_enabled` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>project_messages` DROP COLUMN `is_locked`;
ALTER TABLE `<?php echo $table_prefix ?>project_milestones` MODIFY COLUMN `description` text;
ALTER TABLE `<?php echo $table_prefix ?>project_tasks` MODIFY COLUMN `text` text;
ALTER TABLE `<?php echo $table_prefix ?>project_users` CHANGE `can_upload_documents` `can_upload_files` tinyint(1) unsigned DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>project_users` CHANGE `can_manage_documents` `can_manage_files` tinyint(1) unsigned DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>project_users` ADD COLUMN `can_assign_to_owners` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>project_users` ADD COLUMN `can_assign_to_other` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>searchable_objects` CHANGE `object_manager_class` `rel_object_manager` varchar(50) NOT NULL;
ALTER TABLE `<?php echo $table_prefix ?>searchable_objects` CHANGE `object_id` `rel_object_id` int(10) NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>searchable_objects` DROP KEY `PRIMARY`, ADD PRIMARY KEY (`rel_object_manager`,`rel_object_id`,`column_name`);
ALTER TABLE `<?php echo $table_prefix ?>tags` CHANGE `object_id` `rel_object_id` int(10) NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>tags` CHANGE `object_manager_class` `rel_object_manager` varchar(50) NOT NULL;
ALTER TABLE `<?php echo $table_prefix ?>tags` DROP KEY `object_id`, ADD INDEX `object_id` (`rel_object_id`,`rel_object_manager`);
ALTER TABLE `<?php echo $table_prefix ?>users` MODIFY COLUMN `company_id` smallint(5) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `<?php echo $table_prefix ?>users` MODIFY COLUMN `username` varchar(50) NOT NULL;
ALTER TABLE `<?php echo $table_prefix ?>users` ADD COLUMN `token` varchar(40) NOT NULL;
ALTER TABLE `<?php echo $table_prefix ?>users` ADD COLUMN `salt` varchar(13) NOT NULL;
ALTER TABLE `<?php echo $table_prefix ?>users` ADD COLUMN `twister` varchar(10) NOT NULL;
ALTER TABLE `<?php echo $table_prefix ?>users` MODIFY COLUMN `avatar_file` varchar(44);
ALTER TABLE `<?php echo $table_prefix ?>users` ADD COLUMN `timezone` float(3,1) NOT NULL DEFAULT '0.0';
ALTER TABLE `<?php echo $table_prefix ?>users` DROP COLUMN `password`;
ALTER TABLE `<?php echo $table_prefix ?>users` DROP KEY `session_id`;
ALTER TABLE `<?php echo $table_prefix ?>users` DROP COLUMN `session_id`;
DROP TABLE IF EXISTS `<?php echo $table_prefix ?>document_downloads`;
-- Modify existing tables or add tables with initial data;
DROP TABLE IF EXISTS `<?php echo $table_prefix ?>administration_tools`;
CREATE TABLE `<?php echo $table_prefix ?>administration_tools` (
`id` tinyint(3) unsigned NOT NULL auto_increment,
`name` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`controller` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`action` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`order` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
INSERT INTO `<?php echo $table_prefix ?>administration_tools` (`id`, `name`, `controller`, `action`, `order`) VALUES (1, 'test_mail_settings', 'administration', 'tool_test_email', 1);
INSERT INTO `<?php echo $table_prefix ?>administration_tools` (`id`, `name`, `controller`, `action`, `order`) VALUES (2, 'mass_mailer', 'administration', 'tool_mass_mailer', 2);
DROP TABLE IF EXISTS `<?php echo $table_prefix ?>config_categories`;
CREATE TABLE `<?php echo $table_prefix ?>config_categories` (
`id` tinyint(3) unsigned NOT NULL auto_increment,
`name` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`is_system` tinyint(1) unsigned NOT NULL default '0',
`category_order` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `order` (`category_order`)
) ENGINE=InnoDB <?php echo $default_charset ?> COLLATE=utf8_unicode_ci;
INSERT INTO `<?php echo $table_prefix ?>config_categories` (`id`, `name`, `is_system`, `category_order`) VALUES (1, 'system', 1, 0);
INSERT INTO `<?php echo $table_prefix ?>config_categories` (`id`, `name`, `is_system`, `category_order`) VALUES (2, 'general', 0, 1);
INSERT INTO `<?php echo $table_prefix ?>config_categories` (`id`, `name`, `is_system`, `category_order`) VALUES (3, 'mailing', 0, 2);
DROP TABLE IF EXISTS `<?php echo $table_prefix ?>config_options`;
CREATE TABLE `<?php echo $table_prefix ?>config_options` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`category_name` varchar(30) <?php echo $default_collation ?> NOT NULL default '',
`name` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`value` text <?php echo $default_collation ?>,
`config_handler_class` varchar(50) <?php echo $default_collation ?> NOT NULL default '',
`is_system` tinyint(1) unsigned NOT NULL default '0',
`option_order` smallint(5) unsigned NOT NULL default '0',
`dev_comment` varchar(255) <?php echo $default_collation ?> default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `order` (`option_order`),
KEY `category_id` (`category_name`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (1, 'system', 'project_logs_per_page', '15', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (2, 'system', 'messages_per_page', '5', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (3, 'system', 'max_avatar_width', '50', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (4, 'system', 'max_avatar_height', '50', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (5, 'system', 'dashboard_logs_count', '15', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (6, 'system', 'max_logo_width', '50', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (7, 'system', 'max_logo_height', '50', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (8, 'system', 'files_per_page', '10', 'IntegerConfigHandler', 1, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (9, 'general', 'site_name', 'ProjectPier', 'StringConfigHandler', 0, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (10, 'general', 'upgrade_last_check_datetime', '', 'DateTimeConfigHandler', 1, 0, 'Date and time of the last upgrade check');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (11, 'general', 'upgrade_last_check_new_version', '0', 'BoolConfigHandler', 1, 0, 'True if system checked for the new version and found it. This value is used to highlight upgrade tab in the administration');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (12, 'general', 'upgrade_check_enabled', '1', 'BoolConfigHandler', 0, 0, 'Upgrade check enabled / dissabled');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (13, 'general', 'file_storage_adapter', 'mysql', 'FileStorageConfigHandler', 0, 0, 'What storage adapter should be used? fs or mysql');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (14, 'general', 'default_project_folders', 'images\r\ndocuments\r\n\r\nother', 'TextConfigHandler', 0, 3, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (15, 'general', 'theme', 'default', 'ThemeConfigHandler', 0, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (16, 'mailing', 'exchange_compatible', '0', 'BoolConfigHandler', 0, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (17, 'mailing', 'mail_transport', 'mail()', 'MailTransportConfigHandler', 0, 0, 'Values: ''mail()'' - try to emulate mail() function, ''smtp'' - use SMTP connection');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (18, 'mailing', 'smtp_server', '', 'StringConfigHandler', 0, 0, '');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (19, 'mailing', 'smtp_port', '25', 'IntegerConfigHandler', 0, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (20, 'mailing', 'smtp_authenticate', '0', 'BoolConfigHandler', 0, 0, 'Use SMTP authentication');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (21, 'mailing', 'smtp_username', '', 'StringConfigHandler', 0, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (22, 'mailing', 'smtp_password', '', 'PasswordConfigHandler', 0, 0, NULL);
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (23, 'mailing', 'smtp_secure_connection', 'no', 'SecureSmtpConnectionConfigHandler', 0, 0, 'Values: no, ssl, tls');
INSERT INTO `<?php echo $table_prefix ?>config_options` (`id`, `category_name`, `name`, `value`, `config_handler_class`, `is_system`, `option_order`, `dev_comment`) VALUES (24, 'system', 'feed_logs_count', '50', 'IntegerConfigHandler', 1, 0, 'Number of items in feeds');
DROP TABLE IF EXISTS `<?php echo $table_prefix ?>file_types`;
CREATE TABLE `<?php echo $table_prefix ?>file_types` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`extension` varchar(10) <?php echo $default_collation ?> NOT NULL default '',
`icon` varchar(30) <?php echo $default_collation ?> NOT NULL default '',
`is_searchable` tinyint(1) unsigned NOT NULL default '0',
`is_image` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `extension` (`extension`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (1, 'zip', 'archive.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (2, 'rar', 'archive.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (3, 'bz', 'archive.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (4, 'bz2', 'archive.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (5, 'gz', 'archive.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (6, 'ace', 'archive.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (7, 'mp3', 'audio.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (8, 'wma', 'audio.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (9, 'ogg', 'audio.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (10, 'doc', 'doc.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (11, 'xsl', 'doc.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (12, 'gif', 'image.png', 0, 1);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (13, 'jpg', 'image.png', 0, 1);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (14, 'jpeg', 'image.png', 0, 1);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (15, 'png', 'image.png', 0, 1);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (16, 'mov', 'mov.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (17, 'pdf', 'pdf.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (18, 'psd', 'psd.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (19, 'rm', 'rm.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (20, 'svg', 'svg.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (21, 'swf', 'swf.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (22, 'avi', 'video.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (23, 'mpeg', 'video.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (24, 'mpg', 'video.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (25, 'qt', 'mov.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (26, 'vob', 'video.png', 0, 0);
INSERT INTO `<?php echo $table_prefix ?>file_types` (`id`, `extension`, `icon`, `is_searchable`, `is_image`) VALUES (27, 'txt', 'doc.png', 1, 0);
DROP TABLE IF EXISTS `<?php echo $table_prefix ?>im_types`;
CREATE TABLE `<?php echo $table_prefix ?>im_types` (
`id` tinyint(3) unsigned NOT NULL auto_increment,
`name` varchar(30) <?php echo $default_collation ?> NOT NULL default '',
`icon` varchar(30) <?php echo $default_collation ?> NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB <?php echo $default_charset ?>;
INSERT INTO `<?php echo $table_prefix ?>im_types` (`id`, `name`, `icon`) VALUES (1, 'ICQ', 'icq.gif');
INSERT INTO `<?php echo $table_prefix ?>im_types` (`id`, `name`, `icon`) VALUES (2, 'AIM', 'aim.gif');
INSERT INTO `<?php echo $table_prefix ?>im_types` (`id`, `name`, `icon`) VALUES (3, 'MSN', 'msn.gif');
INSERT INTO `<?php echo $table_prefix ?>im_types` (`id`, `name`, `icon`) VALUES (4, 'Yahoo!', 'yahoo.gif');
INSERT INTO `<?php echo $table_prefix ?>im_types` (`id`, `name`, `icon`) VALUES (5, 'Skype', 'skype.gif');
INSERT INTO `<?php echo $table_prefix ?>im_types` (`id`, `name`, `icon`) VALUES (6, 'Jabber', 'jabber.gif'); | {
"pile_set_name": "Github"
} |
import jkson.Generic
abstract class ScalaGen[T] extends Generic[T]
abstract class ScalaMono extends Generic[Product]
| {
"pile_set_name": "Github"
} |
#ifndef ZCOIN_ELYSIUM_SIGMA_H
#define ZCOIN_ELYSIUM_SIGMA_H
#include "property.h"
#include "sigmaprimitives.h"
#include <stddef.h>
namespace elysium {
bool VerifySigmaSpend(
PropertyId property,
SigmaDenomination denomination,
SigmaMintGroup group,
size_t groupSize,
const SigmaProof& proof,
const secp_primitives::Scalar& serial,
bool fPadding);
} // namespace elysium
#endif // ZCOIN_ELYSIUM_SIGMA_H
| {
"pile_set_name": "Github"
} |
/*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
Copyright (C) 2015-2019 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Stockfish is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <cassert>
#include <cstring> // For std::memset
#include <iomanip>
#include <sstream>
#include "bitboard.h"
#include "evaluate.h"
#include "material.h"
#include "pawns.h"
#include "thread.h"
namespace Trace {
enum Tracing { NO_TRACE, TRACE };
enum Term { // The first 8 entries are reserved for PieceType
MATERIAL = 8, IMBALANCE, MOBILITY, THREAT, PASSED, SPACE, INITIATIVE, VARIANT, TOTAL, TERM_NB
};
Score scores[TERM_NB][COLOR_NB];
double to_cp(Value v) { return double(v) / PawnValueEg; }
void add(int idx, Color c, Score s) {
scores[idx][c] = s;
}
void add(int idx, Score w, Score b = SCORE_ZERO) {
scores[idx][WHITE] = w;
scores[idx][BLACK] = b;
}
std::ostream& operator<<(std::ostream& os, Score s) {
os << std::setw(5) << to_cp(mg_value(s)) << " "
<< std::setw(5) << to_cp(eg_value(s));
return os;
}
std::ostream& operator<<(std::ostream& os, Term t) {
if (t == MATERIAL || t == IMBALANCE || t == INITIATIVE || t == TOTAL)
os << " ---- ----" << " | " << " ---- ----";
else
os << scores[t][WHITE] << " | " << scores[t][BLACK];
os << " | " << scores[t][WHITE] - scores[t][BLACK] << "\n";
return os;
}
}
using namespace Trace;
namespace {
constexpr Bitboard QueenSide = FileABB | FileBBB | FileCBB | FileDBB;
constexpr Bitboard CenterFiles = FileCBB | FileDBB | FileEBB | FileFBB;
constexpr Bitboard KingSide = FileEBB | FileFBB | FileGBB | FileHBB;
constexpr Bitboard Center = (FileDBB | FileEBB) & (Rank4BB | Rank5BB);
constexpr Bitboard KingFlank[FILE_NB] = {
QueenSide ^ FileDBB, QueenSide, QueenSide,
CenterFiles, CenterFiles,
KingSide, KingSide, KingSide ^ FileEBB
};
// Threshold for lazy and space evaluation
constexpr Value LazyThreshold = Value(1500);
constexpr Value SpaceThreshold[VARIANT_NB] = {
Value(12222),
#ifdef ANTI
Value(12222),
#endif
#ifdef ATOMIC
Value(12222),
#endif
#ifdef CRAZYHOUSE
Value(12222),
#endif
#ifdef EXTINCTION
Value(12222),
#endif
#ifdef GRID
2 * MidgameLimit,
#endif
#ifdef HORDE
Value(12222),
#endif
#ifdef KOTH
VALUE_ZERO,
#endif
#ifdef LOSERS
Value(12222),
#endif
#ifdef RACE
Value(12222),
#endif
#ifdef THREECHECK
Value(12222),
#endif
#ifdef TWOKINGS
Value(12222),
#endif
};
// KingAttackWeights[PieceType] contains king attack weights by piece type
constexpr int KingAttackWeights[VARIANT_NB][PIECE_TYPE_NB] = {
{ 0, 0, 77, 55, 44, 10 },
#ifdef ANTI
{},
#endif
#ifdef ATOMIC
{ 0, 0, 76, 64, 46, 11 },
#endif
#ifdef CRAZYHOUSE
{ 0, 0, 112, 87, 63, 2 },
#endif
#ifdef EXTINCTION
{},
#endif
#ifdef GRID
{ 0, 0, 89, 62, 47, 11 },
#endif
#ifdef HORDE
{ 0, 0, 77, 55, 44, 10 },
#endif
#ifdef KOTH
{ 0, 0, 76, 48, 44, 10 },
#endif
#ifdef LOSERS
{ 0, 0, 77, 55, 44, 10 },
#endif
#ifdef RACE
{},
#endif
#ifdef THREECHECK
{ 0, 0, 115, 64, 62, 35 },
#endif
#ifdef TWOKINGS
{ 0, 0, 77, 55, 44, 10 },
#endif
};
// Per-variant king danger malus factors
constexpr int KingDangerParams[VARIANT_NB][8] = {
{ 69, 185, 150, 1, -873, -6, -30, 0 },
#ifdef ANTI
{},
#endif
#ifdef ATOMIC
{ 274, 166, 146, 1, -654, -12, -7, 29 },
#endif
#ifdef CRAZYHOUSE
{ 119, 439, 130, 1, -613, -6, -1, 320 },
#endif
#ifdef EXTINCTION
{},
#endif
#ifdef GRID
{ 119, 211, 158, 1, -722, -9, 41, 0 },
#endif
#ifdef HORDE
{ 101, 235, 134, 1, -717, -11, -5, 0 },
#endif
#ifdef KOTH
{ 85, 229, 131, 1, -658, -9, -5, 0 },
#endif
#ifdef LOSERS
{ 101, 235, 134, 1, -717, -357, -5, 0 },
#endif
#ifdef RACE
{},
#endif
#ifdef THREECHECK
{ 85, 136, 106, 1, -613, -7, -73, 181 },
#endif
#ifdef TWOKINGS
{ 92, 155, 136, 1, -967, -8, 38, 0 },
#endif
};
// Penalties for enemy's safe checks
constexpr int QueenSafeCheck = 780;
constexpr int RookSafeCheck = 880;
constexpr int BishopSafeCheck = 435;
constexpr int KnightSafeCheck = 790;
#ifdef CRAZYHOUSE
constexpr int PawnSafeCheck = 435;
#endif
#ifdef ATOMIC
constexpr int IndirectKingAttack = 883;
#endif
#ifdef THREECHECK
// In Q8 fixed point
constexpr int ThreeCheckKSFactors[CHECKS_NB] = { 571, 619, 858, 0 };
#endif
#define S(mg, eg) make_score(mg, eg)
// MobilityBonus[PieceType-2][attacked] contains bonuses for middle and end game,
// indexed by piece type and number of attacked squares in the mobility area.
constexpr Score MobilityBonus[VARIANT_NB][4][32] = {
{
{ S(-62,-81), S(-53,-56), S(-12,-30), S( -4,-14), S( 3, 8), S( 13, 15), // Knights
S( 22, 23), S( 28, 27), S( 33, 33) },
{ S(-48,-59), S(-20,-23), S( 16, -3), S( 26, 13), S( 38, 24), S( 51, 42), // Bishops
S( 55, 54), S( 63, 57), S( 63, 65), S( 68, 73), S( 81, 78), S( 81, 86),
S( 91, 88), S( 98, 97) },
{ S(-58,-76), S(-27,-18), S(-15, 28), S(-10, 55), S( -5, 69), S( -2, 82), // Rooks
S( 9,112), S( 16,118), S( 30,132), S( 29,142), S( 32,155), S( 38,165),
S( 46,166), S( 48,169), S( 58,171) },
{ S(-39,-36), S(-21,-15), S( 3, 8), S( 3, 18), S( 14, 34), S( 22, 54), // Queens
S( 28, 61), S( 41, 73), S( 43, 79), S( 48, 92), S( 56, 94), S( 60,104),
S( 60,113), S( 66,120), S( 67,123), S( 70,126), S( 71,133), S( 73,136),
S( 79,140), S( 88,143), S( 88,148), S( 99,166), S(102,170), S(102,175),
S(106,184), S(109,191), S(113,206), S(116,212) }
},
#ifdef ANTI
{
{ S(-150,-152), S(-112,-108), S(-18,-52), S( -4,-20), S( 12, 10), S( 30, 22), // Knights
S( 44, 52), S( 60, 56), S( 72, 58) },
{ S(-96,-116), S(-42,-38), S( 32, -4), S( 52, 24), S( 74, 44), S(102, 84), // Bishops
S(108, 108), S(126,116), S(130,126), S(142,140), S(158,148), S(162,172),
S(184, 180), S(194,188) },
{ S(-112,-156), S(-50,-36), S(-22, 52), S(-10,110), S( -8,140), S( -2,162), // Rooks
S( 16, 218), S( 28,240), S( 42,256), S( 46,286), S( 62,308), S( 64,320),
S( 86, 330), S( 98,336), S(118,338) },
{ S(-80,-70), S(-50,-24), S( 4, 14), S( 8, 38), S( 28, 74), S( 48,110), // Queens
S( 50,124), S( 80,152), S( 86,158), S( 94,174), S(108,188), S(112,204),
S(120,222), S(140,232), S(144,236), S(146,244), S(150,256), S(154,260),
S(170,266), S(188,272), S(198,280), S(216,314), S(224,316), S(226,322),
S(236,348), S(238,354), S(246,382), S(256,398) }
},
#endif
#ifdef ATOMIC
{
{ S(-86,-77), S(-79,-64), S(-36,-40), S( -2,-24), S( 14, 8), S( 23, 25), // Knights
S( 40, 26), S( 30, 23), S( 37, 29) },
{ S(-55,-65), S(-17,-34), S( 13, -9), S( 24, 20), S( 22, 25), S( 57, 39), // Bishops
S( 32, 52), S( 66, 66), S( 51, 52), S( 56, 74), S( 73, 76), S( 85, 81),
S( 93, 90), S(108, 87) },
{ S(-61,-73), S(-32,-28), S(-18, 9), S(-19, 30), S(-19, 57), S( 20, 78), // Rooks
S( 12,104), S( 11,134), S( 21,133), S( 33,166), S( 35,168), S( 38,185),
S( 25,172), S( 60,182), S( 58,155) },
{ S(-43,-43), S(-14,-16), S( -5, 1), S( 0, 23), S( 6, 24), S( 23, 59), // Queens
S( 20, 55), S( 32, 66), S( 47, 89), S( 29, 77), S( 47, 89), S( 69,103),
S( 63,110), S( 76,131), S( 73,115), S( 48,132), S( 58,131), S( 75,135),
S( 82,122), S(111,130), S(114,144), S(101,139), S(106,146), S(107,167),
S(115,157), S(129,175), S(132,176), S(130,210) }
},
#endif
#ifdef CRAZYHOUSE
{
{ S(-126, -96), S(-103,-31), S(-90,-27), S(-40, 3), S( 0, 3), S( 4, 0), // Knights
S( 20, 12), S( 15, 33), S( 50, 46) },
{ S(-156, -79), S(-115,-43), S( 42,-14), S( 35, 26), S( 64, 26), S( 74, 38), // Bishops
S( 70, 46), S( 83, 71), S( 70, 68), S( 66, 80), S( 64, 68), S( 70, 77),
S( 97, 92), S( 89, 98) },
{ S( -53, -53), S( -22, -8), S(-48, 30), S(-14, 57), S( -4, 77), S( 11, 87), // Rooks
S( 7, 115), S( 12,123), S( 27,120), S( 6,140), S( 55,156), S( 18,161),
S( 51, 161), S( 54,171), S( 52,166) },
{ S( -26, -56), S( -24,-14), S( 7, 14), S( 8, 15), S( 18, 34), S( 14, 41), // Queens
S( 28, 58), S( 33, 66), S( 40, 70), S( 47, 74), S( 50,100), S( 52,106),
S( 59, 111), S( 50, 95), S( 60,115), S( 61,126), S( 75,144), S( 82,119),
S( 95, 137), S( 102,138), S(100,142), S(119,154), S(129,156), S(107,156),
S( 111, 177), S( 115,181), S(124,197), S(124,199) }
},
#endif
#ifdef EXTINCTION
{
{ S(-123, -90), S( -91,-32), S(-61,-29), S(-38, 3), S( 0, 3), S( 4, 0), // Knights
S( 19, 12), S( 15, 33), S( 52, 45) },
{ S(-153, -80), S(-112,-41), S( 41,-14), S( 35, 24), S( 62, 26), S( 75, 41), // Bishops
S( 72, 48), S( 85, 74), S( 74, 65), S( 66, 79), S( 64, 69), S( 73, 80),
S( 107, 92), S( 96,101) },
{ S( -59, -51), S( -20, -8), S(-54, 32), S(-15, 54), S( -4, 70), S( 11, 84), // Rooks
S( 6, 113), S( 13,123), S( 27,114), S( 6,144), S( 60,162), S( 19,162),
S( 48, 170), S( 57,170), S( 52,177) },
{ S( -27, -56), S( -24,-14), S( 7, 13), S( 9, 16), S( 18, 37), S( 14, 40), // Queens
S( 29, 56), S( 34, 64), S( 39, 73), S( 49, 65), S( 50, 98), S( 50,106),
S( 60, 107), S( 53, 92), S( 62,119), S( 69,130), S( 77,145), S( 84,120),
S( 90, 153), S( 98,131), S(106,139), S(116,147), S(127,157), S(112,154),
S( 121, 174), S( 124,167), S(126,194), S(130,190) }
},
#endif
#ifdef GRID
{
{ S(-75,-76), S(-57,-54), S( -9,-28), S( -2,-10), S( 6, 5), S( 14, 12), // Knights
S( 22, 26), S( 29, 29), S( 36, 29) },
{ S(-48,-59), S(-20,-23), S( 16, -3), S( 26, 13), S( 38, 24), S( 51, 42), // Bishops
S( 55, 54), S( 63, 57), S( 63, 65), S( 68, 73), S( 81, 78), S( 81, 86),
S( 91, 88), S( 98, 97) },
{ S(-58,-76), S(-27,-18), S(-15, 28), S(-10, 55), S( -5, 69), S( -2, 82), // Rooks
S( 9,112), S( 16,118), S( 30,132), S( 29,142), S( 32,155), S( 38,165),
S( 46,166), S( 48,169), S( 58,171) },
{ S(-39,-36), S(-21,-15), S( 3, 8), S( 3, 18), S( 14, 34), S( 22, 54), // Queens
S( 28, 61), S( 41, 73), S( 43, 79), S( 48, 92), S( 56, 94), S( 60,104),
S( 60,113), S( 66,120), S( 67,123), S( 70,126), S( 71,133), S( 73,136),
S( 79,140), S( 88,143), S( 88,148), S( 99,166), S(102,170), S(102,175),
S(106,184), S(109,191), S(113,206), S(116,212) }
},
#endif
#ifdef HORDE
{
{ S(-126,-90), S( -7,-22), S( -46,-25), S( 19,7), S( -53, 71), S( 31, -1), // Knights
S( -6, 51), S(-12, 47), S( -9, -56) },
{ S( -46,-2), S(30,66), S( 18, -27), S( 86, 21), S( 65, 11), S(147, 45), // Bishops
S( 98, 38), S( 95, 52), S(122, 45), S( 95, 33), S( 89,103), S( 85, -9),
S( 105, 70), S(131, 82) },
{ S( -56,-78), S(-25,-18), S(-11, 26), S( -5, 55), S( -4, 70), S( -1, 81), // Rooks
S( 8,109), S( 14,120), S( 21,128), S( 23,143), S( 31,154), S( 32,160),
S( 43,165), S( 49,168), S( 59,169) },
{ S( -40,-35), S(-25,-12), S( 2, 7), S( 4, 19), S( 14, 37), S( 24, 55), // Queens
S( 25, 62), S( 40, 76), S( 43, 79), S( 47, 87), S( 54, 94), S( 56,102),
S( 60,111), S( 70,116), S( 72,118), S( 73,122), S( 75,128), S( 77,130),
S( 85,133), S( 94,136), S( 99,140), S(108,157), S(112,158), S(113,161),
S( 118,174), S(119,177), S(123,191), S(128,199) }
},
#endif
#ifdef KOTH
{
{ S(-75,-76), S(-56,-54), S( -9,-26), S( -2,-10), S( 6, 5), S( 15, 11), // Knights
S( 22, 26), S( 30, 28), S( 36, 29) },
{ S(-48,-58), S(-21,-19), S( 16, -2), S( 26, 12), S( 37, 22), S( 51, 42), // Bishops
S( 54, 54), S( 63, 58), S( 65, 63), S( 71, 70), S( 79, 74), S( 81, 86),
S( 92, 90), S( 97, 94) },
{ S(-56,-78), S(-25,-18), S(-11, 26), S( -5, 55), S( -4, 70), S( -1, 81), // Rooks
S( 8,109), S( 14,120), S( 21,128), S( 23,143), S( 31,154), S( 32,160),
S( 43,165), S( 49,168), S( 59,169) },
{ S(-40,-35), S(-25,-12), S( 2, 7), S( 4, 19), S( 14, 37), S( 24, 55), // Queens
S( 25, 62), S( 40, 76), S( 43, 79), S( 47, 87), S( 54, 94), S( 56,102),
S( 60,111), S( 70,116), S( 72,118), S( 73,122), S( 75,128), S( 77,130),
S( 85,133), S( 94,136), S( 99,140), S(108,157), S(112,158), S(113,161),
S(118,174), S(119,177), S(123,191), S(128,199) }
},
#endif
#ifdef LOSERS
{
{ S(-150,-152), S(-112,-108), S(-18,-52), S( -4,-20), S( 12, 10), S( 30, 22), // Knights
S( 44, 52), S( 60, 56), S( 72, 58) },
{ S(-96,-116), S(-42,-38), S( 32, -4), S( 52, 24), S( 74, 44), S(102, 84), // Bishops
S(108, 108), S(126,116), S(130,126), S(142,140), S(158,148), S(162,172),
S(184, 180), S(194,188) },
{ S(-112,-156), S(-50,-36), S(-22, 52), S(-10,110), S( -8,140), S( -2,162), // Rooks
S( 16, 218), S( 28,240), S( 42,256), S( 46,286), S( 62,308), S( 64,320),
S( 86, 330), S( 98,336), S(118,338) },
{ S(-80,-70), S(-50,-24), S( 4, 14), S( 8, 38), S( 28, 74), S( 48,110), // Queens
S( 50,124), S( 80,152), S( 86,158), S( 94,174), S(108,188), S(112,204),
S(120,222), S(140,232), S(144,236), S(146,244), S(150,256), S(154,260),
S(170,266), S(188,272), S(198,280), S(216,314), S(224,316), S(226,322),
S(236,348), S(238,354), S(246,382), S(256,398) }
},
#endif
#ifdef RACE
{
{ S(-132,-117), S( -89,-110), S(-13,-49), S(-11,-15), S(-10,-30), S( 29, 17), // Knights
S( 13, 32), S( 79, 69), S(109, 79) },
{ S(-101,-119), S( -19, -27), S( 27, -9), S( 35, 30), S( 62, 31), S(115, 72), // Bishops
S( 91, 99), S( 138, 122), S(129,119), S(158,156), S(153,162), S(143,189),
S( 172, 181), S( 196, 204) },
{ S(-131,-162), S( -57, -37), S( -8, 47), S( 12, 93), S( 3,127), S( 10,139), // Rooks
S( 3, 240), S( 18, 236), S( 44,251), S( 44,291), S( 49,301), S( 67,316),
S( 100, 324), S( 97, 340), S(110,324) },
{ S( -87, -68), S( -73, -2), S( -7, 9), S( -5, 16), S( 39, 76), S( 39,118), // Queens
S( 64, 131), S( 86, 169), S( 86,175), S( 78,166), S( 97,195), S(123,216),
S( 137, 200), S( 155, 247), S(159,260), S(136,252), S(156,279), S(160,251),
S( 165, 251), S( 194, 267), S(204,271), S(216,331), S(226,304), S(223,295),
S( 239, 316), S( 228, 365), S(240,385), S(249,377) }
},
#endif
#ifdef THREECHECK
{
{ S(-74,-76), S(-55,-54), S( -9,-26), S( -2,-10), S( 6, 5), S( 15, 11), // Knights
S( 22, 26), S( 31, 27), S( 37, 29) },
{ S(-49,-56), S(-23,-18), S( 15, -2), S( 25, 12), S( 36, 22), S( 50, 42), // Bishops
S( 53, 54), S( 64, 57), S( 67, 63), S( 71, 68), S( 84, 76), S( 79, 87),
S( 95, 91), S( 98, 93) },
{ S(-57,-76), S(-25,-18), S(-11, 25), S( -5, 53), S( -4, 70), S( -1, 78), // Rooks
S( 8,111), S( 14,116), S( 22,125), S( 24,148), S( 31,159), S( 31,173),
S( 44,163), S( 50,162), S( 56,168) },
{ S(-42,-35), S(-25,-12), S( 2, 7), S( 4, 19), S( 14, 37), S( 24, 53), // Queens
S( 26, 63), S( 39, 80), S( 42, 77), S( 48, 88), S( 53, 96), S( 57, 96),
S( 61,108), S( 71,116), S( 70,116), S( 74,125), S( 75,133), S( 78,133),
S( 85,137), S( 97,135), S(103,141), S(107,165), S(109,153), S(115,162),
S(119,164), S(121,184), S(121,192), S(131,203) }
},
#endif
#ifdef TWOKINGS
{
{ S(-75,-76), S(-57,-54), S( -9,-28), S( -2,-10), S( 6, 5), S( 14, 12), // Knights
S( 22, 26), S( 29, 29), S( 36, 29) },
{ S(-48,-59), S(-20,-23), S( 16, -3), S( 26, 13), S( 38, 24), S( 51, 42), // Bishops
S( 55, 54), S( 63, 57), S( 63, 65), S( 68, 73), S( 81, 78), S( 81, 86),
S( 91, 88), S( 98, 97) },
{ S(-58,-76), S(-27,-18), S(-15, 28), S(-10, 55), S( -5, 69), S( -2, 82), // Rooks
S( 9,112), S( 16,118), S( 30,132), S( 29,142), S( 32,155), S( 38,165),
S( 46,166), S( 48,169), S( 58,171) },
{ S(-39,-36), S(-21,-15), S( 3, 8), S( 3, 18), S( 14, 34), S( 22, 54), // Queens
S( 28, 61), S( 41, 73), S( 43, 79), S( 48, 92), S( 56, 94), S( 60,104),
S( 60,113), S( 66,120), S( 67,123), S( 70,126), S( 71,133), S( 73,136),
S( 79,140), S( 88,143), S( 88,148), S( 99,166), S(102,170), S(102,175),
S(106,184), S(109,191), S(113,206), S(116,212) }
},
#endif
};
// Outpost[knight/bishop][supported by pawn] contains bonuses for minor
// pieces if they occupy or can reach an outpost square, bigger if that
// square is supported by a pawn.
constexpr Score Outpost[][2] = {
{ S(22, 6), S(36,12) }, // Knight
{ S( 9, 2), S(15, 5) } // Bishop
};
// RookOnFile[semiopen/open] contains bonuses for each rook when there is
// no (friendly) pawn on the rook file.
constexpr Score RookOnFile[] = { S(18, 7), S(44, 20) };
// ThreatByMinor/ByRook[attacked PieceType] contains bonuses according to
// which piece type attacks which one. Attacks on lesser pieces which are
// pawn-defended are not considered.
constexpr Score ThreatByMinor[PIECE_TYPE_NB] = {
S(0, 0), S(0, 31), S(39, 42), S(57, 44), S(68, 112), S(62, 120)
};
constexpr Score ThreatByRook[PIECE_TYPE_NB] = {
S(0, 0), S(0, 24), S(38, 71), S(38, 61), S(0, 38), S(51, 38)
};
#ifdef ATOMIC
constexpr Score ThreatByBlast = S(80, 80);
#endif
#ifdef THREECHECK
constexpr Score ChecksGivenBonus[CHECKS_NB] = {
S(0, 0),
S(444, 181),
S(2425, 603),
S(0, 0)
};
#endif
#ifdef KOTH
constexpr Score KothDistanceBonus[6] = {
S(1949, 1934), S(454, 364), S(151, 158), S(75, 85), S(42, 49), S(0, 0)
};
constexpr Score KothSafeCenter = S(163, 207);
#endif
#ifdef ANTI
constexpr Score PieceCountAnti = S(119, 123);
constexpr Score ThreatsAnti[] = { S(192, 203), S(411, 322) };
constexpr Score AttacksAnti[2][2][PIECE_TYPE_NB] = {
{
{ S( 30, 141), S( 26, 94), S(161, 105), S( 70, 123), S( 61, 72), S( 78, 12), S(139, 115) },
{ S( 56, 89), S( 82, 107), S(114, 93), S(110, 115), S(188, 112), S( 73, 59), S(122, 59) }
},
{
{ S(119, 142), S( 99, 105), S(123, 193), S(142, 37), S(118, 96), S( 50, 12), S( 91, 85) },
{ S( 58, 81), S( 66, 110), S(105, 153), S(100, 143), S(140, 113), S(145, 73), S(153, 154) }
}
};
#endif
#ifdef LOSERS
constexpr Score ThreatsLosers[] = { S(216, 279), S(441, 341) };
constexpr Score AttacksLosers[2][2][PIECE_TYPE_NB] = {
{
{ S( 27, 140), S( 23, 95), S(160, 112), S( 78, 129), S( 65, 75), S( 70, 13), S(146, 123) },
{ S( 58, 82), S( 80, 112), S(124, 87), S(103, 110), S(185, 107), S( 72, 60), S(126, 62) }
},
{
{ S(111, 127), S(102, 95), S(121, 183), S(140, 37), S(120, 99), S( 55, 11), S( 88, 93) },
{ S( 56, 69), S( 72, 124), S(109, 154), S( 98, 149), S(129, 113), S(147, 72), S(157, 152) }
}
};
#endif
#ifdef CRAZYHOUSE
constexpr int KingDangerInHand[PIECE_TYPE_NB] = {
79, 16, 200, 61, 138, 152
};
constexpr Score DropMobilityBonus = S(30, 30);
#endif
#ifdef RACE
// Bonus for distance of king from 8th rank
constexpr Score KingRaceBonus[RANK_NB] = {
S(14282, 14493), S(6369, 5378), S(4224, 3557), S(2633, 2219),
S( 1614, 1456), S( 975, 885), S( 528, 502), S( 0, 0)
};
#endif
// PassedRank[Rank] contains a bonus according to the rank of a passed pawn
constexpr Score PassedRank[VARIANT_NB][RANK_NB] = {
{
S(0, 0), S(5, 18), S(12, 23), S(10, 31), S(57, 62), S(163, 167), S(271, 250)
},
#ifdef ANTI
{ S(0, 0), S(5, 7), S(5, 14), S(31, 38), S(73, 73), S(166, 166), S(252, 252) },
#endif
#ifdef ATOMIC
{ S(0, 0), S(95, 86), S(118, 43), S(94, 61), S(142, 62), S(196, 150), S(204, 256) },
#endif
#ifdef CRAZYHOUSE
{ S(0, 0), S(15, 27), S(23, 13), S(13, 19), S(88, 111), S(177, 140), S(229, 293) },
#endif
#ifdef EXTINCTION
{ S(0, 0), S(5, 7), S(5, 14), S(31, 38), S(73, 73), S(166, 166), S(252, 252) },
#endif
#ifdef GRID
{ S(0, 0), S(11, 2), S(4, 0), S(27, 34), S(58, 17), S(168, 165), S(251, 253) },
#endif
#ifdef HORDE
{ S(0, 0), S(-66, 10), S(-25, 7), S(66, -12), S(68, 81), S(72, 210), S(250, 258) },
#endif
#ifdef KOTH
{ S(0, 0), S(5, 7), S(5, 14), S(31, 38), S(73, 73), S(166, 166), S(252, 252) },
#endif
#ifdef LOSERS
{ S(0, 0), S(5, 8), S(5, 13), S(31, 36), S(72, 72), S(170, 159), S(276, 251) },
#endif
#ifdef RACE
{},
#endif
#ifdef THREECHECK
{ S(0, 0), S(5, 7), S(5, 14), S(31, 38), S(73, 73), S(166, 166), S(252, 252) },
#endif
#ifdef TWOKINGS
{ S(0, 0), S(5, 7), S(5, 14), S(31, 38), S(73, 73), S(166, 166), S(252, 252) },
#endif
};
// PassedFile[File] contains a bonus according to the file of a passed pawn
constexpr Score PassedFile[FILE_NB] = {
S( -1, 7), S( 0, 9), S(-9, -8), S(-30,-14),
S(-30,-14), S(-9, -8), S( 0, 9), S( -1, 7)
};
// Assorted bonuses and penalties
constexpr Score BishopPawns = S( 3, 8);
constexpr Score CloseEnemies[VARIANT_NB] = {
S( 7, 0),
#ifdef ANTI
S( 0, 0),
#endif
#ifdef ATOMIC
S(17, 0),
#endif
#ifdef CRAZYHOUSE
S(14, 20),
#endif
#ifdef EXTINCTION
S( 0, 0),
#endif
#ifdef GRID
S( 7, 0),
#endif
#ifdef HORDE
S( 7, 0),
#endif
#ifdef KOTH
S( 7, 0),
#endif
#ifdef LOSERS
S( 7, 0),
#endif
#ifdef RACE
S( 0, 0),
#endif
#ifdef THREECHECK
S(16, 9),
#endif
#ifdef TWOKINGS
S( 7, 0),
#endif
};
constexpr Score CorneredBishop = S( 50, 50);
constexpr Score Hanging = S( 62, 34);
constexpr Score KingProtector = S( 6, 7);
constexpr Score KnightOnQueen = S( 20, 12);
constexpr Score LongDiagonalBishop = S( 44, 0);
constexpr Score MinorBehindPawn = S( 16, 0);
constexpr Score PawnlessFlank = S( 18, 94);
constexpr Score RestrictedPiece = S( 7, 6);
constexpr Score RookOnPawn = S( 10, 28);
constexpr Score SliderOnQueen = S( 49, 21);
constexpr Score ThreatByKing = S( 21, 84);
constexpr Score ThreatByPawnPush = S( 48, 42);
constexpr Score ThreatByRank = S( 14, 3);
constexpr Score ThreatBySafePawn = S(169, 99);
constexpr Score TrappedRook = S( 98, 5);
constexpr Score WeakQueen = S( 51, 10);
constexpr Score WeakUnopposedPawn = S( 14, 20);
#undef S
// Evaluation class computes and stores attacks tables and other working data
template<Tracing T>
class Evaluation {
public:
Evaluation() = delete;
explicit Evaluation(const Position& p) : pos(p) {}
Evaluation& operator=(const Evaluation&) = delete;
Value value();
private:
template<Color Us> void initialize();
template<Color Us, PieceType Pt> Score pieces();
template<Color Us> Score king() const;
template<Color Us> Score threats() const;
template<Color Us> Score passed() const;
template<Color Us> Score space() const;
template<Color Us> Score variant() const;
ScaleFactor scale_factor(Value eg) const;
Score initiative(Value eg) const;
const Position& pos;
Material::Entry* me;
Pawns::Entry* pe;
Bitboard mobilityArea[COLOR_NB];
Score mobility[COLOR_NB] = { SCORE_ZERO, SCORE_ZERO };
// attackedBy[color][piece type] is a bitboard representing all squares
// attacked by a given color and piece type. Special "piece types" which
// is also calculated is ALL_PIECES.
Bitboard attackedBy[COLOR_NB][PIECE_TYPE_NB];
// attackedBy2[color] are the squares attacked by 2 pieces of a given color,
// possibly via x-ray or by one pawn and one piece. Diagonal x-ray through
// pawn or squares attacked by 2 pawns are not explicitly added.
Bitboard attackedBy2[COLOR_NB];
// kingRing[color] are the squares adjacent to the king, plus (only for a
// king on its first rank) the squares two ranks in front. For instance,
// if black's king is on g8, kingRing[BLACK] is f8, h8, f7, g7, h7, f6, g6
// and h6. It is set to 0 when king safety evaluation is skipped.
Bitboard kingRing[COLOR_NB];
// kingAttackersCount[color] is the number of pieces of the given color
// which attack a square in the kingRing of the enemy king.
int kingAttackersCount[COLOR_NB];
// kingAttackersWeight[color] is the sum of the "weights" of the pieces of
// the given color which attack a square in the kingRing of the enemy king.
// The weights of the individual piece types are given by the elements in
// the KingAttackWeights array.
int kingAttackersWeight[COLOR_NB];
// kingAttacksCount[color] is the number of attacks by the given color to
// squares directly adjacent to the enemy king. Pieces which attack more
// than one square are counted multiple times. For instance, if there is
// a white knight on g5 and black's king is on g8, this white knight adds 2
// to kingAttacksCount[WHITE].
int kingAttacksCount[COLOR_NB];
};
// Evaluation::initialize() computes king and pawn attacks, and the king ring
// bitboard for a given color. This is done at the beginning of the evaluation.
template<Tracing T> template<Color Us>
void Evaluation<T>::initialize() {
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH);
constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH);
constexpr Bitboard LowRanks = (Us == WHITE ? Rank2BB | Rank3BB: Rank7BB | Rank6BB);
// Find our pawns that are blocked or on the first two ranks
Bitboard b = pos.pieces(Us, PAWN) & (shift<Down>(pos.pieces()) | LowRanks);
// Squares occupied by those pawns, by our king or queen, or controlled by enemy pawns
// are excluded from the mobility area.
#ifdef ANTI
if (pos.is_anti())
mobilityArea[Us] = ~0;
else
#endif
#ifdef HORDE
if (pos.is_horde() && pos.is_horde_color(Us))
mobilityArea[Us] = ~(b | pe->pawn_attacks(Them));
else
#endif
mobilityArea[Us] = ~(b | pos.pieces(Us, KING, QUEEN) | pe->pawn_attacks(Them));
// Initialise attackedBy bitboards for kings and pawns
#ifdef ANTI
if (pos.is_anti())
{
attackedBy[Us][KING] = 0;
Bitboard kings = pos.pieces(Us, KING);
while (kings)
attackedBy[Us][KING] |= pos.attacks_from<KING>(pop_lsb(&kings));
}
else
#endif
#ifdef EXTINCTION
if (pos.is_extinction())
{
attackedBy[Us][KING] = 0;
Bitboard kings = pos.pieces(Us, KING);
while (kings)
attackedBy[Us][KING] |= pos.attacks_from<KING>(pop_lsb(&kings));
}
else
#endif
#ifdef HORDE
if (pos.is_horde() && pos.is_horde_color(Us))
attackedBy[Us][KING] = 0;
else
#endif
#ifdef PLACEMENT
if (pos.is_placement() && pos.count_in_hand<KING>(Us))
attackedBy[Us][KING] = 0;
else
#endif
attackedBy[Us][KING] = pos.attacks_from<KING>(pos.square<KING>(Us));
attackedBy[Us][PAWN] = pe->pawn_attacks(Us);
attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN];
kingRing[Us] = kingAttackersCount[Them] = 0;
// Init our king safety tables only if we are going to use them
if ((
#ifdef ANTI
!pos.is_anti() &&
#endif
#ifdef EXTINCTION
!pos.is_extinction() &&
#endif
#ifdef HORDE
!(pos.is_horde() && pos.is_horde_color(Us)) &&
#endif
(pos.non_pawn_material(Them) >= RookValueMg + KnightValueMg))
)
{
kingRing[Us] = attackedBy[Us][KING];
if (relative_rank(Us, pos.square<KING>(Us)) == RANK_1)
kingRing[Us] |= shift<Up>(kingRing[Us]);
if (file_of(pos.square<KING>(Us)) == FILE_H)
kingRing[Us] |= shift<WEST>(kingRing[Us]);
else if (file_of(pos.square<KING>(Us)) == FILE_A)
kingRing[Us] |= shift<EAST>(kingRing[Us]);
kingAttackersCount[Them] = popcount(kingRing[Us] & pe->pawn_attacks(Them));
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
}
}
// Evaluation::pieces() scores pieces of a given color and type
template<Tracing T> template<Color Us, PieceType Pt>
Score Evaluation<T>::pieces() {
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH);
constexpr Bitboard OutpostRanks = (Us == WHITE ? Rank4BB | Rank5BB | Rank6BB
: Rank5BB | Rank4BB | Rank3BB);
const Square* pl = pos.squares<Pt>(Us);
Bitboard b, bb;
Square s;
Score score = SCORE_ZERO;
attackedBy[Us][Pt] = 0;
while ((s = *pl++) != SQ_NONE)
{
// Find attacked squares, including x-ray attacks for bishops and rooks
b = Pt == BISHOP ? attacks_bb<BISHOP>(s, pos.pieces() ^ pos.pieces(QUEEN))
: Pt == ROOK ? attacks_bb< ROOK>(s, pos.pieces() ^ pos.pieces(QUEEN) ^ pos.pieces(Us, ROOK))
: pos.attacks_from<Pt>(s);
#ifdef GRID
if (pos.is_grid())
b &= ~pos.grid_bb(s);
#endif
if (pos.blockers_for_king(Us) & s)
b &= LineBB[pos.square<KING>(Us)][s];
attackedBy2[Us] |= attackedBy[Us][ALL_PIECES] & b;
attackedBy[Us][Pt] |= b;
attackedBy[Us][ALL_PIECES] |= b;
if (b & kingRing[Them] & ~double_pawn_attacks_bb<Them>(pos.pieces(Them, PAWN)))
{
kingAttackersCount[Us]++;
kingAttackersWeight[Us] += KingAttackWeights[pos.variant()][Pt];
kingAttacksCount[Us] += popcount(b & attackedBy[Them][KING]);
}
int mob = popcount(b & mobilityArea[Us]);
mobility[Us] += MobilityBonus[pos.variant()][Pt - 2][mob];
#ifdef ANTI
if (pos.is_anti())
continue;
#endif
#ifdef HORDE
if (pos.is_horde() && pos.is_horde_color(Us))
continue;
#endif
#ifdef PLACEMENT
if (pos.is_placement() && pos.count_in_hand<KING>(Us))
continue;
#endif
if (Pt == BISHOP || Pt == KNIGHT)
{
// Bonus if piece is on an outpost square or can reach one
bb = OutpostRanks & ~pe->pawn_attacks_span(Them);
if (bb & s)
score += Outpost[Pt == BISHOP][bool(attackedBy[Us][PAWN] & s)] * 2;
else if (bb &= b & ~pos.pieces(Us))
score += Outpost[Pt == BISHOP][bool(attackedBy[Us][PAWN] & bb)];
// Knight and Bishop bonus for being right behind a pawn
if (shift<Down>(pos.pieces(PAWN)) & s)
score += MinorBehindPawn;
// Penalty if the piece is far from the king
score -= KingProtector * distance(s, pos.square<KING>(Us));
if (Pt == BISHOP)
{
// Penalty according to number of pawns on the same color square as the
// bishop, bigger when the center files are blocked with pawns.
Bitboard blocked = pos.pieces(Us, PAWN) & shift<Down>(pos.pieces());
score -= BishopPawns * pe->pawns_on_same_color_squares(Us, s)
* (1 + popcount(blocked & CenterFiles));
// Bonus for bishop on a long diagonal which can "see" both center squares
if (more_than_one(attacks_bb<BISHOP>(s, pos.pieces(PAWN)) & Center))
score += LongDiagonalBishop;
}
// An important Chess960 pattern: A cornered bishop blocked by a friendly
// pawn diagonally in front of it is a very serious problem, especially
// when that pawn is also blocked.
if ( Pt == BISHOP
&& pos.is_chess960()
&& (s == relative_square(Us, SQ_A1) || s == relative_square(Us, SQ_H1)))
{
Direction d = pawn_push(Us) + (file_of(s) == FILE_A ? EAST : WEST);
if (pos.piece_on(s + d) == make_piece(Us, PAWN))
score -= !pos.empty(s + d + pawn_push(Us)) ? CorneredBishop * 4
: pos.piece_on(s + d + d) == make_piece(Us, PAWN) ? CorneredBishop * 2
: CorneredBishop;
}
}
if (Pt == ROOK)
{
// Bonus for aligning rook with enemy pawns on the same rank/file
if (relative_rank(Us, s) >= RANK_5)
score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]);
// Bonus for rook on an open or semi-open file
if (pe->semiopen_file(Us, file_of(s)))
score += RookOnFile[bool(pe->semiopen_file(Them, file_of(s)))];
// Penalty when trapped by the king, even more if the king cannot castle
else if (mob <= 3)
{
File kf = file_of(pos.square<KING>(Us));
if ((kf < FILE_E) == (file_of(s) < kf))
score -= (TrappedRook - make_score(mob * 22, 0)) * (1 + !pos.can_castle(Us));
}
}
if (Pt == QUEEN)
{
// Penalty if any relative pin or discovered attack against the queen
Bitboard queenPinners;
if (pos.slider_blockers(pos.pieces(Them, ROOK, BISHOP), s, queenPinners))
score -= WeakQueen;
}
}
if (T)
Trace::add(Pt, Us, score);
return score;
}
// Evaluation::king() assigns bonuses and penalties to a king of a given color
template<Tracing T> template<Color Us>
Score Evaluation<T>::king() const {
#ifdef ANTI
if (pos.is_anti())
return SCORE_ZERO;
#endif
#ifdef EXTINCTION
if (pos.is_extinction())
return SCORE_ZERO;
#endif
#ifdef HORDE
if (pos.is_horde() && pos.is_horde_color(Us))
return SCORE_ZERO;
#endif
#ifdef PLACEMENT
if (pos.is_placement() && pos.count_in_hand<KING>(Us))
return SCORE_ZERO;
#endif
#ifdef RACE
if (pos.is_race())
return SCORE_ZERO;
#endif
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
constexpr Bitboard Camp = (Us == WHITE ? AllSquares ^ Rank6BB ^ Rank7BB ^ Rank8BB
: AllSquares ^ Rank1BB ^ Rank2BB ^ Rank3BB);
const Square ksq = pos.square<KING>(Us);
Bitboard kingFlank, weak, b, b1, b2, safe, unsafeChecks;
// King shelter and enemy pawns storm
Score score = pe->king_safety<Us>(pos);
// Find the squares that opponent attacks in our king flank, and the squares
// which are attacked twice in that flank.
kingFlank = KingFlank[file_of(ksq)];
b1 = attackedBy[Them][ALL_PIECES] & kingFlank & Camp;
b2 = b1 & attackedBy2[Them];
int tropism = popcount(b1) + popcount(b2);
// Main king safety evaluation
if (kingAttackersCount[Them] > 1 - pos.count<QUEEN>(Them))
{
int kingDanger = 0;
unsafeChecks = 0;
// Attacked squares defended at most once by our queen or king
#ifdef ATOMIC
if (pos.is_atomic())
weak = (attackedBy[Them][ALL_PIECES] | (pos.pieces(Them) ^ pos.pieces(Them, KING)))
& (~attackedBy[Us][ALL_PIECES] | attackedBy[Us][KING] | (attackedBy[Us][QUEEN] & ~attackedBy2[Us]));
else
#endif
weak = attackedBy[Them][ALL_PIECES]
& ~attackedBy2[Us]
& (~attackedBy[Us][ALL_PIECES] | attackedBy[Us][KING] | attackedBy[Us][QUEEN]);
Bitboard h = 0;
#ifdef CRAZYHOUSE
if (pos.is_house())
h = pos.count_in_hand<QUEEN>(Them) ? weak & ~pos.pieces() : 0;
#endif
// Analyse the safe enemy's checks which are possible on next move
safe = ~pos.pieces(Them);
safe &= ~attackedBy[Us][ALL_PIECES] | (weak & attackedBy2[Them]);
#ifdef ATOMIC
if (pos.is_atomic())
safe |= attackedBy[Us][KING];
#endif
// Defended by our queen or king only
Bitboard dqko = ~attackedBy2[Us] & (attackedBy[Us][QUEEN] | attackedBy[Us][KING]);
Bitboard dropSafe = (safe | (attackedBy[Them][ALL_PIECES] & dqko)) & ~pos.pieces(Us);
b1 = attacks_bb<ROOK >(ksq, pos.pieces() ^ pos.pieces(Us, QUEEN));
b2 = attacks_bb<BISHOP>(ksq, pos.pieces() ^ pos.pieces(Us, QUEEN));
// Enemy queen safe checks
if ((b1 | b2) & (h | attackedBy[Them][QUEEN]) & safe & ~attackedBy[Us][QUEEN])
kingDanger += QueenSafeCheck;
#ifdef THREECHECK
if (pos.is_three_check() && pos.checks_given(Them))
safe = ~pos.pieces(Them);
#endif
// Enemy rooks checks
#ifdef CRAZYHOUSE
h = pos.is_house() && pos.count_in_hand<ROOK>(Them) ? ~pos.pieces() : 0;
#endif
if (b1 & ((attackedBy[Them][ROOK] & safe) | (h & dropSafe)))
kingDanger += RookSafeCheck;
else
unsafeChecks |= b1 & (attackedBy[Them][ROOK] | h);
// Enemy bishops checks
#ifdef CRAZYHOUSE
h = pos.is_house() && pos.count_in_hand<BISHOP>(Them) ? ~pos.pieces() : 0;
#endif
if (b2 & ((attackedBy[Them][BISHOP] & safe) | (h & dropSafe)))
kingDanger += BishopSafeCheck;
else
unsafeChecks |= b2 & (attackedBy[Them][BISHOP] | h);
// Enemy knights checks
b = pos.attacks_from<KNIGHT>(ksq);
#ifdef CRAZYHOUSE
h = pos.is_house() && pos.count_in_hand<KNIGHT>(Them) ? ~pos.pieces() : 0;
#endif
if (b & ((attackedBy[Them][KNIGHT] & safe) | (h & dropSafe)))
kingDanger += KnightSafeCheck;
else
unsafeChecks |= b & (attackedBy[Them][KNIGHT] | h);
#ifdef CRAZYHOUSE
// Enemy pawn checks
if (pos.is_house())
{
constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH);
b = pos.attacks_from<PAWN>(ksq, Us);
h = pos.count_in_hand<PAWN>(Them) ? ~pos.pieces() : 0;
Bitboard pawn_moves = (attackedBy[Them][PAWN] & pos.pieces(Us)) | (shift<Down>(pos.pieces(Them, PAWN)) & ~pos.pieces());
if (b & ((pawn_moves & safe) | (h & dropSafe)))
kingDanger += PawnSafeCheck;
else
unsafeChecks |= b & (pawn_moves | h);
}
#endif
// Unsafe or occupied checking squares will also be considered, as long as
// the square is in the attacker's mobility area.
unsafeChecks &= mobilityArea[Them];
const auto KDP = KingDangerParams[pos.variant()];
kingDanger += kingAttackersCount[Them] * kingAttackersWeight[Them]
+ KDP[0] * kingAttacksCount[Them]
+ KDP[1] * popcount(kingRing[Us] & weak)
+ KDP[2] * popcount(pos.blockers_for_king(Us) | unsafeChecks)
+ KDP[3] * tropism * tropism / 4
+ KDP[4] * !pos.count<QUEEN>(Them)
+ KDP[5] * mg_value(score) / 8
+ mg_value(mobility[Them] - mobility[Us])
+ KDP[6];
#ifdef CRAZYHOUSE
if (pos.is_house())
{
kingDanger += KingDangerInHand[ALL_PIECES] * pos.count_in_hand<ALL_PIECES>(Them);
kingDanger += KingDangerInHand[PAWN] * pos.count_in_hand<PAWN>(Them);
kingDanger += KingDangerInHand[KNIGHT] * pos.count_in_hand<KNIGHT>(Them);
kingDanger += KingDangerInHand[BISHOP] * pos.count_in_hand<BISHOP>(Them);
kingDanger += KingDangerInHand[ROOK] * pos.count_in_hand<ROOK>(Them);
kingDanger += KingDangerInHand[QUEEN] * pos.count_in_hand<QUEEN>(Them);
h = pos.count_in_hand<QUEEN>(Them) ? weak & ~pos.pieces() : 0;
}
#endif
#ifdef ATOMIC
if (pos.is_atomic())
{
kingDanger += IndirectKingAttack * popcount(pos.attacks_from<KING>(pos.square<KING>(Us)) & pos.pieces(Us) & attackedBy[Them][ALL_PIECES]);
score -= make_score(100, 100) * popcount(attackedBy[Us][KING] & pos.pieces());
}
#endif
// Transform the kingDanger units into a Score, and subtract it from the evaluation
if (kingDanger > 0)
{
#ifdef THREECHECK
if (pos.is_three_check())
kingDanger = ThreeCheckKSFactors[pos.checks_given(Them)] * kingDanger / 256;
#endif
int v = kingDanger * kingDanger / 4096;
#ifdef ATOMIC
if (pos.is_atomic() && v > QueenValueMg)
v = QueenValueMg;
#endif
#ifdef CRAZYHOUSE
if (pos.is_house() && Us == pos.side_to_move())
v -= v / 10;
if (pos.is_house() && v > QueenValueMg)
v = QueenValueMg;
#endif
#ifdef THREECHECK
if (pos.is_three_check() && v > QueenValueMg)
v = QueenValueMg;
#endif
score -= make_score(v, kingDanger / 16 + KDP[7] * v / 256);
}
}
// Penalty when our king is on a pawnless flank
if (!(pos.pieces(PAWN) & kingFlank))
score -= PawnlessFlank;
// King tropism bonus, to anticipate slow motion attacks on our king
score -= CloseEnemies[pos.variant()] * tropism;
if (T)
Trace::add(KING, Us, score);
return score;
}
// Evaluation::threats() assigns bonuses according to the types of the
// attacking and the attacked pieces.
template<Tracing T> template<Color Us>
Score Evaluation<T>::threats() const {
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH);
constexpr Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB);
Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safe, restricted;
Score score = SCORE_ZERO;
#ifdef ANTI
if (pos.is_anti())
{
constexpr Bitboard TRank2BB = (Us == WHITE ? Rank2BB : Rank7BB);
bool weCapture = attackedBy[Us][ALL_PIECES] & pos.pieces(Them);
bool theyCapture = attackedBy[Them][ALL_PIECES] & pos.pieces(Us);
// Penalties for possible captures
if (weCapture)
{
// Penalty if we only attack unprotected pieces
bool theyDefended = attackedBy[Us][ALL_PIECES] & pos.pieces(Them) & attackedBy[Them][ALL_PIECES];
for (PieceType pt = PAWN; pt <= KING; ++pt)
{
if (attackedBy[Us][pt] & pos.pieces(Them) & ~attackedBy2[Us])
score -= AttacksAnti[theyCapture][theyDefended][pt];
else if (attackedBy[Us][pt] & pos.pieces(Them))
score -= AttacksAnti[theyCapture][theyDefended][NO_PIECE_TYPE];
}
// If both colors attack pieces, increase penalty with piece count
if (theyCapture)
score -= PieceCountAnti * pos.count<ALL_PIECES>(Us);
}
// Bonus if we threaten to force captures (ignoring possible discoveries)
if (!weCapture || theyCapture)
{
b = pos.pieces(Us, PAWN);
Bitboard pawnPushes = shift<Up>(b | (shift<Up>(b & TRank2BB) & ~pos.pieces())) & ~pos.pieces();
Bitboard pieceMoves = (attackedBy[Us][KNIGHT] | attackedBy[Us][BISHOP] | attackedBy[Us][ROOK]
| attackedBy[Us][QUEEN] | attackedBy[Us][KING]) & ~pos.pieces();
Bitboard unprotectedPawnPushes = pawnPushes & ~attackedBy[Us][ALL_PIECES];
Bitboard unprotectedPieceMoves = pieceMoves & ~attackedBy2[Us];
score += ThreatsAnti[0] * popcount(attackedBy[Them][ALL_PIECES] & (pawnPushes | pieceMoves));
score += ThreatsAnti[1] * popcount(attackedBy[Them][ALL_PIECES] & (unprotectedPawnPushes | unprotectedPieceMoves));
}
nonPawnEnemies = 0;
stronglyProtected = 0;
}
else
#endif
#ifdef ATOMIC
if (pos.is_atomic())
{
Bitboard attacks = pos.pieces(Them) & attackedBy[Us][ALL_PIECES] & ~attackedBy[Us][KING];
while (attacks)
{
Square s = pop_lsb(&attacks);
Bitboard blast = (pos.attacks_from<KING>(s) & (pos.pieces() ^ pos.pieces(PAWN))) | s;
int count = popcount(blast & pos.pieces(Them)) - popcount(blast & pos.pieces(Us)) - 1;
if (blast & pos.pieces(Them, QUEEN))
count++;
if ((blast & pos.pieces(Us, QUEEN)) || ((attackedBy[Us][QUEEN] & s) & ~attackedBy2[Us]))
count--;
score += std::max(SCORE_ZERO, ThreatByBlast * count);
}
nonPawnEnemies = 0;
stronglyProtected = 0;
}
else
#endif
#ifdef GRID
if (pos.is_grid()) {} else
#endif
#ifdef LOSERS
if (pos.is_losers())
{
constexpr Bitboard TRank2BB = (Us == WHITE ? Rank2BB : Rank7BB);
bool weCapture = attackedBy[Us][ALL_PIECES] & pos.pieces(Them);
bool theyCapture = attackedBy[Them][ALL_PIECES] & pos.pieces(Us);
// Penalties for possible captures
if (weCapture)
{
// Penalty if we only attack unprotected pieces
bool theyDefended = attackedBy[Us][ALL_PIECES] & pos.pieces(Them) & attackedBy[Them][ALL_PIECES];
for (PieceType pt = PAWN; pt <= KING; ++pt)
{
if (attackedBy[Us][pt] & pos.pieces(Them) & ~attackedBy2[Us])
score -= AttacksLosers[theyCapture][theyDefended][pt];
else if (attackedBy[Us][pt] & pos.pieces(Them))
score -= AttacksLosers[theyCapture][theyDefended][NO_PIECE_TYPE];
}
}
// Bonus if we threaten to force captures (ignoring possible discoveries)
if (!weCapture || theyCapture)
{
b = pos.pieces(Us, PAWN);
Bitboard pawnPushes = shift<Up>(b | (shift<Up>(b & TRank2BB) & ~pos.pieces())) & ~pos.pieces();
Bitboard pieceMoves = (attackedBy[Us][KNIGHT] | attackedBy[Us][BISHOP] | attackedBy[Us][ROOK]
| attackedBy[Us][QUEEN] | attackedBy[Us][KING]) & ~pos.pieces();
Bitboard unprotectedPawnPushes = pawnPushes & ~attackedBy[Us][ALL_PIECES];
Bitboard unprotectedPieceMoves = pieceMoves & ~attackedBy2[Us];
score += ThreatsLosers[0] * popcount(attackedBy[Them][ALL_PIECES] & (pawnPushes | pieceMoves));
score += ThreatsLosers[1] * popcount(attackedBy[Them][ALL_PIECES] & (unprotectedPawnPushes | unprotectedPieceMoves));
}
nonPawnEnemies = 0;
stronglyProtected = 0;
}
else
#endif
{
// Non-pawn enemies
nonPawnEnemies = pos.pieces(Them) ^ pos.pieces(Them, PAWN);
// Squares strongly protected by the enemy, either because they defend the
// square with a pawn, or because they defend the square twice and we don't.
stronglyProtected = attackedBy[Them][PAWN]
| (attackedBy2[Them] & ~attackedBy2[Us]);
// Non-pawn enemies, strongly protected
defended = nonPawnEnemies & stronglyProtected;
// Enemies not strongly protected and under our attack
weak = pos.pieces(Them) & ~stronglyProtected & attackedBy[Us][ALL_PIECES];
// Safe or protected squares
safe = ~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES];
// Bonus according to the kind of attacking pieces
if (defended | weak)
{
b = (defended | weak) & (attackedBy[Us][KNIGHT] | attackedBy[Us][BISHOP]);
while (b)
{
Square s = pop_lsb(&b);
score += ThreatByMinor[type_of(pos.piece_on(s))];
if (type_of(pos.piece_on(s)) != PAWN)
score += ThreatByRank * (int)relative_rank(Them, s);
}
b = weak & attackedBy[Us][ROOK];
while (b)
{
Square s = pop_lsb(&b);
score += ThreatByRook[type_of(pos.piece_on(s))];
if (type_of(pos.piece_on(s)) != PAWN)
score += ThreatByRank * (int)relative_rank(Them, s);
}
if (weak & attackedBy[Us][KING])
score += ThreatByKing;
b = ~attackedBy[Them][ALL_PIECES]
| (nonPawnEnemies & attackedBy2[Us]);
score += Hanging * popcount(weak & b);
}
// Bonus for restricting their piece moves
restricted = attackedBy[Them][ALL_PIECES]
& ~attackedBy[Them][PAWN]
& ~attackedBy2[Them]
& attackedBy[Us][ALL_PIECES];
score += RestrictedPiece * popcount(restricted);
// Bonus for enemy unopposed weak pawns
if (pos.pieces(Us, ROOK, QUEEN))
score += WeakUnopposedPawn * pe->weak_unopposed(Them);
// Find squares where our pawns can push on the next move
b = shift<Up>(pos.pieces(Us, PAWN)) & ~pos.pieces();
b |= shift<Up>(b & TRank3BB) & ~pos.pieces();
// Keep only the squares which are relatively safe
b &= ~attackedBy[Them][PAWN] & safe;
// Bonus for safe pawn threats on the next move
b = pawn_attacks_bb<Us>(b) & pos.pieces(Them);
score += ThreatByPawnPush * popcount(b);
// Our safe or protected pawns
b = pos.pieces(Us, PAWN) & safe;
b = pawn_attacks_bb<Us>(b) & nonPawnEnemies;
score += ThreatBySafePawn * popcount(b);
// Bonus for threats on the next moves against enemy queen
#ifdef CRAZYHOUSE
if ((pos.is_house() ? pos.count<QUEEN>(Them) - pos.count_in_hand<QUEEN>(Them) : pos.count<QUEEN>(Them)) == 1)
#else
if (pos.count<QUEEN>(Them) == 1)
#endif
{
Square s = pos.square<QUEEN>(Them);
safe = mobilityArea[Us] & ~stronglyProtected;
b = attackedBy[Us][KNIGHT] & pos.attacks_from<KNIGHT>(s);
score += KnightOnQueen * popcount(b & safe);
b = (attackedBy[Us][BISHOP] & pos.attacks_from<BISHOP>(s))
| (attackedBy[Us][ROOK ] & pos.attacks_from<ROOK >(s));
score += SliderOnQueen * popcount(b & safe & attackedBy2[Us]);
}
}
if (T)
Trace::add(THREAT, Us, score);
return score;
}
// Evaluation::passed() evaluates the passed pawns and candidate passed
// pawns of the given color.
template<Tracing T> template<Color Us>
Score Evaluation<T>::passed() const {
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH);
auto king_proximity = [&](Color c, Square s) {
return std::min(distance(pos.square<KING>(c), s), 5);
};
Bitboard b, bb, squaresToQueen, defendedSquares, unsafeSquares;
Score score = SCORE_ZERO;
b = pe->passed_pawns(Us);
while (b)
{
Square s = pop_lsb(&b);
assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up)));
int r = relative_rank(Us, s);
Score bonus = PassedRank[pos.variant()][r];
#ifdef GRID
if (pos.is_grid()) {} else
#endif
if (r > RANK_3)
{
int w = (r-2) * (r-2) + 2;
Square blockSq = s + Up;
#ifdef HORDE
if (pos.is_horde())
{
// Assume a horde king distance of approximately 5
if (pos.is_horde_color(Us))
bonus += make_score(0, king_proximity(Them, blockSq) * 5 * w);
else
bonus += make_score(0, 15 * w);
}
else
#endif
#ifdef PLACEMENT
if (pos.is_placement() && pos.count_in_hand<KING>(Us))
bonus += make_score(0, 15 * w);
else
#endif
#ifdef ANTI
if (pos.is_anti()) {} else
#endif
#ifdef ATOMIC
if (pos.is_atomic())
bonus += make_score(0, king_proximity(Them, blockSq) * 5 * w);
else
#endif
{
// Adjust bonus based on the king's proximity
bonus += make_score(0, ( king_proximity(Them, blockSq) * 5
- king_proximity(Us, blockSq) * 2) * w);
// If blockSq is not the queening square then consider also a second push
if (r != RANK_7)
bonus -= make_score(0, king_proximity(Us, blockSq + Up) * w);
}
// If the pawn is free to advance, then increase the bonus
if (pos.empty(blockSq))
{
// If there is a rook or queen attacking/defending the pawn from behind,
// consider all the squaresToQueen. Otherwise consider only the squares
// in the pawn's path attacked or occupied by the enemy.
defendedSquares = unsafeSquares = squaresToQueen = forward_file_bb(Us, s);
bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN) & pos.attacks_from<ROOK>(s);
if (!(pos.pieces(Us) & bb))
defendedSquares &= attackedBy[Us][ALL_PIECES];
if (!(pos.pieces(Them) & bb))
unsafeSquares &= attackedBy[Them][ALL_PIECES] | pos.pieces(Them);
// If there aren't any enemy attacks, assign a big bonus. Otherwise
// assign a smaller bonus if the block square isn't attacked.
int k = !unsafeSquares ? 20 : !(unsafeSquares & blockSq) ? 9 : 0;
// If the path to the queen is fully defended, assign a big bonus.
// Otherwise assign a smaller bonus if the block square is defended.
if (defendedSquares == squaresToQueen)
k += 6;
else if (defendedSquares & blockSq)
k += 4;
bonus += make_score(k * w, k * w);
}
} // rank > RANK_3
// Scale down bonus for candidate passers which need more than one
// pawn push to become passed, or have a pawn in front of them.
if ( !pos.pawn_passed(Us, s + Up)
|| (pos.pieces(PAWN) & forward_file_bb(Us, s)))
bonus = bonus / 2;
score += bonus + PassedFile[file_of(s)];
}
if (T)
Trace::add(PASSED, Us, score);
return score;
}
// Evaluation::space() computes the space evaluation for a given side. The
// space evaluation is a simple bonus based on the number of safe squares
// available for minor pieces on the central four files on ranks 2--4. Safe
// squares one, two or three squares behind a friendly pawn are counted
// twice. Finally, the space bonus is multiplied by a weight. The aim is to
// improve play on game opening.
template<Tracing T> template<Color Us>
Score Evaluation<T>::space() const {
if (pos.non_pawn_material() < SpaceThreshold[pos.variant()])
return SCORE_ZERO;
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
constexpr Bitboard SpaceMask =
Us == WHITE ? CenterFiles & (Rank2BB | Rank3BB | Rank4BB)
: CenterFiles & (Rank7BB | Rank6BB | Rank5BB);
// Find the available squares for our pieces inside the area defined by SpaceMask
Bitboard safe = SpaceMask
& ~pos.pieces(Us, PAWN)
& ~attackedBy[Them][PAWN];
// Find all squares which are at most three squares behind some friendly pawn
Bitboard behind = pos.pieces(Us, PAWN);
behind |= (Us == WHITE ? behind >> 8 : behind << 8);
behind |= (Us == WHITE ? behind >> 16 : behind << 16);
int bonus = popcount(safe) + popcount(behind & safe);
int weight = pos.count<ALL_PIECES>(Us) - 2 * pe->open_files();
Score score = make_score(bonus * weight * weight / 16, 0);
#ifdef KOTH
if (pos.is_koth())
score += KothSafeCenter * popcount(behind & safe & Center);
#endif
if (T)
Trace::add(SPACE, Us, score);
return score;
}
// Evaluation::variant() computes variant-specific evaluation terms.
template<Tracing T> template<Color Us>
Score Evaluation<T>::variant() const {
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
Score score = SCORE_ZERO;
#ifdef HORDE
if (pos.is_horde() && pos.is_horde_color(Them))
{
// Add a bonus according to how close we are to breaking through the pawn wall
if (pos.pieces(Us, ROOK) | pos.pieces(Us, QUEEN))
{
int dist = 8;
if ((attackedBy[Us][QUEEN] | attackedBy[Us][ROOK]) & rank_bb(relative_rank(Us, RANK_8)))
dist = 0;
else
{
for (File f = FILE_A; f <= FILE_H; ++f)
{
int pawns = popcount(pos.pieces(Them, PAWN) & file_bb(f));
int pawnsl = f > FILE_A ? std::min(popcount(pos.pieces(Them, PAWN) & FileBB[f - 1]), pawns) : 0;
int pawnsr = f < FILE_H ? std::min(popcount(pos.pieces(Them, PAWN) & FileBB[f + 1]), pawns) : 0;
dist = std::min(dist, pawnsl + pawnsr);
}
}
score += make_score(71, 61) * pos.count<PAWN>(Them) / (1 + dist) / (pos.pieces(Us, QUEEN) ? 2 : 4);
}
}
#endif
#ifdef KOTH
if (pos.is_koth())
{
constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH);
Bitboard pinned = pos.blockers_for_king(Them) & pos.pieces(Them);
Bitboard center = Center;
while (center)
{
Square s = pop_lsb(¢er);
int dist = distance(pos.square<KING>(Us), s)
+ ((pinned || (attackedBy[Them][ALL_PIECES] & s)) ? popcount(pos.attackers_to(s) & pos.pieces(Them)) : 0)
+ !!(pos.pieces(Us) & s)
+ !!(shift<Up>(pos.pieces(Us, PAWN) & s) & pos.pieces(Them, PAWN));
assert(dist > 0);
score += KothDistanceBonus[std::min(dist - 1, 5)];
}
}
#endif
#ifdef RACE
if (pos.is_race())
{
Square ksq = pos.square<KING>(Us);
int s = relative_rank(BLACK, ksq);
for (Rank kr = rank_of(ksq), r = Rank(kr + 1); r <= RANK_8; ++r)
if (!(rank_bb(r) & DistanceRingBB[ksq][r - kr] & ~attackedBy[Them][ALL_PIECES]))
s++;
score += KingRaceBonus[std::min(s, 7)];
}
#endif
#ifdef THREECHECK
if (pos.is_three_check())
score += ChecksGivenBonus[pos.checks_given(Us)];
#endif
if (T)
Trace::add(VARIANT, Us, score);
return score;
}
// Evaluation::initiative() computes the initiative correction value
// for the position. It is a second order bonus/malus based on the
// known attacking/defending status of the players.
template<Tracing T>
Score Evaluation<T>::initiative(Value eg) const {
#ifdef ANTI
if (pos.is_anti())
return SCORE_ZERO;
#endif
#ifdef HORDE
if (pos.is_horde())
return SCORE_ZERO;
#endif
#ifdef PLACEMENT
if (pos.is_placement() && (pos.count_in_hand<KING>(WHITE) || pos.count_in_hand<KING>(BLACK)))
return SCORE_ZERO;
#endif
int outflanking = distance<File>(pos.square<KING>(WHITE), pos.square<KING>(BLACK))
- distance<Rank>(pos.square<KING>(WHITE), pos.square<KING>(BLACK));
bool pawnsOnBothFlanks = (pos.pieces(PAWN) & QueenSide)
&& (pos.pieces(PAWN) & KingSide);
// Compute the initiative bonus for the attacking side
int complexity = 8 * pe->pawn_asymmetry()
+ 12 * pos.count<PAWN>()
+ 12 * outflanking
+ 16 * pawnsOnBothFlanks
+ 48 * !pos.non_pawn_material()
-118 ;
// Now apply the bonus: note that we find the attacking side by extracting
// the sign of the endgame value, and that we carefully cap the bonus so
// that the endgame score will never change sign after the bonus.
int v = ((eg > 0) - (eg < 0)) * std::max(complexity, -abs(eg));
if (T)
Trace::add(INITIATIVE, make_score(0, v));
return make_score(0, v);
}
// Evaluation::scale_factor() computes the scale factor for the winning side
template<Tracing T>
ScaleFactor Evaluation<T>::scale_factor(Value eg) const {
Color strongSide = eg > VALUE_DRAW ? WHITE : BLACK;
int sf = me->scale_factor(pos, strongSide);
#ifdef ATOMIC
if (pos.is_atomic()) {} else
#endif
#ifdef HORDE
if (pos.is_horde() && pos.is_horde_color(~strongSide))
{
if (pos.non_pawn_material(~strongSide) >= QueenValueMg)
sf = ScaleFactor(10);
}
else
#endif
#ifdef GRID
if (pos.is_grid() && pos.non_pawn_material(strongSide) <= RookValueMg)
sf = 10;
else
#endif
// If scale is not already specific, scale down the endgame via general heuristics
if (sf == SCALE_FACTOR_NORMAL)
{
if ( pos.opposite_bishops()
&& pos.non_pawn_material(WHITE) == BishopValueMg
&& pos.non_pawn_material(BLACK) == BishopValueMg)
sf = 8 + 4 * pe->pawn_asymmetry();
else
sf = std::min(40 + (pos.opposite_bishops() ? 2 : 7) * pos.count<PAWN>(strongSide), sf);
}
return ScaleFactor(sf);
}
// Evaluation::value() is the main function of the class. It computes the various
// parts of the evaluation and returns the value of the position from the point
// of view of the side to move.
template<Tracing T>
Value Evaluation<T>::value() {
assert(!pos.checkers());
if (pos.is_variant_end())
return pos.variant_result();
// Probe the material hash table
me = Material::probe(pos);
// If we have a specialized evaluation function for the current material
// configuration, call it and return.
if (me->specialized_eval_exists())
return me->evaluate(pos);
// Initialize score by reading the incrementally updated scores included in
// the position object (material + piece square tables) and the material
// imbalance. Score is computed internally from the white point of view.
Score score = pos.psq_score() + me->imbalance() + pos.this_thread()->contempt;
// Probe the pawn hash table
pe = Pawns::probe(pos);
score += pe->pawn_score(WHITE) - pe->pawn_score(BLACK);
// Early exit if score is high
Value v = (mg_value(score) + eg_value(score)) / 2;
if (pos.variant() == CHESS_VARIANT)
{
if (abs(v) > LazyThreshold)
return pos.side_to_move() == WHITE ? v : -v;
}
// Main evaluation begins here
initialize<WHITE>();
initialize<BLACK>();
// Pieces should be evaluated first (populate attack tables)
score += pieces<WHITE, KNIGHT>() - pieces<BLACK, KNIGHT>()
+ pieces<WHITE, BISHOP>() - pieces<BLACK, BISHOP>()
+ pieces<WHITE, ROOK >() - pieces<BLACK, ROOK >()
+ pieces<WHITE, QUEEN >() - pieces<BLACK, QUEEN >();
#ifdef CRAZYHOUSE
if (pos.is_house()) {
// Positional bonus for potential drop points - unoccupied squares in enemy territory that are not attacked by enemy non-KQ pieces
mobility[WHITE] += DropMobilityBonus * popcount(~(attackedBy[BLACK][PAWN] | attackedBy[BLACK][KNIGHT] | attackedBy[BLACK][BISHOP] | attackedBy[BLACK][ROOK] | pos.pieces() | Rank1234BB));
mobility[BLACK] += DropMobilityBonus * popcount(~(attackedBy[WHITE][PAWN] | attackedBy[WHITE][KNIGHT] | attackedBy[WHITE][BISHOP] | attackedBy[WHITE][ROOK] | pos.pieces() | Rank5678BB));
}
#endif
score += mobility[WHITE] - mobility[BLACK];
score += king< WHITE>() - king< BLACK>()
+ threats<WHITE>() - threats<BLACK>()
+ passed< WHITE>() - passed< BLACK>()
+ space< WHITE>() - space< BLACK>();
if (pos.variant() != CHESS_VARIANT)
score += variant<WHITE>() - variant<BLACK>();
score += initiative(eg_value(score));
// Interpolate between a middlegame and a (scaled by 'sf') endgame score
ScaleFactor sf = scale_factor(eg_value(score));
v = mg_value(score) * int(me->game_phase())
+ eg_value(score) * int(PHASE_MIDGAME - me->game_phase()) * sf / SCALE_FACTOR_NORMAL;
v /= int(PHASE_MIDGAME);
// In case of tracing add all remaining individual evaluation terms
if (T)
{
Trace::add(MATERIAL, pos.psq_score());
Trace::add(IMBALANCE, me->imbalance());
Trace::add(PAWN, pe->pawn_score(WHITE), pe->pawn_score(BLACK));
Trace::add(MOBILITY, mobility[WHITE], mobility[BLACK]);
Trace::add(TOTAL, score);
}
return (pos.side_to_move() == WHITE ? v : -v) // Side to move point of view
+ Eval::Tempo[pos.variant()];
}
} // namespace
/// evaluate() is the evaluator for the outer world. It returns a static
/// evaluation of the position from the point of view of the side to move.
Value Eval::evaluate(const Position& pos) {
return Evaluation<NO_TRACE>(pos).value();
}
/// trace() is like evaluate(), but instead of returning a value, it returns
/// a string (suitable for outputting to stdout) that contains the detailed
/// descriptions and values of each evaluation term. Useful for debugging.
std::string Eval::trace(const Position& pos) {
std::memset(scores, 0, sizeof(scores));
pos.this_thread()->contempt = SCORE_ZERO; // Reset any dynamic contempt
Value v = Evaluation<TRACE>(pos).value();
v = pos.side_to_move() == WHITE ? v : -v; // Trace scores are from white's point of view
std::stringstream ss;
ss << std::showpoint << std::noshowpos << std::fixed << std::setprecision(2)
<< " Term | White | Black | Total \n"
<< " | MG EG | MG EG | MG EG \n"
<< " ------------+-------------+-------------+------------\n"
<< " Material | " << Term(MATERIAL)
<< " Imbalance | " << Term(IMBALANCE)
<< " Initiative | " << Term(INITIATIVE)
<< " Pawns | " << Term(PAWN)
<< " Knights | " << Term(KNIGHT)
<< " Bishops | " << Term(BISHOP)
<< " Rooks | " << Term(ROOK)
<< " Queens | " << Term(QUEEN)
<< " Mobility | " << Term(MOBILITY)
<< " King safety | " << Term(KING)
<< " Threats | " << Term(THREAT)
<< " Passed | " << Term(PASSED)
<< " Space | " << Term(SPACE)
<< " Variant | " << Term(VARIANT)
<< " ------------+-------------+-------------+------------\n"
<< " Total | " << Term(TOTAL);
ss << "\nTotal evaluation: " << to_cp(v) << " (white side)\n";
return ss.str();
}
| {
"pile_set_name": "Github"
} |
#ifndef KABSCH_RMSD
#define KABSCH_RMSD
#include <valarray>
#include <cblas.h>
#include <lapacke.h>
namespace kabsch
{
template <class M>
double rmsd(
const M P,
const M Q)
{
double rmsd {0.0};
const unsigned int D {3};
const unsigned int size = P.size();
const unsigned int N = size / D;
for(unsigned int i = 0; i < size; ++i) {
rmsd += (P[i] - Q[i])*(P[i] - Q[i]);
}
return sqrt(rmsd/N);
}
template <class M>
M centroid(M coordinates)
{
double x {0};
double y {0};
double z {0};
unsigned int size = coordinates.size();
unsigned int n_atoms = size / 3;
unsigned int i = 0;
while(i<size)
{
x += coordinates[i++];
y += coordinates[i++];
z += coordinates[i++];
}
x /= n_atoms;
y /= n_atoms;
z /= n_atoms;
return M {x, y, z};
}
template <class Matrix>
Matrix multiply(Matrix A, Matrix B,
const int M,
const int N,
const int K)
{
double one = 1.0;
Matrix C(M*N);
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,
M, N, K, one,
begin(A), K,
begin(B), N, 1.0,
begin(C), N);
return C;
}
template <class Matrix>
Matrix transpose_multiply(Matrix A, Matrix B,
const int M,
const int N,
const int K)
{
double one = 1.0;
Matrix C(M*N);
cblas_dgemm(CblasRowMajor, CblasTrans, CblasNoTrans,
M, N, K, one,
begin(A), M,
begin(B), N, one,
begin(C), N);
return C;
}
template <class Matrix>
std::tuple<Matrix, Matrix, Matrix> matrix_svd(Matrix A, int rows, int cols)
{
// lapack_int LAPACKE_dgesvd( int matrix_layout, char jobu, char jobvt,
// lapack_int m, lapack_int n,
// double* a, lapack_int lda,
// double* s, double* u, lapack_int ldu,
// double* vt, lapack_int ldvt,
// double* superb );
Matrix U(cols*rows);
Matrix S(rows);
Matrix VT(cols*rows);
Matrix superb(cols*rows);
int info;
info = LAPACKE_dgesvd(LAPACK_ROW_MAJOR, 'A', 'A',
rows, cols,
begin(A), rows,
begin(S),
begin(U), rows,
begin(VT), rows,
begin(superb));
// TODO check if SVD is unconverged
if(info > 0)
{
// Failed
}
return make_tuple(U, S, VT);
}
template <class M>
double determinant3x3(M A)
{
// determinant of a square 3x3 matrix
double det = A[0]*A[4]*A[8]
+A[1]*A[5]*A[6]
+A[2]*A[3]*A[7]
-A[2]*A[4]*A[6]
-A[1]*A[3]*A[8]
-A[0]*A[5]*A[7];
return det;
}
template <class M, class T>
M kabsch(M P, M Q, const T n_atoms)
{
// const unsigned int L = P.size();
// const unsigned int D = 3;
M U;
M V;
M S;
M C = transpose_multiply(P, Q, 3, 3, n_atoms);
tie(U, S, V) = matrix_svd(C, 3, 3);
// Getting the sign of the det(U)*(V) to decide whether we need to correct
// our rotation matrix to ensure a right-handed coordinate system.
if(determinant3x3(U)*determinant3x3(V) < 0.0)
{
// TODO More numpy'ish way to do this?
U[std::slice( 2, 3, 3 )] = M({-U[3*0+2], -U[3*1+2], -U[3*2+2]});
}
M rotation = multiply(U, V, 3, 3, 3);
return rotation;
}
template <class M, class T>
M kabsch_rotate(
const M P,
const M Q,
const T n_atoms)
{
M U = kabsch(P, Q, n_atoms);
M product = multiply(P, U, n_atoms, 3, 3);
return product;
}
template <class M, class T>
double kabsch_rmsd(
const M P,
const M Q,
const T n_atoms)
{
M P_rotated = kabsch_rotate(P, Q, n_atoms);
return rmsd(P_rotated, Q);
}
} // namespace rmsd
#endif
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.tiia.v20190529.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class RegionDetected extends AbstractModel{
/**
* 商品的品类预测结果。
包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
*/
@SerializedName("Category")
@Expose
private String Category;
/**
* 商品品类预测的置信度
*/
@SerializedName("CategoryScore")
@Expose
private Float CategoryScore;
/**
* 检测到的主体在图片中的坐标,表示为矩形框的四个顶点坐标
*/
@SerializedName("Location")
@Expose
private Location Location;
/**
* Get 商品的品类预测结果。
包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
* @return Category 商品的品类预测结果。
包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
*/
public String getCategory() {
return this.Category;
}
/**
* Set 商品的品类预测结果。
包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
* @param Category 商品的品类预测结果。
包含:鞋、图书音像、箱包、美妆个护、服饰、家电数码、玩具乐器、食品饮料、珠宝、家居家装、药品、酒水、绿植园艺、其他商品、非商品等。
*/
public void setCategory(String Category) {
this.Category = Category;
}
/**
* Get 商品品类预测的置信度
* @return CategoryScore 商品品类预测的置信度
*/
public Float getCategoryScore() {
return this.CategoryScore;
}
/**
* Set 商品品类预测的置信度
* @param CategoryScore 商品品类预测的置信度
*/
public void setCategoryScore(Float CategoryScore) {
this.CategoryScore = CategoryScore;
}
/**
* Get 检测到的主体在图片中的坐标,表示为矩形框的四个顶点坐标
* @return Location 检测到的主体在图片中的坐标,表示为矩形框的四个顶点坐标
*/
public Location getLocation() {
return this.Location;
}
/**
* Set 检测到的主体在图片中的坐标,表示为矩形框的四个顶点坐标
* @param Location 检测到的主体在图片中的坐标,表示为矩形框的四个顶点坐标
*/
public void setLocation(Location Location) {
this.Location = Location;
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "Category", this.Category);
this.setParamSimple(map, prefix + "CategoryScore", this.CategoryScore);
this.setParamObj(map, prefix + "Location.", this.Location);
}
}
| {
"pile_set_name": "Github"
} |
---
title: ColorPicker
subtitle: 颜色选择器
path: component/colorpicker
group: 数据
---
## ColorPicker 颜色选择器
用于颜色选择,支持多种格式。
### API
#### ColorPicker
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
| ------------- | ------------------- | ------------------- | ----------- | --------- |
| color | 颜色选择器的颜色 | string | | `'#5197FF'` 或 `'rgba(81, 151, 255, 0.6)'` |
| showAlpha | 是否显示透明度选择 | bool | `false` | `true/false` |
| type | 颜色选择器类型 | string | `'default'` | `'default'`、`'simple'` |
| presetColors | 简化版自定义颜色数组 | array | [`'#FFFFFF'`, `'#F8F8F8'`, `'#F2F2F2'`, `'#999999'`, `'#444444'`, `'#FF4444'`, `'#FF6500'`, `'#FF884D'`, `'#FFCD00'`, `'#3FBD00'`, `'#3FBC87'`, `'#00CD98'`, `'#5197FF'`, `'#BADCFF'`, `'#FFEFB8'`] | |
| onChange | 颜色变化时回调函数 | func(color) | `noop` | |
| className | 可选,自定义类名 | string | `''` | |
| wrapperClassName | 可选,自定义trigger包裹节点的类名 | string | `''` | |
| disabled | 可选,禁用状态 | bool | - | |
#### ColorBoard
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
| ------------- | ------------------- | ------------------- | ----------- | --------- |
| color | 颜色选择器的颜色 | string | | `'#5197FF'` 或 `'rgba(81, 151, 255, 0.6)'` |
| showAlpha | 是否显示透明度选择 | bool | `false` | `true/false` |
| onChange | 颜色变化时回调函数 | func(color) | `noop` | |
| className | 可选,自定义类名 | string | `''` | |
| {
"pile_set_name": "Github"
} |
/*
Copyright© (c) 2017-2020 S.Gray, (aka PiezPiedPy).
Copyright© (c) 2017-2018 A.Korsunsky, (aka fat-lobyte).
This file is part of Trajectories.
Trajectories is available under the terms of GPL-3.0-or-later.
See the LICENSE.md file for more details.
Trajectories is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Trajectories 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.
You should have received a copy of the GNU General Public License
along with Trajectories. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Diagnostics;
#if DEBUG_PROFILER
using System;
using System.Collections.Generic;
using KSP.Localization;
using UnityEngine;
using UnityEngine.Events;
#endif
namespace Trajectories
{
#if !DEBUG_PROFILER
/// <summary> Simple profiler for measuring the execution time of code placed between the Start and Stop methods. </summary>
public sealed class Profiler
{
#endif
#if DEBUG_PROFILER
/// <summary> Simple profiler for measuring the execution time of code placed between the Start and Stop methods. </summary>
[KSPAddon(KSPAddon.Startup.Flight, false)]
public sealed class Profiler : MonoBehaviour
{
// constants
private const float width = 550.0f;
private const float height = 500.0f;
private const float value_width = 75.0f;
// visible flag
private static bool visible = false;
private static bool show_zero = false;
// popup window
private static MultiOptionDialog multi_dialog;
private static PopupDialog popup_dialog;
private static DialogGUIScrollList scroll_list;
private static DialogGUIVerticalLayout dialog_items;
// an entry in the profiler
private class Entry
{
public double start; // used to measure call time
public long calls; // number of calls in current simulation step
public double time; // time in current simulation step
public long prev_calls; // number of calls in previous simulation step
public double prev_time; // time in previous simulation step
public long tot_calls; // number of calls in total used for avg calculation
public double tot_time; // total time used for avg calculation
public string last_txt = ""; // last call time display string
public string avg_txt = ""; // average call time display string
public string calls_txt = ""; // number of calls display string
public string avg_calls_txt = ""; // number of average calls display string
}
// store all entries
private static readonly Dictionary<string, Entry> entries = new Dictionary<string, Entry>();
private static readonly List<string> channels = new List<string>();
// display update timer
private const double UPDATE_FPS = 5.0; // Frames per second the entry value display will update.
private static double update_timer = Util.Clocks;
private static readonly double timeout = Stopwatch.Frequency / UPDATE_FPS;
private static long tot_frames = 0; // total physics frames used for avg calculation
private static string tot_frames_txt = ""; // total physics frames display string
private static bool Ready => (multi_dialog != null && popup_dialog && scroll_list != null);
// constructor
static Profiler()
{
// create window
dialog_items = new DialogGUIVerticalLayout();
scroll_list = new DialogGUIScrollList(new Vector2(), false, true, dialog_items);
multi_dialog = new MultiOptionDialog(
"TrajectoriesProfilerWindow",
"",
GetTitle(),
HighLogic.UISkin,
new Rect(0.5f, 0.5f, width, height),
new DialogGUIBase[]
{
new DialogGUIVerticalLayout(false, false, 0, new RectOffset(), TextAnchor.UpperCenter,
// create average reset and show zero calls buttons
new DialogGUIHorizontalLayout(false, false,
new DialogGUIButton(Localizer.Format("#autoLOC_900305"),
OnButtonClick_Reset, () => true, 75, 25, false),
new DialogGUIToggle(() => { return show_zero; },"Show zero calls", OnButtonClick_ShowZero),
new DialogGUILabel(() => { return tot_frames_txt; }, value_width + 50f)),
// create header line
new DialogGUIHorizontalLayout(
new DialogGUILabel("<b> NAME</b>", true),
new DialogGUILabel("<b>LAST</b>", value_width),
new DialogGUILabel("<b>AVG</b>", value_width),
new DialogGUILabel("<b>CALLS</b>", value_width - 15f),
new DialogGUILabel("<b>AVG</b>", value_width - 10f))),
// create scrollbox for entry data
scroll_list
});
}
// Awake is called only once when the script instance is being loaded. Used in place of the constructor for initialization.
public void Awake() => SpawnDialog();
#if PROFILER_TELEMETRY
public void Start() => ConstructTelemetry();
#endif
private static void SpawnDialog()
{
if (multi_dialog != null)
{
ClampToScreen();
// create popup dialog
popup_dialog = PopupDialog.SpawnPopupDialog(multi_dialog, false, HighLogic.UISkin, false, "");
popup_dialog.onDestroy.AddListener(new UnityAction(OnPopupDialogDestroy));
scroll_list.children.Add(new DialogGUIVerticalLayout());
}
}
public void Update()
{
if (Util.IsPaused)
return;
// skip calculations for a smoother display
#if PROFILER_TELEMETRY
if ((Util.Clocks - update_timer) > (Stopwatch.Frequency / 25d)) // samples at 25 fps
{
update_timer = Util.Clocks;
Calculate();
}
#else
if (((Util.Clocks - update_timer) > timeout) && visible)
{
update_timer = Util.Clocks;
Calculate();
}
#endif
// hide or show the dialog box
if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) && Input.GetKeyUp(KeyCode.P))
visible = !visible;
if (visible)
{
if (popup_dialog == null)
SpawnDialog();
popup_dialog.gameObject.SetActive(true);
}
else if (popup_dialog != null)
{
popup_dialog.gameObject.SetActive(false);
}
}
private static void Calculate()
{
if (entries == null)
return;
foreach (KeyValuePair<string, Entry> p in entries)
{
Entry e = p.Value;
double time = e.prev_calls > 0L ? Util.Microseconds(e.prev_time / e.prev_calls) : 0d;
double avg = e.tot_calls > 0L ? Util.Microseconds(e.tot_time / e.tot_calls) : 0d;
#if PROFILER_TELEMETRY
Telemetry.Send(p.Key + "_time", time);
Telemetry.Send(p.Key + "_calls", (double)e.prev_calls);
#endif
if (e.prev_calls > 0L)
{
e.last_txt = time > 1e6d ? (time * 1e-6).ToString("F2") + "s" :
time > 1e3d ? (time * 1e-3).ToString("F2") + "ms" :
time > 0d ? time.ToString("F2") + "µs" : "";
e.calls_txt = e.prev_calls.ToString();
}
else if (show_zero)
{
e.last_txt = "";
e.calls_txt = "0";
}
e.avg_txt = avg > 1e6d ? (avg * 1e-6).ToString("F2") + "s" :
avg > 1e3d ? (avg * 1e-3).ToString("F2") + "ms" :
avg > 0d ? avg.ToString("F2") + "µs" : "";
e.avg_calls_txt = tot_frames > 0L ? ((float)e.tot_calls / (float)tot_frames).ToString("F3") : "0";
}
tot_frames_txt = tot_frames.ToString() + " Frames";
}
public void FixedUpdate()
{
foreach (KeyValuePair<string, Entry> p in entries)
{
Entry e = p.Value;
e.prev_calls = e.calls;
e.prev_time = e.time;
e.tot_calls += e.calls;
e.tot_time += e.time;
e.calls = 0L;
e.time = 0.0;
}
++tot_frames;
}
public static void OnDestroy()
{
if (popup_dialog != null)
{
popup_dialog.Dismiss();
popup_dialog = null;
}
}
#if PROFILER_TELEMETRY
private static void ConstructTelemetry()
{
foreach (string name in channels)
{
Telemetry.AddChannel<double>(name + "_time");
Telemetry.AddChannel<double>(name + "_calls");
}
}
#endif
/// <summary>
/// Defaults window to center of screen and also ensures it remains within the screen bounds.
/// </summary>
private static void ClampToScreen()
{
float border = 50f;
bool adjusted = false;
if (multi_dialog.dialogRect.position.x <= 0.0f || multi_dialog.dialogRect.position.y <= 0.0f)
{
// default window to center of screen
multi_dialog.dialogRect.Set(0.5f, 0.5f, width, height);
adjusted = true;
}
else
{
// ensure window remains within the screen bounds
Vector2 pos = new Vector2(((multi_dialog.dialogRect.position.x * Screen.width) - (Screen.width / 2)) * GameSettings.UI_SCALE,
((multi_dialog.dialogRect.position.y * Screen.height) - (Screen.height / 2)) * GameSettings.UI_SCALE);
if (pos.x > (Screen.width / 2) - border)
{
pos.x = (Screen.width / 2) - (border + (width / 2));
adjusted = true;
}
else if (pos.x < ((Screen.width / 2) - border) * -1f)
{
pos.x = ((Screen.width / 2) - (border + (width / 2))) * -1f;
adjusted = true;
}
if (pos.y > (Screen.height / 2) - border)
{
pos.y = (Screen.height / 2) - (border + (height / 2));
adjusted = true;
}
else if (pos.y < ((Screen.height / 2) - border) * -1f)
{
pos.y = ((Screen.height / 2) - (border + (height / 2))) * -1f;
adjusted = true;
}
if (adjusted)
{
multi_dialog.dialogRect.Set(
((Screen.width / 2) + (pos.x / GameSettings.UI_SCALE)) / Screen.width,
((Screen.height / 2) + (pos.y / GameSettings.UI_SCALE)) / Screen.height,
width, height);
}
}
}
/// <summary>
/// Called when the PopupDialog OnDestroy method is called. Used for saving the window position.
/// </summary>
private static void OnPopupDialogDestroy()
{
// save popup position. Note. PopupDialog.RTrf is an offset from the center of the screen.
if (popup_dialog != null)
{
Vector2 window_pos = new Vector2(
((Screen.width / 2) + (popup_dialog.RTrf.position.x / GameSettings.UI_SCALE)) / Screen.width,
((Screen.height / 2) + (popup_dialog.RTrf.position.y / GameSettings.UI_SCALE)) / Screen.height);
//Util.DebugLog("Saving profiler window position as {0}", window_pos.ToString());
multi_dialog.dialogRect.Set(window_pos.x, window_pos.y, width, height);
dialog_items.children.Clear();
scroll_list.children.Clear();
entries.Clear();
}
}
private static string GetTitle()
{
switch (Localizer.CurrentLanguage)
{
case "es-es":
return "Trayectorias Profiler";
case "ru":
return "Провайдер Траектория";
case "zh-cn":
return "軌跡分析儀";
case "ja":
return "軌道プロファイラ";
case "de-de":
return "Trajektorien Profiler";
case "fr-fr":
return "Trajectoires Profiler";
case "it-it":
return "Trailerories Profiler";
case "pt-br":
return "Trajectórias perfil";
default:
return "Trajectories Profiler";
}
}
private static void OnButtonClick_Reset()
{
foreach (KeyValuePair<string, Entry> e in entries)
{
e.Value.tot_calls = 0L;
e.Value.tot_time = 0.0;
}
tot_frames = 0L;
}
private static void OnButtonClick_ShowZero(bool inState) => show_zero = inState;
private static void AddDialogItem(string e_name)
{
if (!Ready)
return;
//Util.DebugLog("{0}: {1}", e_name, dialog_items.children.Count.ToString());
// add item
dialog_items.AddChild(
new DialogGUIHorizontalLayout(
new DialogGUILabel(" " + e_name, true),
new DialogGUILabel(() => { return entries[e_name].last_txt; }, value_width),
new DialogGUILabel(() => { return entries[e_name].avg_txt; }, value_width),
new DialogGUILabel(() => { return entries[e_name].calls_txt; }, value_width - 15f),
new DialogGUILabel(() => { return entries[e_name].avg_calls_txt; }, value_width - 10f)));
// required to force the Gui creation
Stack<Transform> stack = new Stack<Transform>();
stack.Push(dialog_items.uiItem.gameObject.transform);
dialog_items.children[dialog_items.children.Count - 1].Create(ref stack, HighLogic.UISkin);
}
#endif
[Conditional("DEBUG_PROFILER")]
/// <summary> Start a profiler entry. </summary>
public static void Start(string e_name)
{
#if DEBUG_PROFILER
if (entries == null)
return;
if (!entries.ContainsKey(e_name))
{
entries.Add(e_name, new Entry());
AddDialogItem(e_name);
#if PROFILER_TELEMETRY
if (!channels.Contains(e_name))
channels.Add(e_name);
#endif
}
entries[e_name].start = Util.Clocks;
#endif
}
[Conditional("DEBUG_PROFILER")]
/// <summary> Stop a profiler entry. </summary>
public static void Stop(string e_name)
{
#if DEBUG_PROFILER
if (entries == null)
return;
Entry e = entries[e_name];
++e.calls;
e.time += Util.Clocks - e.start;
#endif
}
#if DEBUG_PROFILER
/// <summary> Profile a function scope. </summary>
internal sealed class ProfileScope : IDisposable
{
public ProfileScope(string name)
{
this.name = name;
Start(name);
}
public void Dispose() => Stop(name);
private readonly string name;
}
#endif
}
} // Trajectories
| {
"pile_set_name": "Github"
} |
package opentracing
import "context"
type contextKey struct{}
var activeSpanKey = contextKey{}
// ContextWithSpan returns a new `context.Context` that holds a reference to
// `span`'s SpanContext.
func ContextWithSpan(ctx context.Context, span Span) context.Context {
return context.WithValue(ctx, activeSpanKey, span)
}
// SpanFromContext returns the `Span` previously associated with `ctx`, or
// `nil` if no such `Span` could be found.
//
// NOTE: context.Context != SpanContext: the former is Go's intra-process
// context propagation mechanism, and the latter houses OpenTracing's per-Span
// identity and baggage information.
func SpanFromContext(ctx context.Context) Span {
val := ctx.Value(activeSpanKey)
if sp, ok := val.(Span); ok {
return sp
}
return nil
}
// StartSpanFromContext starts and returns a Span with `operationName`, using
// any Span found within `ctx` as a ChildOfRef. If no such parent could be
// found, StartSpanFromContext creates a root (parentless) Span.
//
// The second return value is a context.Context object built around the
// returned Span.
//
// Example usage:
//
// SomeFunction(ctx context.Context, ...) {
// sp, ctx := opentracing.StartSpanFromContext(ctx, "SomeFunction")
// defer sp.Finish()
// ...
// }
func StartSpanFromContext(ctx context.Context, operationName string, opts ...StartSpanOption) (Span, context.Context) {
return StartSpanFromContextWithTracer(ctx, GlobalTracer(), operationName, opts...)
}
// StartSpanFromContextWithTracer starts and returns a span with `operationName`
// using a span found within the context as a ChildOfRef. If that doesn't exist
// it creates a root span. It also returns a context.Context object built
// around the returned span.
//
// It's behavior is identical to StartSpanFromContext except that it takes an explicit
// tracer as opposed to using the global tracer.
func StartSpanFromContextWithTracer(ctx context.Context, tracer Tracer, operationName string, opts ...StartSpanOption) (Span, context.Context) {
if parentSpan := SpanFromContext(ctx); parentSpan != nil {
opts = append(opts, ChildOf(parentSpan.Context()))
}
span := tracer.StartSpan(operationName, opts...)
return span, ContextWithSpan(ctx, span)
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>0.9.9 API documenation: type_vec3.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">0.9.9 API documenation
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_934f46a345653ef2b3014a1b37a162c1.html">G:</a></li><li class="navelem"><a class="el" href="dir_98f7f9d41f9d3029bd68cf237526a774.html">Source</a></li><li class="navelem"><a class="el" href="dir_9344afb825aed5e2f5be1d2015dde43c.html">G-Truc</a></li><li class="navelem"><a class="el" href="dir_45973f864e07b2505003ae343b7c8af7.html">glm</a></li><li class="navelem"><a class="el" href="dir_304be5dfae1339a7705426c0b536faf2.html">glm</a></li><li class="navelem"><a class="el" href="dir_da256b9dd32ba43e2eaa8a2832c37f1b.html">detail</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">type_vec3.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00128.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> </div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include "<a class="code" href="a00125.html">type_vec.hpp</a>"</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor"># if GLM_HAS_UNRESTRICTED_UNIONS</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor"># include "<a class="code" href="a00004.html">_swizzle.hpp</a>"</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor"># else</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor"># include "<a class="code" href="a00005.html">_swizzle_func.hpp</a>"</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#endif //GLM_SWIZZLE == GLM_SWIZZLE_ENABLED</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include <cstddef></span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">namespace </span><a class="code" href="a00140.html">glm</a></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> {</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P = defaultp></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  <span class="keyword">struct </span>tvec3</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  {</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  <span class="comment">// -- Implementation detail --</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  <span class="keyword">typedef</span> T value_type;</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <span class="keyword">typedef</span> tvec3<T, P> type;</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keyword">typedef</span> tvec3<bool, P> bool_type;</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <span class="comment">// -- Data --</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor"># if GLM_HAS_ALIGNED_TYPE</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor"># if GLM_COMPILER & GLM_COMPILER_GCC</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor"># pragma GCC diagnostic push</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor"># pragma GCC diagnostic ignored "-Wpedantic"</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor"># if GLM_COMPILER & GLM_COMPILER_CLANG</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor"># pragma clang diagnostic push</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor"># pragma clang diagnostic ignored "-Wgnu-anonymous-struct"</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor"># pragma clang diagnostic ignored "-Wnested-anon-types"</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keyword">union</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  {</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keyword">struct</span>{ T x, y, z; };</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keyword">struct</span>{ T r, g, b; };</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">struct</span>{ T s, t, p; };</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor"># if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  _GLM_SWIZZLE3_2_MEMBERS(T, P, glm::tvec2, x, y, z)</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  _GLM_SWIZZLE3_2_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec2, r, g, b)</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  _GLM_SWIZZLE3_2_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec2, s, t, p)</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  _GLM_SWIZZLE3_3_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec3, x, y, z)</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  _GLM_SWIZZLE3_3_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec3, r, g, b)</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  _GLM_SWIZZLE3_3_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec3, s, t, p)</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  _GLM_SWIZZLE3_4_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec4, x, y, z)</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  _GLM_SWIZZLE3_4_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec4, r, g, b)</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  _GLM_SWIZZLE3_4_MEMBERS(T, P, <a class="code" href="a00140.html">glm</a>::tvec4, s, t, p)</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor"># endif//GLM_SWIZZLE</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  };</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  </div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor"># if GLM_COMPILER & GLM_COMPILER_CLANG</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor"># pragma clang diagnostic pop</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor"># if GLM_COMPILER & GLM_COMPILER_GCC</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor"># pragma GCC diagnostic pop</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor"># else</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keyword">union </span>{ T x, r, s; };</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keyword">union </span>{ T y, g, t; };</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="keyword">union </span>{ T z, b, p; };</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="preprocessor"># if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, tvec3, tvec2, tvec3, tvec4)</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor"># endif//GLM_SWIZZLE</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="preprocessor"># endif//GLM_LANG</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment">// -- Component accesses --</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keyword">typedef</span> length_t length_type;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  GLM_FUNC_DECL <span class="keyword">static</span> length_type <a class="code" href="a00147.html#ga18d45e3d4c7705e67ccfabd99e521604">length</a>(){<span class="keywordflow">return</span> 3;}</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  GLM_FUNC_DECL T & operator[](length_type i);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  GLM_FUNC_DECL T <span class="keyword">const</span> & operator[](length_type i) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="comment">// -- Implicit basic constructors --</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3() GLM_DEFAULT_CTOR;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, P> const & v) GLM_DEFAULT;</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  template <precision Q></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, Q> const & v);</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="comment">// -- Explicit basic constructors --</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec3(ctor);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec3(T scalar);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(T a, T b, T c);</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="comment">// -- Conversion scalar constructors --</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  template <typename A, typename B, typename C></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(A a, B b, C c);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  template <typename A, typename B, typename C></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c);</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="comment">// -- Conversion vector constructors --</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  template <typename A, typename B, precision Q></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec2<A, Q> const & a, B b);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  template <typename A, typename B, precision Q></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  template <typename A, typename B, precision Q></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(A a, tvec2<B, Q> const & b);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  template <typename A, typename B, precision Q></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  template <typename U, precision Q></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec3(tvec4<U, Q> const & v);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  template <typename U, precision Q></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec3(tvec3<U, Q> const & v);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="comment">// -- Swizzle constructors --</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="preprocessor"># if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keyword">template</span> <<span class="keywordtype">int</span> E0, <span class="keywordtype">int</span> E1, <span class="keywordtype">int</span> E2></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  GLM_FUNC_DECL tvec3(detail::_swizzle<3, T, P, glm::tvec3, E0, E1, E2, -1> <span class="keyword">const</span> & that)</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  {</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  *<span class="keyword">this</span> = that();</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  }</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keyword">template</span> <<span class="keywordtype">int</span> E0, <span class="keywordtype">int</span> E1></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & scalar)</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  {</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  *<span class="keyword">this</span> = tvec3<T, P>(v(), scalar);</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  }</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span> </div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keyword">template</span> <<span class="keywordtype">int</span> E0, <span class="keywordtype">int</span> E1></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  GLM_FUNC_DECL tvec3(T <span class="keyword">const</span> & scalar, detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> <span class="keyword">const</span> & v)</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  {</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  *<span class="keyword">this</span> = tvec3<T, P>(scalar, v());</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  }</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="preprocessor"># endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment">// -- Unary arithmetic operators --</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> <span class="keyword">const</span> & v) GLM_DEFAULT;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  GLM_FUNC_DECL tvec3<T, P> & operator+=(U scalar);</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  GLM_FUNC_DECL tvec3<T, P> & operator-=(U scalar);</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  GLM_FUNC_DECL tvec3<T, P> & operator*=(U scalar);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  GLM_FUNC_DECL tvec3<T, P> & operator/=(U scalar);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span> </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="comment">// -- Increment and decrement operators --</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span> </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  GLM_FUNC_DECL tvec3<T, P> & operator++();</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  GLM_FUNC_DECL tvec3<T, P> & operator--();</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  GLM_FUNC_DECL tvec3<T, P> operator++(<span class="keywordtype">int</span>);</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  GLM_FUNC_DECL tvec3<T, P> operator--(<span class="keywordtype">int</span>);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="comment">// -- Unary bit operators --</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  GLM_FUNC_DECL tvec3<T, P> & operator%=(U scalar);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  GLM_FUNC_DECL tvec3<T, P> & operator&=(U scalar);</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  GLM_FUNC_DECL tvec3<T, P> & operator|=(U scalar);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  GLM_FUNC_DECL tvec3<T, P> & operator^=(U scalar);</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  GLM_FUNC_DECL tvec3<T, P> & operator<<=(U scalar);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  GLM_FUNC_DECL tvec3<T, P> & operator>>=(U scalar);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  };</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span> </div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="comment">// -- Unary operators --</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span> </div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span> </div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> </div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="comment">// -- Binary operators --</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span> </div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span> </div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & scalar);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span> </div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  GLM_FUNC_DECL tvec3<T, P> operator+(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span> </div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span> </div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span> </div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span> </div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span> </div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  GLM_FUNC_DECL tvec3<T, P> operator-(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span> </div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span> </div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> </div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span> </div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span> </div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  GLM_FUNC_DECL tvec3<T, P> operator*(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span> </div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span> </div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span> </div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span> </div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  GLM_FUNC_DECL tvec3<T, P> operator/(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span> </div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span> </div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span> </div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span> </div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  GLM_FUNC_DECL tvec3<T, P> operator%(T <span class="keyword">const</span> & scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span> </div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span> </div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> <span class="keyword">const</span> & v1, T scalar);</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span> </div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span> </div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  GLM_FUNC_DECL tvec3<T, P> operator&(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span> </div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> </div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span> </div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span> </div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span> </div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  GLM_FUNC_DECL tvec3<T, P> operator|(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> </div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span> </div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span> </div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span> </div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  GLM_FUNC_DECL tvec3<T, P> operator^(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span> </div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span> </div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span> </div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> </div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span> </div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span> </div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span> </div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span> </div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> <span class="keyword">const</span> & v, T scalar);</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span> </div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> <span class="keyword">const</span> & v1, tvec1<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span> </div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(T scalar, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span> </div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec1<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span> </div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span> </div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P> </div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span> </div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="comment">// -- Boolean operators --</span></div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span> </div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  GLM_FUNC_DECL <span class="keywordtype">bool</span> operator==(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span> </div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  GLM_FUNC_DECL <span class="keywordtype">bool</span> operator!=(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span> </div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <span class="keyword">template</span> <precision P></div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  GLM_FUNC_DECL tvec3<bool, P> operator&&(tvec3<bool, P> <span class="keyword">const</span> & v1, tvec3<bool, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span> </div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <span class="keyword">template</span> <precision P></div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  GLM_FUNC_DECL tvec3<bool, P> operator||(tvec3<bool, P> <span class="keyword">const</span> & v1, tvec3<bool, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span> }<span class="comment">//namespace glm</span></div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span> </div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span> <span class="preprocessor">#ifndef GLM_EXTERNAL_TEMPLATE</span></div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span> <span class="preprocessor">#include "type_vec3.inl"</span></div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span> <span class="preprocessor">#endif//GLM_EXTERNAL_TEMPLATE</span></div>
<div class="ttc" id="a00147_html_ga18d45e3d4c7705e67ccfabd99e521604"><div class="ttname"><a href="a00147.html#ga18d45e3d4c7705e67ccfabd99e521604">glm::length</a></div><div class="ttdeci">GLM_FUNC_DECL T length(vecType< T, P > const &x)</div><div class="ttdoc">Returns the length of x, i.e., sqrt(x * x). </div></div>
<div class="ttc" id="a00005_html"><div class="ttname"><a href="a00005.html">_swizzle_func.hpp</a></div><div class="ttdoc">GLM Core </div></div>
<div class="ttc" id="a00125_html"><div class="ttname"><a href="a00125.html">type_vec.hpp</a></div><div class="ttdoc">GLM Core </div></div>
<div class="ttc" id="a00140_html"><div class="ttname"><a href="a00140.html">glm</a></div><div class="ttdef"><b>Definition:</b> <a href="a00003_source.html#l00011">_noise.hpp:11</a></div></div>
<div class="ttc" id="a00004_html"><div class="ttname"><a href="a00004.html">_swizzle.hpp</a></div><div class="ttdoc">GLM Core </div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*----------------------
Copyright (C): OpenGATE Collaboration
This software is distributed under the terms
of the GNU Lesser General Public Licence (LGPL)
See LICENSE.md for further details
----------------------*/
#include "GateVDistribution.hh"
#include "GateDistributionListManager.hh"
GateVDistribution::GateVDistribution(const G4String& itsName)
: GateNamedObject(itsName)
{
GateDistributionListManager::GetInstance()->RegisterDistribution(this);
}
GateVDistribution::~GateVDistribution()
{
}
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard.
//
#import <AppKit/NSScroller.h>
@interface TListScroller : NSScroller
{
}
+ (BOOL)isCompatibleWithResponsiveScrolling;
+ (BOOL)isCompatibleWithOverlayScrollers;
@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.
#
#CMVCPATHNAME com.ibm.ws.apache.el-3.0/resources/org/apache/el/Messages.nlsprops
#ISMESSAGEFILE TRUE
#NLS_ENCODING=UNICODE
#NLS_MESSAGEFORMAT_VAR
# General Errors
error.convert=\uc720\ud615 {1}\uc758 {0}\uc744(\ub97c) {2}(\uc73c)\ub85c \ubcc0\ud658\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
error.compare={0}\uc744(\ub97c) {1}\uacfc(\uc640) \ube44\uad50\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
error.function=''{0}'' \ud568\uc218\ub97c \ud638\ucd9c\ud558\ub294 \uc911\uc5d0 \ubb38\uc81c\uc810\uc774 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4.
error.unreachable.base=\ub300\uc0c1\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. ID ''{0}''\uc774(\uac00) \ub110\ub85c \ubd84\uc11d\ub418\uc5c8\uc2b5\ub2c8\ub2e4.
error.unreachable.property=\ub300\uc0c1\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. ''{0}''\uc774(\uac00) \ub110\uc744 \ub9ac\ud134\ud588\uc2b5\ub2c8\ub2e4.
error.resolver.unhandled=ELResolver\uac00 \ud2b9\uc131\uc774 ''{1}''\uc778 \uc720\ud615 {0}\uc744(\ub97c) \ucc98\ub9ac\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4.
error.resolver.unhandled.null=ELResolver\uac00 ID\uac00 ''{0}''\uc778 \ub110 \uae30\ubc18 \uc624\ube0c\uc81d\ud2b8\ub97c \ucc98\ub9ac\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
# ValueExpressionLiteral
error.value.literal.write=ValueExpression\uc740 \ub9ac\ud130\ub7f4\uc774\uba70 \uc4f0\uae30 \uac00\ub2a5\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. {0}
# ExpressionFactoryImpl
error.null=\ud45c\ud604\uc2dd\uc740 \ub110\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
error.mixed=\ud45c\ud604\uc2dd\uc740 ''#''{..}''\uc640 ''$''{..}''\ub97c \ub458 \ub2e4 \ud3ec\ud568\ud560 \uc218\ub294 \uc5c6\uc2b5\ub2c8\ub2e4. {0}
error.method=\uc720\ud6a8\ud55c MethodExpression\uc774 \uc544\ub2d9\ub2c8\ub2e4. {0}
error.method.nullParms=\ub9e4\uac1c\ubcc0\uc218 \uc720\ud615\uc740 \ub110\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
error.value.expectedType=\uc608\uc0c1\ub41c \uc720\ud615\uc740 \ub110\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
# ExpressionBuilder
error.parseFail=\ud45c\ud604\uc2dd [{0}]\uc744(\ub97c) \uad6c\ubb38 \ubd84\uc11d\ud558\ub294 \ub370 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.
# ValueSetVisitor
error.syntax.set=\uc124\uc815 \uc870\uc791\uc5d0 \ub300\ud55c \uad6c\ubb38\uc774 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.
# ReflectionUtil
error.method.notfound=\uba54\uc18c\ub4dc\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc74c: {0}.{1}({2})
error.method.ambiguous=\uba85\ud655\ud55c \uba54\uc18c\ub4dc\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc74c: {0}.{1}({2})
# ValidatingVisitor
error.fnMapper.null=\ud45c\ud604\uc2dd\uc740 \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\ub294\ub370 FunctionMapper\uac00 \uc81c\uacf5\ub418\uc5c8\uc2b5\ub2c8\ub2e4.
error.fnMapper.method=''{0}'' \ud568\uc218\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
error.fnMapper.paramcount=''{0}'' \ud568\uc218\uac00 {1} \ub9e4\uac1c\ubcc0\uc218\ub97c \uc9c0\uc815\ud558\ub294\ub370 {2}\uc774(\uac00) \uc120\uc5b8\ub418\uc5c8\uc2b5\ub2c8\ub2e4.
# ExpressionImpl
error.context.null=ELContext\uac00 \ub110\uc785\ub2c8\ub2e4.
# Parser
error.funciton.tooManyMethodParameterSets=\ud568\uc218 [{0}]\uc5d0 \ub300\ud574 \uc9c0\uc815\ub41c \ub2e4\uc911 \ub9e4\uac1c\ubcc0\uc218 \uc138\ud2b8\uac00 \uc788\uc2b5\ub2c8\ub2e4.
error.identifier.notjava=EL \uc2a4\ud399\uc758 \uc139\uc158 1.19\uc5d0\uc11c \ud544\uc694\ub85c \ud558\ubbc0\ub85c ID [{0}]\uc774(\uac00) \uc720\ud6a8\ud55c Java ID\uac00 \uc544\ub2d9\ub2c8\ub2e4(ID ::= Java \uc5b8\uc5b4 ID). \uc2dc\uc2a4\ud15c \ud2b9\uc131 org.apache.el.parser.SKIP_IDENTIFIER_CHECK\ub97c true\ub85c \uc124\uc815\ud558\uba74 \uc774 \uac80\uc0ac\ub97c \uc0ac\uc6a9 \uc548\ud568\uc73c\ub85c \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.
error.lambda.tooManyMethodParameterSets=\uc911\ucca9 lambda \ud45c\ud604\uc2dd\ubcf4\ub2e4 \ub354 \ub9ce\uc740 \uc218\uc758 \uba54\uc18c\ub4dc \ub9e4\uac1c\ubcc0\uc218 \uc138\ud2b8\uac00 \uc9c0\uc815\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.
# Stream
stream.compare.notComparable=\uc2a4\ud2b8\ub9bc \uc694\uc18c\ub294 Comparable\uc744 \uad6c\ud604\ud574\uc57c \ud569\ub2c8\ub2e4.
stream.optional.empty=\ube48 \uc870\uc791\uc5d0\uc11c\ub294 get()\uc744 \ud638\ucd9c\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.
stream.optional.paramNotLambda=\uba54\uc18c\ub4dc [{0}]\uc5d0 \ub300\ud55c \ub9e4\uac1c\ubcc0\uc218\ub294 lambda \ud45c\ud604\uc2dd\uc774\uc5b4\uc57c \ud569\ub2c8\ub2e4.
| {
"pile_set_name": "Github"
} |
#ifndef OSRM_UTIL_FILTERED_GRAPH_HPP
#define OSRM_UTIL_FILTERED_GRAPH_HPP
#include "storage/shared_memory_ownership.hpp"
#include "util/dynamic_graph.hpp"
#include "util/filtered_integer_range.hpp"
#include "util/static_graph.hpp"
#include "util/vector_view.hpp"
namespace osrm
{
namespace util
{
namespace detail
{
template <typename GraphT, storage::Ownership Ownership> class FilteredGraphImpl;
// For static graphs we can save the filters as a static vector since
// we don't modify the structure of the graph. This also makes it easy to
// swap out the filter.
template <typename EdgeDataT, storage::Ownership Ownership>
class FilteredGraphImpl<util::StaticGraph<EdgeDataT, Ownership>, Ownership>
{
template <typename T> using Vector = util::ViewOrVector<T, Ownership>;
public:
using Graph = util::StaticGraph<EdgeDataT, Ownership>;
using EdgeIterator = typename Graph::EdgeIterator;
using NodeIterator = typename Graph::NodeIterator;
using NodeArrayEntry = typename Graph::NodeArrayEntry;
using EdgeArrayEntry = typename Graph::EdgeArrayEntry;
using EdgeRange = util::filtered_range<EdgeIterator, Vector<bool>>;
unsigned GetNumberOfNodes() const { return graph.GetNumberOfNodes(); }
unsigned GetNumberOfEdges() const { return graph.GetNumberOfEdges(); }
unsigned GetOutDegree(const NodeIterator n) const
{
auto range = graph.GetAdjacentEdgeRange(n);
return std::count_if(range.begin(), range.end(), [this](const EdgeIterator edge) {
return edge_filter[edge];
});
}
inline NodeIterator GetTarget(const EdgeIterator e) const
{
BOOST_ASSERT(edge_filter[e]);
return graph.GetTarget(e);
}
auto &GetEdgeData(const EdgeIterator e)
{
BOOST_ASSERT(edge_filter[e]);
return graph.GetEdgeData(e);
}
const auto &GetEdgeData(const EdgeIterator e) const
{
BOOST_ASSERT(edge_filter[e]);
return graph.GetEdgeData(e);
}
auto GetAdjacentEdgeRange(const NodeIterator n) const
{
return EdgeRange{graph.BeginEdges(n), graph.EndEdges(n), edge_filter};
}
// searches for a specific edge
EdgeIterator FindEdge(const NodeIterator from, const NodeIterator to) const
{
for (const auto edge : GetAdjacentEdgeRange(from))
{
if (to == GetTarget(edge))
{
return edge;
}
}
return SPECIAL_EDGEID;
}
template <typename FilterFunction>
EdgeIterator
FindSmallestEdge(const NodeIterator from, const NodeIterator to, FilterFunction &&filter) const
{
static_assert(traits::HasDataMember<typename Graph::EdgeArrayEntry>::value,
"Filtering on .data not possible without .data member attribute");
EdgeIterator smallest_edge = SPECIAL_EDGEID;
EdgeWeight smallest_weight = INVALID_EDGE_WEIGHT;
for (auto edge : GetAdjacentEdgeRange(from))
{
const NodeID target = GetTarget(edge);
const auto &data = GetEdgeData(edge);
if (target == to && data.weight < smallest_weight &&
std::forward<FilterFunction>(filter)(data))
{
smallest_edge = edge;
smallest_weight = data.weight;
}
}
return smallest_edge;
}
EdgeIterator FindEdgeInEitherDirection(const NodeIterator from, const NodeIterator to) const
{
EdgeIterator tmp = FindEdge(from, to);
return (SPECIAL_NODEID != tmp ? tmp : FindEdge(to, from));
}
EdgeIterator
FindEdgeIndicateIfReverse(const NodeIterator from, const NodeIterator to, bool &result) const
{
EdgeIterator current_iterator = FindEdge(from, to);
if (SPECIAL_NODEID == current_iterator)
{
current_iterator = FindEdge(to, from);
if (SPECIAL_NODEID != current_iterator)
{
result = true;
}
}
return current_iterator;
}
FilteredGraphImpl() = default;
FilteredGraphImpl(Graph graph, Vector<bool> edge_filter_)
: graph(std::move(graph)), edge_filter(std::move(edge_filter_))
{
BOOST_ASSERT(edge_filter.empty() || edge_filter.size() == graph.GetNumberOfEdges());
}
// Takes a graph and a function that maps EdgeID to true
// if the edge should be included in the graph.
template <typename Pred>
FilteredGraphImpl(Graph graph, Pred filter)
: graph(std::move(graph)), edge_filter(graph.GetNumberOfEdges())
{
auto edge_ids = util::irange<EdgeID>(0, graph.GetNumberOfEdges());
std::transform(edge_ids.begin(), edge_ids.end(), edge_filter.begin(), filter);
}
void Renumber(const std::vector<NodeID> &old_to_new_node)
{
graph.Renumber(old_to_new_node);
// FIXME the edge filter needs to be renumbered with a different permutation
// util::inplacePermutation(edge_filter.begin(), edge_filter.end(), old_to_new_node);
}
private:
Graph graph;
Vector<bool> edge_filter;
};
}
template <typename GraphT>
using FilteredGraphContainer = detail::FilteredGraphImpl<GraphT, storage::Ownership::Container>;
template <typename GraphT>
using FilteredGraphView = detail::FilteredGraphImpl<GraphT, storage::Ownership::View>;
}
}
#endif
| {
"pile_set_name": "Github"
} |
Contributing
============
We try to achieve a 100% coverage on the Javascript code. Please make sure that each addition reaches this goal.
## Tests
- clone the project to your local machine
- do a npm install
To create a report use `npm test`. To create a report and also check the coverage use `unit.test.coverage`
## Documentation
Make any applicable changes to the documentation.
| {
"pile_set_name": "Github"
} |
<?php
/*
* @copyright 2014 Mautic Contributors. All rights reserved
* @author Mautic
*
* @link http://mautic.org
*
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
namespace Mautic\EmailBundle\Swiftmailer\SendGrid\Exception;
class ResponseItemException extends \Exception
{
}
| {
"pile_set_name": "Github"
} |
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
syntax = 'proto2';
package k8s.io.api.policy.v1beta1;
import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1beta1";
// AllowedFlexVolume represents a single Flexvolume that is allowed to be used.
message AllowedFlexVolume {
// driver is the name of the Flexvolume driver.
optional string driver = 1;
}
// AllowedHostPath defines the host volume conditions that will be enabled by a policy
// for pods to use. It requires the path prefix to be defined.
message AllowedHostPath {
// pathPrefix is the path prefix that the host volume must match.
// It does not support `*`.
// Trailing slashes are trimmed when validating the path prefix with a host path.
//
// Examples:
// `/foo` would allow `/foo`, `/foo/` and `/foo/bar`
// `/foo` would not allow `/food` or `/etc/foo`
optional string pathPrefix = 1;
// when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly.
// +optional
optional bool readOnly = 2;
}
// Eviction evicts a pod from its node subject to certain policies and safety constraints.
// This is a subresource of Pod. A request to cause such an eviction is
// created by POSTing to .../pods/<pod name>/evictions.
message Eviction {
// ObjectMeta describes the pod that is being evicted.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// DeleteOptions may be provided
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
}
// FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
message FSGroupStrategyOptions {
// rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
// +optional
optional string rule = 1;
// ranges are the allowed ranges of fs groups. If you would like to force a single
// fs group then supply a single range with the same start and end. Required for MustRunAs.
// +optional
repeated IDRange ranges = 2;
}
// HostPortRange defines a range of host ports that will be enabled by a policy
// for pods to use. It requires both the start and end to be defined.
message HostPortRange {
// min is the start of the range, inclusive.
optional int32 min = 1;
// max is the end of the range, inclusive.
optional int32 max = 2;
}
// IDRange provides a min/max of an allowed range of IDs.
message IDRange {
// min is the start of the range, inclusive.
optional int64 min = 1;
// max is the end of the range, inclusive.
optional int64 max = 2;
}
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
message PodDisruptionBudget {
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the PodDisruptionBudget.
// +optional
optional PodDisruptionBudgetSpec spec = 2;
// Most recently observed status of the PodDisruptionBudget.
// +optional
optional PodDisruptionBudgetStatus status = 3;
}
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
message PodDisruptionBudgetList {
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated PodDisruptionBudget items = 2;
}
// PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
message PodDisruptionBudgetSpec {
// An eviction is allowed if at least "minAvailable" pods selected by
// "selector" will still be available after the eviction, i.e. even in the
// absence of the evicted pod. So for example you can prevent all voluntary
// evictions by specifying "100%".
// +optional
optional k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
// Label query over pods whose evictions are managed by the disruption
// budget.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
// An eviction is allowed if at most "maxUnavailable" pods selected by
// "selector" are unavailable after the eviction, i.e. even in absence of
// the evicted pod. For example, one can prevent all voluntary evictions
// by specifying 0. This is a mutually exclusive setting with "minAvailable".
// +optional
optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
}
// PodDisruptionBudgetStatus represents information about the status of a
// PodDisruptionBudget. Status may trail the actual state of a system.
message PodDisruptionBudgetStatus {
// Most recent generation observed when updating this PDB status. PodDisruptionsAllowed and other
// status informatio is valid only if observedGeneration equals to PDB's object generation.
// +optional
optional int64 observedGeneration = 1;
// DisruptedPods contains information about pods whose eviction was
// processed by the API server eviction subresource handler but has not
// yet been observed by the PodDisruptionBudget controller.
// A pod will be in this map from the time when the API server processed the
// eviction request to the time when the pod is seen by PDB controller
// as having been marked for deletion (or after a timeout). The key in the map is the name of the pod
// and the value is the time when the API server processed the eviction request. If
// the deletion didn't occur and a pod is still there it will be removed from
// the list automatically by PodDisruptionBudget controller after some time.
// If everything goes smooth this map should be empty for the most of the time.
// Large number of entries in the map may indicate problems with pod deletions.
// +optional
map<string, k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
// Number of pod disruptions that are currently allowed.
optional int32 disruptionsAllowed = 3;
// current number of healthy pods
optional int32 currentHealthy = 4;
// minimum desired number of healthy pods
optional int32 desiredHealthy = 5;
// total number of pods counted by this disruption budget
optional int32 expectedPods = 6;
}
// PodSecurityPolicy governs the ability to make requests that affect the Security Context
// that will be applied to a pod and container.
message PodSecurityPolicy {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// spec defines the policy enforced.
// +optional
optional PodSecurityPolicySpec spec = 2;
}
// PodSecurityPolicyList is a list of PodSecurityPolicy objects.
message PodSecurityPolicyList {
// Standard list metadata.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// items is a list of schema objects.
repeated PodSecurityPolicy items = 2;
}
// PodSecurityPolicySpec defines the policy enforced.
message PodSecurityPolicySpec {
// privileged determines if a pod can request to be run as privileged.
// +optional
optional bool privileged = 1;
// defaultAddCapabilities is the default set of capabilities that will be added to the container
// unless the pod spec specifically drops the capability. You may not list a capability in both
// defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly
// allowed, and need not be included in the allowedCapabilities list.
// +optional
repeated string defaultAddCapabilities = 2;
// requiredDropCapabilities are the capabilities that will be dropped from the container. These
// are required to be dropped and cannot be added.
// +optional
repeated string requiredDropCapabilities = 3;
// allowedCapabilities is a list of capabilities that can be requested to add to the container.
// Capabilities in this field may be added at the pod author's discretion.
// You must not list a capability in both allowedCapabilities and requiredDropCapabilities.
// +optional
repeated string allowedCapabilities = 4;
// volumes is a white list of allowed volume plugins. Empty indicates that
// no volumes may be used. To allow all volumes you may use '*'.
// +optional
repeated string volumes = 5;
// hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.
// +optional
optional bool hostNetwork = 6;
// hostPorts determines which host port ranges are allowed to be exposed.
// +optional
repeated HostPortRange hostPorts = 7;
// hostPID determines if the policy allows the use of HostPID in the pod spec.
// +optional
optional bool hostPID = 8;
// hostIPC determines if the policy allows the use of HostIPC in the pod spec.
// +optional
optional bool hostIPC = 9;
// seLinux is the strategy that will dictate the allowable labels that may be set.
optional SELinuxStrategyOptions seLinux = 10;
// runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.
optional RunAsUserStrategyOptions runAsUser = 11;
// RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set.
// If this field is omitted, the pod's RunAsGroup can take any value. This field requires the
// RunAsGroup feature gate to be enabled.
// +optional
optional RunAsGroupStrategyOptions runAsGroup = 22;
// supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.
optional SupplementalGroupsStrategyOptions supplementalGroups = 12;
// fsGroup is the strategy that will dictate what fs group is used by the SecurityContext.
optional FSGroupStrategyOptions fsGroup = 13;
// readOnlyRootFilesystem when set to true will force containers to run with a read only root file
// system. If the container specifically requests to run with a non-read only root file system
// the PSP should deny the pod.
// If set to false the container may run with a read only root file system if it wishes but it
// will not be forced to.
// +optional
optional bool readOnlyRootFilesystem = 14;
// defaultAllowPrivilegeEscalation controls the default setting for whether a
// process can gain more privileges than its parent process.
// +optional
optional bool defaultAllowPrivilegeEscalation = 15;
// allowPrivilegeEscalation determines if a pod can request to allow
// privilege escalation. If unspecified, defaults to true.
// +optional
optional bool allowPrivilegeEscalation = 16;
// allowedHostPaths is a white list of allowed host paths. Empty indicates
// that all host paths may be used.
// +optional
repeated AllowedHostPath allowedHostPaths = 17;
// allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all
// Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes
// is allowed in the "volumes" field.
// +optional
repeated AllowedFlexVolume allowedFlexVolumes = 18;
// allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none.
// Each entry is either a plain sysctl name or ends in "*" in which case it is considered
// as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed.
// Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection.
//
// Examples:
// e.g. "foo/*" allows "foo/bar", "foo/baz", etc.
// e.g. "foo.*" allows "foo.bar", "foo.baz", etc.
// +optional
repeated string allowedUnsafeSysctls = 19;
// forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none.
// Each entry is either a plain sysctl name or ends in "*" in which case it is considered
// as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.
//
// Examples:
// e.g. "foo/*" forbids "foo/bar", "foo/baz", etc.
// e.g. "foo.*" forbids "foo.bar", "foo.baz", etc.
// +optional
repeated string forbiddenSysctls = 20;
// AllowedProcMountTypes is a whitelist of allowed ProcMountTypes.
// Empty or nil indicates that only the DefaultProcMountType may be used.
// This requires the ProcMountType feature flag to be enabled.
// +optional
repeated string allowedProcMountTypes = 21;
}
// RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.
message RunAsGroupStrategyOptions {
// rule is the strategy that will dictate the allowable RunAsGroup values that may be set.
optional string rule = 1;
// ranges are the allowed ranges of gids that may be used. If you would like to force a single gid
// then supply a single range with the same start and end. Required for MustRunAs.
// +optional
repeated IDRange ranges = 2;
}
// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.
message RunAsUserStrategyOptions {
// rule is the strategy that will dictate the allowable RunAsUser values that may be set.
optional string rule = 1;
// ranges are the allowed ranges of uids that may be used. If you would like to force a single uid
// then supply a single range with the same start and end. Required for MustRunAs.
// +optional
repeated IDRange ranges = 2;
}
// SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.
message SELinuxStrategyOptions {
// rule is the strategy that will dictate the allowable labels that may be set.
optional string rule = 1;
// seLinuxOptions required to run as; required for MustRunAs
// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
// +optional
optional k8s.io.api.core.v1.SELinuxOptions seLinuxOptions = 2;
}
// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
message SupplementalGroupsStrategyOptions {
// rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
// +optional
optional string rule = 1;
// ranges are the allowed ranges of supplemental groups. If you would like to force a single
// supplemental group then supply a single range with the same start and end. Required for MustRunAs.
// +optional
repeated IDRange ranges = 2;
}
| {
"pile_set_name": "Github"
} |
attribute vec4 a_Position ;
uniform mat4 u_Matrix;
//attribute mat4 u_Matrix;
uniform mat4 u_ProMatrix;
void main(){
gl_Position = u_ProMatrix * u_Matrix * a_Position;
} | {
"pile_set_name": "Github"
} |
/*
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
#define INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
#include "libyuv/basic_types.h"
#ifdef __cplusplus
namespace libyuv {
extern "C" {
#endif
// Copy ARGB to ARGB.
#define ARGBToARGB ARGBCopy
LIBYUV_API
int ARGBCopy(const uint8* src_argb, int src_stride_argb,
uint8* dst_argb, int dst_stride_argb,
int width, int height);
// Convert ARGB To BGRA.
LIBYUV_API
int ARGBToBGRA(const uint8* src_argb, int src_stride_argb,
uint8* dst_bgra, int dst_stride_bgra,
int width, int height);
// Convert ARGB To ABGR.
LIBYUV_API
int ARGBToABGR(const uint8* src_argb, int src_stride_argb,
uint8* dst_abgr, int dst_stride_abgr,
int width, int height);
// Convert ARGB To RGBA.
LIBYUV_API
int ARGBToRGBA(const uint8* src_argb, int src_stride_argb,
uint8* dst_rgba, int dst_stride_rgba,
int width, int height);
// Convert ARGB To RGB24.
LIBYUV_API
int ARGBToRGB24(const uint8* src_argb, int src_stride_argb,
uint8* dst_rgb24, int dst_stride_rgb24,
int width, int height);
// Convert ARGB To RAW.
LIBYUV_API
int ARGBToRAW(const uint8* src_argb, int src_stride_argb,
uint8* dst_rgb, int dst_stride_rgb,
int width, int height);
// Convert ARGB To RGB565.
LIBYUV_API
int ARGBToRGB565(const uint8* src_argb, int src_stride_argb,
uint8* dst_rgb565, int dst_stride_rgb565,
int width, int height);
// Convert ARGB To RGB565 with 4x4 dither matrix (16 bytes).
// Values in dither matrix from 0 to 7 recommended.
// The order of the dither matrix is first byte is upper left.
// TODO(fbarchard): Consider pointer to 2d array for dither4x4.
// const uint8(*dither)[4][4];
LIBYUV_API
int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb,
uint8* dst_rgb565, int dst_stride_rgb565,
const uint8* dither4x4, int width, int height);
// Convert ARGB To ARGB1555.
LIBYUV_API
int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb,
uint8* dst_argb1555, int dst_stride_argb1555,
int width, int height);
// Convert ARGB To ARGB4444.
LIBYUV_API
int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb,
uint8* dst_argb4444, int dst_stride_argb4444,
int width, int height);
// Convert ARGB To I444.
LIBYUV_API
int ARGBToI444(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int width, int height);
// Convert ARGB To I422.
LIBYUV_API
int ARGBToI422(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int width, int height);
// Convert ARGB To I420. (also in convert.h)
LIBYUV_API
int ARGBToI420(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int width, int height);
// Convert ARGB to J420. (JPeg full range I420).
LIBYUV_API
int ARGBToJ420(const uint8* src_argb, int src_stride_argb,
uint8* dst_yj, int dst_stride_yj,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int width, int height);
// Convert ARGB to J422.
LIBYUV_API
int ARGBToJ422(const uint8* src_argb, int src_stride_argb,
uint8* dst_yj, int dst_stride_yj,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int width, int height);
// Convert ARGB To I411.
LIBYUV_API
int ARGBToI411(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int width, int height);
// Convert ARGB to J400. (JPeg full range).
LIBYUV_API
int ARGBToJ400(const uint8* src_argb, int src_stride_argb,
uint8* dst_yj, int dst_stride_yj,
int width, int height);
// Convert ARGB to I400.
LIBYUV_API
int ARGBToI400(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
int width, int height);
// Convert ARGB to G. (Reverse of J400toARGB, which replicates G back to ARGB)
LIBYUV_API
int ARGBToG(const uint8* src_argb, int src_stride_argb,
uint8* dst_g, int dst_stride_g,
int width, int height);
// Convert ARGB To NV12.
LIBYUV_API
int ARGBToNV12(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
uint8* dst_uv, int dst_stride_uv,
int width, int height);
// Convert ARGB To NV21.
LIBYUV_API
int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
uint8* dst_vu, int dst_stride_vu,
int width, int height);
// Convert ARGB To NV21.
LIBYUV_API
int ARGBToNV21(const uint8* src_argb, int src_stride_argb,
uint8* dst_y, int dst_stride_y,
uint8* dst_vu, int dst_stride_vu,
int width, int height);
// Convert ARGB To YUY2.
LIBYUV_API
int ARGBToYUY2(const uint8* src_argb, int src_stride_argb,
uint8* dst_yuy2, int dst_stride_yuy2,
int width, int height);
// Convert ARGB To UYVY.
LIBYUV_API
int ARGBToUYVY(const uint8* src_argb, int src_stride_argb,
uint8* dst_uyvy, int dst_stride_uyvy,
int width, int height);
#ifdef __cplusplus
} // extern "C"
} // namespace libyuv
#endif
#endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_
| {
"pile_set_name": "Github"
} |
package org.multiverse.api.blocking;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.multiverse.TestUtils.assertClosed;
public class DefaultRetryLatch_prepareForPoolingTest {
@Test
public void whenClosed() {
DefaultRetryLatch latch = new DefaultRetryLatch();
long era = latch.getEra();
latch.reset();
assertClosed(latch);
assertEquals(era + 1, latch.getEra());
}
@Test
public void whenOpen() {
DefaultRetryLatch latch = new DefaultRetryLatch();
long era = latch.getEra();
latch.open(era);
latch.reset();
assertClosed(latch);
assertEquals(era + 1, latch.getEra());
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
namespace Microsoft.FSharp.NativeInterop
open Microsoft.FSharp.Core
open Microsoft.FSharp.Collections
[<RequireQualifiedAccess>]
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
/// <summary>Contains operations on native pointers. Use of these operators may
/// result in the generation of unverifiable code.</summary>
///
/// <namespacedoc><summary>
/// Library functionality for native interopability. See
/// also <a href="https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/external-functions">F# External Functions</a> in
/// the F# Language Guide.
/// </summary></namespacedoc>
module NativePtr =
[<Unverifiable>]
[<CompiledName("OfNativeIntInlined")>]
/// <summary>Returns a typed native pointer for a given machine address.</summary>
/// <param name="address">The pointer address.</param>
///
/// <returns>A typed pointer.</returns>
val inline ofNativeInt : address:nativeint -> nativeptr<'T>
[<Unverifiable>]
[<CompiledName("ToVoidPtrInlined")>]
/// <summary>Returns an untyped native pointer for a given typed pointer.</summary>
///
/// <param name="address">The pointer address.</param>
///
/// <returns>A typed pointer.</returns>
val inline toVoidPtr : address:nativeptr<'T> -> voidptr
[<Unverifiable>]
[<CompiledName("OfVoidPtrInlined")>]
/// <summary>Returns a typed native pointer for a untyped native pointer.</summary>
///
/// <param name="address">The untyped pointer.</param>
///
/// <returns>A typed pointer.</returns>
val inline ofVoidPtr : address: voidptr -> nativeptr<'T>
[<Unverifiable>]
[<CompiledName("ToNativeIntInlined")>]
/// <summary>Returns a machine address for a given typed native pointer.</summary>
///
/// <param name="address">The input pointer.</param>
///
/// <returns>The machine address.</returns>
val inline toNativeInt : address:nativeptr<'T> -> nativeint
[<Unverifiable>]
[<CompiledName("AddPointerInlined")>]
/// <summary>Returns a typed native pointer by adding index * sizeof<'T> to the
/// given input pointer.</summary>
///
/// <param name="address">The input pointer.</param>
/// <param name="index">The index by which to offset the pointer.</param>
///
/// <returns>A typed pointer.</returns>
val inline add : address:nativeptr<'T> -> index:int -> nativeptr<'T>
[<Unverifiable>]
[<CompiledName("GetPointerInlined")>]
/// <summary>Dereferences the typed native pointer computed by adding index * sizeof<'T> to the
/// given input pointer.</summary>
///
/// <param name="address">The input pointer.</param>
/// <param name="index">The index by which to offset the pointer.</param>
///
/// <returns>The value at the pointer address.</returns>
val inline get : address:nativeptr<'T> -> index:int -> 'T
[<Unverifiable>]
[<CompiledName("ReadPointerInlined")>]
/// <summary>Dereferences the given typed native pointer.</summary>
///
/// <param name="address">The input pointer.</param>
///
/// <returns>The value at the pointer address.</returns>
val inline read : address:nativeptr<'T> -> 'T
[<Unverifiable>]
[<CompiledName("WritePointerInlined")>]
/// <summary>Assigns the <c>value</c> into the memory location referenced by the given typed native pointer.</summary>
///
/// <param name="address">The input pointer.</param>
/// <param name="value">The value to assign.</param>
val inline write : address:nativeptr<'T> -> value:'T -> unit
[<Unverifiable>]
[<CompiledName("SetPointerInlined")>]
/// <summary>Assigns the <c>value</c> into the memory location referenced by the typed native
/// pointer computed by adding index * sizeof<'T> to the given input pointer.</summary>
///
/// <param name="address">The input pointer.</param>
/// <param name="index">The index by which to offset the pointer.</param>
/// <param name="value">The value to assign.</param>
val inline set : address:nativeptr<'T> -> index:int -> value:'T -> unit
/// <summary>Allocates a region of memory on the stack.</summary>
///
/// <param name="count">The number of objects of type T to allocate.</param>
///
/// <returns>A typed pointer to the allocated memory.</returns>
[<Unverifiable>]
[<CompiledName("StackAllocate")>]
val inline stackalloc: count:int -> nativeptr<'T>
/// <summary>Converts a given typed native pointer to a managed pointer.</summary>
///
/// <param name="address">The input pointer.</param>
///
/// <returns>The managed pointer.</returns>
[<Unverifiable>]
[<CompiledName("ToByRefInlined")>]
val inline toByRef: address: nativeptr<'T> -> byref<'T>
| {
"pile_set_name": "Github"
} |
#ifndef BOOST_SMART_PTR_DETAIL_LWM_PTHREADS_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_LWM_PTHREADS_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/detail/lwm_pthreads.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
//
// 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)
//
#include <boost/assert.hpp>
#include <pthread.h>
namespace boost
{
namespace detail
{
class lightweight_mutex
{
private:
pthread_mutex_t m_;
lightweight_mutex(lightweight_mutex const &);
lightweight_mutex & operator=(lightweight_mutex const &);
public:
lightweight_mutex()
{
// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
#if defined(__hpux) && defined(_DECTHREADS_)
BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 );
#else
BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 );
#endif
}
~lightweight_mutex()
{
BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 );
}
class scoped_lock;
friend class scoped_lock;
class scoped_lock
{
private:
pthread_mutex_t & m_;
scoped_lock(scoped_lock const &);
scoped_lock & operator=(scoped_lock const &);
public:
scoped_lock(lightweight_mutex & m): m_(m.m_)
{
BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
}
~scoped_lock()
{
BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
}
};
};
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_DETAIL_LWM_PTHREADS_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
//==============================================================================
// Copyright (c) 2010-2018 Advanced Micro Devices, Inc. All rights reserved.
/// \author AMD Developer Tools Team
/// \file
/// \brief Defines the data types and enumerations used by GPUPerfAPI.
/// This file does not need to be directly included by an application
/// that uses GPUPerfAPI.
//==============================================================================
#ifndef _GPUPERFAPI_TYPES_H_
#define _GPUPERFAPI_TYPES_H_
#include <limits.h>
// Platform specific definitions
#ifdef _WIN32
#include <Windows.h>
typedef HMODULE LibHandle; ///< typedef for HMODULE for loading the library on windows
typedef GUID GPA_UUID; ///< typedef for Windows GUID definition
#else
typedef void* LibHandle; ///< typedef for void* for loading the library on linux
/// Structure for holding UUID
typedef struct GPA_UUID
{
unsigned long m_data1; ///< first part of the UUID data
unsigned short m_data2; ///< second part of the UUID data
unsigned short m_data3; ///< third part of the UUID data
unsigned char m_data4[8]; ///< fourth part of the UUID data
#ifdef __cplusplus
/// operator overloaded function for equality comparison
/// \param otherUUID the item being compared
/// \return true if UUIDs are equal otherwise false
bool operator==(const GPA_UUID& otherUUID)
{
bool isEqual = true;
isEqual &= m_data1 == otherUUID.m_data1;
isEqual &= m_data2 == otherUUID.m_data2;
isEqual &= m_data3 == otherUUID.m_data3;
isEqual &= m_data4[0] == otherUUID.m_data4[0];
isEqual &= m_data4[1] == otherUUID.m_data4[1];
isEqual &= m_data4[2] == otherUUID.m_data4[2];
isEqual &= m_data4[3] == otherUUID.m_data4[3];
isEqual &= m_data4[4] == otherUUID.m_data4[4];
isEqual &= m_data4[5] == otherUUID.m_data4[5];
isEqual &= m_data4[6] == otherUUID.m_data4[6];
isEqual &= m_data4[7] == otherUUID.m_data4[7];
return isEqual;
}
#endif
} GPA_UUID;
#endif
// Type definitions
typedef float gpa_float32; ///< GPA specific type for 32-bit float
typedef double gpa_float64; ///< GPA specific type for 64-bit float
typedef unsigned char gpa_uint8; ///< GPA specific type for 8-bit unsigned integer
typedef unsigned short gpa_uint16; ///< GPA specific type for 16-bit unsigned integer
typedef unsigned int gpa_uint32; ///< GPA specific type for 32-bit unsigned integer
#ifdef _WIN32
typedef unsigned __int64 gpa_uint64; ///< GPA specific type for 64-bit unsigned integer
#endif // _WIN32
#ifdef __linux__
#ifndef GPALIB_DECL
#ifdef __cplusplus
#define GPALIB_DECL extern "C"
#else
#define GPALIB_DECL
#endif // _cplusplus
#endif
typedef unsigned int UINT; ///< GPA specific type to define UINT on Linux
typedef unsigned long long gpa_uint64; ///< GPA specific type for 64-bit unsigned integer
#ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(x) (void)(x)
#endif
#define _strcmpi(a, b) strcasecmp(a, b)
#define _stricmp(a, b) strcasecmp(a, b)
// for now, just use non secure version for Linux
#define strcpy_s(dst, ndst, src) strcpy(dst, src)
#define strcat_s(dst, ndst, src) strcat(dst, src)
#define strtok_s(a, b, c) strtok(a, b)
#define strnlen_s(a, b) strlen(a)
#define strncpy_s(a, b, c, d) strncpy(a, c, d)
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif // __linux__
// Limit definitions
/// Macro for max uint32
#define GPA_UINT32_MAX UINT_MAX
/// Macro for max uint64
#define GPA_UINT64_MAX ULLONG_MAX
/// Macro to define opaque pointer types
#define GPA_DEFINE_OBJECT(ObjectType) typedef struct _GPA_##ObjectType* GPA_##ObjectType;
/// Context ID opaque pointer type
GPA_DEFINE_OBJECT(ContextId)
/// Session ID opaque pointer type
GPA_DEFINE_OBJECT(SessionId)
/// Command List ID opaque pointer type
GPA_DEFINE_OBJECT(CommandListId)
/// Macro for null command list
#define GPA_NULL_COMMAND_LIST NULL
/// Status enumerations
typedef enum
{
GPA_STATUS_OK = 0,
GPA_STATUS_RESULT_NOT_READY = 1,
GPA_STATUS_MAX = GPA_STATUS_RESULT_NOT_READY,
GPA_STATUS_ERROR_NULL_POINTER = -1,
GPA_STATUS_ERROR_CONTEXT_NOT_OPEN = -2,
GPA_STATUS_ERROR_CONTEXT_ALREADY_OPEN = -3,
GPA_STATUS_ERROR_INDEX_OUT_OF_RANGE = -4,
GPA_STATUS_ERROR_COUNTER_NOT_FOUND = -5,
GPA_STATUS_ERROR_ALREADY_ENABLED = -6,
GPA_STATUS_ERROR_NO_COUNTERS_ENABLED = -7,
GPA_STATUS_ERROR_NOT_ENABLED = -8,
GPA_STATUS_ERROR_COMMAND_LIST_ALREADY_ENDED = -9,
GPA_STATUS_ERROR_COMMAND_LIST_ALREADY_STARTED = -10,
GPA_STATUS_ERROR_COMMAND_LIST_NOT_ENDED = -11,
GPA_STATUS_ERROR_NOT_ENOUGH_PASSES = -12,
GPA_STATUS_ERROR_SAMPLE_NOT_STARTED = -13,
GPA_STATUS_ERROR_SAMPLE_ALREADY_STARTED = -14,
GPA_STATUS_ERROR_SAMPLE_NOT_ENDED = -15,
GPA_STATUS_ERROR_CANNOT_CHANGE_COUNTERS_WHEN_SAMPLING = -16,
GPA_STATUS_ERROR_SESSION_NOT_FOUND = -17,
GPA_STATUS_ERROR_SAMPLE_NOT_FOUND = -18,
GPA_STATUS_ERROR_CONTEXT_NOT_FOUND = -19,
GPA_STATUS_ERROR_COMMAND_LIST_NOT_FOUND = -20,
GPA_STATUS_ERROR_READING_SAMPLE_RESULT = -21,
GPA_STATUS_ERROR_VARIABLE_NUMBER_OF_SAMPLES_IN_PASSES = -22,
GPA_STATUS_ERROR_FAILED = -23,
GPA_STATUS_ERROR_HARDWARE_NOT_SUPPORTED = -24,
GPA_STATUS_ERROR_DRIVER_NOT_SUPPORTED = -25,
GPA_STATUS_ERROR_API_NOT_SUPPORTED = -26,
GPA_STATUS_ERROR_INVALID_PARAMETER = -27,
GPA_STATUS_ERROR_LIB_LOAD_FAILED = -28,
GPA_STATUS_ERROR_LIB_LOAD_MAJOR_VERSION_MISMATCH = -29,
GPA_STATUS_ERROR_LIB_LOAD_MINOR_VERSION_MISMATCH = -30,
GPA_STATUS_ERROR_GPA_NOT_INITIALIZED = -31,
GPA_STATUS_ERROR_GPA_ALREADY_INITIALIZED = -32,
GPA_STATUS_ERROR_SAMPLE_IN_SECONDARY_COMMAND_LIST = -33,
GPA_STATUS_ERROR_INCOMPATIBLE_SAMPLE_TYPES = -34,
GPA_STATUS_ERROR_SESSION_ALREADY_STARTED = -35,
GPA_STATUS_ERROR_SESSION_NOT_STARTED = -36,
GPA_STATUS_ERROR_SESSION_NOT_ENDED = -37,
GPA_STATUS_ERROR_INVALID_DATATYPE = -38,
GPA_STATUS_ERROR_INVALID_COUNTER_EQUATION = -39,
GPA_STATUS_ERROR_TIMEOUT = -40,
GPA_STATUS_ERROR_LIB_ALREADY_LOADED = -41,
GPA_STATUS_ERROR_OTHER_SESSION_ACTIVE = -42,
GPA_STATUS_ERROR_EXCEPTION = -43,
GPA_STATUS_MIN = GPA_STATUS_ERROR_EXCEPTION,
// following are status codes used internally within GPUPerfAPI
GPA_STATUS_INTERNAL = 256,
} GPA_Status;
/// Typedef for a set of flags that can be combined into an integer
typedef gpa_uint32 GPA_Flags;
/// Flags to pass into GPA_Initialize()
typedef enum
{
GPA_INITIALIZE_DEFAULT_BIT = 0, ///< Initialize GPA using all default options
} GPA_Initialize_Bits;
/// Allows GPA_Initialize_Bits to be combined into a single parameter.
typedef GPA_Flags GPA_InitializeFlags;
/// Flags to pass into GPA_OpenContext()
typedef enum
{
GPA_OPENCONTEXT_DEFAULT_BIT = 0, ///< Open contexts using all default options (all counters exposed, clocks are set to stable frequencies which are known to be power and thermal sustainable. The ratio between the engine and memory clock frequencies will be kept the same as much as possible)
GPA_OPENCONTEXT_HIDE_PUBLIC_COUNTERS_BIT = 0x01, ///< Prevent the public counters from being exposed
GPA_OPENCONTEXT_HIDE_SOFTWARE_COUNTERS_BIT = 0x02, ///< Prevent the software counters from being exposed
GPA_OPENCONTEXT_HIDE_HARDWARE_COUNTERS_BIT = 0x04, ///< Prevent the hardware counters from being exposed
GPA_OPENCONTEXT_CLOCK_MODE_NONE_BIT = 0x0008, ///< Clock frequencies are not altered and may vary widely during profiling based on GPU usage and other factors.
GPA_OPENCONTEXT_CLOCK_MODE_PEAK_BIT = 0x0010, ///< Clocks are set to peak frequencies. In most cases this is safe to do for short periods of time while profiling. However, the GPU clock frequencies could still be reduced from peak level under power and thermal constraints.
GPA_OPENCONTEXT_CLOCK_MODE_MIN_MEMORY_BIT = 0x0020, ///< The memory clock frequency is set to the minimum level, while the engine clock is set to a power and thermal sustainable level.
GPA_OPENCONTEXT_CLOCK_MODE_MIN_ENGINE_BIT = 0x0040 ///< The engine clock frequency is set to the minimum level, while the memory clock is set to a power and thermal sustainable level.
} GPA_OpenContext_Bits;
/// Allows GPA_OpenContext_Bits to be combined into a single parameter.
typedef GPA_Flags GPA_OpenContextFlags;
/// Value type definitions
typedef enum
{
GPA_DATA_TYPE_FLOAT64, ///< Result will be a 64-bit float
GPA_DATA_TYPE_UINT64, ///< Result will be a 64-bit unsigned int
GPA_DATA_TYPE__LAST ///< Marker indicating last element
} GPA_Data_Type;
/// Result usage type definitions
typedef enum
{
GPA_USAGE_TYPE_RATIO, ///< Result is a ratio of two different values or types
GPA_USAGE_TYPE_PERCENTAGE, ///< Result is a percentage, typically within [0,100] range, but may be higher for certain counters
GPA_USAGE_TYPE_CYCLES, ///< Result is in clock cycles
GPA_USAGE_TYPE_MILLISECONDS, ///< Result is in milliseconds
GPA_USAGE_TYPE_BYTES, ///< Result is in bytes
GPA_USAGE_TYPE_ITEMS, ///< Result is a count of items or objects (ie, vertices, triangles, threads, pixels, texels, etc)
GPA_USAGE_TYPE_KILOBYTES, ///< Result is in kilobytes
GPA_USAGE_TYPE_NANOSECONDS, ///< Result is in nanoseconds
GPA_USAGE_TYPE__LAST ///< Marker indicating last element
} GPA_Usage_Type;
/// Logging type definitions
typedef enum
{
GPA_LOGGING_NONE = 0x00, ///< No logging
GPA_LOGGING_ERROR = 0x01, ///< Log errors
GPA_LOGGING_MESSAGE = 0x02, ///< Log messages
GPA_LOGGING_ERROR_AND_MESSAGE = GPA_LOGGING_ERROR | GPA_LOGGING_MESSAGE, ///< Log errors and messages
GPA_LOG_ERROR_AND_MESSAGE = GPA_LOGGING_ERROR_AND_MESSAGE, ///< Log errors and messages - Backward Compatibility
GPA_LOGGING_TRACE = 0x04, ///< Log traces
GPA_LOGGING_ERROR_AND_TRACE = GPA_LOGGING_ERROR | GPA_LOGGING_TRACE, ///< Log errors and traces
GPA_LOGGING_MESSAGE_AND_TRACE = GPA_LOGGING_MESSAGE | GPA_LOGGING_TRACE, ///< Log messages traces
GPA_LOGGING_ERROR_MESSAGE_AND_TRACE = GPA_LOGGING_ERROR | GPA_LOGGING_MESSAGE | GPA_LOGGING_TRACE, ///< Log errors and messages and traces
GPA_LOGGING_ALL = 0xFF, ///< Log all
GPA_LOGGING_DEBUG_ERROR = 0x0100, ///< Log debugging errors
GPA_LOGGING_DEBUG_MESSAGE = 0x0200, ///< Log debugging messages
GPA_LOGGING_DEBUG_TRACE = 0x0400, ///< Log debugging traces
GPA_LOGGING_DEBUG_COUNTERDEFS = 0x0800, ///< Log debugging counter defs
GPA_LOGGING_INTERNAL = 0x1000, ///< Log internal GPA
GPA_LOGGING_DEBUG_ALL = 0xFF00 ///< Log all debugging
} GPA_Logging_Type;
/// APIs Supported (either publicly or internally) by GPUPerfAPI
typedef enum
{
GPA_API__START, ///< Marker indicating first element
GPA_API_DIRECTX_11 = GPA_API__START, ///< DirectX 11 API
GPA_API_DIRECTX_12, ///< DirectX 12 API
GPA_API_OPENGL, ///< OpenGL API
GPA_API_OPENCL, ///< OpenCL API
GPA_API_ROCM, ///< ROCm API
GPA_API_HSA = GPA_API_ROCM, ///< HSA API -- maps to ROCm API, enum value left here for backwards compatibility
GPA_API_VULKAN, ///< Vulkan API
GPA_API_NO_SUPPORT, ///< APIs which are not yet supported or for which support has been removed
GPA_API__LAST ///< Marker indicating last element
} GPA_API_Type;
/// This enum needs to be kept up to date with GDT_HW_GENERATION in DeviceInfo.h
typedef enum
{
GPA_HW_GENERATION_NONE, ///< undefined hw generation
GPA_HW_GENERATION_NVIDIA, ///< Used for nvidia cards by GPA
GPA_HW_GENERATION_INTEL, ///< Used for Intel cards by GPA
GPA_HW_GENERATION_GFX6, ///< GFX IP 6
GPA_HW_GENERATION_SOUTHERNISLAND = GPA_HW_GENERATION_GFX6, ///< For backwards compatibility
GPA_HW_GENERATION_GFX7, ///< GFX IP 7
GPA_HW_GENERATION_SEAISLAND = GPA_HW_GENERATION_GFX7, ///< For backwards compatibility
GPA_HW_GENERATION_GFX8, ///< GFX IP 8
GPA_HW_GENERATION_VOLCANICISLAND = GPA_HW_GENERATION_GFX8, ///< For backwards compatibility
GPA_HW_GENERATION_GFX9, ///< GFX IP 9
GPA_HW_GENERATION__LAST ///< Marker indicating last element
} GPA_Hw_Generation;
/// Command list / command buffer types
typedef enum
{
GPA_COMMAND_LIST_NONE, ///< no command list, used for APIs that do not directly expose command lists or command buffers (DirectX 11, OpenGL, OpenCL, HSA)
GPA_COMMAND_LIST_PRIMARY, ///< corresponds to DirectX 12 direct/compute/copy command list and Vulkan primary vkCommandBuffer
GPA_COMMAND_LIST_SECONDARY, ///< corresponds to DirectX 12 bundle and Vulkan secondary vkCommandBuffer
GPA_COMMAND_LIST__LAST ///< Marker indicating last element
} GPA_Command_List_Type;
/// Counter sample types - used to indicate which sample types are supported by a counter
typedef enum
{
GPA_COUNTER_SAMPLE_TYPE_DISCRETE, ///< Discrete counter type -- discrete counters provide a single value per workload measured
} GPA_Counter_Sample_Type;
/// Context Sample types -- used to indicate which sample types are supported by a context. A context can support any combination of these
typedef enum
{
GPA_CONTEXT_SAMPLE_TYPE_DISCRETE_COUNTER = 0x01, ///< Discrete counters sample type -- discrete counters provide a single value per workload measured
} GPA_Context_Sample_Type_Bits;
/// Allows GPA_Context_Sample_Type_Bits to be combined into a single parameter.
typedef GPA_Flags GPA_ContextSampleTypeFlags;
/// Session Sample types -- used by the client to tell GPUPerfAPI which sample types will be created for a session
typedef enum
{
GPA_SESSION_SAMPLE_TYPE_DISCRETE_COUNTER, ///< Discrete counters sample type -- discrete counters provide a single value per workload measured
} GPA_Session_Sample_Type;
#endif // _GPUPERFAPI_TYPES_H_
| {
"pile_set_name": "Github"
} |
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// Copyright 2019 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#pragma once
#include <gtest/gtest.h>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdlib>
#include <functional>
#include <limits>
#include <random>
#include <vector>
#include <fp16.h>
#include <xnnpack.h>
#include <xnnpack/params-init.h>
#include <xnnpack/params.h>
class ClampMicrokernelTester {
public:
enum class Variant {
Native,
Scalar,
};
inline ClampMicrokernelTester& batch_size(size_t batch_size) {
assert(batch_size != 0);
this->batch_size_ = batch_size;
return *this;
}
inline size_t batch_size() const {
return this->batch_size_;
}
inline ClampMicrokernelTester& inplace(bool inplace) {
this->inplace_ = inplace;
return *this;
}
inline bool inplace() const {
return this->inplace_;
}
inline ClampMicrokernelTester& qmin(uint8_t qmin) {
this->qmin_ = qmin;
return *this;
}
inline uint8_t qmin() const {
return this->qmin_;
}
inline ClampMicrokernelTester& qmax(uint8_t qmax) {
this->qmax_ = qmax;
return *this;
}
inline uint8_t qmax() const {
return this->qmax_;
}
inline ClampMicrokernelTester& iterations(size_t iterations) {
this->iterations_ = iterations;
return *this;
}
inline size_t iterations() const {
return this->iterations_;
}
void Test(xnn_u8_clamp_ukernel_function clamp, Variant variant = Variant::Native) const {
std::random_device random_device;
auto rng = std::mt19937(random_device());
auto u8rng = std::bind(std::uniform_int_distribution<uint32_t>(0, std::numeric_limits<uint8_t>::max()), rng);
std::vector<uint8_t> x(batch_size() + XNN_EXTRA_BYTES / sizeof(uint8_t));
std::vector<uint8_t> y(batch_size() + (inplace() ? XNN_EXTRA_BYTES / sizeof(uint8_t) : 0));
std::vector<uint8_t> y_ref(batch_size());
for (size_t iteration = 0; iteration < iterations(); iteration++) {
std::generate(x.begin(), x.end(), std::ref(u8rng));
if (inplace()) {
std::generate(y.begin(), y.end(), std::ref(u8rng));
} else {
std::fill(y.begin(), y.end(), 0xA5);
}
const uint8_t* x_data = inplace() ? y.data() : x.data();
// Prepare parameters.
union xnn_u8_minmax_params params = { };
switch (variant) {
case Variant::Native:
params = xnn_init_u8_minmax_params(qmin(), qmax());
break;
case Variant::Scalar:
params = xnn_init_scalar_u8_minmax_params(qmin(), qmax());
break;
}
// Compute reference results.
for (size_t i = 0; i < batch_size(); i++) {
y_ref[i] = std::max(std::min(x_data[i], qmax()), qmin());
}
// Call optimized micro-kernel.
clamp(batch_size() * sizeof(uint8_t), x_data, y.data(), ¶ms);
// Verify results.
for (size_t i = 0; i < batch_size(); i++) {
ASSERT_LE(uint32_t(y[i]), uint32_t(qmax()))
<< "at position " << i << ", batch_size = " << batch_size();
ASSERT_GE(uint32_t(y[i]), uint32_t(qmin()))
<< "at position " << i << ", batch_size = " << batch_size();
ASSERT_EQ(uint32_t(y_ref[i]), uint32_t(y[i]))
<< "at position " << i << ", batch_size = " << batch_size()
<< ", qmin = " << uint32_t(qmin()) << ", qmax = " << uint32_t(qmax());
}
}
}
void Test(xnn_f16_clamp_ukernel_function clamp) const {
std::random_device random_device;
auto rng = std::mt19937(random_device());
auto f32rng = std::bind(std::uniform_real_distribution<float>(0.0f, 255.0f), rng);
auto f16rng = std::bind(fp16_ieee_from_fp32_value, f32rng);
std::vector<uint16_t> x(batch_size() + XNN_EXTRA_BYTES / sizeof(uint16_t));
std::vector<uint16_t> y(batch_size() + (inplace() ? XNN_EXTRA_BYTES / sizeof(uint16_t) : 0));
std::vector<float> y_ref(batch_size());
for (size_t iteration = 0; iteration < iterations(); iteration++) {
std::generate(x.begin(), x.end(), std::ref(f16rng));
if (inplace()) {
std::generate(y.begin(), y.end(), std::ref(f16rng));
} else {
std::fill(y.begin(), y.end(), UINT16_C(0x7E00) /* NaN */);
}
const uint16_t* x_data = inplace() ? y.data() : x.data();
// Prepare parameters.
xnn_f16_minmax_params params = xnn_init_f16_minmax_params(
fp16_ieee_from_fp32_value(float(qmin())),
fp16_ieee_from_fp32_value(float(qmax())));
// Compute reference results.
for (size_t i = 0; i < batch_size(); i++) {
y_ref[i] = std::max(std::min(fp16_ieee_to_fp32_value(x_data[i]), float(qmax())), float(qmin()));
}
// Call optimized micro-kernel.
clamp(batch_size() * sizeof(uint16_t), x_data, y.data(), ¶ms);
// Verify results.
for (size_t i = 0; i < batch_size(); i++) {
ASSERT_LE(fp16_ieee_to_fp32_value(y[i]), float(qmax()))
<< "at position " << i << ", batch_size = " << batch_size();
ASSERT_GE(fp16_ieee_to_fp32_value(y[i]), float(qmin()))
<< "at position " << i << ", batch_size = " << batch_size();
ASSERT_EQ(y_ref[i], fp16_ieee_to_fp32_value(y[i]))
<< "at position " << i << ", batch_size = " << batch_size()
<< ", qmin = " << float(qmin()) << ", qmax = " << float(qmax());
}
}
}
void Test(xnn_f32_clamp_ukernel_function clamp, Variant variant = Variant::Native) const {
std::random_device random_device;
auto rng = std::mt19937(random_device());
auto f32rng = std::bind(std::uniform_real_distribution<float>(0.0f, 255.0f), rng);
std::vector<float> x(batch_size() + XNN_EXTRA_BYTES / sizeof(float));
std::vector<float> y(batch_size() + (inplace() ? XNN_EXTRA_BYTES / sizeof(float) : 0));
std::vector<float> y_ref(batch_size());
for (size_t iteration = 0; iteration < iterations(); iteration++) {
std::generate(x.begin(), x.end(), std::ref(f32rng));
if (inplace()) {
std::generate(y.begin(), y.end(), std::ref(f32rng));
} else {
std::fill(y.begin(), y.end(), std::nanf(""));
}
const float* x_data = inplace() ? y.data() : x.data();
// Prepare parameters.
xnn_f32_minmax_params params = { };
switch (variant) {
case Variant::Native:
params = xnn_init_f32_minmax_params(float(qmin()), float(qmax()));
break;
case Variant::Scalar:
params = xnn_init_scalar_f32_minmax_params(float(qmin()), float(qmax()));
break;
}
// Compute reference results.
for (size_t i = 0; i < batch_size(); i++) {
y_ref[i] = std::max(std::min(x_data[i], float(qmax())), float(qmin()));
}
// Call optimized micro-kernel.
clamp(batch_size() * sizeof(float), x_data, y.data(), ¶ms);
// Verify results.
for (size_t i = 0; i < batch_size(); i++) {
ASSERT_LE(y[i], float(qmax()))
<< "at position " << i << ", batch_size = " << batch_size();
ASSERT_GE(y[i], float(qmin()))
<< "at position " << i << ", batch_size = " << batch_size();
ASSERT_EQ(y_ref[i], y[i])
<< "at position " << i << ", batch_size = " << batch_size()
<< ", qmin = " << uint32_t(qmin()) << ", qmax = " << uint32_t(qmax());
}
}
}
private:
size_t batch_size_{1};
bool inplace_{false};
uint8_t qmin_{50};
uint8_t qmax_{200};
size_t iterations_{15};
};
| {
"pile_set_name": "Github"
} |
package runtime
import (
"context"
"encoding/base64"
"fmt"
"net"
"net/http"
"net/textproto"
"strconv"
"strings"
"time"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)
// MetadataHeaderPrefix is the http prefix that represents custom metadata
// parameters to or from a gRPC call.
const MetadataHeaderPrefix = "Grpc-Metadata-"
// MetadataPrefix is prepended to permanent HTTP header keys (as specified
// by the IANA) when added to the gRPC context.
const MetadataPrefix = "grpcgateway-"
// MetadataTrailerPrefix is prepended to gRPC metadata as it is converted to
// HTTP headers in a response handled by grpc-gateway
const MetadataTrailerPrefix = "Grpc-Trailer-"
const metadataGrpcTimeout = "Grpc-Timeout"
const metadataHeaderBinarySuffix = "-Bin"
const xForwardedFor = "X-Forwarded-For"
const xForwardedHost = "X-Forwarded-Host"
var (
// DefaultContextTimeout is used for gRPC call context.WithTimeout whenever a Grpc-Timeout inbound
// header isn't present. If the value is 0 the sent `context` will not have a timeout.
DefaultContextTimeout = 0 * time.Second
)
func decodeBinHeader(v string) ([]byte, error) {
if len(v)%4 == 0 {
// Input was padded, or padding was not necessary.
return base64.StdEncoding.DecodeString(v)
}
return base64.RawStdEncoding.DecodeString(v)
}
/*
AnnotateContext adds context information such as metadata from the request.
At a minimum, the RemoteAddr is included in the fashion of "X-Forwarded-For",
except that the forwarded destination is not another HTTP service but rather
a gRPC service.
*/
func AnnotateContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, error) {
var pairs []string
timeout := DefaultContextTimeout
if tm := req.Header.Get(metadataGrpcTimeout); tm != "" {
var err error
timeout, err = timeoutDecode(tm)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid grpc-timeout: %s", tm)
}
}
for key, vals := range req.Header {
for _, val := range vals {
key = textproto.CanonicalMIMEHeaderKey(key)
// For backwards-compatibility, pass through 'authorization' header with no prefix.
if key == "Authorization" {
pairs = append(pairs, "authorization", val)
}
if h, ok := mux.incomingHeaderMatcher(key); ok {
// Handles "-bin" metadata in grpc, since grpc will do another base64
// encode before sending to server, we need to decode it first.
if strings.HasSuffix(key, metadataHeaderBinarySuffix) {
b, err := decodeBinHeader(val)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid binary header %s: %s", key, err)
}
val = string(b)
}
pairs = append(pairs, h, val)
}
}
}
if host := req.Header.Get(xForwardedHost); host != "" {
pairs = append(pairs, strings.ToLower(xForwardedHost), host)
} else if req.Host != "" {
pairs = append(pairs, strings.ToLower(xForwardedHost), req.Host)
}
if addr := req.RemoteAddr; addr != "" {
if remoteIP, _, err := net.SplitHostPort(addr); err == nil {
if fwd := req.Header.Get(xForwardedFor); fwd == "" {
pairs = append(pairs, strings.ToLower(xForwardedFor), remoteIP)
} else {
pairs = append(pairs, strings.ToLower(xForwardedFor), fmt.Sprintf("%s, %s", fwd, remoteIP))
}
} else {
grpclog.Infof("invalid remote addr: %s", addr)
}
}
if timeout != 0 {
ctx, _ = context.WithTimeout(ctx, timeout)
}
if len(pairs) == 0 {
return ctx, nil
}
md := metadata.Pairs(pairs...)
for _, mda := range mux.metadataAnnotators {
md = metadata.Join(md, mda(ctx, req))
}
return metadata.NewOutgoingContext(ctx, md), nil
}
// ServerMetadata consists of metadata sent from gRPC server.
type ServerMetadata struct {
HeaderMD metadata.MD
TrailerMD metadata.MD
}
type serverMetadataKey struct{}
// NewServerMetadataContext creates a new context with ServerMetadata
func NewServerMetadataContext(ctx context.Context, md ServerMetadata) context.Context {
return context.WithValue(ctx, serverMetadataKey{}, md)
}
// ServerMetadataFromContext returns the ServerMetadata in ctx
func ServerMetadataFromContext(ctx context.Context) (md ServerMetadata, ok bool) {
md, ok = ctx.Value(serverMetadataKey{}).(ServerMetadata)
return
}
func timeoutDecode(s string) (time.Duration, error) {
size := len(s)
if size < 2 {
return 0, fmt.Errorf("timeout string is too short: %q", s)
}
d, ok := timeoutUnitToDuration(s[size-1])
if !ok {
return 0, fmt.Errorf("timeout unit is not recognized: %q", s)
}
t, err := strconv.ParseInt(s[:size-1], 10, 64)
if err != nil {
return 0, err
}
return d * time.Duration(t), nil
}
func timeoutUnitToDuration(u uint8) (d time.Duration, ok bool) {
switch u {
case 'H':
return time.Hour, true
case 'M':
return time.Minute, true
case 'S':
return time.Second, true
case 'm':
return time.Millisecond, true
case 'u':
return time.Microsecond, true
case 'n':
return time.Nanosecond, true
default:
}
return
}
// isPermanentHTTPHeader checks whether hdr belongs to the list of
// permenant request headers maintained by IANA.
// http://www.iana.org/assignments/message-headers/message-headers.xml
func isPermanentHTTPHeader(hdr string) bool {
switch hdr {
case
"Accept",
"Accept-Charset",
"Accept-Language",
"Accept-Ranges",
"Authorization",
"Cache-Control",
"Content-Type",
"Cookie",
"Date",
"Expect",
"From",
"Host",
"If-Match",
"If-Modified-Since",
"If-None-Match",
"If-Schedule-Tag-Match",
"If-Unmodified-Since",
"Max-Forwards",
"Origin",
"Pragma",
"Referer",
"User-Agent",
"Via",
"Warning":
return true
}
return false
}
| {
"pile_set_name": "Github"
} |
.cls1 { /*!*/ }
.cls2 {
composes: cls1;
color: ultra-red;
} | {
"pile_set_name": "Github"
} |
// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------
var rule = require('../../../lib/rules/aria-role');
var RuleTester = require('eslint').RuleTester;
const errorMessage = 'Elements with ARIA roles must use a valid, non-abstract ARIA role.';
var tester = new RuleTester({
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 2015,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
}
});
tester.run('aria-role', rule, {
valid: [
{
filename: 'test.vue',
code: '<template><div role="button"></div></template>',
},
{
filename: 'test.vue',
code: '<template><div :role={role}></div></template>',
},
{
filename: 'test.vue',
code: '<template><div></div></template>',
},
{
filename: 'test.vue',
code: '<template><Foo role="maran"></Foo></template>',
options: [{
ignoreNonDOM: true
}]
},
{
code: `
export default {
render (h) {
return (
<Foo role={role}></Foo>
)
},
};`
}
],
invalid: [{
filename: 'test.vue',
code: '<template><div role="datepicker"></div></template>',
errors: [{
message: errorMessage
}]
},{
filename: 'test.vue',
code: '<template><div role=""></div></template>',
errors: [{
message: errorMessage
}]
}],
});
| {
"pile_set_name": "Github"
} |
[
{
"kids":[],
"uid":"heavenvisitor",
"parent":"",
"text":"转发微博。",
"mid":"hiFOX2",
"date":"2011-05-16 11:17:45"
},
{
"kids":[],
"uid":"hnxcylx",
"parent":"fwlJPb",
"text":"",
"mid":"gJ61PD",
"date":"2011-05-09 21:20:30"
},
{
"kids":[],
"uid":"1759438351",
"parent":"",
"text":"转发微博。",
"mid":"ggeXoq",
"date":"2011-05-04 14:30:14"
},
{
"kids":[],
"uid":"1778157857",
"parent":"",
"text":"转发微博。",
"mid":"fLxZn1",
"date":"2011-04-28 16:29:19"
},
{
"kids":[],
"uid":"1778157857",
"parent":"",
"text":"转发微博。",
"mid":"fLxYLN",
"date":"2011-04-28 16:29:16"
},
{
"kids":[],
"uid":"viano114",
"parent":"",
"text":"为什么受伤的总是我们。",
"mid":"fL62Ly",
"date":"2011-04-28 13:53:41"
},
{
"kids":[],
"uid":"33483956",
"parent":"",
"text":"转发微博。",
"mid":"fL4aK0",
"date":"2011-04-28 13:43:31"
},
{
"kids":[],
"uid":"2108064923",
"parent":"fwuQSc",
"text":"",
"mid":"fKynaQ",
"date":"2011-04-28 12:49:10"
},
{
"kids":[],
"uid":"gieseking",
"parent":"fxDXUc",
"text":"敌占区威武,坐等和谐",
"mid":"fJcf6M",
"date":"2011-04-28 02:12:28"
},
{
"kids":[],
"uid":"ljyueran",
"parent":"",
"text":"",
"mid":"fGDB2A",
"date":"2011-04-27 17:28:09"
},
{
"kids":[],
"uid":"4reedom",
"parent":"",
"text":"是的",
"mid":"fGtgoQ",
"date":"2011-04-27 16:33:50"
},
{
"kids":[],
"uid":"1bmw",
"parent":"",
"text":"",
"mid":"fGmbns",
"date":"2011-04-27 15:55:16"
},
{
"kids":[],
"uid":"2006916677",
"parent":"",
"text":"",
"mid":"fFxqVB",
"date":"2011-04-27 13:15:36"
},
{
"kids":[],
"uid":"geyushu",
"parent":"",
"text":"转发微博。",
"mid":"fEmJvx",
"date":"2011-04-27 09:05:36"
},
{
"kids":[],
"uid":"1805727512",
"parent":"",
"text":"",
"mid":"fEdnXX",
"date":"2011-04-27 08:00:46"
},
{
"kids":[],
"uid":"1803888475",
"parent":"",
"text":"",
"mid":"fEc1Up",
"date":"2011-04-27 07:45:36"
},
{
"kids":[],
"uid":"1814878701",
"parent":"",
"text":"要转",
"mid":"fDzEvT",
"date":"2011-04-27 00:32:37"
},
{
"kids":[],
"uid":"benieinino",
"parent":"",
"text":"轉發微博。",
"mid":"fBwRdb",
"date":"2011-04-26 18:06:01"
},
{
"kids":[],
"uid":"wingsong",
"parent":"",
"text":"转发微博。",
"mid":"fBrA27",
"date":"2011-04-26 17:39:01"
},
{
"kids":[],
"uid":"tw0oo",
"parent":"",
"text":"",
"mid":"fAzVTy",
"date":"2011-04-26 14:32:01"
},
{
"kids":[],
"uid":"dalaopoxiaoxi",
"parent":"",
"text":"",
"mid":"fAwUyg",
"date":"2011-04-26 14:15:25"
},
{
"kids":[],
"uid":"1843433613",
"parent":"",
"text":"",
"mid":"fyyqtX",
"date":"2011-04-26 02:48:17"
},
{
"kids":[],
"uid":"evaguduing",
"parent":"",
"text":"",
"mid":"fyxGuY",
"date":"2011-04-26 02:11:21"
},
{
"kids":[],
"uid":"1705399841",
"parent":"",
"text":"",
"mid":"fyw6ds",
"date":"2011-04-26 01:12:36"
},
{
"kids":[],
"uid":"guyimeng",
"parent":"",
"text":"辛酸心酸。",
"mid":"fyhXmL",
"date":"2011-04-25 22:44:13"
},
{
"kids":[],
"uid":"1550102004",
"parent":"",
"text":"转",
"mid":"fyep1q",
"date":"2011-04-25 22:19:53"
},
{
"kids":[],
"uid":"1766213440",
"parent":"",
"text":"",
"mid":"fy9VW6",
"date":"2011-04-25 21:47:27"
},
{
"kids":[],
"uid":"1607773831",
"parent":"",
"text":"说得好,敌占区",
"mid":"fy4i3r",
"date":"2011-04-25 21:03:22"
},
{
"kids":[],
"uid":"1923180220",
"parent":"",
"text":"",
"mid":"fy2jdo",
"date":"2011-04-25 20:46:53"
},
{
"kids":[
"fJcf6M"
],
"uid":"kuramamew",
"parent":"",
"text":"",
"mid":"fxDXUc",
"date":"2011-04-25 20:09:08"
},
{
"kids":[],
"uid":"tengfeiv5",
"parent":"",
"text":"",
"mid":"fxDLWV",
"date":"2011-04-25 20:07:26"
},
{
"kids":[],
"uid":"1848918447",
"parent":"",
"text":"",
"mid":"fxBv03",
"date":"2011-04-25 19:46:45"
},
{
"kids":[],
"uid":"1885081053",
"parent":"",
"text":"敌占区伤不起!",
"mid":"fxASrF",
"date":"2011-04-25 19:40:58"
},
{
"kids":[],
"uid":"1872196804",
"parent":"",
"text":"",
"mid":"fxAGXZ",
"date":"2011-04-25 19:39:11"
},
{
"kids":[],
"uid":"adorewisdom",
"parent":"",
"text":"",
"mid":"fxuwuN",
"date":"2011-04-25 18:41:18"
},
{
"kids":[],
"uid":"nllt",
"parent":"",
"text":"伤不起。",
"mid":"fxqrcz",
"date":"2011-04-25 18:01:37"
},
{
"kids":[],
"uid":"1610855312",
"parent":"",
"text":"转发微博。",
"mid":"fxpOWm",
"date":"2011-04-25 17:55:57"
},
{
"kids":[],
"uid":"1999092607",
"parent":"",
"text":"转发微博。",
"mid":"fxkrhT",
"date":"2011-04-25 17:03:19"
},
{
"kids":[],
"uid":"1988417895",
"parent":"",
"text":"",
"mid":"fxkk5d",
"date":"2011-04-25 17:02:09"
},
{
"kids":[],
"uid":"yadiair",
"parent":"",
"text":"今天中午买了四个丑柑花了七块六…正式宣布我吃不起水果了",
"mid":"fxkcSf",
"date":"2011-04-25 17:00:59"
},
{
"kids":[],
"uid":"sange261531697",
"parent":"",
"text":"",
"mid":"fxk949",
"date":"2011-04-25 17:00:23"
},
{
"kids":[],
"uid":"2092076601",
"parent":"",
"text":"唉!",
"mid":"fxjVC1",
"date":"2011-04-25 16:58:17"
},
{
"kids":[],
"uid":"sthaipo",
"parent":"",
"text":"反正有吃亏的就得有占便宜的",
"mid":"fxhIIZ",
"date":"2011-04-25 16:36:44"
},
{
"kids":[],
"uid":"1855040401",
"parent":"",
"text":"卡子太多,进不了城j。想买好菜,下乡来吧",
"mid":"fxhlF1",
"date":"2011-04-25 16:33:05"
},
{
"kids":[],
"uid":"tuyifang",
"parent":"",
"text":"兴,百姓苦;亡,百姓苦!",
"mid":"fxdGuZ",
"date":"2011-04-25 15:55:57"
},
{
"kids":[],
"uid":"c0d0",
"parent":"",
"text":"敌占区哈哈",
"mid":"fxdp1i",
"date":"2011-04-25 15:53:01"
},
{
"kids":[],
"uid":"ghibli0222",
"parent":"",
"text":"",
"mid":"fxcJWJ",
"date":"2011-04-25 15:46:11"
},
{
"kids":[],
"uid":"1258466731",
"parent":"",
"text":"我要多吃白菜,我吃素啦",
"mid":"fxbTkk",
"date":"2011-04-25 15:37:23"
},
{
"kids":[],
"uid":"1775878692",
"parent":"",
"text":"笑!",
"mid":"fxadxM",
"date":"2011-04-25 15:19:57"
},
{
"kids":[],
"uid":"1718055272",
"parent":"",
"text":"",
"mid":"fxa4EN",
"date":"2011-04-25 15:18:26"
},
{
"kids":[],
"uid":"1855667513",
"parent":"",
"text":"苦了我们这些农村老百姓",
"mid":"fx8eAo",
"date":"2011-04-25 14:59:13"
},
{
"kids":[],
"uid":"hmimicky",
"parent":"",
"text":"这里面的波折伤了多少农民的心!",
"mid":"fx80J7",
"date":"2011-04-25 14:56:51"
},
{
"kids":[],
"uid":"antorny",
"parent":"",
"text":"",
"mid":"fx5LmI",
"date":"2011-04-25 14:33:52"
},
{
"kids":[],
"uid":"1982190573",
"parent":"",
"text":"说对了。[good]",
"mid":"fx5oYO",
"date":"2011-04-25 14:30:09"
},
{
"kids":[],
"uid":"eyesblur",
"parent":"",
"text":"我也想不明白.这个问题难办到年复一年的出现?...",
"mid":"fx5395",
"date":"2011-04-25 14:26:34"
},
{
"kids":[],
"uid":"2109112802",
"parent":"",
"text":"原来我一直生活在敌占区。。。。懂了。。。。",
"mid":"fx4Wk3",
"date":"2011-04-25 14:25:23"
},
{
"kids":[],
"uid":"1682029470",
"parent":"",
"text":"",
"mid":"fx4rzw",
"date":"2011-04-25 14:20:16"
},
{
"kids":[],
"uid":"1785864807",
"parent":"",
"text":"唉",
"mid":"fx48cW",
"date":"2011-04-25 14:17:07"
},
{
"kids":[],
"uid":"1228075603",
"parent":"",
"text":"“敌占区”形容的非常生动",
"mid":"fx3LYU",
"date":"2011-04-25 14:13:22"
},
{
"kids":[],
"uid":"tongyuhang",
"parent":"",
"text":"",
"mid":"fx3IfQ",
"date":"2011-04-25 14:12:43"
},
{
"kids":[],
"uid":"1994251571",
"parent":"",
"text":"哎~",
"mid":"fx3vzN",
"date":"2011-04-25 14:10:39"
},
{
"kids":[],
"uid":"1773103100",
"parent":"",
"text":"求解[奥特曼]",
"mid":"fx1GO2",
"date":"2011-04-25 13:52:18"
},
{
"kids":[],
"uid":"hexiaoxiaopeng",
"parent":"",
"text":"正所谓兴百姓苦,亡百姓苦,黎民百姓要的只是吃饭住房而已,可是这都难实现",
"mid":"fx1g9a",
"date":"2011-04-25 13:48:03"
},
{
"kids":[],
"uid":"1337032317",
"parent":"",
"text":"",
"mid":"fx114W",
"date":"2011-04-25 13:45:39"
},
{
"kids":[],
"uid":"dubisheng",
"parent":"",
"text":"",
"mid":"fx0Tln",
"date":"2011-04-25 13:44:25"
},
{
"kids":[],
"uid":"1256784760",
"parent":"",
"text":"",
"mid":"fx0DpC",
"date":"2011-04-25 13:41:55"
},
{
"kids":[],
"uid":"gengwochouba",
"parent":"",
"text":"",
"mid":"fwFh6E",
"date":"2011-04-25 13:29:17"
},
{
"kids":[],
"uid":"1895772683",
"parent":"",
"text":"哈哈",
"mid":"fwFamj",
"date":"2011-04-25 13:28:14"
},
{
"kids":[],
"uid":"1862438310",
"parent":"",
"text":"转发微博。",
"mid":"fwEMJr",
"date":"2011-04-25 13:24:51"
},
{
"kids":[],
"uid":"jojo123",
"parent":"",
"text":"",
"mid":"fwECOj",
"date":"2011-04-25 13:23:29"
},
{
"kids":[],
"uid":"yizifeng",
"parent":"",
"text":"我在想,是因为大家一窝蜂的种菜导致来年积压吗?那要政府做什么!!!",
"mid":"fwE1wB",
"date":"2011-04-25 13:18:22"
},
{
"kids":[],
"uid":"1849197872",
"parent":"",
"text":"",
"mid":"fwDURq",
"date":"2011-04-25 13:17:29"
},
{
"kids":[],
"uid":"jimandtom",
"parent":"",
"text":"",
"mid":"fwDw1O",
"date":"2011-04-25 13:14:07"
},
{
"kids":[],
"uid":"bannyshao",
"parent":"",
"text":"好句",
"mid":"fwDmat",
"date":"2011-04-25 13:12:47"
},
{
"kids":[],
"uid":"1881140760",
"parent":"",
"text":"经济模式有问题啦,杂种的经济模模式~!",
"mid":"fwCDGZ",
"date":"2011-04-25 13:06:55"
},
{
"kids":[],
"uid":"mumu325",
"parent":"",
"text":"",
"mid":"fwBqF2",
"date":"2011-04-25 12:57:32"
},
{
"kids":[],
"uid":"song1119",
"parent":"",
"text":"",
"mid":"fwAQfb",
"date":"2011-04-25 12:53:06"
},
{
"kids":[],
"uid":"tigershine",
"parent":"",
"text":"转发微博。",
"mid":"fwABqT",
"date":"2011-04-25 12:51:17"
},
{
"kids":[],
"uid":"bluelonelycat",
"parent":"",
"text":"从地里到菜市场10倍的价差被谁拿走了?",
"mid":"fwAwzS",
"date":"2011-04-25 12:50:42"
},
{
"kids":[],
"uid":"1734210993",
"parent":"",
"text":"",
"mid":"fwApJR",
"date":"2011-04-25 12:49:55"
},
{
"kids":[],
"uid":"lc0816",
"parent":"",
"text":"",
"mid":"fwAaQr",
"date":"2011-04-25 12:48:05"
},
{
"kids":[],
"uid":"chen19900808",
"parent":"",
"text":"",
"mid":"fwA57o",
"date":"2011-04-25 12:47:21"
},
{
"kids":[],
"uid":"1782119757",
"parent":"",
"text":"楼主你知道的太多了。",
"mid":"fwA0w7",
"date":"2011-04-25 12:46:48"
},
{
"kids":[],
"uid":"candylyamn",
"parent":"",
"text":"",
"mid":"fwzXd2",
"date":"2011-04-25 12:46:24"
},
{
"kids":[],
"uid":"1874305533",
"parent":"",
"text":"层层关卡",
"mid":"fwzyYD",
"date":"2011-04-25 12:43:27"
},
{
"kids":[],
"uid":"1227620957",
"parent":"",
"text":"",
"mid":"fwzpfy",
"date":"2011-04-25 12:42:15"
},
{
"kids":[],
"uid":"tenz1989",
"parent":"",
"text":"",
"mid":"fwzonY",
"date":"2011-04-25 12:42:07"
},
{
"kids":[],
"uid":"zoxzo",
"parent":"",
"text":"",
"mid":"fwzkFG",
"date":"2011-04-25 12:41:40"
},
{
"kids":[],
"uid":"yichaojove",
"parent":"",
"text":"",
"mid":"fwzkO1",
"date":"2011-04-25 12:41:38"
},
{
"kids":[],
"uid":"1835058767",
"parent":"",
"text":"",
"mid":"fwz8kj",
"date":"2011-04-25 12:40:05"
},
{
"kids":[],
"uid":"komer",
"parent":"",
"text":"转发微博。",
"mid":"fwz5aQ",
"date":"2011-04-25 12:39:38"
},
{
"kids":[],
"uid":"kuonnana",
"parent":"",
"text":"",
"mid":"fwyWuu",
"date":"2011-04-25 12:38:34"
},
{
"kids":[],
"uid":"guohuajie",
"parent":"",
"text":"敌占区?",
"mid":"fwytLT",
"date":"2011-04-25 12:34:43"
},
{
"kids":[],
"uid":"sarahneverlazy",
"parent":"",
"text":"",
"mid":"fwynQ1",
"date":"2011-04-25 12:33:56"
},
{
"kids":[],
"uid":"1918273450",
"parent":"",
"text":"那边的菜那么便宜,这边的菜这么贵,他们中间的是什么?",
"mid":"fwyihZ",
"date":"2011-04-25 12:33:08"
},
{
"kids":[],
"uid":"kingdom320",
"parent":"",
"text":"在这个高贵的国家里,菜贵伤民,菜贱伤农。",
"mid":"fwy8ex",
"date":"2011-04-25 12:31:49"
},
{
"kids":[],
"uid":"1695694704",
"parent":"",
"text":"转发微博。",
"mid":"fwxYac",
"date":"2011-04-25 12:30:23"
},
{
"kids":[],
"uid":"dogandog",
"parent":"",
"text":"我们还是社会主义初级阶段,恩,等到高级阶段,农民估计都已经被搞死一半了",
"mid":"fwxLvv",
"date":"2011-04-25 12:28:37"
},
{
"kids":[],
"uid":"vincentfxu",
"parent":"",
"text":"",
"mid":"fwxLc3",
"date":"2011-04-25 12:28:34"
},
{
"kids":[],
"uid":"asmart",
"parent":"",
"text":"",
"mid":"fwxJQi",
"date":"2011-04-25 12:28:25"
},
{
"kids":[],
"uid":"1883035811",
"parent":"",
"text":"",
"mid":"fwxFJq",
"date":"2011-04-25 12:27:49"
},
{
"kids":[],
"uid":"1884369352",
"parent":"",
"text":"政府啊,共产党啊。。。。",
"mid":"fwxzD9",
"date":"2011-04-25 12:26:54"
},
{
"kids":[],
"uid":"1912098745",
"parent":"",
"text":"",
"mid":"fwxlqC",
"date":"2011-04-25 12:24:49"
},
{
"kids":[],
"uid":"fengyinger",
"parent":"",
"text":"",
"mid":"fwxd87",
"date":"2011-04-25 12:23:31"
},
{
"kids":[],
"uid":"732152123",
"parent":"",
"text":"",
"mid":"fwx4iY",
"date":"2011-04-25 12:22:10"
},
{
"kids":[],
"uid":"hubird",
"parent":"",
"text":"为什么市里的菜还 么贵?",
"mid":"fwwZ2e",
"date":"2011-04-25 12:21:23"
},
{
"kids":[],
"uid":"1858197632",
"parent":"",
"text":"",
"mid":"fwwSYg",
"date":"2011-04-25 12:20:24"
},
{
"kids":[],
"uid":"1868458522",
"parent":"",
"text":"天朝人民提倡自力更生啊",
"mid":"fwwQaZ",
"date":"2011-04-25 12:19:57"
},
{
"kids":[],
"uid":"1420127307",
"parent":"",
"text":"",
"mid":"fwwGJ5",
"date":"2011-04-25 12:18:31"
},
{
"kids":[],
"uid":"1880057837",
"parent":"",
"text":"",
"mid":"fwwtad",
"date":"2011-04-25 12:16:23"
},
{
"kids":[],
"uid":"1694142377",
"parent":"",
"text":"是的,太多的碉堡了。",
"mid":"fwwlfo",
"date":"2011-04-25 12:15:07"
},
{
"kids":[],
"uid":"leozliu",
"parent":"",
"text":"",
"mid":"fwwdpy",
"date":"2011-04-25 12:13:47"
},
{
"kids":[],
"uid":"baby2cute",
"parent":"",
"text":"",
"mid":"fwvSqc",
"date":"2011-04-25 12:10:14"
},
{
"kids":[],
"uid":"201271108",
"parent":"",
"text":"",
"mid":"fwvQ6n",
"date":"2011-04-25 12:09:57"
},
{
"kids":[],
"uid":"1820626007",
"parent":"",
"text":"",
"mid":"fwvGjK",
"date":"2011-04-25 12:08:15"
},
{
"kids":[],
"uid":"rosegui",
"parent":"",
"text":"",
"mid":"fwvyS4",
"date":"2011-04-25 12:07:01"
},
{
"kids":[],
"uid":"1652655202",
"parent":"",
"text":"",
"mid":"fwvuRv",
"date":"2011-04-25 12:06:17"
},
{
"kids":[],
"uid":"2002233252",
"parent":"",
"text":"",
"mid":"fwvqMa",
"date":"2011-04-25 12:05:36"
},
{
"kids":[],
"uid":"908114725",
"parent":"",
"text":"",
"mid":"fwvdJf",
"date":"2011-04-25 12:03:24"
},
{
"kids":[],
"uid":"augel007",
"parent":"",
"text":"",
"mid":"fwuU1v",
"date":"2011-04-25 12:00:10"
},
{
"kids":[],
"uid":"1823167447",
"parent":"",
"text":"我们这里的菜贵的离谱.一询问.都说:现在菜都涨了,我们也没办法 ..然后新闻又说菜价低的菜农自杀,,,哦买噶,, 低价菜.你在哪里??是谁精神分裂了?!",
"mid":"fwuRn1",
"date":"2011-04-25 11:59:44"
},
{
"kids":[
"fKynaQ"
],
"uid":"VATAYOUKONG",
"parent":"",
"text":"",
"mid":"fwuQSc",
"date":"2011-04-25 11:59:41"
},
{
"kids":[],
"uid":"1765166597",
"parent":"",
"text":"农、民皆郁闷",
"mid":"fwuGD6",
"date":"2011-04-25 11:57:59"
},
{
"kids":[],
"uid":"1297771260",
"parent":"",
"text":"",
"mid":"fwuGl5",
"date":"2011-04-25 11:57:56"
},
{
"kids":[],
"uid":"yd55555",
"parent":"",
"text":"",
"mid":"fwuD4b",
"date":"2011-04-25 11:57:23"
},
{
"kids":[],
"uid":"1983joyce",
"parent":"",
"text":"",
"mid":"fwuv8f",
"date":"2011-04-25 11:56:07"
},
{
"kids":[],
"uid":"khjmervin7",
"parent":"",
"text":"过五关斩六将也逃不出收费站的重重关卡",
"mid":"fwuqlW",
"date":"2011-04-25 11:55:23"
},
{
"kids":[],
"uid":"1789763431",
"parent":"",
"text":"悲催",
"mid":"fwueiR",
"date":"2011-04-25 11:53:28"
},
{
"kids":[],
"uid":"1956422827",
"parent":"",
"text":"",
"mid":"fwua8V",
"date":"2011-04-25 11:52:48"
},
{
"kids":[],
"uid":"ivordeng",
"parent":"",
"text":"敌占区。。。占区。。。区。。。",
"mid":"fwu8or",
"date":"2011-04-25 11:52:31"
},
{
"kids":[],
"uid":"1866591002",
"parent":"",
"text":"兴,百姓苦;亡,百姓苦~",
"mid":"fwtY5z",
"date":"2011-04-25 11:50:52"
},
{
"kids":[],
"uid":"erichupeng",
"parent":"",
"text":"",
"mid":"fwtKIU",
"date":"2011-04-25 11:48:44"
},
{
"kids":[],
"uid":"778958225",
"parent":"",
"text":"贊敵佔區",
"mid":"fwtxhE",
"date":"2011-04-25 11:46:38"
},
{
"kids":[],
"uid":"1858974010",
"parent":"",
"text":"这是怎么的了呢?",
"mid":"fwtwKV",
"date":"2011-04-25 11:46:32"
},
{
"kids":[],
"uid":"1144845117",
"parent":"",
"text":"转发微博。",
"mid":"fwttO4",
"date":"2011-04-25 11:46:03"
},
{
"kids":[],
"uid":"1563032374",
"parent":"",
"text":"",
"mid":"fwtkud",
"date":"2011-04-25 11:44:26"
},
{
"kids":[],
"uid":"zjuawen",
"parent":"",
"text":"那比敌占区还难过",
"mid":"fwtgIb",
"date":"2011-04-25 11:43:49"
},
{
"kids":[],
"uid":"moo00oom",
"parent":"",
"text":"转发微博。",
"mid":"fwtefO",
"date":"2011-04-25 11:43:26"
},
{
"kids":[],
"uid":"1908302677",
"parent":"",
"text":"",
"mid":"fwte4y",
"date":"2011-04-25 11:43:25"
},
{
"kids":[],
"uid":"1885576844",
"parent":"",
"text":"",
"mid":"fwtaKM",
"date":"2011-04-25 11:42:52"
},
{
"kids":[],
"uid":"sophykim",
"parent":"",
"text":"嗯···是的。白色恐怖区······",
"mid":"fwt7c1",
"date":"2011-04-25 11:42:17"
},
{
"kids":[],
"uid":"hucongxian",
"parent":"",
"text":"",
"mid":"fwt6IA",
"date":"2011-04-25 11:42:13"
},
{
"kids":[],
"uid":"kunlun1988",
"parent":"",
"text":"",
"mid":"fwt65M",
"date":"2011-04-25 11:42:08"
},
{
"kids":[],
"uid":"1951731837",
"parent":"",
"text":"",
"mid":"fwt63A",
"date":"2011-04-25 11:42:08"
},
{
"kids":[],
"uid":"pyepan",
"parent":"",
"text":"",
"mid":"fwt2Kj",
"date":"2011-04-25 11:41:36"
},
{
"kids":[],
"uid":"caspermoon",
"parent":"",
"text":"",
"mid":"fwt18s",
"date":"2011-04-25 11:41:20"
},
{
"kids":[],
"uid":"1903245712",
"parent":"",
"text":"流通环节吃水深,物流交通成本高",
"mid":"fwsWYi",
"date":"2011-04-25 11:40:35"
},
{
"kids":[],
"uid":"1770173222",
"parent":"",
"text":"",
"mid":"fwsWza",
"date":"2011-04-25 11:40:35"
},
{
"kids":[],
"uid":"1996000127",
"parent":"",
"text":"",
"mid":"fwsUND",
"date":"2011-04-25 11:40:17"
},
{
"kids":[],
"uid":"franckqu",
"parent":"",
"text":"",
"mid":"fwsSvZ",
"date":"2011-04-25 11:39:57"
},
{
"kids":[],
"uid":"hanzhiyong",
"parent":"",
"text":"转发微博。",
"mid":"fwsNYN",
"date":"2011-04-25 11:39:12"
},
{
"kids":[],
"uid":"1785265214",
"parent":"",
"text":"最近听到的这样的消息太多",
"mid":"fwsHDj",
"date":"2011-04-25 11:38:08"
},
{
"kids":[],
"uid":"1834327251",
"parent":"",
"text":"转发微博。",
"mid":"fwsFvx",
"date":"2011-04-25 11:37:51"
},
{
"kids":[],
"uid":"1940185975",
"parent":"",
"text":"",
"mid":"fwsAbi",
"date":"2011-04-25 11:36:57"
},
{
"kids":[],
"uid":"1888580117",
"parent":"",
"text":"都什么情况呢。。",
"mid":"fwstCt",
"date":"2011-04-25 11:35:52"
},
{
"kids":[],
"uid":"rileychen",
"parent":"",
"text":"",
"mid":"fwssxU",
"date":"2011-04-25 11:35:41"
},
{
"kids":[],
"uid":"zx9051",
"parent":"",
"text":"",
"mid":"fwsp2i",
"date":"2011-04-25 11:35:08"
},
{
"kids":[],
"uid":"josen21",
"parent":"",
"text":"民不聊生。",
"mid":"fwsmG5",
"date":"2011-04-25 11:34:45"
},
{
"kids":[],
"uid":"1915902917",
"parent":"",
"text":"",
"mid":"fwsllm",
"date":"2011-04-25 11:34:31"
},
{
"kids":[],
"uid":"317160666",
"parent":"",
"text":"",
"mid":"fwsj0s",
"date":"2011-04-25 11:34:08"
},
{
"kids":[],
"uid":"saifar",
"parent":"",
"text":"",
"mid":"fwscb5",
"date":"2011-04-25 11:33:02"
},
{
"kids":[],
"uid":"lovepili",
"parent":"",
"text":"",
"mid":"fwsawS",
"date":"2011-04-25 11:32:50"
},
{
"kids":[],
"uid":"rotart",
"parent":"",
"text":"",
"mid":"fws0ce",
"date":"2011-04-25 11:31:10"
},
{
"kids":[],
"uid":"1877043255",
"parent":"",
"text":"",
"mid":"fwrU27",
"date":"2011-04-25 11:30:11"
},
{
"kids":[],
"uid":"wxiaoj",
"parent":"",
"text":"埋伏甚多啊,从菜地到市场,一路遇险呢",
"mid":"fwrBZ1",
"date":"2011-04-25 11:27:19"
},
{
"kids":[],
"uid":"1646757673",
"parent":"",
"text":"疏菜为什么贵政府最清楚",
"mid":"fwrAeW",
"date":"2011-04-25 11:27:04"
},
{
"kids":[],
"uid":"yejinlun0129",
"parent":"",
"text":"谁能让最后一公里变得便宜~",
"mid":"fwrsHd",
"date":"2011-04-25 11:25:49"
},
{
"kids":[],
"uid":"deynzy",
"parent":"",
"text":"。。。。",
"mid":"fwrqqc",
"date":"2011-04-25 11:25:26"
},
{
"kids":[],
"uid":"1662716852",
"parent":"",
"text":"",
"mid":"fwrq1Y",
"date":"2011-04-25 11:25:21"
},
{
"kids":[],
"uid":"335644008",
"parent":"",
"text":"",
"mid":"fwrpt0",
"date":"2011-04-25 11:25:18"
},
{
"kids":[],
"uid":"1739458943",
"parent":"",
"text":"",
"mid":"fwrp2Y",
"date":"2011-04-25 11:25:14"
},
{
"kids":[],
"uid":"1800194433",
"parent":"",
"text":"hah 路过敌占区 是要收重税的",
"mid":"fwrhOZ",
"date":"2011-04-25 11:24:05"
},
{
"kids":[],
"uid":"irisinfj",
"parent":"",
"text":"肯定是日本鬼子干的!",
"mid":"fwrflO",
"date":"2011-04-25 11:23:41"
},
{
"kids":[],
"uid":"beautystore",
"parent":"",
"text":"敌占区美",
"mid":"fwrddJ",
"date":"2011-04-25 11:23:20"
},
{
"kids":[],
"uid":"wqq4sn",
"parent":"",
"text":"转发微博。",
"mid":"fwr6zI",
"date":"2011-04-25 11:22:15"
},
{
"kids":[],
"uid":"qq37002452",
"parent":"",
"text":"怎么没感觉买的菜便宜了,中间的钱让谁赚了",
"mid":"fwr3NN",
"date":"2011-04-25 11:21:51"
},
{
"kids":[],
"uid":"1867668190",
"parent":"",
"text":"",
"mid":"fwr2ht",
"date":"2011-04-25 11:21:35"
},
{
"kids":[],
"uid":"weiba46",
"parent":"",
"text":"",
"mid":"fwr1Jn",
"date":"2011-04-25 11:21:30"
},
{
"kids":[],
"uid":"318834999",
"parent":"",
"text":"神奇国度",
"mid":"fwqZCn",
"date":"2011-04-25 11:21:11"
},
{
"kids":[],
"uid":"fairysi1984",
"parent":"",
"text":"菜贵伤民,菜贱伤农",
"mid":"fwqXBN",
"date":"2011-04-25 11:20:56"
},
{
"kids":[],
"uid":"yalanale",
"parent":"",
"text":"转发微博。",
"mid":"fwqVqf",
"date":"2011-04-25 11:20:37"
},
{
"kids":[],
"uid":"1979831723",
"parent":"",
"text":"",
"mid":"fwqSNp",
"date":"2011-04-25 11:20:15"
},
{
"kids":[],
"uid":"1848878992",
"parent":"",
"text":"",
"mid":"fwqO2i",
"date":"2011-04-25 11:19:26"
},
{
"kids":[],
"uid":"1460158973",
"parent":"",
"text":"",
"mid":"fwqMUS",
"date":"2011-04-25 11:19:15"
},
{
"kids":[],
"uid":"1867242154",
"parent":"",
"text":"",
"mid":"fwqKKe",
"date":"2011-04-25 11:18:57"
},
{
"kids":[],
"uid":"wanzhaohuizhou",
"parent":"",
"text":"",
"mid":"fwqJT2",
"date":"2011-04-25 11:18:48"
},
{
"kids":[],
"uid":"moody86",
"parent":"",
"text":"敌人N多阿",
"mid":"fwqGd9",
"date":"2011-04-25 11:18:13"
},
{
"kids":[],
"uid":"panyikkkkk",
"parent":"",
"text":"",
"mid":"fwquwr",
"date":"2011-04-25 11:16:21"
},
{
"kids":[],
"uid":"1457781762",
"parent":"",
"text":"",
"mid":"fwqqv1",
"date":"2011-04-25 11:15:42"
},
{
"kids":[],
"uid":"1954984355",
"parent":"",
"text":"",
"mid":"fwqngv",
"date":"2011-04-25 11:15:12"
},
{
"kids":[],
"uid":"oushuqing",
"parent":"",
"text":"",
"mid":"fwqmT7",
"date":"2011-04-25 11:15:08"
},
{
"kids":[],
"uid":"daxuehua",
"parent":"",
"text":"商务部的看过来",
"mid":"fwqkUI",
"date":"2011-04-25 11:14:49"
},
{
"kids":[],
"uid":"1806028027",
"parent":"",
"text":"好一个敌占区……",
"mid":"fwqfDa",
"date":"2011-04-25 11:14:00"
},
{
"kids":[],
"uid":"1837348607",
"parent":"",
"text":"",
"mid":"fwqdpB",
"date":"2011-04-25 11:13:39"
},
{
"kids":[],
"uid":"laserprinter",
"parent":"",
"text":"敌占区的人打游击吗",
"mid":"fwqcln",
"date":"2011-04-25 11:13:29"
},
{
"kids":[],
"uid":"flyingcff",
"parent":"",
"text":"",
"mid":"fwq3S0",
"date":"2011-04-25 11:12:10"
},
{
"kids":[],
"uid":"junyuweike",
"parent":"",
"text":"路过了白区",
"mid":"fwq2IU",
"date":"2011-04-25 11:12:00"
},
{
"kids":[],
"uid":"1825984097",
"parent":"",
"text":"",
"mid":"fwpWpU",
"date":"2011-04-25 11:10:59"
},
{
"kids":[],
"uid":"fajin",
"parent":"",
"text":"",
"mid":"fwpSaD",
"date":"2011-04-25 11:10:24"
},
{
"kids":[],
"uid":"1710742711",
"parent":"",
"text":"",
"mid":"fwpS8Y",
"date":"2011-04-25 11:10:21"
},
{
"kids":[],
"uid":"ruoxiaobaihappy",
"parent":"",
"text":"可是我们买菜依然很贵!真不知道这个钱都给谁了",
"mid":"fwpJV2",
"date":"2011-04-25 11:09:05"
},
{
"kids":[],
"uid":"ghostcat1984",
"parent":"",
"text":"",
"mid":"fwpIvD",
"date":"2011-04-25 11:08:50"
},
{
"kids":[],
"uid":"1898988540",
"parent":"",
"text":"",
"mid":"fwpGjU",
"date":"2011-04-25 11:08:33"
},
{
"kids":[],
"uid":"jinyubuku",
"parent":"",
"text":"",
"mid":"fwpFni",
"date":"2011-04-25 11:08:23"
},
{
"kids":[],
"uid":"leixo",
"parent":"",
"text":"中国经济模式好啊,靠的就是坑这些种粮种菜养殖畜牧采矿挖煤的",
"mid":"fwpFjU",
"date":"2011-04-25 11:08:23"
},
{
"kids":[],
"uid":"80367293",
"parent":"",
"text":"",
"mid":"fwpF8J",
"date":"2011-04-25 11:08:21"
},
{
"kids":[],
"uid":"ningo01",
"parent":"",
"text":"我不爱党 现在也快被逼得不爱国了。。。",
"mid":"fwpDyh",
"date":"2011-04-25 11:08:04"
},
{
"kids":[],
"uid":"zye2012",
"parent":"",
"text":"多数农民总是爱跟风,去年神马贵,今年就种神马,结果都种一样的,还不多吗?卖就便宜的不得呗。伤不起起伤不起",
"mid":"fwpzdy",
"date":"2011-04-25 11:07:28"
},
{
"kids":[],
"uid":"1885067310",
"parent":"",
"text":"哈哈 都是敌占区/@猫扑:转发微博。",
"mid":"fwpzHq",
"date":"2011-04-25 11:07:24"
},
{
"kids":[],
"uid":"davy0929",
"parent":"",
"text":"",
"mid":"fwpywL",
"date":"2011-04-25 11:07:19"
},
{
"kids":[],
"uid":"fuqingyu",
"parent":"",
"text":"",
"mid":"fwpszt",
"date":"2011-04-25 11:06:23"
},
{
"kids":[],
"uid":"1737324645",
"parent":"",
"text":"",
"mid":"fwpnHG",
"date":"2011-04-25 11:05:39"
},
{
"kids":[],
"uid":"simonfantasy",
"parent":"",
"text":"国统区",
"mid":"fwpnL9",
"date":"2011-04-25 11:05:38"
},
{
"kids":[],
"uid":"618121999",
"parent":"",
"text":"汗,菜价越来越贵,菜农越来越赔,这一路比小日本扫地还狠啊!",
"mid":"fwpkzC",
"date":"2011-04-25 11:05:09"
},
{
"kids":[],
"uid":"1882931252",
"parent":"",
"text":"真是敌占区。。。",
"mid":"fwpkef",
"date":"2011-04-25 11:05:07"
},
{
"kids":[],
"uid":"zhuxy326",
"parent":"",
"text":"敌占区,若干。",
"mid":"fwpjei",
"date":"2011-04-25 11:04:58"
},
{
"kids":[],
"uid":"bthanjian",
"parent":"",
"text":"",
"mid":"fwpjnK",
"date":"2011-04-25 11:04:58"
},
{
"kids":[],
"uid":"1635675531",
"parent":"",
"text":"哎 这就是和谐社会啊",
"mid":"fwpiXE",
"date":"2011-04-25 11:04:55"
},
{
"kids":[],
"uid":"htxd",
"parent":"",
"text":"",
"mid":"fwpgcM",
"date":"2011-04-25 11:04:29"
},
{
"kids":[],
"uid":"ningo01",
"parent":"",
"text":"",
"mid":"fwpf3y",
"date":"2011-04-25 11:04:18"
},
{
"kids":[],
"uid":"shenzheng718",
"parent":"",
"text":"",
"mid":"fwpb7O",
"date":"2011-04-25 11:03:39"
},
{
"kids":[],
"uid":"1887632223",
"parent":"",
"text":"",
"mid":"fwp9WY",
"date":"2011-04-25 11:03:30"
},
{
"kids":[],
"uid":"wanglu326",
"parent":"",
"text":"敌区。。。",
"mid":"fwp8As",
"date":"2011-04-25 11:03:19"
},
{
"kids":[],
"uid":"1552717700",
"parent":"",
"text":"",
"mid":"fwp7XB",
"date":"2011-04-25 11:03:12"
},
{
"kids":[],
"uid":"hantao140",
"parent":"",
"text":"",
"mid":"fwp4R9",
"date":"2011-04-25 11:02:44"
},
{
"kids":[],
"uid":"huangweixin573451846",
"parent":"",
"text":"中国物流运输需要好好整合下啊",
"mid":"fwp4BR",
"date":"2011-04-25 11:02:42"
},
{
"kids":[],
"uid":"xiaoyaoc",
"parent":"",
"text":"贵,百姓苦;贱,百姓苦。。能正常点不?",
"mid":"fwp3eJ",
"date":"2011-04-25 11:02:28"
},
{
"kids":[],
"uid":"sandy0529",
"parent":"",
"text":"最后难得还是咱们老百姓",
"mid":"fwoZ9t",
"date":"2011-04-25 11:01:51"
},
{
"kids":[],
"uid":"1898813631",
"parent":"",
"text":"敌占区,有意思。",
"mid":"fwoXJT",
"date":"2011-04-25 11:01:39"
},
{
"kids":[],
"uid":"fat0518",
"parent":"",
"text":"",
"mid":"fwoSpR",
"date":"2011-04-25 11:00:49"
},
{
"kids":[],
"uid":"resiyne",
"parent":"",
"text":"哎~",
"mid":"fwoOIX",
"date":"2011-04-25 11:00:13"
},
{
"kids":[],
"uid":"fiossoso",
"parent":"",
"text":"神奇的国度",
"mid":"fwoJu5",
"date":"2011-04-25 10:59:27"
},
{
"kids":[],
"uid":"1763970834",
"parent":"",
"text":"",
"mid":"fwoJrE",
"date":"2011-04-25 10:59:24"
},
{
"kids":[],
"uid":"1645972541",
"parent":"",
"text":"吃菜和吃药一样层层叠加",
"mid":"fwoEiw",
"date":"2011-04-25 10:58:34"
},
{
"kids":[],
"uid":"1936040407",
"parent":"",
"text":"还被鬼子QJ了N次 。。。",
"mid":"fwoCP2",
"date":"2011-04-25 10:58:23"
},
{
"kids":[],
"uid":"hedachunzi",
"parent":"",
"text":"",
"mid":"fwoBBX",
"date":"2011-04-25 10:58:08"
},
{
"kids":[],
"uid":"1769091202",
"parent":"",
"text":"唉。菜贵伤民,菜贱伤农。",
"mid":"fwox2m",
"date":"2011-04-25 10:57:28"
},
{
"kids":[],
"uid":"1835458765",
"parent":"",
"text":"",
"mid":"fwousu",
"date":"2011-04-25 10:57:01"
},
{
"kids":[],
"uid":"1798620862",
"parent":"",
"text":"",
"mid":"fworyI",
"date":"2011-04-25 10:56:38"
},
{
"kids":[],
"uid":"liaomw",
"parent":"",
"text":"",
"mid":"fwoqxP",
"date":"2011-04-25 10:56:26"
},
{
"kids":[],
"uid":"kiakiachou",
"parent":"",
"text":"究竟是什麽样的敌占区…如此可怕…",
"mid":"fwopUM",
"date":"2011-04-25 10:56:22"
},
{
"kids":[],
"uid":"qutanwan",
"parent":"",
"text":"",
"mid":"fwooMg",
"date":"2011-04-25 10:56:12"
},
{
"kids":[],
"uid":"1055852631",
"parent":"",
"text":"昨天电视上说青州的卷心菜7分钱没人要,我去我怎么没见这么便宜的卷心菜",
"mid":"fwooQZ",
"date":"2011-04-25 10:56:11"
},
{
"kids":[],
"uid":"1583774280",
"parent":"",
"text":"农民阶级要起义",
"mid":"fwonJw",
"date":"2011-04-25 10:56:02"
},
{
"kids":[],
"uid":"haogirl",
"parent":"",
"text":"",
"mid":"fwolEG",
"date":"2011-04-25 10:55:41"
},
{
"kids":[],
"uid":"duooooooo",
"parent":"",
"text":"",
"mid":"fwokGW",
"date":"2011-04-25 10:55:31"
},
{
"kids":[],
"uid":"618292340",
"parent":"",
"text":"",
"mid":"fwojJH",
"date":"2011-04-25 10:55:23"
},
{
"kids":[],
"uid":"nxinran",
"parent":"",
"text":"敌占区[衰]",
"mid":"fwoiJl",
"date":"2011-04-25 10:55:15"
},
{
"kids":[],
"uid":"lovemunchen",
"parent":"",
"text":"米贵伤民,谷贱伤农。这话如此耳熟哦~",
"mid":"fwoimP",
"date":"2011-04-25 10:55:10"
},
{
"kids":[],
"uid":"catvanessa",
"parent":"",
"text":"",
"mid":"fwogbd",
"date":"2011-04-25 10:54:51"
},
{
"kids":[],
"uid":"tableble",
"parent":"",
"text":"",
"mid":"fwoew8",
"date":"2011-04-25 10:54:38"
},
{
"kids":[],
"uid":"1803656684",
"parent":"",
"text":"",
"mid":"fwoeiy",
"date":"2011-04-25 10:54:35"
},
{
"kids":[],
"uid":"338989615",
"parent":"",
"text":"",
"mid":"fwoebZ",
"date":"2011-04-25 10:54:32"
},
{
"kids":[],
"uid":"1785387675",
"parent":"",
"text":"敌占区我看不像,倒像是去过黄世仁家里!",
"mid":"fwodnB",
"date":"2011-04-25 10:54:25"
},
{
"kids":[],
"uid":"1291331254",
"parent":"",
"text":"",
"mid":"fwocV7",
"date":"2011-04-25 10:54:22"
},
{
"kids":[],
"uid":"1844059953",
"parent":"",
"text":"",
"mid":"fwoczx",
"date":"2011-04-25 10:54:19"
},
{
"kids":[],
"uid":"wanzhuanbj",
"parent":"",
"text":"转发微博。",
"mid":"fwobNS",
"date":"2011-04-25 10:54:13"
},
{
"kids":[],
"uid":"lucifor520",
"parent":"",
"text":"本来一买一卖就是利益博弈的双方,有毛好叫的哇?有这功夫不如去填核电站,看菜还贱不贱!某些人上赶着搅混水的玩意儿才是真贱",
"mid":"fwo7MA",
"date":"2011-04-25 10:53:37"
},
{
"kids":[],
"uid":"1879848290",
"parent":"",
"text":"快点多买蔬菜吃",
"mid":"fwo6hX",
"date":"2011-04-25 10:53:22"
},
{
"kids":[],
"uid":"1861931442",
"parent":"",
"text":"人鬼更上民",
"mid":"fwo5o2",
"date":"2011-04-25 10:53:15"
},
{
"kids":[],
"uid":"1846774805",
"parent":"",
"text":"",
"mid":"fwo4O0",
"date":"2011-04-25 10:53:08"
},
{
"kids":[],
"uid":"yvonne401",
"parent":"",
"text":"",
"mid":"fwo4I6",
"date":"2011-04-25 10:53:07"
},
{
"kids":[],
"uid":"1190185972",
"parent":"",
"text":"",
"mid":"fwo0Ag",
"date":"2011-04-25 10:52:29"
},
{
"kids":[],
"uid":"1174510672",
"parent":"",
"text":"匪区",
"mid":"fwnYJ7",
"date":"2011-04-25 10:52:10"
},
{
"kids":[],
"uid":"feitianhanxiaozhu",
"parent":"",
"text":"",
"mid":"fwnYfF",
"date":"2011-04-25 10:52:07"
},
{
"kids":[],
"uid":"1861406562",
"parent":"",
"text":"",
"mid":"fwnXyN",
"date":"2011-04-25 10:52:00"
},
{
"kids":[],
"uid":"emilyhongliwei",
"parent":"",
"text":"",
"mid":"fwnXpL",
"date":"2011-04-25 10:51:56"
},
{
"kids":[],
"uid":"pinkyyang0823",
"parent":"",
"text":"从5分到5块~~中间那4快9毛5去哪了~?!",
"mid":"fwnX4t",
"date":"2011-04-25 10:51:54"
},
{
"kids":[],
"uid":"349347456",
"parent":"",
"text":"",
"mid":"fwnWNu",
"date":"2011-04-25 10:51:53"
},
{
"kids":[],
"uid":"knigh7",
"parent":"",
"text":"",
"mid":"fwnUbu",
"date":"2011-04-25 10:51:30"
},
{
"kids":[],
"uid":"1859695140",
"parent":"",
"text":"转发",
"mid":"fwnSfr",
"date":"2011-04-25 10:51:13"
},
{
"kids":[],
"uid":"1771882631",
"parent":"",
"text":"是!",
"mid":"fwnRht",
"date":"2011-04-25 10:51:03"
},
{
"kids":[],
"uid":"raoliyuan",
"parent":"",
"text":"",
"mid":"fwnP2z",
"date":"2011-04-25 10:50:41"
},
{
"kids":[],
"uid":"ttrend",
"parent":"",
"text":"#最新热推#",
"mid":"fwnM9t",
"date":"2011-04-25 10:50:15"
},
{
"kids":[],
"uid":"lankewei",
"parent":"",
"text":"转发微博。",
"mid":"fwnLt8",
"date":"2011-04-25 10:50:08"
},
{
"kids":[],
"uid":"sinkayc",
"parent":"",
"text":"",
"mid":"fwnJj2",
"date":"2011-04-25 10:49:51"
},
{
"kids":[],
"uid":"1794236700",
"parent":"",
"text":"",
"mid":"fwnINo",
"date":"2011-04-25 10:49:44"
},
{
"kids":[],
"uid":"1818396095",
"parent":"",
"text":"原来如此",
"mid":"fwnHKr",
"date":"2011-04-25 10:49:35"
},
{
"kids":[],
"uid":"1996746161",
"parent":"",
"text":"",
"mid":"fwnGaX",
"date":"2011-04-25 10:49:20"
},
{
"kids":[],
"uid":"ghostplayer",
"parent":"",
"text":"天朝的市场经济的畸形的,计划经济的有点没有继承,市场经济的优点也没有学到,却把两者的大多数缺点都攒齐了。。。理由很简单。。。一部分人先富起来。。",
"mid":"fwnEyW",
"date":"2011-04-25 10:49:05"
},
{
"kids":[],
"uid":"1655102852",
"parent":"",
"text":"",
"mid":"fwnDEJ",
"date":"2011-04-25 10:48:57"
},
{
"kids":[],
"uid":"sajuuk",
"parent":"",
"text":"",
"mid":"fwnBXz",
"date":"2011-04-25 10:48:39"
},
{
"kids":[],
"uid":"1409669903",
"parent":"",
"text":"终有一天你们伤不起!人在做,天在看哦",
"mid":"fwnyC1",
"date":"2011-04-25 10:48:08"
},
{
"kids":[],
"uid":"moguri",
"parent":"",
"text":"",
"mid":"fwnw2f",
"date":"2011-04-25 10:47:43"
},
{
"kids":[],
"uid":"icefire6533",
"parent":"",
"text":"转发微博。",
"mid":"fwnvft",
"date":"2011-04-25 10:47:34"
},
{
"kids":[],
"uid":"1898893547",
"parent":"",
"text":"转发微博。",
"mid":"fwnu1D",
"date":"2011-04-25 10:47:24"
},
{
"kids":[],
"uid":"1841772203",
"parent":"",
"text":"",
"mid":"fwntfW",
"date":"2011-04-25 10:47:17"
},
{
"kids":[],
"uid":"starlle",
"parent":"",
"text":"敌占区?",
"mid":"fwnqxC",
"date":"2011-04-25 10:46:54"
},
{
"kids":[],
"uid":"tiffanylauxf",
"parent":"",
"text":"",
"mid":"fwnp3r",
"date":"2011-04-25 10:46:39"
},
{
"kids":[],
"uid":"1678480802",
"parent":"",
"text":"",
"mid":"fwnoeM",
"date":"2011-04-25 10:46:33"
},
{
"kids":[],
"uid":"si4gh",
"parent":"",
"text":"",
"mid":"fwnnBx",
"date":"2011-04-25 10:46:25"
},
{
"kids":[],
"uid":"ahayounglady",
"parent":"",
"text":"",
"mid":"fwnlL6",
"date":"2011-04-25 10:46:08"
},
{
"kids":[],
"uid":"yuanbao15",
"parent":"",
"text":"",
"mid":"fwnm3y",
"date":"2011-04-25 10:46:06"
},
{
"kids":[],
"uid":"heavensoul0503",
"parent":"",
"text":"",
"mid":"fwnk7t",
"date":"2011-04-25 10:45:52"
},
{
"kids":[],
"uid":"januaryzheng",
"parent":"",
"text":"菜贵伤民,菜贱伤农- -最不受伤的是谁- -",
"mid":"fwnjOa",
"date":"2011-04-25 10:45:49"
},
{
"kids":[],
"uid":"dingninger",
"parent":"",
"text":"[衰]",
"mid":"fwnhKH",
"date":"2011-04-25 10:45:28"
},
{
"kids":[],
"uid":"1726632393",
"parent":"",
"text":"补上:ZF",
"mid":"fwngZW",
"date":"2011-04-25 10:45:23"
},
{
"kids":[],
"uid":"jewelry72",
"parent":"",
"text":"转发微博。",
"mid":"fwngWZ",
"date":"2011-04-25 10:45:22"
},
{
"kids":[],
"uid":"chenchen7",
"parent":"",
"text":"",
"mid":"fwngeJ",
"date":"2011-04-25 10:45:15"
},
{
"kids":[],
"uid":"1848022622",
"parent":"",
"text":"敌占区...",
"mid":"fwnesG",
"date":"2011-04-25 10:44:59"
},
{
"kids":[],
"uid":"1834559295",
"parent":"",
"text":"转发微博。",
"mid":"fwndHP",
"date":"2011-04-25 10:44:52"
},
{
"kids":[],
"uid":"1620964842",
"parent":"",
"text":"哈哈",
"mid":"fwncQh",
"date":"2011-04-25 10:44:44"
},
{
"kids":[],
"uid":"210100607",
"parent":"",
"text":"为什么农民们的命运这么悲催?!",
"mid":"fwncba",
"date":"2011-04-25 10:44:36"
},
{
"kids":[],
"uid":"qianxiaohuer",
"parent":"",
"text":"",
"mid":"fwnc7g",
"date":"2011-04-25 10:44:35"
},
{
"kids":[],
"uid":"1954235357",
"parent":"",
"text":"",
"mid":"fwnbzl",
"date":"2011-04-25 10:44:31"
},
{
"kids":[],
"uid":"luoshuiyiyun",
"parent":"",
"text":"",
"mid":"fwnaXj",
"date":"2011-04-25 10:44:24"
},
{
"kids":[],
"uid":"yaxuanwang",
"parent":"",
"text":"头疼医头脚痛医脚,工作组满天飞,就是抓不到根本。",
"mid":"fwn8m4",
"date":"2011-04-25 10:44:01"
},
{
"kids":[],
"uid":"zjtzy",
"parent":"",
"text":"这菜在我们食堂一份2块钱!!!",
"mid":"fwn7vZ",
"date":"2011-04-25 10:43:52"
},
{
"kids":[],
"uid":"1726632393",
"parent":"",
"text":"我狠我的[鄙视][鄙视][鄙视]",
"mid":"fwn6y2",
"date":"2011-04-25 10:43:46"
},
{
"kids":[],
"uid":"charlinekoo",
"parent":"",
"text":"",
"mid":"fwn3Ke",
"date":"2011-04-25 10:43:20"
},
{
"kids":[],
"uid":"fuqixiaohu",
"parent":"",
"text":"",
"mid":"fwn32I",
"date":"2011-04-25 10:43:13"
},
{
"kids":[],
"uid":"zlygo",
"parent":"",
"text":"反正中间人员是不伤的。可知菜从农到民的手中,经历了多少级代理商,多少时间和距离的运输。每一级代理都要收17%的增值税,每公里的运输都要1块钱的过路费和1块钱的邮费,还有车船税、保险等等等等,在这8分钱的白菜里要扣出那么多钱,中国人,你伤得起么?吾国万税万税万万税",
"mid":"fwn1V6",
"date":"2011-04-25 10:43:00"
},
{
"kids":[],
"uid":"toyamavis",
"parent":"",
"text":"城里的骂菜价那么贵,城外的哭菜价那么贱。有些人乐呵呵的捂着腰包,吃着外面的,赚着里面的",
"mid":"fwn10Z",
"date":"2011-04-25 10:42:55"
},
{
"kids":[],
"uid":"qingpuno1",
"parent":"",
"text":"",
"mid":"fwn103",
"date":"2011-04-25 10:42:54"
},
{
"kids":[],
"uid":"1669598471",
"parent":"",
"text":"强大的敌人,",
"mid":"fwn0RQ",
"date":"2011-04-25 10:42:51"
},
{
"kids":[],
"uid":"zeromingqiu",
"parent":"",
"text":"",
"mid":"fwn065",
"date":"2011-04-25 10:42:44"
},
{
"kids":[],
"uid":"1710244384",
"parent":"",
"text":"",
"mid":"fwmZQT",
"date":"2011-04-25 10:42:41"
},
{
"kids":[],
"uid":"326607373",
"parent":"",
"text":"",
"mid":"fwmYSN",
"date":"2011-04-25 10:42:31"
},
{
"kids":[],
"uid":"dove51",
"parent":"",
"text":"在这个高贵的国度里,活着都不容易",
"mid":"fwmY7e",
"date":"2011-04-25 10:42:24"
},
{
"kids":[],
"uid":"huangjiwei",
"parent":"",
"text":"",
"mid":"fwmWW1",
"date":"2011-04-25 10:42:15"
},
{
"kids":[],
"uid":"w1032836025",
"parent":"",
"text":"",
"mid":"fwmVPU",
"date":"2011-04-25 10:42:04"
},
{
"kids":[],
"uid":"songyouding",
"parent":"",
"text":"大婶V5",
"mid":"fwmVn7",
"date":"2011-04-25 10:41:59"
},
{
"kids":[],
"uid":"yarinaw",
"parent":"",
"text":"一时不知道说什么了",
"mid":"fwmVdB",
"date":"2011-04-25 10:41:56"
},
{
"kids":[],
"uid":"277869931",
"parent":"",
"text":"这社会。",
"mid":"fwmUUy",
"date":"2011-04-25 10:41:54"
},
{
"kids":[],
"uid":"dollyajax",
"parent":"",
"text":"",
"mid":"fwmSUh",
"date":"2011-04-25 10:41:34"
},
{
"kids":[],
"uid":"jianjie87",
"parent":"",
"text":"敌占区~~",
"mid":"fwmSlw",
"date":"2011-04-25 10:41:31"
},
{
"kids":[],
"uid":"akiheeca",
"parent":"",
"text":"",
"mid":"fwmS6c",
"date":"2011-04-25 10:41:29"
},
{
"kids":[],
"uid":"wmike",
"parent":"",
"text":"勿谈x事!",
"mid":"fwmRJ7",
"date":"2011-04-25 10:41:25"
},
{
"kids":[],
"uid":"1847236693",
"parent":"",
"text":"默默转发。",
"mid":"fwmPyX",
"date":"2011-04-25 10:41:05"
},
{
"kids":[],
"uid":"1722619155",
"parent":"",
"text":"",
"mid":"fwmPsx",
"date":"2011-04-25 10:41:03"
},
{
"kids":[],
"uid":"comet1102",
"parent":"",
"text":"。。。[哈哈]",
"mid":"fwmOAF",
"date":"2011-04-25 10:40:56"
},
{
"kids":[],
"uid":"adminmaster",
"parent":"",
"text":"",
"mid":"fwmOE6",
"date":"2011-04-25 10:40:55"
},
{
"kids":[],
"uid":"dinga206",
"parent":"",
"text":"",
"mid":"fwmMIt",
"date":"2011-04-25 10:40:35"
},
{
"kids":[],
"uid":"1823647704",
"parent":"",
"text":"转",
"mid":"fwmMdj",
"date":"2011-04-25 10:40:33"
},
{
"kids":[],
"uid":"1882434953",
"parent":"",
"text":"这是为什么呢?",
"mid":"fwmMiy",
"date":"2011-04-25 10:40:33"
},
{
"kids":[],
"uid":"2005532805",
"parent":"",
"text":"。。。。",
"mid":"fwmMoP",
"date":"2011-04-25 10:40:33"
},
{
"kids":[],
"uid":"1708735754",
"parent":"",
"text":"",
"mid":"fwmKMY",
"date":"2011-04-25 10:40:20"
},
{
"kids":[],
"uid":"bobbychi",
"parent":"",
"text":"沦陷区啊",
"mid":"fwmKnv",
"date":"2011-04-25 10:40:15"
},
{
"kids":[],
"uid":"1679717904",
"parent":"",
"text":"没有层层盘剥 哪来得漂亮的Gdp指数",
"mid":"fwmJ1w",
"date":"2011-04-25 10:40:05"
},
{
"kids":[],
"uid":"dongcaca",
"parent":"",
"text":"转发微博。",
"mid":"fwmHGM",
"date":"2011-04-25 10:39:52"
},
{
"kids":[],
"uid":"2102850655",
"parent":"",
"text":"",
"mid":"fwmHLt",
"date":"2011-04-25 10:39:51"
},
{
"kids":[],
"uid":"1852419131",
"parent":"",
"text":"",
"mid":"fwmHfG",
"date":"2011-04-25 10:39:49"
},
{
"kids":[],
"uid":"monksong",
"parent":"",
"text":"",
"mid":"fwmFoS",
"date":"2011-04-25 10:39:32"
},
{
"kids":[],
"uid":"jackeysung",
"parent":"",
"text":"",
"mid":"fwmDYK",
"date":"2011-04-25 10:39:20"
},
{
"kids":[],
"uid":"1734913887",
"parent":"",
"text":"",
"mid":"fwmE6i",
"date":"2011-04-25 10:39:18"
},
{
"kids":[],
"uid":"aylomumi",
"parent":"",
"text":"",
"mid":"fwmDfZ",
"date":"2011-04-25 10:39:11"
},
{
"kids":[],
"uid":"c9c4",
"parent":"",
"text":"",
"mid":"fwmCLK",
"date":"2011-04-25 10:39:05"
},
{
"kids":[],
"uid":"104616618",
"parent":"",
"text":"",
"mid":"fwmByP",
"date":"2011-04-25 10:38:55"
},
{
"kids":[],
"uid":"736088838",
"parent":"",
"text":"",
"mid":"fwmBn0",
"date":"2011-04-25 10:38:54"
},
{
"kids":[],
"uid":"wjgcbd",
"parent":"",
"text":"",
"mid":"fwmByZ",
"date":"2011-04-25 10:38:54"
},
{
"kids":[],
"uid":"1891797384",
"parent":"",
"text":"",
"mid":"fwmBsW",
"date":"2011-04-25 10:38:53"
},
{
"kids":[],
"uid":"206084343",
"parent":"",
"text":"哈哈,敌占区算PI啊",
"mid":"fwmB60",
"date":"2011-04-25 10:38:51"
},
{
"kids":[],
"uid":"jb7181",
"parent":"",
"text":"",
"mid":"fwmAWp",
"date":"2011-04-25 10:38:49"
},
{
"kids":[],
"uid":"flyerdancing",
"parent":"",
"text":"",
"mid":"fwmATI",
"date":"2011-04-25 10:38:48"
},
{
"kids":[],
"uid":"doopcl",
"parent":"",
"text":"高昂的路费比敌人更危险",
"mid":"fwmyZW",
"date":"2011-04-25 10:38:31"
},
{
"kids":[],
"uid":"207779317",
"parent":"",
"text":"一一!",
"mid":"fwmy54",
"date":"2011-04-25 10:38:24"
},
{
"kids":[],
"uid":"1859788137",
"parent":"",
"text":"",
"mid":"fwmxSn",
"date":"2011-04-25 10:38:19"
},
{
"kids":[],
"uid":"chenyong1986",
"parent":"",
"text":"",
"mid":"fwmxl9",
"date":"2011-04-25 10:38:14"
},
{
"kids":[],
"uid":"yvonnie",
"parent":"",
"text":"家门口卖水果的大婶跟我发出心底的怒吼:国富民穷!国富民穷啊!!!",
"mid":"fwmwsn",
"date":"2011-04-25 10:38:07"
},
{
"kids":[],
"uid":"lantiansun",
"parent":"",
"text":"路过敌占区!",
"mid":"fwmx1n",
"date":"2011-04-25 10:38:05"
},
{
"kids":[],
"uid":"nlwan",
"parent":"",
"text":"",
"mid":"fwmvNo",
"date":"2011-04-25 10:38:02"
},
{
"kids":[],
"uid":"blacker999",
"parent":"",
"text":"",
"mid":"fwmvtm",
"date":"2011-04-25 10:38:00"
},
{
"kids":[],
"uid":"1945495671",
"parent":"",
"text":"拿过了,可怜了,伤心了[泪]",
"mid":"fwmvnG",
"date":"2011-04-25 10:37:59"
},
{
"kids":[],
"uid":"mxch21619",
"parent":"",
"text":"半路还有强盗劫匪吸血鬼呢!",
"mid":"fwmvcv",
"date":"2011-04-25 10:37:55"
},
{
"kids":[],
"uid":"1651743924",
"parent":"",
"text":"",
"mid":"fwmtd9",
"date":"2011-04-25 10:37:37"
},
{
"kids":[],
"uid":"528893012",
"parent":"",
"text":"",
"mid":"fwmsO4",
"date":"2011-04-25 10:37:30"
},
{
"kids":[],
"uid":"jsxbb",
"parent":"",
"text":"",
"mid":"fwmqjn",
"date":"2011-04-25 10:37:10"
},
{
"kids":[],
"uid":"legendlu",
"parent":"",
"text":"唉,层层压迫,层层剥削",
"mid":"fwmpQv",
"date":"2011-04-25 10:37:06"
},
{
"kids":[],
"uid":"prettyjane",
"parent":"",
"text":"菜在贵民也不会轻生,菜一贱农就自杀",
"mid":"fwmpGP",
"date":"2011-04-25 10:37:04"
},
{
"kids":[],
"uid":"1905483712",
"parent":"",
"text":"我,也是农民,转一个",
"mid":"fwmpIJ",
"date":"2011-04-25 10:37:04"
},
{
"kids":[],
"uid":"1233818290",
"parent":"",
"text":"",
"mid":"fwmpix",
"date":"2011-04-25 10:37:01"
},
{
"kids":[],
"uid":"1853756773",
"parent":"",
"text":"他妈的,这得顶!!",
"mid":"fwmoWs",
"date":"2011-04-25 10:37:00"
},
{
"kids":[],
"uid":"1887830100",
"parent":"",
"text":"转发微博。",
"mid":"fwmp4r",
"date":"2011-04-25 10:36:59"
},
{
"kids":[],
"uid":"210004312",
"parent":"",
"text":"",
"mid":"fwmoCF",
"date":"2011-04-25 10:36:53"
},
{
"kids":[],
"uid":"311195882",
"parent":"",
"text":"转发微博。",
"mid":"fwmnT1",
"date":"2011-04-25 10:36:48"
},
{
"kids":[],
"uid":"shamuer",
"parent":"",
"text":"",
"mid":"fwmnKK",
"date":"2011-04-25 10:36:47"
},
{
"kids":[],
"uid":"yuhuihe",
"parent":"",
"text":"菜农不容易啊",
"mid":"fwmnGV",
"date":"2011-04-25 10:36:45"
},
{
"kids":[],
"uid":"2013775417",
"parent":"",
"text":"说的太精辟了!!!",
"mid":"fwmnuq",
"date":"2011-04-25 10:36:43"
},
{
"kids":[],
"uid":"forrestjian",
"parent":"",
"text":"比敌占区还狠!",
"mid":"fwmmzz",
"date":"2011-04-25 10:36:36"
},
{
"kids":[],
"uid":"shadowly0922",
"parent":"",
"text":"看图不说话,说话会被打",
"mid":"fwmm5F",
"date":"2011-04-25 10:36:32"
},
{
"kids":[],
"uid":"338910001",
"parent":"",
"text":"",
"mid":"fwmm05",
"date":"2011-04-25 10:36:30"
},
{
"kids":[],
"uid":"yifei1003",
"parent":"",
"text":"",
"mid":"fwmkzC",
"date":"2011-04-25 10:36:16"
},
{
"kids":[],
"uid":"bechg",
"parent":"",
"text":"",
"mid":"fwmki9",
"date":"2011-04-25 10:36:13"
},
{
"kids":[],
"uid":"mmjswy",
"parent":"",
"text":"昨天去超市买菜,顺便看了一下大白菜,记得年前,甚至是2月的时候白菜还是8毛多一斤吧,一棵白菜最多也就一二块钱。现在都已经涨到二块一斤,半棵白菜就要五六块。看了半天,都不敢买。",
"mid":"fwmjGq",
"date":"2011-04-25 10:36:07"
},
{
"kids":[],
"uid":"seaflanker",
"parent":"",
"text":"闯收费站的封锁线 过交警的炮楼 冒着城管的炮火",
"mid":"fwmjeR",
"date":"2011-04-25 10:36:02"
},
{
"kids":[],
"uid":"1238059583",
"parent":"",
"text":"",
"mid":"fwmiOa",
"date":"2011-04-25 10:36:00"
},
{
"kids":[],
"uid":"ladywenwenmuaslk",
"parent":"",
"text":"",
"mid":"fwmiEp",
"date":"2011-04-25 10:35:57"
},
{
"kids":[],
"uid":"breath99",
"parent":"",
"text":"",
"mid":"fwmikj",
"date":"2011-04-25 10:35:55"
},
{
"kids":[],
"uid":"xuxiaoheng",
"parent":"",
"text":"",
"mid":"fwmh9u",
"date":"2011-04-25 10:35:43"
},
{
"kids":[],
"uid":"abi",
"parent":"",
"text":"",
"mid":"fwmh5U",
"date":"2011-04-25 10:35:42"
},
{
"kids":[],
"uid":"208222942",
"parent":"",
"text":"菜贵伤民,菜贱伤农。。。",
"mid":"fwmgKg",
"date":"2011-04-25 10:35:39"
},
{
"kids":[],
"uid":"seaflanker",
"parent":"",
"text":"闯封收费站的锁线 过交警的炮楼 冒着城管的炮火",
"mid":"fwmgEq",
"date":"2011-04-25 10:35:39"
},
{
"kids":[],
"uid":"leondxb",
"parent":"",
"text":"以收费为目的的修路都是刷流氓",
"mid":"fwmgHd",
"date":"2011-04-25 10:35:38"
},
{
"kids":[],
"uid":"xule1000",
"parent":"",
"text":"谁能告诉我为什么突然间白菜就没人买了?",
"mid":"fwmg1y",
"date":"2011-04-25 10:35:31"
},
{
"kids":[],
"uid":"ljyueran",
"parent":"",
"text":"",
"mid":"fwmfzb",
"date":"2011-04-25 10:35:28"
},
{
"kids":[],
"uid":"eleanor210",
"parent":"",
"text":"农和民都伤不起啊,但又想市场经济又想计划干预,搞到最后既不市场又不计划,所以都被伤得深啊,不管则已越管越乱…菜价房价亦如是啊……高贵的国家悲催的P民",
"mid":"fwmfmW",
"date":"2011-04-25 10:35:28"
},
{
"kids":[],
"uid":"201272746",
"parent":"",
"text":"",
"mid":"fwmfbH",
"date":"2011-04-25 10:35:25"
},
{
"kids":[],
"uid":"1064528057",
"parent":"",
"text":"",
"mid":"fwmfbA",
"date":"2011-04-25 10:35:25"
},
{
"kids":[],
"uid":"1770511825",
"parent":"",
"text":"",
"mid":"fwmf8s",
"date":"2011-04-25 10:35:24"
},
{
"kids":[],
"uid":"loveblog2",
"parent":"",
"text":"我想到那首元曲了-------- 兴,百姓苦;亡,百姓苦!",
"mid":"fwmfBg",
"date":"2011-04-25 10:35:23"
},
{
"kids":[],
"uid":"yypdc007",
"parent":"",
"text":"解放区早沦陷到冻土层了。",
"mid":"fwmdSw",
"date":"2011-04-25 10:35:12"
},
{
"kids":[],
"uid":"zhuoyueba",
"parent":"",
"text":"枪在手,跟我走!",
"mid":"fwmdUN",
"date":"2011-04-25 10:35:11"
},
{
"kids":[],
"uid":"1806014135",
"parent":"",
"text":"",
"mid":"fwmdl7",
"date":"2011-04-25 10:35:06"
},
{
"kids":[],
"uid":"miyou57",
"parent":"",
"text":"",
"mid":"fwmde7",
"date":"2011-04-25 10:35:05"
},
{
"kids":[],
"uid":"1786826771",
"parent":"",
"text":"自己零售吧。。。别让菜贩子赚了~",
"mid":"fwmd6D",
"date":"2011-04-25 10:35:04"
},
{
"kids":[],
"uid":"1765140217",
"parent":"",
"text":"中间过了个妖孽区",
"mid":"fwmcHd",
"date":"2011-04-25 10:35:01"
},
{
"kids":[],
"uid":"june14th",
"parent":"",
"text":"敌战区V5~",
"mid":"fwmbnh",
"date":"2011-04-25 10:34:48"
},
{
"kids":[],
"uid":"anfieldcaddie",
"parent":"",
"text":"敌占区!",
"mid":"fwmaPm",
"date":"2011-04-25 10:34:41"
},
{
"kids":[],
"uid":"1716152600",
"parent":"",
"text":"明天开始吃大白菜",
"mid":"fwmaYl",
"date":"2011-04-25 10:34:39"
},
{
"kids":[],
"uid":"pureleo",
"parent":"",
"text":"",
"mid":"fwmakz",
"date":"2011-04-25 10:34:37"
},
{
"kids":[],
"uid":"47298247",
"parent":"",
"text":"这里是天朝到哪都是要收费的",
"mid":"fwmaip",
"date":"2011-04-25 10:34:36"
},
{
"kids":[],
"uid":"liam1223",
"parent":"",
"text":"",
"mid":"fwm9Pk",
"date":"2011-04-25 10:34:30"
},
{
"kids":[],
"uid":"201280586",
"parent":"",
"text":"",
"mid":"fwm9ow",
"date":"2011-04-25 10:34:28"
},
{
"kids":[],
"uid":"jojolove123",
"parent":"",
"text":"哎哎哎…",
"mid":"fwm9c3",
"date":"2011-04-25 10:34:26"
},
{
"kids":[],
"uid":"1903003072",
"parent":"",
"text":"",
"mid":"fwm8y5",
"date":"2011-04-25 10:34:22"
},
{
"kids":[],
"uid":"youngyouth",
"parent":"",
"text":"",
"mid":"fwm8WQ",
"date":"2011-04-25 10:34:22"
},
{
"kids":[],
"uid":"1742412472",
"parent":"",
"text":"菜贵伤民,菜贱伤农",
"mid":"fwm8Q8",
"date":"2011-04-25 10:34:21"
},
{
"kids":[],
"uid":"cccat",
"parent":"",
"text":"",
"mid":"fwm8yL",
"date":"2011-04-25 10:34:21"
},
{
"kids":[],
"uid":"shiqige",
"parent":"",
"text":"",
"mid":"fwm8uD",
"date":"2011-04-25 10:34:19"
},
{
"kids":[],
"uid":"weihuzhong",
"parent":"",
"text":"",
"mid":"fwm8jk",
"date":"2011-04-25 10:34:17"
},
{
"kids":[],
"uid":"0stone",
"parent":"",
"text":"",
"mid":"fwm7ZY",
"date":"2011-04-25 10:34:13"
},
{
"kids":[],
"uid":"1245610682",
"parent":"",
"text":"转发微博。",
"mid":"fwm7HV",
"date":"2011-04-25 10:34:11"
},
{
"kids":[],
"uid":"1808770672",
"parent":"",
"text":"敌占区",
"mid":"fwm79f",
"date":"2011-04-25 10:34:07"
},
{
"kids":[],
"uid":"murongpku",
"parent":"",
"text":"无",
"mid":"fwm73N",
"date":"2011-04-25 10:34:06"
},
{
"kids":[],
"uid":"1668973327",
"parent":"",
"text":"敌占区V5....一路被盘剥",
"mid":"fwm6QZ",
"date":"2011-04-25 10:34:03"
},
{
"kids":[],
"uid":"1750279541",
"parent":"",
"text":"交通!交通!",
"mid":"fwm54C",
"date":"2011-04-25 10:33:46"
},
{
"kids":[],
"uid":"1795130001",
"parent":"",
"text":"",
"mid":"fwm4Dp",
"date":"2011-04-25 10:33:42"
},
{
"kids":[],
"uid":"ifmomo",
"parent":"",
"text":"好心痛~!看到就很心酸",
"mid":"fwm4nY",
"date":"2011-04-25 10:33:39"
},
{
"kids":[],
"uid":"2053300187",
"parent":"",
"text":"说的好!",
"mid":"fwm43Q",
"date":"2011-04-25 10:33:35"
},
{
"kids":[],
"uid":"1714872193",
"parent":"",
"text":"前几天我买个大白菜,6毛一斤,一共一块六。给了2块,菜农说,我再给你一个小的,就不找你钱了,行吗?",
"mid":"fwm3MV",
"date":"2011-04-25 10:33:34"
},
{
"kids":[],
"uid":"diemonuo",
"parent":"",
"text":"啧啧 精辟",
"mid":"fwm3Jq",
"date":"2011-04-25 10:33:32"
},
{
"kids":[],
"uid":"kittyyu423",
"parent":"",
"text":"这条路中间到底有什么洪水猛兽?!",
"mid":"fwm3Ec",
"date":"2011-04-25 10:33:32"
},
{
"kids":[],
"uid":"1709019955",
"parent":"",
"text":"",
"mid":"fwm3lz",
"date":"2011-04-25 10:33:29"
},
{
"kids":[],
"uid":"1687012834",
"parent":"",
"text":"",
"mid":"fwm2TD",
"date":"2011-04-25 10:33:24"
},
{
"kids":[],
"uid":"yangxiaofee",
"parent":"",
"text":"",
"mid":"fwm2CT",
"date":"2011-04-25 10:33:23"
},
{
"kids":[],
"uid":"imtulanduo",
"parent":"",
"text":"",
"mid":"fwm24x",
"date":"2011-04-25 10:33:17"
},
{
"kids":[],
"uid":"pro7c",
"parent":"",
"text":"",
"mid":"fwm1Zx",
"date":"2011-04-25 10:33:15"
},
{
"kids":[],
"uid":"travelwell",
"parent":"",
"text":"转发微博。",
"mid":"fwm1hC",
"date":"2011-04-25 10:33:11"
},
{
"kids":[],
"uid":"1823190237",
"parent":"",
"text":"反正都是老百姓受苦…",
"mid":"fwm1fT",
"date":"2011-04-25 10:33:07"
},
{
"kids":[],
"uid":"zhailygg",
"parent":"",
"text":"",
"mid":"fwm0S3",
"date":"2011-04-25 10:33:06"
},
{
"kids":[],
"uid":"1743339212",
"parent":"",
"text":"因为我们发改委都去管油价去了,没有人管菜价了",
"mid":"fwm1Ot",
"date":"2011-04-25 10:33:05"
},
{
"kids":[],
"uid":"4006066969shenzhen",
"parent":"",
"text":"真的要为广大农民朋友做主啊,菜农伤不起啊",
"mid":"fwm08t",
"date":"2011-04-25 10:32:53"
},
{
"kids":[],
"uid":"206572345",
"parent":"",
"text":"",
"mid":"fwlZmW",
"date":"2011-04-25 10:32:50"
},
{
"kids":[],
"uid":"zolie",
"parent":"",
"text":"转发微博.",
"mid":"fwlYTF",
"date":"2011-04-25 10:32:49"
},
{
"kids":[],
"uid":"young6699",
"parent":"",
"text":"敌占区。。。",
"mid":"fwlYXb",
"date":"2011-04-25 10:32:47"
},
{
"kids":[],
"uid":"1778928635",
"parent":"",
"text":"平民伤不起,贫农伤不起,可受伤的还是他们",
"mid":"fwlY1G",
"date":"2011-04-25 10:32:37"
},
{
"kids":[],
"uid":"kissme2864",
"parent":"",
"text":"才短短5-6年。这个产业链就被完全控制了.悲剧的天朝.完全不懂经济和民生的农民政权.最后连生自己养自己的农民都保护不了,",
"mid":"fwlXK6",
"date":"2011-04-25 10:32:34"
},
{
"kids":[],
"uid":"hivltlove",
"parent":"",
"text":"",
"mid":"fwlXt1",
"date":"2011-04-25 10:32:33"
},
{
"kids":[],
"uid":"2062232223",
"parent":"",
"text":"沉默",
"mid":"fwlXf6",
"date":"2011-04-25 10:32:31"
},
{
"kids":[],
"uid":"1879088914",
"parent":"",
"text":"",
"mid":"fwlX20",
"date":"2011-04-25 10:32:28"
},
{
"kids":[],
"uid":"1725601842",
"parent":"",
"text":"",
"mid":"fwlWA4",
"date":"2011-04-25 10:32:25"
},
{
"kids":[],
"uid":"zqun",
"parent":"",
"text":"转发微博。",
"mid":"fwlWGt",
"date":"2011-04-25 10:32:23"
},
{
"kids":[],
"uid":"1907651945",
"parent":"",
"text":"[吃惊] 那这钱都叫那个王八犊子赚去啦?",
"mid":"fwlWqn",
"date":"2011-04-25 10:32:22"
},
{
"kids":[],
"uid":"1349611692",
"parent":"",
"text":"一点也不觉得在卖的白菜便宜啊!",
"mid":"fwlWoX",
"date":"2011-04-25 10:32:22"
},
{
"kids":[],
"uid":"claireyaya",
"parent":"",
"text":"这是神一样的后清时代。。",
"mid":"fwlW1E",
"date":"2011-04-25 10:32:19"
},
{
"kids":[],
"uid":"wangyt",
"parent":"",
"text":"同问!?",
"mid":"fwlW0w",
"date":"2011-04-25 10:32:18"
},
{
"kids":[],
"uid":"songajiu",
"parent":"",
"text":"",
"mid":"fwlVoD",
"date":"2011-04-25 10:32:13"
},
{
"kids":[],
"uid":"1738731617",
"parent":"",
"text":"沦陷区的悲哀啊。。。。",
"mid":"fwlVsP",
"date":"2011-04-25 10:32:12"
},
{
"kids":[],
"uid":"1876699351",
"parent":"",
"text":"",
"mid":"fwlVh2",
"date":"2011-04-25 10:32:11"
},
{
"kids":[],
"uid":"345820923",
"parent":"",
"text":"精辟",
"mid":"fwlVgH",
"date":"2011-04-25 10:32:09"
},
{
"kids":[],
"uid":"1406481692",
"parent":"",
"text":"我擦~",
"mid":"fwlUCG",
"date":"2011-04-25 10:32:04"
},
{
"kids":[],
"uid":"laohehua",
"parent":"",
"text":"如果涨价的钱能落到农民手里我们也认了。无奈啊~!总是事与愿违。",
"mid":"fwlUjW",
"date":"2011-04-25 10:32:04"
},
{
"kids":[],
"uid":"1881073440",
"parent":"",
"text":"哎。。。",
"mid":"fwlUq5",
"date":"2011-04-25 10:32:03"
},
{
"kids":[],
"uid":"suevalley",
"parent":"",
"text":"我爱吃青菜。。",
"mid":"fwlTvV",
"date":"2011-04-25 10:31:57"
},
{
"kids":[],
"uid":"anorangebaby",
"parent":"",
"text":"",
"mid":"fwlT2N",
"date":"2011-04-25 10:31:50"
},
{
"kids":[],
"uid":"yuqwpro",
"parent":"",
"text":"",
"mid":"fwlSZa",
"date":"2011-04-25 10:31:49"
},
{
"kids":[],
"uid":"1862232454",
"parent":"",
"text":"",
"mid":"fwlSMW",
"date":"2011-04-25 10:31:48"
},
{
"kids":[],
"uid":"876414485",
"parent":"",
"text":"",
"mid":"fwlSq1",
"date":"2011-04-25 10:31:44"
},
{
"kids":[],
"uid":"gengyang331",
"parent":"",
"text":"瞬间生活在水深火热之中。",
"mid":"fwlSb1",
"date":"2011-04-25 10:31:41"
},
{
"kids":[],
"uid":"1701034355",
"parent":"",
"text":"",
"mid":"fwlS8L",
"date":"2011-04-25 10:31:41"
},
{
"kids":[],
"uid":"civonliu",
"parent":"",
"text":"",
"mid":"fwlRS5",
"date":"2011-04-25 10:31:37"
},
{
"kids":[],
"uid":"jaybinler",
"parent":"",
"text":"传说从上海运1吨白菜到洛杉矶需要运费60rmb,相同的东西运到北京要80rmb",
"mid":"fwlRgK",
"date":"2011-04-25 10:31:34"
},
{
"kids":[],
"uid":"tiaotiaowang",
"parent":"",
"text":"哎 农民伯伯也苦呀",
"mid":"fwlRhp",
"date":"2011-04-25 10:31:32"
},
{
"kids":[],
"uid":"1581278800",
"parent":"",
"text":"为毛农民的菜卖不上价,而我们在市场里买的菜,价格又奇高?难道这个世界,就这么纠结么?",
"mid":"fwlR51",
"date":"2011-04-25 10:31:31"
},
{
"kids":[],
"uid":"1792562303",
"parent":"",
"text":"",
"mid":"fwlQVn",
"date":"2011-04-25 10:31:29"
},
{
"kids":[],
"uid":"1057293222",
"parent":"",
"text":"",
"mid":"fwlQSD",
"date":"2011-04-25 10:31:27"
},
{
"kids":[],
"uid":"1662414025",
"parent":"",
"text":"伤",
"mid":"fwlQ5N",
"date":"2011-04-25 10:31:20"
},
{
"kids":[],
"uid":"1655085132",
"parent":"",
"text":"",
"mid":"fwlPMp",
"date":"2011-04-25 10:31:17"
},
{
"kids":[],
"uid":"1781457727",
"parent":"",
"text":"",
"mid":"fwlPnv",
"date":"2011-04-25 10:31:16"
},
{
"kids":[],
"uid":"ou830",
"parent":"",
"text":"说不定吧。。这钱落谁手里了",
"mid":"fwlPge",
"date":"2011-04-25 10:31:14"
},
{
"kids":[],
"uid":"clearth",
"parent":"",
"text":"转发微博。",
"mid":"fwlPoD",
"date":"2011-04-25 10:31:14"
},
{
"kids":[],
"uid":"bai99",
"parent":"",
"text":"",
"mid":"fwlODS",
"date":"2011-04-25 10:31:07"
},
{
"kids":[],
"uid":"flyingshadow",
"parent":"",
"text":"",
"mid":"fwlNA4",
"date":"2011-04-25 10:30:58"
},
{
"kids":[],
"uid":"arthh",
"parent":"",
"text":"",
"mid":"fwlNCL",
"date":"2011-04-25 10:30:58"
},
{
"kids":[],
"uid":"327575723",
"parent":"",
"text":"戒菜。食肉去。",
"mid":"fwlNjC",
"date":"2011-04-25 10:30:54"
},
{
"kids":[],
"uid":"wangqianyu19921022",
"parent":"",
"text":"",
"mid":"fwlMTS",
"date":"2011-04-25 10:30:50"
},
{
"kids":[],
"uid":"hongandr9",
"parent":"",
"text":"",
"mid":"fwlMyT",
"date":"2011-04-25 10:30:48"
},
{
"kids":[],
"uid":"hanami1984",
"parent":"",
"text":"路上太凶险啊",
"mid":"fwlM8m",
"date":"2011-04-25 10:30:44"
},
{
"kids":[],
"uid":"208086469",
"parent":"",
"text":"是的",
"mid":"fwlLY9",
"date":"2011-04-25 10:30:44"
},
{
"kids":[],
"uid":"326720101",
"parent":"",
"text":"",
"mid":"fwlLVE",
"date":"2011-04-25 10:30:41"
},
{
"kids":[],
"uid":"duanpeng",
"parent":"",
"text":"",
"mid":"fwlLSb",
"date":"2011-04-25 10:30:41"
},
{
"kids":[],
"uid":"kkaarreennqq",
"parent":"",
"text":"",
"mid":"fwlLLO",
"date":"2011-04-25 10:30:40"
},
{
"kids":[],
"uid":"upmobaobei",
"parent":"",
"text":"[赞]",
"mid":"fwlLAS",
"date":"2011-04-25 10:30:38"
},
{
"kids":[],
"uid":"nikiyang",
"parent":"",
"text":"",
"mid":"fwlLaI",
"date":"2011-04-25 10:30:33"
},
{
"kids":[],
"uid":"zhumingfeng",
"parent":"",
"text":"好一个敌占区!",
"mid":"fwlKRY",
"date":"2011-04-25 10:30:32"
},
{
"kids":[],
"uid":"1870562060",
"parent":"",
"text":"",
"mid":"fwlKJM",
"date":"2011-04-25 10:30:30"
},
{
"kids":[],
"uid":"enkangkangtvxq",
"parent":"",
"text":"",
"mid":"fwlKbP",
"date":"2011-04-25 10:30:28"
},
{
"kids":[],
"uid":"1912084940",
"parent":"",
"text":"转",
"mid":"fwlKI9",
"date":"2011-04-25 10:30:28"
},
{
"kids":[],
"uid":"xian414",
"parent":"",
"text":"转发微博。",
"mid":"fwlKla",
"date":"2011-04-25 10:30:27"
},
{
"kids":[],
"uid":"jingkr",
"parent":"",
"text":"",
"mid":"fwlK2Q",
"date":"2011-04-25 10:30:25"
},
{
"kids":[
"gJ61PD"
],
"uid":"wanernao",
"parent":"",
"text":"过桥费,过路费,汽油费,各种税......万税,万税,万万税!",
"mid":"fwlJPb",
"date":"2011-04-25 10:30:21"
},
{
"kids":[],
"uid":"she2b",
"parent":"",
"text":"",
"mid":"fwlJsV",
"date":"2011-04-25 10:30:19"
},
{
"kids":[],
"uid":"wangqianyu19921022",
"parent":"",
"text":"………",
"mid":"fwlJvE",
"date":"2011-04-25 10:30:19"
},
{
"kids":[],
"uid":"1656933670",
"parent":"",
"text":"",
"mid":"fwlJ9b",
"date":"2011-04-25 10:30:14"
},
{
"kids":[],
"uid":"1629468671",
"parent":"",
"text":"",
"mid":"fwlIUC",
"date":"2011-04-25 10:30:13"
},
{
"kids":[],
"uid":"zhutouiii",
"parent":"",
"text":"是敌人太强大~",
"mid":"fwlICQ",
"date":"2011-04-25 10:30:11"
},
{
"kids":[],
"uid":"hugok",
"parent":"",
"text":"人家本来就是土匪",
"mid":"fwlIJ4",
"date":"2011-04-25 10:30:11"
},
{
"kids":[],
"uid":"1867290102",
"parent":"",
"text":"",
"mid":"fwlILL",
"date":"2011-04-25 10:30:10"
},
{
"kids":[],
"uid":"dangguowansui",
"parent":"",
"text":"",
"mid":"fwlIEz",
"date":"2011-04-25 10:30:09"
},
{
"kids":[],
"uid":"szhentan",
"parent":"",
"text":"可爱的天朝",
"mid":"fwlI60",
"date":"2011-04-25 10:30:05"
},
{
"kids":[],
"uid":"victorlrq",
"parent":"",
"text":"",
"mid":"fwlHS6",
"date":"2011-04-25 10:30:03"
},
{
"kids":[],
"uid":"1455416485",
"parent":"",
"text":"",
"mid":"fwlHV0",
"date":"2011-04-25 10:30:01"
},
{
"kids":[],
"uid":"1133058223",
"parent":"",
"text":"其实是路过了解放区",
"mid":"fwlHSO",
"date":"2011-04-25 10:30:01"
},
{
"kids":[],
"uid":"1950381284",
"parent":"",
"text":"敌占区。。。",
"mid":"fwlHv3",
"date":"2011-04-25 10:29:58"
},
{
"kids":[],
"uid":"chenshi3230",
"parent":"",
"text":"",
"mid":"fwlHvB",
"date":"2011-04-25 10:29:57"
},
{
"kids":[],
"uid":"eyessloo",
"parent":"",
"text":"",
"mid":"fwlHmT",
"date":"2011-04-25 10:29:57"
},
{
"kids":[],
"uid":"duguputao",
"parent":"",
"text":"",
"mid":"fwlHcv",
"date":"2011-04-25 10:29:55"
},
{
"kids":[],
"uid":"smxjared",
"parent":"",
"text":"恩",
"mid":"fwlHdb",
"date":"2011-04-25 10:29:55"
},
{
"kids":[],
"uid":"2060461897",
"parent":"",
"text":"哎",
"mid":"fwlGOE",
"date":"2011-04-25 10:29:53"
},
{
"kids":[],
"uid":"1863155613",
"parent":"",
"text":"",
"mid":"fwlGZl",
"date":"2011-04-25 10:29:53"
},
{
"kids":[],
"uid":"1213490485",
"parent":"",
"text":"",
"mid":"fwlGPm",
"date":"2011-04-25 10:29:52"
},
{
"kids":[],
"uid":"hug4ghoul",
"parent":"",
"text":"",
"mid":"fwlGP5",
"date":"2011-04-25 10:29:50"
},
{
"kids":[],
"uid":"lisiu",
"parent":"",
"text":"",
"mid":"fwlFVT",
"date":"2011-04-25 10:29:42"
},
{
"kids":[],
"uid":"2026154473",
"parent":"",
"text":"偷菜也不值钱啦,民生无小事啊~~",
"mid":"fwlFFZ",
"date":"2011-04-25 10:29:41"
},
{
"kids":[],
"uid":"yummyyuan",
"parent":"",
"text":"",
"mid":"fwlFBB",
"date":"2011-04-25 10:29:39"
},
{
"kids":[],
"uid":"superairxi",
"parent":"",
"text":"",
"mid":"fwlFra",
"date":"2011-04-25 10:29:39"
},
{
"kids":[],
"uid":"1872945570",
"parent":"",
"text":"",
"mid":"fwlFct",
"date":"2011-04-25 10:29:36"
},
{
"kids":[],
"uid":"1619933714",
"parent":"",
"text":"",
"mid":"fwlF8C",
"date":"2011-04-25 10:29:36"
},
{
"kids":[],
"uid":"1887779317",
"parent":"",
"text":"",
"mid":"fwlF89",
"date":"2011-04-25 10:29:35"
},
{
"kids":[],
"uid":"570822114",
"parent":"",
"text":"我说这些个大白菜要不收拾收拾卖韩国去,要不折腾下弄成泡菜酸菜什么的也能卖- - 这一天天放着,钱也回不来啊",
"mid":"fwlF3q",
"date":"2011-04-25 10:29:35"
},
{
"kids":[],
"uid":"imtyw",
"parent":"",
"text":"8分收,9毛卖",
"mid":"fwlEHC",
"date":"2011-04-25 10:29:31"
},
{
"kids":[],
"uid":"weibomiao",
"parent":"",
"text":"敌占区 [威武]",
"mid":"fwlEAI",
"date":"2011-04-25 10:29:31"
},
{
"kids":[],
"uid":"111989420",
"parent":"",
"text":"天朝V5",
"mid":"fwlEak",
"date":"2011-04-25 10:29:27"
},
{
"kids":[],
"uid":"gzxchen",
"parent":"",
"text":"社会主义优越性",
"mid":"fwlDRn",
"date":"2011-04-25 10:29:23"
},
{
"kids":[],
"uid":"1318787320",
"parent":"",
"text":"靠…你不是药加鑫吗?",
"mid":"fwlDWl",
"date":"2011-04-25 10:29:23"
},
{
"kids":[],
"uid":"z1980",
"parent":"",
"text":"",
"mid":"fwlDHx",
"date":"2011-04-25 10:29:22"
},
{
"kids":[],
"uid":"1896088947",
"parent":"",
"text":"",
"mid":"fwlDB4",
"date":"2011-04-25 10:29:21"
},
{
"kids":[],
"uid":"viachina",
"parent":"",
"text":"",
"mid":"fwlDso",
"date":"2011-04-25 10:29:19"
},
{
"kids":[],
"uid":"1913962902",
"parent":"",
"text":"",
"mid":"fwlDmv",
"date":"2011-04-25 10:29:18"
},
{
"kids":[],
"uid":"herorain",
"parent":"",
"text":"",
"mid":"fwlDbj",
"date":"2011-04-25 10:29:18"
},
{
"kids":[],
"uid":"tuoxiaoz",
"parent":"",
"text":"",
"mid":"fwlDlz",
"date":"2011-04-25 10:29:17"
},
{
"kids":[],
"uid":"fredxu0216",
"parent":"",
"text":"三光政策现代版",
"mid":"fwlDeo",
"date":"2011-04-25 10:29:16"
},
{
"kids":[],
"uid":"feifanicheng",
"parent":"",
"text":"转发微博。",
"mid":"fwlCDL",
"date":"2011-04-25 10:29:11"
},
{
"kids":[],
"uid":"kangwei17",
"parent":"",
"text":"",
"mid":"fwlCuK",
"date":"2011-04-25 10:29:11"
},
{
"kids":[],
"uid":"1733565307",
"parent":"",
"text":"",
"mid":"fwlCwQ",
"date":"2011-04-25 10:29:10"
},
{
"kids":[],
"uid":"208023466",
"parent":"",
"text":"",
"mid":"fwlCtw",
"date":"2011-04-25 10:29:10"
},
{
"kids":[],
"uid":"208156777",
"parent":"",
"text":"因为这个国家整天干些吃饱了撑的的事儿 关于这些问题木有在考虑范围内",
"mid":"fwlCwF",
"date":"2011-04-25 10:29:08"
},
{
"kids":[],
"uid":"338711127",
"parent":"",
"text":"",
"mid":"fwlCcX",
"date":"2011-04-25 10:29:07"
},
{
"kids":[],
"uid":"candy628",
"parent":"",
"text":"转发微博。",
"mid":"fwlCmH",
"date":"2011-04-25 10:29:07"
},
{
"kids":[],
"uid":"1791650713",
"parent":"",
"text":"文明用语.F*U*C*K*",
"mid":"fwlBWX",
"date":"2011-04-25 10:29:05"
},
{
"kids":[],
"uid":"1874587884",
"parent":"",
"text":"需要农民伯伯养活的高贵官员太多了,不够养活啊~!",
"mid":"fwlBJC",
"date":"2011-04-25 10:29:02"
},
{
"kids":[],
"uid":"1887959353",
"parent":"",
"text":"无语的祖国!!",
"mid":"fwlBzd",
"date":"2011-04-25 10:28:59"
},
{
"kids":[],
"uid":"ddcplay",
"parent":"",
"text":"“敌占区”——很贴切么!",
"mid":"fwlByl",
"date":"2011-04-25 10:28:59"
},
{
"kids":[],
"uid":"jiajiayaoyaoqin",
"parent":"",
"text":"",
"mid":"fwlAZj",
"date":"2011-04-25 10:28:55"
},
{
"kids":[],
"uid":"feralimmatureanimal",
"parent":"",
"text":"",
"mid":"fwlAnw",
"date":"2011-04-25 10:28:50"
},
{
"kids":[],
"uid":"boomerang503",
"parent":"",
"text":"",
"mid":"fwlAtA",
"date":"2011-04-25 10:28:49"
},
{
"kids":[],
"uid":"damiano",
"parent":"",
"text":"反正有一部分“人”永远没事,鄙视",
"mid":"fwlAfG",
"date":"2011-04-25 10:28:48"
},
{
"kids":[],
"uid":"1896667593",
"parent":"",
"text":"",
"mid":"fwlzNK",
"date":"2011-04-25 10:28:45"
},
{
"kids":[],
"uid":"sixfool",
"parent":"",
"text":"哎。",
"mid":"fwlzRt",
"date":"2011-04-25 10:28:44"
},
{
"kids":[],
"uid":"linloveslife",
"parent":"",
"text":"",
"mid":"fwlzwM",
"date":"2011-04-25 10:28:40"
},
{
"kids":[],
"uid":"kankancc",
"parent":"",
"text":"天朝啊。一直以来,最可怕的是自己人,不是敌人。",
"mid":"fwlzhG",
"date":"2011-04-25 10:28:39"
},
{
"kids":[],
"uid":"liuxiyang314",
"parent":"",
"text":"",
"mid":"fwlzrL",
"date":"2011-04-25 10:28:38"
},
{
"kids":[],
"uid":"yeah0102",
"parent":"",
"text":"转发微博。",
"mid":"fwlyzm",
"date":"2011-04-25 10:28:31"
},
{
"kids":[],
"uid":"huanbin433",
"parent":"",
"text":"很讽刺,其中都有人在搞鬼~~!!!",
"mid":"fwlyoK",
"date":"2011-04-25 10:28:30"
},
{
"kids":[],
"uid":"345123008",
"parent":"",
"text":"",
"mid":"fwlxFL",
"date":"2011-04-25 10:28:22"
},
{
"kids":[],
"uid":"lisadt",
"parent":"",
"text":"",
"mid":"fwlxnl",
"date":"2011-04-25 10:28:18"
},
{
"kids":[],
"uid":"laosui",
"parent":"",
"text":"",
"mid":"fwlxkA",
"date":"2011-04-25 10:28:17"
},
{
"kids":[],
"uid":"1767536372",
"parent":"",
"text":"",
"mid":"fwlwWh",
"date":"2011-04-25 10:28:14"
},
{
"kids":[],
"uid":"2011946920",
"parent":"",
"text":"...不可以这么一针见血",
"mid":"fwlwyT",
"date":"2011-04-25 10:28:11"
},
{
"kids":[],
"uid":"kingryu",
"parent":"",
"text":"",
"mid":"fwlvMP",
"date":"2011-04-25 10:28:05"
},
{
"kids":[],
"uid":"drchaos",
"parent":"",
"text":"",
"mid":"fwlvAt",
"date":"2011-04-25 10:28:00"
},
{
"kids":[],
"uid":"forsaken123",
"parent":"",
"text":"",
"mid":"fwlvhs",
"date":"2011-04-25 10:27:59"
},
{
"kids":[],
"uid":"hxxooh",
"parent":"",
"text":"",
"mid":"fwlvk2",
"date":"2011-04-25 10:27:58"
}
] | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2014 Stratio (http://stratio.com)
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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.stratio.decision.shell" />
</beans> | {
"pile_set_name": "Github"
} |
//////////////////////////////////////////////////////////////////////////
bool canWinNim(int n)
{
return n % 4 != 0;
}
//////////////////////////////////////////////////////////////////////////
bool _solution_run(int n)
{
return canWinNim(n);
}
//#define USE_SOLUTION_CUSTOM
//bool _solution_custom(TestCases &tc)
//{
//}
//////////////////////////////////////////////////////////////////////////
//#define USE_GET_TEST_CASES_IN_CPP
//vector<string> _get_test_cases_string()
//{
// return {};
//}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Smarty Internal Plugin Templatelexer
*
* This is the lexer to break the template source into tokens
* @package Smarty
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Templatelexer
*/
class Smarty_Internal_Templatelexer
{
public $data;
public $counter;
public $token;
public $value;
public $node;
public $line;
public $taglineno;
public $state = 1;
public $strip = false;
private $heredoc_id_stack = Array();
public $smarty_token_names = array ( // Text for parser error messages
'IDENTITY' => '===',
'NONEIDENTITY' => '!==',
'EQUALS' => '==',
'NOTEQUALS' => '!=',
'GREATEREQUAL' => '(>=,ge)',
'LESSEQUAL' => '(<=,le)',
'GREATERTHAN' => '(>,gt)',
'LESSTHAN' => '(<,lt)',
'MOD' => '(%,mod)',
'NOT' => '(!,not)',
'LAND' => '(&&,and)',
'LOR' => '(||,or)',
'LXOR' => 'xor',
'OPENP' => '(',
'CLOSEP' => ')',
'OPENB' => '[',
'CLOSEB' => ']',
'PTR' => '->',
'APTR' => '=>',
'EQUAL' => '=',
'NUMBER' => 'number',
'UNIMATH' => '+" , "-',
'MATH' => '*" , "/" , "%',
'INCDEC' => '++" , "--',
'SPACE' => ' ',
'DOLLAR' => '$',
'SEMICOLON' => ';',
'COLON' => ':',
'DOUBLECOLON' => '::',
'AT' => '@',
'HATCH' => '#',
'QUOTE' => '"',
'BACKTICK' => '`',
'VERT' => '|',
'DOT' => '.',
'COMMA' => '","',
'ANDSYM' => '"&"',
'QMARK' => '"?"',
'ID' => 'identifier',
'OTHER' => 'text',
'LINEBREAK' => 'newline',
'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
'PHPSTARTTAG' => 'PHP start tag',
'PHPENDTAG' => 'PHP end tag',
'LITERALSTART' => 'Literal start',
'LITERALEND' => 'Literal end',
'LDELSLASH' => 'closing tag',
'COMMENT' => 'comment',
'AS' => 'as',
'TO' => 'to',
);
function __construct($data,$compiler)
{
// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
$this->data = $data;
$this->counter = 0;
$this->line = 1;
$this->smarty = $compiler->smarty;
$this->compiler = $compiler;
$this->ldel = preg_quote($this->smarty->left_delimiter,'/');
$this->ldel_length = strlen($this->smarty->left_delimiter);
$this->rdel = preg_quote($this->smarty->right_delimiter,'/');
$this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
$this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
$this->mbstring_overload = ini_get('mbstring.func_overload') & 2;
}
private $_yy_state = 1;
private $_yy_stack = array();
function yylex()
{
return $this->{'yylex' . $this->_yy_state}();
}
function yypushstate($state)
{
array_push($this->_yy_stack, $this->_yy_state);
$this->_yy_state = $state;
}
function yypopstate()
{
$this->_yy_state = array_pop($this->_yy_stack);
}
function yybegin($state)
{
$this->_yy_state = $state;
}
function yylex1()
{
$tokenMap = array (
1 => 0,
2 => 0,
3 => 1,
5 => 0,
6 => 0,
7 => 0,
8 => 0,
9 => 0,
10 => 0,
11 => 0,
12 => 1,
14 => 0,
15 => 0,
16 => 0,
17 => 0,
18 => 0,
19 => 0,
20 => 0,
21 => 0,
22 => 0,
23 => 0,
24 => 2,
27 => 0,
28 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
$yy_global_pattern = "/\G(".$this->ldel."[$]smarty\\.block\\.child".$this->rdel.")|\G(\\{\\})|\G(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|\G([\t ]*[\r\n]+[\t ]*)|\G(".$this->ldel."strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/strip".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/strip\\s{1,}".$this->rdel.")|\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s*setfilter\\s+)|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?|\\?>|<%|%>)))|\G([\S\s]+)|\G(.)/iS";
do {
if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception('Error: lexing failed because a rule matched' .
' an empty string. Input "' . substr($this->data,
$this->counter, 5) . '... state TEXT');
}
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1,
$tokenMap[$this->token]);
} else {
$yysubmatches = array();
}
$this->value = current($yymatches); // token value
$r = $this->{'yy_r1_' . $this->token}($yysubmatches);
if ($r === null) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
// accept this token
return true;
} elseif ($r === true) {
// we have changed state
// process this token in the new state
return $this->yylex();
} elseif ($r === false) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
// skip this token
continue;
} } else {
throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]);
}
break;
} while (true);
} // end function
const TEXT = 1;
function yy_r1_1($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILD;
}
function yy_r1_2($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yy_r1_3($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_COMMENT;
}
function yy_r1_5($yy_subpatterns)
{
if ($this->strip) {
return false;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LINEBREAK;
}
}
function yy_r1_6($yy_subpatterns)
{
$this->strip = true;
return false;
}
function yy_r1_7($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->strip = true;
return false;
}
}
function yy_r1_8($yy_subpatterns)
{
$this->strip = false;
return false;
}
function yy_r1_9($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->strip = false;
return false;
}
}
function yy_r1_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
$this->yypushstate(self::LITERAL);
}
function yy_r1_11($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_12($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELIF;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_14($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_15($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_16($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_17($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_18($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r1_19($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r1_20($yy_subpatterns)
{
if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
$this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
} elseif ($this->value == '<?xml') {
$this->token = Smarty_Internal_Templateparser::TP_XMLTAG;
} else {
$this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
$this->value = substr($this->value, 0, 2);
}
}
function yy_r1_21($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
}
function yy_r1_22($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
}
function yy_r1_23($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
}
function yy_r1_24($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yy_r1_27($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yy_r1_28($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yylex2()
{
$tokenMap = array (
1 => 0,
2 => 0,
3 => 1,
5 => 0,
6 => 0,
7 => 0,
8 => 0,
9 => 0,
10 => 0,
11 => 0,
12 => 0,
13 => 0,
14 => 0,
15 => 0,
16 => 0,
17 => 0,
18 => 0,
19 => 0,
20 => 1,
22 => 1,
24 => 1,
26 => 0,
27 => 0,
28 => 0,
29 => 0,
30 => 0,
31 => 0,
32 => 0,
33 => 0,
34 => 0,
35 => 0,
36 => 0,
37 => 0,
38 => 0,
39 => 0,
40 => 0,
41 => 0,
42 => 0,
43 => 3,
47 => 0,
48 => 0,
49 => 0,
50 => 0,
51 => 0,
52 => 0,
53 => 0,
54 => 0,
55 => 1,
57 => 1,
59 => 0,
60 => 0,
61 => 0,
62 => 0,
63 => 0,
64 => 0,
65 => 0,
66 => 0,
67 => 0,
68 => 0,
69 => 0,
70 => 0,
71 => 0,
72 => 0,
73 => 0,
74 => 0,
75 => 0,
76 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
$yy_global_pattern = "/\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(\\s{1,}".$this->rdel.")|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(".$this->rdel.")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\s+)|\G(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\)\\s*)|\G(\\s*\\(\\s*)|\G(\\s*\\))|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*->\\s*)|\G(\\s*=>\\s*)|\G(\\s*=\\s*)|\G(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(\\$)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(@)|\G(#)|\G(\")|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(\\s+)|\G(.)/iS";
do {
if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception('Error: lexing failed because a rule matched' .
' an empty string. Input "' . substr($this->data,
$this->counter, 5) . '... state SMARTY');
}
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1,
$tokenMap[$this->token]);
} else {
$yysubmatches = array();
}
$this->value = current($yymatches); // token value
$r = $this->{'yy_r2_' . $this->token}($yysubmatches);
if ($r === null) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
// accept this token
return true;
} elseif ($r === true) {
// we have changed state
// process this token in the new state
return $this->yylex();
} elseif ($r === false) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
// skip this token
continue;
} } else {
throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]);
}
break;
} while (true);
} // end function
const SMARTY = 2;
function yy_r2_1($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
}
function yy_r2_2($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r2_3($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELIF;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r2_5($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r2_6($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r2_7($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r2_8($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_RDEL;
$this->yypopstate();
}
function yy_r2_9($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r2_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r2_11($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_RDEL;
$this->yypopstate();
}
function yy_r2_12($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISIN;
}
function yy_r2_13($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_AS;
}
function yy_r2_14($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TO;
}
function yy_r2_15($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_STEP;
}
function yy_r2_16($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
}
function yy_r2_17($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
}
function yy_r2_18($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
}
function yy_r2_19($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_EQUALS;
}
function yy_r2_20($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
}
function yy_r2_22($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
}
function yy_r2_24($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
}
function yy_r2_26($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
}
function yy_r2_27($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
}
function yy_r2_28($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_MOD;
}
function yy_r2_29($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_NOT;
}
function yy_r2_30($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LAND;
}
function yy_r2_31($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LOR;
}
function yy_r2_32($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LXOR;
}
function yy_r2_33($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
}
function yy_r2_34($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
}
function yy_r2_35($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISODD;
}
function yy_r2_36($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
}
function yy_r2_37($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
}
function yy_r2_38($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
}
function yy_r2_39($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
}
function yy_r2_40($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
}
function yy_r2_41($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
}
function yy_r2_42($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
}
function yy_r2_43($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
}
function yy_r2_47($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OPENP;
}
function yy_r2_48($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
}
function yy_r2_49($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OPENB;
}
function yy_r2_50($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
}
function yy_r2_51($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_PTR;
}
function yy_r2_52($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_APTR;
}
function yy_r2_53($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_EQUAL;
}
function yy_r2_54($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_INCDEC;
}
function yy_r2_55($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
}
function yy_r2_57($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_MATH;
}
function yy_r2_59($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
}
function yy_r2_60($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
}
function yy_r2_61($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
}
function yy_r2_62($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_COLON;
}
function yy_r2_63($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_AT;
}
function yy_r2_64($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_HATCH;
}
function yy_r2_65($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypushstate(self::DOUBLEQUOTEDSTRING);
}
function yy_r2_66($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
$this->yypopstate();
}
function yy_r2_67($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_VERT;
}
function yy_r2_68($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOT;
}
function yy_r2_69($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_COMMA;
}
function yy_r2_70($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
}
function yy_r2_71($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_QMARK;
}
function yy_r2_72($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_HEX;
}
function yy_r2_73($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ID;
}
function yy_r2_74($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_INTEGER;
}
function yy_r2_75($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_SPACE;
}
function yy_r2_76($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yylex3()
{
$tokenMap = array (
1 => 0,
2 => 0,
3 => 0,
4 => 0,
5 => 0,
6 => 0,
7 => 0,
8 => 2,
11 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
$yy_global_pattern = "/\G(".$this->ldel."\\s*literal\\s*".$this->rdel.")|\G(".$this->ldel."\\s*\/literal\\s*".$this->rdel.")|\G([\t ]*[\r\n]+[\t ]*)|\G(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|\G(\\?>)|\G(<%)|\G(%>)|\G(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."\/?literal".$this->rdel."|<\\?|<%)))|\G(.)/iS";
do {
if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception('Error: lexing failed because a rule matched' .
' an empty string. Input "' . substr($this->data,
$this->counter, 5) . '... state LITERAL');
}
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1,
$tokenMap[$this->token]);
} else {
$yysubmatches = array();
}
$this->value = current($yymatches); // token value
$r = $this->{'yy_r3_' . $this->token}($yysubmatches);
if ($r === null) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
// accept this token
return true;
} elseif ($r === true) {
// we have changed state
// process this token in the new state
return $this->yylex();
} elseif ($r === false) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
// skip this token
continue;
} } else {
throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]);
}
break;
} while (true);
} // end function
const LITERAL = 3;
function yy_r3_1($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
$this->yypushstate(self::LITERAL);
}
function yy_r3_2($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
$this->yypopstate();
}
function yy_r3_3($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
}
function yy_r3_4($yy_subpatterns)
{
if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
$this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
} else {
$this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
$this->value = substr($this->value, 0, 2);
}
}
function yy_r3_5($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
}
function yy_r3_6($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
}
function yy_r3_7($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
}
function yy_r3_8($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
}
function yy_r3_11($yy_subpatterns)
{
$this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
}
function yylex4()
{
$tokenMap = array (
1 => 0,
2 => 1,
4 => 0,
5 => 0,
6 => 0,
7 => 0,
8 => 0,
9 => 0,
10 => 0,
11 => 0,
12 => 0,
13 => 3,
17 => 0,
18 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
$yy_global_pattern = "/\G(".$this->ldel."\\s{1,}\/)|\G(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|\G(".$this->ldel."\\s*for\\s+)|\G(".$this->ldel."\\s*foreach(?![^\s]))|\G(".$this->ldel."\\s{1,})|\G(".$this->ldel."\/)|\G(".$this->ldel.")|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|\G([\S\s]+)|\G(.)/iS";
do {
if ($this->mbstring_overload ? preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches) : preg_match($yy_global_pattern,$this->data, $yymatches, null, $this->counter)) {
$yysubmatches = $yymatches;
$yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
if (!count($yymatches)) {
throw new Exception('Error: lexing failed because a rule matched' .
' an empty string. Input "' . substr($this->data,
$this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
}
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
if ($tokenMap[$this->token]) {
// extract sub-patterns for passing to lex function
$yysubmatches = array_slice($yysubmatches, $this->token + 1,
$tokenMap[$this->token]);
} else {
$yysubmatches = array();
}
$this->value = current($yymatches); // token value
$r = $this->{'yy_r4_' . $this->token}($yysubmatches);
if ($r === null) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
// accept this token
return true;
} elseif ($r === true) {
// we have changed state
// process this token in the new state
return $this->yylex();
} elseif ($r === false) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
// skip this token
continue;
} } else {
throw new Exception('Unexpected input at line' . $this->line .
': ' . $this->data[$this->counter]);
}
break;
} while (true);
} // end function
const DOUBLEQUOTEDSTRING = 4;
function yy_r4_1($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r4_2($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELIF;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r4_4($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r4_5($yy_subpatterns)
{
if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r4_6($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r4_7($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r4_8($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r4_9($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypopstate();
}
function yy_r4_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
$this->value = substr($this->value,0,-1);
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r4_11($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
}
function yy_r4_12($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yy_r4_13($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yy_r4_17($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
function yy_r4_18($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
}
?> | {
"pile_set_name": "Github"
} |
module Kontena::Cli::Master
class RemoveCommand < Kontena::Command
include Kontena::Cli::Common
parameter '[NAME]', "Master name"
banner "Note: This command only removes the master from your local configuration file"
option '--force', :flag, "Don't ask for confirmation", attribute_name: :forced
def run_interactive
selections = prompt.multi_select("Select masters to remove from configuration file:") do |menu|
config.servers.each do |server|
menu.choice " #{pastel.green("* ") if config.current_server == server.name}#{server.name} (#{server.username || 'unknown'} @ #{server.url})", server
end
end
if selections.empty?
puts "No masters selected"
exit 0
end
delete_servers(selections)
end
def delete_servers(servers)
abort "Master not found in configuration" if servers.empty?
unless forced?
puts "Removing #{servers.size} master#{"s" if servers.size > 1} from configuration"
confirm
end
config.servers.delete_if {|s| servers.include?(s) }
unless config.find_server(config.current_server)
puts
puts "Current master was removed, to select a new current master use:"
puts " " + pastel.green.on_black(" kontena master use <master_name> ")
puts "Or log into another master by using:"
puts " " + pastel.green.on_black(" kontena master login <master_url> ")
config.current_server = nil
end
config.write
end
def execute
if self.name.nil?
run_interactive
else
delete_servers(config.servers.select {|s| s.name == self.name})
end
end
end
end
| {
"pile_set_name": "Github"
} |
// -----------------------------------------------------------------------
// <copyright file="ContextPool.cs" company="Hibernating Rhinos LTD">
// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
using Sparrow;
using Sparrow.Json;
using Voron;
namespace Raven.Server.ServerWide.Context
{
public class TransactionContextPool : JsonContextPoolBase<TransactionOperationContext>, ITransactionContextPool<TransactionOperationContext>
{
private StorageEnvironment _storageEnvironment;
public TransactionContextPool(StorageEnvironment storageEnvironment, Size? maxContextSizeToKeepInMb = null) : base(maxContextSizeToKeepInMb)
{
_storageEnvironment = storageEnvironment;
}
protected override TransactionOperationContext CreateContext()
{
int initialSize;
int longLivedSize;
int maxNumberOfAllocatedStringValues;
if (_storageEnvironment.Options.RunningOn32Bits)
{
initialSize = 4096;
longLivedSize = 4 * 1024;
maxNumberOfAllocatedStringValues = 2 * 1024;
}
else
{
initialSize = 32 * 1024;
longLivedSize = 16 * 1024;
maxNumberOfAllocatedStringValues = 8 * 1024;
}
return new TransactionOperationContext(_storageEnvironment, initialSize, longLivedSize, maxNumberOfAllocatedStringValues, LowMemoryFlag);
}
public override void Dispose()
{
_storageEnvironment = null;
base.Dispose();
}
}
}
| {
"pile_set_name": "Github"
} |
---
title: 成为女孩子的声音!【6】腹式呼吸
date: 2018-12-03
tags: [伪声,嗓音]
categories: 成为女孩子的声音
top_img: /img/top_img/6.png
---
**成为女孩子的声音**
上一篇:[成为女孩子的声音!【5.5】测定基础频率](https://github.com/Kristall-WangShiwei/Transgender-lost-years/blob/master/0005_BookTranslating/weisheng/nv-zi-sheng/05.5.md)<br><br>
**原作:女の子の声になろう!即効ボイトレ編**
**作者:白石謙二**
**插图:べたにゃ**
**封面图:[アシマ](https://www.pixiv.net/member.php?id=2642047
)(Pixiv)**
**翻译:佐倉奈緒**
**Github:冰蓝、Kristall Wang** <br><br>
**本书所使用的视频同时已上传B站:[av33486397](https://www.bilibili.com/video/av33486397)**<br><br>
## 第三章 尝试着进行发声练习吧
好了,在之前已经做好的嗓音训练的准备,接下来开始进行发声练习。
首先从腹式呼吸开始。
这并不是什么困难的事情。<br><br>
### 【3-1】腹式呼吸的准备
请做出仰卧的姿势,并取基本较厚的书或杂志放在腹部之上准备练习<br><br>
#### 腹式呼吸的准备
1)首先,做出仰卧的姿势,并取基本较厚的书或杂志放在腹部之上。
2)以全身放松的状态,将肺部的剩余空气吐出。这个时候,请注意不要让腹部的重物落下。
3)接着,缓慢地将空气吸入,自然地边让腹部膨胀边将空气吸入,同样这个时候,也请注意不要让腹部的重物落下。
4)请重复步骤1~3,并以可以自然完成为标准进行练习。

### 【3-2】腹式呼吸的练习1
腹式呼吸是发声的基本。请每天重复进行练习吧。
因为可以使腹肌得到锻炼,还可以对腰附近的赘肉进行消耗,并且也有让精神更加容易安定的效果,是一种做了也没有什么损失的锻炼。以4拍长度进行吸入,8拍长度进行吐出。<br><br>
#### 腹式呼吸的练习1
以下的练习,请一边听添付CD的【音轨1】一边进行实践。<br><br>
吸入空气(4拍)
吐出空气(4拍)“呼~”(スゥーッ)
将空气吐净(4拍)“拂~”(フゥ~)<br><br>
(此处中文使用中文谐音)

吐出空气(发出声音)时为了能够使力,发出的为轻微的“呼~”或者无声音。<br><br>
#### 练习的要领
呼吸时,请从鼻子吸入空气,然后从嘴中吐出。
吐出空气(发出声音)时为了能够使力,尝试发出的轻微的“呼~”或不发出声音吧。同时,吐出空气的时间请使用吸入空气的时间的两倍。
即使是这样,也不是说将吸入空气的量的两倍吐出。这样是做不到的呢。
随着肺部的空气被逐渐挤出,横膈膜会随之上升,身体会无意识地使用腹肌进行活动。
将空气吐出到极限(不能再吐为止)的状态下吸入空气的话,可以反射性的使用腹部进行呼吸。
随着让身体熟悉以上的流程,便可以学习到腹式呼吸了。
也就是说,在练习之后,身体会自然地使用腹式呼吸。
本练习重复4次。<br><br>
### 【3-3】腹式呼吸的练习2
接下来更进一步地进行锻炼吧。
在吸入空气后停止呼吸,紧接着再吐出空气。<br><br>
#### 腹式呼吸的练习2
以下的练习,请一边听添付CD的【音轨2】一边进行实践。<br><br>
吸入空气(4拍)
停止呼吸(4拍)
吐出空气(4拍)“呼~”(スゥーッ)
将空气吐净(4拍)“拂~”(フゥ~)<br><br>
(此处中文使用中文谐音)<br><br>
稍微将负荷提升的话练习地效果也会有所提高。
本练习也请重复4次。<br><br>

本练习地呼吸时,也同样请从鼻子吸入空气,然后从嘴中吐出。
如果出现“CD的速度过快,没有办法完全吸入空气或者没有办法吐干净空气”的情况,请根据各位自身的情况进行速度的调节完成练习。
下一篇:[成为女孩子的声音!【7】唇颤音和舌颤音](https://github.com/Kristall-WangShiwei/Transgender-lost-years/blob/master/0005_BookTranslating/weisheng/nv-zi-sheng/07.md)
*(本文仅供学习所用,严禁转载或商业加工,任何需求请联系译者)*
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-cloud-starter-thrift</artifactId>
<groupId>io.ostenant.rpc.thrift</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-starter-thrift-client</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<dependency>
<groupId>com.orbitz.consul</groupId>
<artifactId>consul-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> | {
"pile_set_name": "Github"
} |
#define FSEMU_INTERNAL
#include "fsemu-control.h"
// FIXME: Merge quit into control module
#include "fsemu-quit.h"
static struct {
bool paused;
bool warping;
} fsemu_control;
void fsemu_control_quit(void)
{
fsemu_quit_maybe();
}
bool fsemu_control_paused(void)
{
// By checking for quit here, we do not need to consider quit event
// in pause loops.
if (fsemu_quit_check()) {
return false;
}
return fsemu_control.paused;
}
void fsemu_control_set_paused(bool paused)
{
fsemu_control.paused = paused;
}
void fsemu_control_toggle_paused(void)
{
fsemu_control_set_paused(!fsemu_control_paused());
}
bool fsemu_control_warp(void)
{
return fsemu_control.warping;
}
void fsemu_control_set_warp(bool warping)
{
fsemu_control.warping = warping;
}
void fsemu_control_toggle_warp(void)
{
fsemu_control_set_warp(!fsemu_control_warp());
}
| {
"pile_set_name": "Github"
} |
//
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_LOCALE_TIME_ZONE_HPP_INCLUDED
#define BOOST_LOCALE_TIME_ZONE_HPP_INCLUDED
#include <boost/locale/config.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4275 4251 4231 4660)
#endif
#include <string>
namespace boost {
namespace locale {
///
/// \addtogroup date_time
///
/// @{
///
/// \brief namespace that holds functions for operating with global
/// time zone
///
namespace time_zone {
///
/// Get global time zone identifier. If empty, system time zone is used
///
BOOST_LOCALE_DECL std::string global();
///
/// Set global time zone identifier returning previous one. If empty, system time zone is used
///
BOOST_LOCALE_DECL std::string global(std::string const &new_tz);
}
/// @}
} // locale
} // boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* 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, 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 XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "GUIDialogVisualisationPresetList.h"
#include "addons/Visualisation.h"
#include "guilib/GUIWindowManager.h"
#include "GUIUserMessages.h"
#include "FileItem.h"
#include "guilib/Key.h"
#include "guilib/LocalizeStrings.h"
#include "utils/StringUtils.h"
#define CONTROL_LIST 2
#define CONTROL_PRESETS_LABEL 3
#define CONTROL_NONE_AVAILABLE 4
using ADDON::CVisualisation;
CGUIDialogVisualisationPresetList::CGUIDialogVisualisationPresetList(void)
: CGUIDialog(WINDOW_DIALOG_VIS_PRESET_LIST, "VisualisationPresetList.xml")
{
m_currentPreset = 0;
m_vecPresets = new CFileItemList;
m_viz = NULL;
m_loadType = KEEP_IN_MEMORY;
}
CGUIDialogVisualisationPresetList::~CGUIDialogVisualisationPresetList(void)
{
delete m_vecPresets;
}
bool CGUIDialogVisualisationPresetList::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == CONTROL_LIST && (message.GetParam1() == ACTION_SELECT_ITEM ||
message.GetParam1() == ACTION_MOUSE_LEFT_CLICK))
{
//clicked - ask for the preset to be changed to the new one
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_LIST);
if (OnMessage(msg))
{
int iItem = (int)msg.GetParam1();
if (m_viz)
m_viz->OnAction(VIS_ACTION_LOAD_PRESET, (void *)&iItem);
}
return true;
}
}
break;
case GUI_MSG_VISUALISATION_UNLOADING:
{
m_viz = NULL;
Update();
}
break;
case GUI_MSG_VISUALISATION_LOADED:
{
SetVisualisation((CVisualisation*)message.GetPointer());
}
break;
}
return CGUIDialog::OnMessage(message);
}
void CGUIDialogVisualisationPresetList::SetVisualisation(CVisualisation* vis)
{
m_viz = NULL;
if (vis)
{
m_viz = vis;
Update();
}
}
void CGUIDialogVisualisationPresetList::FrameMove()
{
//FIXME we shouldn't have to check preset each frame
// a viz callback could push GUI_MSG_VISUALISATION_UPDATED
if (m_viz)
{
unsigned preset = m_viz->GetPreset();
if (preset != m_currentPreset && preset < (unsigned int)m_vecPresets->Size())
{
m_vecPresets->Get(m_currentPreset)->Select(false);
m_currentPreset = preset;
m_vecPresets->Get(m_currentPreset)->Select(true);
}
}
CGUIDialog::FrameMove();
}
void CGUIDialogVisualisationPresetList::OnInitWindow()
{
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
g_windowManager.SendMessage(msg);
SetVisualisation((CVisualisation*)msg.GetPointer());
CGUIDialog::OnInitWindow();
}
void CGUIDialogVisualisationPresetList::OnDeinitWindow(int nextWindowID)
{
CGUIDialog::OnDeinitWindow(nextWindowID);
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LIST);
OnMessage(msg);
SET_CONTROL_LABEL(CONTROL_PRESETS_LABEL, "");
m_vecPresets->Clear();
}
void CGUIDialogVisualisationPresetList::Update()
{
m_vecPresets->Clear();
CStdString strHeading;
if (m_viz)
{
strHeading = StringUtils::Format(g_localizeStrings.Get(13407).c_str(), m_viz->Name().c_str());
//clear filelist
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LIST);
OnMessage(msg);
std::vector<std::string> presets;
if (m_viz->GetPresetList(presets))
{
m_currentPreset = m_viz->GetPreset();
for (unsigned i = 0; i < presets.size(); i++)
{
CFileItemPtr pItem(new CFileItem(presets[i]));
if (i == m_currentPreset)
pItem->Select(true);
pItem->RemoveExtension();
pItem->SetLabel2(" ");
m_vecPresets->Add(pItem);
}
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, m_currentPreset, 0, m_vecPresets);
OnMessage(msg);
}
}
// update our dialog's label
SET_CONTROL_LABEL(CONTROL_PRESETS_LABEL, strHeading);
// if there is no presets, add a label saying so
if (m_vecPresets->Size() == 0)
{
SET_CONTROL_VISIBLE(CONTROL_NONE_AVAILABLE);
}
else
{
SET_CONTROL_HIDDEN(CONTROL_NONE_AVAILABLE);
CGUIMessage msg(GUI_MSG_ITEM_SELECT, GetID(), CONTROL_LIST, m_currentPreset);
OnMessage(msg);
}
}
| {
"pile_set_name": "Github"
} |
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <[email protected]>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//
#ifndef BOOST_COMPUTE_ITERATOR_DETAIL_SWIZZLE_ITERATOR_HPP
#define BOOST_COMPUTE_ITERATOR_DETAIL_SWIZZLE_ITERATOR_HPP
#include <string>
#include <cstddef>
#include <iterator>
#include <boost/config.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/compute/functional.hpp>
#include <boost/compute/detail/meta_kernel.hpp>
#include <boost/compute/type_traits/make_vector_type.hpp>
#include <boost/compute/detail/is_buffer_iterator.hpp>
#include <boost/compute/detail/read_write_single_value.hpp>
#include <boost/compute/iterator/detail/get_base_iterator_buffer.hpp>
#include <boost/compute/type_traits/is_device_iterator.hpp>
namespace boost {
namespace compute {
namespace detail {
// forward declaration for swizzle_iterator
template<class InputIterator, size_t Size>
class swizzle_iterator;
// meta-function returing the value_type for a swizzle_iterator
template<class InputIterator, size_t Size>
struct make_swizzle_iterator_value_type
{
typedef
typename make_vector_type<
typename scalar_type<
typename std::iterator_traits<InputIterator>::value_type
>::type,
Size
>::type type;
};
// helper class which defines the iterator_adaptor super-class
// type for swizzle_iterator
template<class InputIterator, size_t Size>
class swizzle_iterator_base
{
public:
typedef ::boost::iterator_adaptor<
swizzle_iterator<InputIterator, Size>,
InputIterator,
typename make_swizzle_iterator_value_type<InputIterator, Size>::type,
typename std::iterator_traits<InputIterator>::iterator_category,
typename make_swizzle_iterator_value_type<InputIterator, Size>::type
> type;
};
template<class InputIterator, size_t Size, class IndexExpr>
struct swizzle_iterator_index_expr
{
typedef typename make_swizzle_iterator_value_type<InputIterator, Size>::type result_type;
swizzle_iterator_index_expr(const InputIterator &input_iter,
const IndexExpr &index_expr,
const std::string &components)
: m_input_iter(input_iter),
m_index_expr(index_expr),
m_components(components)
{
}
InputIterator m_input_iter;
IndexExpr m_index_expr;
std::string m_components;
};
template<class InputIterator, size_t Size, class IndexExpr>
inline meta_kernel& operator<<(meta_kernel &kernel,
const swizzle_iterator_index_expr<InputIterator,
Size,
IndexExpr> &expr)
{
return kernel << expr.m_input_iter[expr.m_index_expr]
<< "." << expr.m_components;
}
template<class InputIterator, size_t Size>
class swizzle_iterator :
public swizzle_iterator_base<InputIterator, Size>::type
{
public:
typedef typename
swizzle_iterator_base<InputIterator, Size>::type
super_type;
typedef typename super_type::value_type value_type;
typedef typename super_type::reference reference;
typedef typename super_type::base_type base_type;
typedef typename super_type::difference_type difference_type;
BOOST_STATIC_CONSTANT(size_t, vector_size = Size);
swizzle_iterator(InputIterator iterator, const std::string &components)
: super_type(iterator),
m_components(components)
{
BOOST_ASSERT(components.size() == Size);
}
swizzle_iterator(const swizzle_iterator<InputIterator, Size> &other)
: super_type(other.base()),
m_components(other.m_components)
{
BOOST_ASSERT(m_components.size() == Size);
}
swizzle_iterator<InputIterator, Size>&
operator=(const swizzle_iterator<InputIterator, Size> &other)
{
if(this != &other){
super_type::operator=(other);
m_components = other.m_components;
}
return *this;
}
~swizzle_iterator()
{
}
size_t get_index() const
{
return super_type::base().get_index();
}
const buffer& get_buffer() const
{
return get_base_iterator_buffer(*this);
}
template<class IndexExpression>
swizzle_iterator_index_expr<InputIterator, Size, IndexExpression>
operator[](const IndexExpression &expr) const
{
return swizzle_iterator_index_expr<InputIterator,
Size,
IndexExpression>(super_type::base(),
expr,
m_components);
}
private:
friend class ::boost::iterator_core_access;
reference dereference() const
{
return reference();
}
private:
std::string m_components;
};
template<size_t Size, class InputIterator>
inline swizzle_iterator<InputIterator, Size>
make_swizzle_iterator(InputIterator iterator, const std::string &components)
{
return swizzle_iterator<InputIterator, Size>(iterator, components);
}
} // end detail namespace
// is_device_iterator specialization for swizzle_iterator
template<size_t Size, class InputIterator>
struct is_device_iterator<detail::swizzle_iterator<InputIterator, Size> > : boost::true_type {};
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_ITERATOR_SWIZZLE_ITERATOR_HPP
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.