text
stringlengths 2
99.9k
| meta
dict |
---|---|
<?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2016 Elcodi Networks S.L.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <[email protected]>
* @author Aldo Chiecchia <[email protected]>
* @author Elcodi Team <[email protected]>
*/
namespace Elcodi\Bundle\UserBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Elcodi\Bundle\CoreBundle\DataFixtures\ORM\Abstracts\AbstractFixture;
use Elcodi\Component\Core\Services\ObjectDirector;
/**
* AdminData class.
*
* Load fixtures of admin entities
*/
class CustomerData extends AbstractFixture
{
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
/**
* @var ObjectDirector $customerDirector
*/
$customerDirector = $this->getDirector('customer');
/**
* Customer 1.
*/
$customer1 = $customerDirector
->create()
->setPassword('customer')
->setEmail('[email protected]');
$customerDirector->save($customer1);
$this->addReference('customer-1', $customer1);
/**
* Customer 2.
*/
$customer2 = $customerDirector
->create()
->setPassword('customer2')
->setEmail('[email protected]');
$customerDirector->save($customer2);
$this->addReference('customer-2', $customer2);
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package net
import (
"os"
"syscall"
"unsafe"
)
// If the ifindex is zero, interfaceTable returns mappings of all
// network interfaces. Otherwise it returns a mapping of a specific
// interface.
func interfaceTable(ifindex int) ([]Interface, error) {
tab, err := syscall.NetlinkRIB(syscall.RTM_GETLINK, syscall.AF_UNSPEC)
if err != nil {
return nil, os.NewSyscallError("netlinkrib", err)
}
msgs, err := syscall.ParseNetlinkMessage(tab)
if err != nil {
return nil, os.NewSyscallError("parsenetlinkmessage", err)
}
var ift []Interface
loop:
for _, m := range msgs {
switch m.Header.Type {
case syscall.NLMSG_DONE:
break loop
case syscall.RTM_NEWLINK:
ifim := (*syscall.IfInfomsg)(unsafe.Pointer(&m.Data[0]))
if ifindex == 0 || ifindex == int(ifim.Index) {
attrs, err := syscall.ParseNetlinkRouteAttr(&m)
if err != nil {
return nil, os.NewSyscallError("parsenetlinkrouteattr", err)
}
ift = append(ift, *newLink(ifim, attrs))
if ifindex == int(ifim.Index) {
break loop
}
}
}
}
return ift, nil
}
const (
// See linux/if_arp.h.
// Note that Linux doesn't support IPv4 over IPv6 tunneling.
sysARPHardwareIPv4IPv4 = 768 // IPv4 over IPv4 tunneling
sysARPHardwareIPv6IPv6 = 769 // IPv6 over IPv6 tunneling
sysARPHardwareIPv6IPv4 = 776 // IPv6 over IPv4 tunneling
sysARPHardwareGREIPv4 = 778 // any over GRE over IPv4 tunneling
sysARPHardwareGREIPv6 = 823 // any over GRE over IPv6 tunneling
)
func newLink(ifim *syscall.IfInfomsg, attrs []syscall.NetlinkRouteAttr) *Interface {
ifi := &Interface{Index: int(ifim.Index), Flags: linkFlags(ifim.Flags)}
for _, a := range attrs {
switch a.Attr.Type {
case syscall.IFLA_ADDRESS:
// We never return any /32 or /128 IP address
// prefix on any IP tunnel interface as the
// hardware address.
switch len(a.Value) {
case IPv4len:
switch ifim.Type {
case sysARPHardwareIPv4IPv4, sysARPHardwareGREIPv4, sysARPHardwareIPv6IPv4:
continue
}
case IPv6len:
switch ifim.Type {
case sysARPHardwareIPv6IPv6, sysARPHardwareGREIPv6:
continue
}
}
var nonzero bool
for _, b := range a.Value {
if b != 0 {
nonzero = true
break
}
}
if nonzero {
ifi.HardwareAddr = a.Value[:]
}
case syscall.IFLA_IFNAME:
ifi.Name = string(a.Value[:len(a.Value)-1])
case syscall.IFLA_MTU:
ifi.MTU = int(*(*uint32)(unsafe.Pointer(&a.Value[:4][0])))
}
}
return ifi
}
func linkFlags(rawFlags uint32) Flags {
var f Flags
if rawFlags&syscall.IFF_UP != 0 {
f |= FlagUp
}
if rawFlags&syscall.IFF_BROADCAST != 0 {
f |= FlagBroadcast
}
if rawFlags&syscall.IFF_LOOPBACK != 0 {
f |= FlagLoopback
}
if rawFlags&syscall.IFF_POINTOPOINT != 0 {
f |= FlagPointToPoint
}
if rawFlags&syscall.IFF_MULTICAST != 0 {
f |= FlagMulticast
}
return f
}
// If the ifi is nil, interfaceAddrTable returns addresses for all
// network interfaces. Otherwise it returns addresses for a specific
// interface.
func interfaceAddrTable(ifi *Interface) ([]Addr, error) {
tab, err := syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC)
if err != nil {
return nil, os.NewSyscallError("netlinkrib", err)
}
msgs, err := syscall.ParseNetlinkMessage(tab)
if err != nil {
return nil, os.NewSyscallError("parsenetlinkmessage", err)
}
var ift []Interface
if ifi == nil {
var err error
ift, err = interfaceTable(0)
if err != nil {
return nil, err
}
}
ifat, err := addrTable(ift, ifi, msgs)
if err != nil {
return nil, err
}
return ifat, nil
}
func addrTable(ift []Interface, ifi *Interface, msgs []syscall.NetlinkMessage) ([]Addr, error) {
var ifat []Addr
loop:
for _, m := range msgs {
switch m.Header.Type {
case syscall.NLMSG_DONE:
break loop
case syscall.RTM_NEWADDR:
ifam := (*syscall.IfAddrmsg)(unsafe.Pointer(&m.Data[0]))
if len(ift) != 0 || ifi.Index == int(ifam.Index) {
if len(ift) != 0 {
var err error
ifi, err = interfaceByIndex(ift, int(ifam.Index))
if err != nil {
return nil, err
}
}
attrs, err := syscall.ParseNetlinkRouteAttr(&m)
if err != nil {
return nil, os.NewSyscallError("parsenetlinkrouteattr", err)
}
ifa := newAddr(ifam, attrs)
if ifa != nil {
ifat = append(ifat, ifa)
}
}
}
}
return ifat, nil
}
func newAddr(ifam *syscall.IfAddrmsg, attrs []syscall.NetlinkRouteAttr) Addr {
var ipPointToPoint bool
// Seems like we need to make sure whether the IP interface
// stack consists of IP point-to-point numbered or unnumbered
// addressing.
for _, a := range attrs {
if a.Attr.Type == syscall.IFA_LOCAL {
ipPointToPoint = true
break
}
}
for _, a := range attrs {
if ipPointToPoint && a.Attr.Type == syscall.IFA_ADDRESS {
continue
}
switch ifam.Family {
case syscall.AF_INET:
return &IPNet{IP: IPv4(a.Value[0], a.Value[1], a.Value[2], a.Value[3]), Mask: CIDRMask(int(ifam.Prefixlen), 8*IPv4len)}
case syscall.AF_INET6:
ifa := &IPNet{IP: make(IP, IPv6len), Mask: CIDRMask(int(ifam.Prefixlen), 8*IPv6len)}
copy(ifa.IP, a.Value[:])
return ifa
}
}
return nil
}
// interfaceMulticastAddrTable returns addresses for a specific
// interface.
func interfaceMulticastAddrTable(ifi *Interface) ([]Addr, error) {
ifmat4 := parseProcNetIGMP("/proc/net/igmp", ifi)
ifmat6 := parseProcNetIGMP6("/proc/net/igmp6", ifi)
return append(ifmat4, ifmat6...), nil
}
func parseProcNetIGMP(path string, ifi *Interface) []Addr {
fd, err := open(path)
if err != nil {
return nil
}
defer fd.close()
var (
ifmat []Addr
name string
)
fd.readLine() // skip first line
b := make([]byte, IPv4len)
for l, ok := fd.readLine(); ok; l, ok = fd.readLine() {
f := splitAtBytes(l, " :\r\t\n")
if len(f) < 4 {
continue
}
switch {
case l[0] != ' ' && l[0] != '\t': // new interface line
name = f[1]
case len(f[0]) == 8:
if ifi == nil || name == ifi.Name {
// The Linux kernel puts the IP
// address in /proc/net/igmp in native
// endianness.
for i := 0; i+1 < len(f[0]); i += 2 {
b[i/2], _ = xtoi2(f[0][i:i+2], 0)
}
i := *(*uint32)(unsafe.Pointer(&b[:4][0]))
ifma := &IPAddr{IP: IPv4(byte(i>>24), byte(i>>16), byte(i>>8), byte(i))}
ifmat = append(ifmat, ifma)
}
}
}
return ifmat
}
func parseProcNetIGMP6(path string, ifi *Interface) []Addr {
fd, err := open(path)
if err != nil {
return nil
}
defer fd.close()
var ifmat []Addr
b := make([]byte, IPv6len)
for l, ok := fd.readLine(); ok; l, ok = fd.readLine() {
f := splitAtBytes(l, " \r\t\n")
if len(f) < 6 {
continue
}
if ifi == nil || f[1] == ifi.Name {
for i := 0; i+1 < len(f[2]); i += 2 {
b[i/2], _ = xtoi2(f[2][i:i+2], 0)
}
ifma := &IPAddr{IP: IP{b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]}}
ifmat = append(ifmat, ifma)
}
}
return ifmat
}
| {
"pile_set_name": "Github"
} |
{
"_from": "@babel/helper-optimise-call-expression@^7.8.3",
"_id": "@babel/[email protected]",
"_inBundle": false,
"_integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==",
"_location": "/@babel/helper-optimise-call-expression",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/helper-optimise-call-expression@^7.8.3",
"name": "@babel/helper-optimise-call-expression",
"escapedName": "@babel%2fhelper-optimise-call-expression",
"scope": "@babel",
"rawSpec": "^7.8.3",
"saveSpec": null,
"fetchSpec": "^7.8.3"
},
"_requiredBy": [
"/@babel/helper-replace-supers",
"/@babel/plugin-transform-classes"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz",
"_shasum": "7ed071813d09c75298ef4f208956006b6111ecb9",
"_spec": "@babel/helper-optimise-call-expression@^7.8.3",
"_where": "/Users/holzschu/src/Xcode_iPad/wasmer/docs.wasmer.io/integrations/js/wasi/browser/examples/hello-world/node_modules/@babel/helper-replace-supers",
"bundleDependencies": false,
"dependencies": {
"@babel/types": "^7.8.3"
},
"deprecated": false,
"description": "Helper function to optimise call expression",
"gitHead": "a7620bd266ae1345975767bbc7abf09034437017",
"license": "MIT",
"main": "lib/index.js",
"name": "@babel/helper-optimise-call-expression",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression"
},
"version": "7.8.3"
}
| {
"pile_set_name": "Github"
} |
Copyright 2019 The Bevietnam Project Authors (https://github.com/bettergui/beVietnam)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
| {
"pile_set_name": "Github"
} |
[6,2,8,5,1]
[1,2,5,6,8]
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <immintrin.h>
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <random>
#include <set>
#include <vector>
#include "./BenchUtils.h"
#include "fbgemm/Fbgemm.h"
#include "fbgemm/FbgemmConvert.h"
#include "fbgemm/Utils.h"
#include "src/RefImplementations.h"
using namespace std;
using namespace fbgemm;
void print_fused_table(int rows, int embedding_dim, const uint8_t* table) {
for (int i = 0; i < rows; i++) {
std::cout << "row: " << i << " : " << std::endl;
for (int ii = 0; ii < embedding_dim; ii++) {
std::cout << (int)table[i * (embedding_dim + 2 * sizeof(float)) + ii]
<< ",";
}
std::cout << std::endl;
}
}
static vector<vector<int>> GetInputs_() {
vector<vector<int>> input_dims = {
// batch size, number of rows of table, emb dim , avg lengthl
// TODO: Add more inputs
// Use these -- but they are slow.
{10, 4000000, 32, 100},
{10, 4000000, 64, 100},
{10, 4000000, 128, 100},
{10, 4000000, 256, 100},
// Use these for debugging
// {2, 16, 128, 10},
// {10, 4000, 128, 100},
// {10, 4000, 128, 100},
// {10, 4000, 128, 100},
};
return input_dims;
}
int run_benchmark(
int bit_rate,
int batch_size,
int num_rows,
int embedding_dim,
int average_len,
bool normalize_by_lengths,
bool use_32_bit_indices = false,
bool prefetch = false) {
// Create embedding table
int num_elem_per_byte = 8 / bit_rate;
int fused_embedding_dim =
(embedding_dim + num_elem_per_byte - 1) / num_elem_per_byte +
2 * sizeof(float16);
default_random_engine generator;
normal_distribution<float> embedding_distribution;
vector<uint8_t> fused_embedding_table(num_rows * fused_embedding_dim);
for (int i = 0; i < num_rows; i++) {
for (int ii = 0;
ii < (embedding_dim + num_elem_per_byte - 1) / num_elem_per_byte;
ii++) {
fused_embedding_table[i * fused_embedding_dim + ii] = 2;
}
float16* scale_bias = reinterpret_cast<float16*>(
&fused_embedding_table[i * fused_embedding_dim] +
(embedding_dim + num_elem_per_byte - 1) / num_elem_per_byte);
float scale = 2.0f;
float bias = 1.0f;
FloatToFloat16_ref(&scale, scale_bias, 1, true /* clip */);
FloatToFloat16_ref(&bias, scale_bias + 1, 1, true /* clip */);
}
// print_fused_table(num_rows, embedding_dim, fused_embedding_table);
// Generate lengths
uniform_int_distribution<int> length_distribution(
1, std::min(2 * average_len + 1, num_rows));
vector<int> offsets(batch_size + 1);
offsets[0] = 0;
for (int i = 0; i < batch_size; ++i) {
offsets[i + 1] = offsets[i] + length_distribution(generator);
}
// Compute the number of indices
int lengths_sum = offsets[batch_size];
cout << "lengths_sum " << lengths_sum << endl;
// Generate indices
vector<int64_t> indices;
vector<int32_t> indices_32;
vector<int> container(num_rows);
map<int64_t, set<int>> dedup_map; // index -> set(output index)
// please note we generate unique indices
for (int i = 0; i < batch_size; ++i) {
iota(container.begin(), container.end(), 0);
random_shuffle(container.begin(), container.end());
copy(
container.begin(),
container.begin() + (offsets[i + 1] - offsets[i]),
back_inserter(indices));
}
copy(begin(indices), end(indices), back_inserter(indices_32));
// Generate weights
vector<float> weights(lengths_sum);
for (int i = 0; i < lengths_sum; ++i) {
weights[i] = embedding_distribution(generator);
}
vector<float> output_sls_ref(batch_size * embedding_dim);
vector<float> output_slws_ref(output_sls_ref.size()),
output_sls(output_sls_ref.size()), output_slws(output_sls_ref.size());
constexpr int NUM_WARMUP = 4;
constexpr int NUM_ITER = 10;
// Only counts the number of bytes for reading embedding table and ignore
// others. Should be good enough as long as embdding_dim is big enough.
double bytes = lengths_sum * fused_embedding_dim;
constexpr int CACHE_LINE_LEN = 64;
double bytes_padded = lengths_sum * CACHE_LINE_LEN *
static_cast<int>((fused_embedding_dim + CACHE_LINE_LEN - 1) /
CACHE_LINE_LEN);
for (bool has_weight : {false, true}) {
vector<float>& output_ref = has_weight ? output_slws_ref : output_sls_ref;
bool success = false, success_ref = false;
if (use_32_bit_indices) {
success_ref = EmbeddingSpMDMNBit_ref(
bit_rate,
embedding_dim,
batch_size,
lengths_sum,
num_rows,
fused_embedding_table.data(),
indices_32.data(),
offsets.data(),
has_weight ? weights.data() : nullptr,
normalize_by_lengths,
output_ref.data());
} else {
success = EmbeddingSpMDMNBit_ref(
bit_rate,
embedding_dim,
batch_size,
lengths_sum,
num_rows,
fused_embedding_table.data(),
indices.data(),
offsets.data(),
has_weight ? weights.data() : nullptr,
normalize_by_lengths,
output_ref.data());
}
auto kernel_32 = GenerateEmbeddingSpMDMNBit<int32_t>(
bit_rate,
embedding_dim,
has_weight,
normalize_by_lengths,
prefetch ? 16 : 0);
auto kernel_64 = GenerateEmbeddingSpMDMNBit<int64_t>(
bit_rate,
embedding_dim,
has_weight,
normalize_by_lengths,
prefetch ? 16 : 0);
vector<float>& output = has_weight ? output_slws : output_sls;
for (bool flush_cache : {false, true}) {
double t = measureWithWarmup(
[&]() {
if (use_32_bit_indices) {
success = kernel_32(
batch_size,
lengths_sum,
num_rows,
fused_embedding_table.data(),
indices_32.data(),
offsets.data(),
has_weight ? weights.data() : nullptr,
output.data());
} else {
success = kernel_64(
batch_size,
lengths_sum,
num_rows,
fused_embedding_table.data(),
indices.data(),
offsets.data(),
has_weight ? weights.data() : nullptr,
output.data());
}
},
NUM_WARMUP,
NUM_ITER,
[&]() {
if (flush_cache) {
cache_evict(fused_embedding_table);
cache_evict(indices);
cache_evict(indices_32);
cache_evict(offsets);
cache_evict(weights);
cache_evict(output);
}
});
// printMatrix(
// matrix_op_t::NoTranspose,
// output.data(),
// batch_size,
// embedding_dim,
// embedding_dim,
// "");
// printMatrix(
// matrix_op_t::NoTranspose,
// output_ref.data(),
// batch_size,
// embedding_dim,
// embedding_dim,
// "");
// Check correctness
if (!flush_cache) {
// vector<float>& output_ref =
// has_weight ? output_slws_ref : output_sls_ref;
if (success != success_ref) {
assert(
false && "ERROR: refernce impl and JIT imp did not both succeed");
} else if (success) {
for (int i = 0; i < output.size(); ++i) {
assert(fabs(output[i] - output_ref[i]) < 1e-3);
if (fabs(output[i] - output_ref[i]) >= 1e-3) {
cout << i << " " << output[i] << " " << output_ref[i] << endl;
}
}
}
}
if (has_weight) {
cout << setw(16) << "SLW(WEIGHTED) ";
} else {
cout << setw(16) << "SLS ";
}
if (flush_cache) {
cout << setw(20) << "cache flushed";
} else {
cout << setw(20) << "cache not flushed";
}
if (prefetch) {
cout << setw(16) << "prefetch on";
} else {
cout << setw(16) << "prefetch off";
}
cout << setw(8) << "b/w" << setw(10) << bytes / 1e9 / t << " GB/s"
<< setw(20) << "effective b/w: " << setw(16)
<< bytes_padded / 1e9 / t << "GB/s" << setw(8) << " time "
<< setw(16) << t << endl;
} // flush_cache
} // has_weight
return 0;
}
int main() {
int batch_size;
int num_rows;
int embedding_dim;
int average_len;
vector<vector<int>> inputs(GetInputs_());
for (int bit_rate : {2, 4}) {
for (auto& input : inputs) {
assert(input.size() > 3);
batch_size = input[0];
num_rows = input[1];
embedding_dim = input[2];
average_len = input[3];
cout << "bit_rate" << setw(6) << bit_rate << "batch size" << setw(6)
<< batch_size << setw(10) << "num rows" << setw(16) << num_rows
<< setw(10) << "emb dim" << setw(6) << embedding_dim << setw(16)
<< "avg length" << setw(6) << average_len << endl;
// args: batch sz, num rows, emb dim, avg len, normalize, use 32b,
// prefetch
cout << "64 bit indices, ";
run_benchmark(
bit_rate,
batch_size,
num_rows,
embedding_dim,
average_len,
false); // normalize_by_lengths
cout << "64 bit indices with prefetching, ";
run_benchmark(
bit_rate,
batch_size,
num_rows,
embedding_dim,
average_len,
false, // normalize_by_lengths
false, // use_32_bit_indices
true); // prefetch
cout << "32 bit indices, ";
run_benchmark(
bit_rate,
batch_size,
num_rows,
embedding_dim,
average_len,
false, // normalize_by_lengths
true); // use_32_bit_indices
cout << "32 bit indices with prefetching, ";
run_benchmark(
bit_rate,
batch_size,
num_rows,
embedding_dim,
average_len,
false, // normalize_by_lengths
true, // use_32_bit_indices
true); // prefetch
// running with normalize by lengths
// run_benchmark(batch_size, num_rows, embedding_dim, average_len,
// true); run_benchmark(
// batch_size, num_rows, embedding_dim, average_len, true,
// true);
// run_benchmark(
// batch_size,
// num_rows,
// embedding_dim,
// average_len,
// false,
// true,
// true);
}
}
return 0;
}
| {
"pile_set_name": "Github"
} |
/* Copyright (c) 2002-2006 Sam Trenholme
*
* TERMS
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* This software is provided 'as is' with no guarantees of correctness or
* fitness for purpose.
*/
/* uncompress a query compressed with the RFC1035 compression algorithm
(section 4.1.4)
input: pointer to compressed udp data, pointer to uncompressed udp data
output: JS_ERROR on error, JS_SUCCESS on success
note: When in multithreaded mode, this is the only operation that
needs to be done on data with a mutex on it. Place a mutex on
the compressed data, copy it over to uncompressed data, then
release the mutex. Have the one "parent" listen for UDP
packets again while the "child" processes the packet
*/
int decompress_data(js_string *compressed, js_string *uncompressed);
/* Determine the length of a domain-name label
Input: the js_string obejct with the domain label in question,
the offset from the beginning of the js_string object
with the domain label
Output: The length of the label, JS_ERROR on error
*/
int dlabel_length(js_string *raw, unsigned int offset);
/* Compress an uncompressed RFC1035 query/answer according to section 4.1.4.
input: pointer to uncompressed udp data, pointer to compressed udp data
output: JS_ERROR on error, JS_SUCCESS on success
*/
int compress_data(js_string *uncompressed, js_string *compressed);
/* Zero-copy implemention of converting a human-readable host name in to the
raw RFC1035 UDP data for a domain.
Input: pointer to js_string object we modify "in place"
Output: -1 on error, numeric type of query on success, -2 on
unsupported query type, -3 on 'U' query type (which
then has to be specified by the user elsewhere)
*/
int hname_2rfc1035(js_string *hostname);
/* Starwhitis: 0: Stars *not* allowed at end of host name
* 1: Stars are allowed at host name ends */
int hname_2rfc1035_starwhitis(js_string *hostname, int starwhitis);
/* Zero-copy implemention of converting a human-readable email address in to
the raw RFC1035 UDP data for a domain.
Input: pointer to js_string object we modify "in place" (needs a
one-octet 'prefix' which can be be any character
Output: -1 on error, JS_SUCCESS on success
*/
int email_2rfc1035(js_string *hostname);
/* Given a q_header structure, initialize the values of the structure
to sane values */
void init_header(q_header *header);
/* Given a q_header structure, and a js object to put the raw UDP data
in, convert a q_header structure to raw UDP data.
input: pointer to q_header structure, pointer to js_string object
output: JS_ERROR on error, JS_SUCCESS on success
*/
int make_hdr(q_header *header, js_string *js);
/* Given a domain-label, change this label in-place so that the first domain
label is lopped off of it. Eg. '\003www\007example\003com\000" becomes
"\007example\003com\000"
input: A pointer to the js_string object in question
output: JS_ERROR on error, JS_SUCCESS on success, 0 if the label is
zero-length already
*/
int bobbit_label(js_string *js);
/* Given a q_header structure, and a js object with the raw UDP data,
convert raw UDP data to a q_header structure.
input: pointer to q_header structure, pointer to js_string object
output: JS_ERROR on error, JS_SUCCESS on success
*/
int read_hdr(js_string *js, q_header *header);
/* Man, RFC1035 decompression is a pain to implement. This routine
decompresses a domain string in the string "compressed" in to
the string "uncompressed".
Input: compressed: Pointer to the js_string we are decompressing
uncompressed: Pointer to the string we are decompressing to
place: Where we are looking in the compressed string right now
uplace: pointer to where we are looking at in the decompression
string right now
output: JS_ERROR on error, length of uncompressed poiner on success
*/
int decompress_dname(js_string *compressed, js_string *uncompressed,
int *place, int *uplace);
/* Man, RFC1035 compression is a pain to implement. This routine
compresses a domain string in the string "uncompressed" in to
the string "compressed".
Input: compressed: Pointer to the js_string we are decompressing
uncompressed: Pointer to the string we are decompressing to
place: Where we are looking in the uncompressed string right now
cplace: pointer to where we are looking at in the compression
string right now
points: A pointer to a uint16 array which is a list of pointers
output: JS_ERROR on error, length of uncompressed poiner on success
*/
int compress_dname(js_string *uncompressed, js_string *compressed,
int *place, int *cplace, uint16 *points);
/* Process the header of a RR record as described in section 4.1.3 of
RFC1035. This converts the contents of a RFC1035 header in to an
q_rr structure.
input: js_string obejct with the raw UDP data, q_rr struct to put data
in, offset form beginning of string to look at data for
output: number of bytes in rr header on success, JS_ERROR on error
*/
int read_rr_h (js_string *js, q_rr *hdr, int offset);
/* read_soa: Read a SOA record.
input: Pointer to js_string, pointer to rr_soa structure, offset
output: JS_ERROR on error, bytes in SOA record on success
*/
int read_soa(js_string *js, rr_soa *soa, int offset);
/* Zero-copy implemention of converting the raw UDP data for a domain in
to a human-readable host name.
Input: pointer to js_string object we modify "in place", query type
(-2 if we wish to make it show a pipe)
Output: JS_ERROR on error, JS_SUCCESS on success
*/
int hname_translate(js_string *hostname, int qtype);
/* Zero-copy implemention of converting the raw UDP data for a domain in
to a human-readable email address
Input: pointer to js_string object we modify "in place"
Output: JS_ERROR on error, JS_SUCCESS on success
*/
int email_translate(js_string *hostname);
/* Initialize the decompression code; set up the RRs, and set the
log_level global variable in the decompression code.
Input: The desired log_level for all of the decompression code
Output: JS_SUCCESS on success, JS_ERROR on error
Global variables affected:
rr_formats (indirectly via decomp_add_rrdesc)
log_level
*/
int decomp_init(int alog_level);
/* Given a js string object and a q_question structure, place the raw UDP
format of the query at the end of the js_string object
input: pointer to q_header structure, pointer to js_string object
output: JS_ERROR on error, JS_SUCCESS on success
*/
int make_question(q_question *question, js_string *js);
/* Given a js string object and an offset (where we begin reading our
question), in addition to a q_question structure, read the raw UDP
format of the query in to the q_question structure
input: pointer to q_header structure, pointer to js_string object
output: JS_ERROR on error, number of bytes in question on success
*/
int read_question(js_string *js, q_question *question, int offset);
/* Read a NS (or any other <domain-name>) record
input: js_string object with raw UDP data, js_string object to have just
the NS record, offset from beginning of raw UDP data to get RR
output: JS_ERROR on ERROR, bytes in <domain-name> on success
*/
int read_ns(js_string *in, js_string *out, int offset);
/* Process the RR portion of a TXT record.
Input: pointer to string of uncompressed UDP data, pointer of string to
put txt record in, offset from beginning of UDP data
Output: JS_ERROR on error, byes in TXT record on success
*/
int read_txt(js_string *in, js_string *out, int offset);
/* This function is designed to make a packet which compresses to a size
* greater than 512 bytes smaller. The input is an uncompressed DNS packet;
* the output is the same packet with the last DNS record removed from the
* packet. As per RFC2181 9, if we are removing a DNS record from the NS
* or AN section of a reply, the TC bit is not set. Otherwise (as a
* reasonable interpretation of the wishes in RFC2181 9), we remove all DNS
* information except the header and mark the DNS packet truncated.
*
* Input: A js_string object with a full uncompressed raw DNS packet.
*
* Output: A point to the above js_string object on success; 0 on error */
js_string *squeeze_to_fit(js_string *packet);
| {
"pile_set_name": "Github"
} |
/*
Erica Sadun, http://ericasadun.com
*/
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "UIColor+Expanded.h"
@interface TestBedViewController : UIViewController
@end
@implementation TestBedViewController
{
UIImageView *imageView;
}
- (void) randomPic
{
CGSize size = self.view.frame.size;
CGFloat w = size.width / 4;
UIGraphicsBeginImageContext(size);
for (int i = 0; i < self.view.frame.size.height / 45; i++)
{
UIColor *color = [UIColor randomColor];
CGRect rect = CGRectMake(4, 0, 30, 30);
UIBezierPath *path;
NSString *s;
UIFont *font = [UIFont systemFontOfSize:10];
// Draw random color
rect.origin.y = i * 40;
path = [UIBezierPath bezierPathWithOvalInRect:rect];
[color set];
[path fill];
// Label it
[color.contrastingColor set];
// HSB
// s = [NSString stringWithFormat:@" %0.2f\n %0.2f\n %0.2f", color.hue, color.saturation, color.brightness];
// [s drawInRect:CGRectOffset(CGRectInset(rect, 0, -12), 3, 10) withFont:[UIFont systemFontOfSize:8]];
// Colorfulness
s = [NSString stringWithFormat:@" %0.2f", color.colorfulness];
[s drawInRect:CGRectInset(rect, 0, 8) withFont:font];
// Fetch close colors
NSDictionary *dict = [color closestColors];
// Dot 1
NSString *targetDictionary = @"xkcd";
NSString *targetColorName = dict[targetDictionary];
UIColor *targetColor = [UIColor colorWithName:targetColorName inDictionary:targetDictionary];
// Draw Dot 1
rect.origin.x = 40;
path = [UIBezierPath bezierPathWithOvalInRect:rect];
[targetColor set];
[path fill];
// Label it
[targetColor.contrastingColor set];
s = [NSString stringWithFormat:@" %0.2f", [color distanceFrom:targetColor]];
[s drawInRect:CGRectInset(rect, 0, 8) withFont:font];
[[UIColor blackColor] set];
[targetColorName.capitalizedString drawInRect:CGRectMake(rect.origin.x + 40, i * 40 + 10, w, 30) withFont:font];
// Dot 2
targetDictionary = @"Moroney";
targetColorName = dict[targetDictionary];
targetColor = [UIColor colorWithName:targetColorName inDictionary:targetDictionary];
// Draw Dot 2
rect.origin.x = 80 + w;
path = [UIBezierPath bezierPathWithOvalInRect:rect];
[targetColor set];
[path fill];
// Label it
[targetColor.contrastingColor set];
s = [NSString stringWithFormat:@" %0.2f", [color distanceFrom:targetColor]];
[s drawInRect:CGRectInset(rect, 0, 8) withFont:font];
[[UIColor blackColor] set];
[targetColorName.capitalizedString drawInRect:CGRectMake(rect.origin.x + 40, i * 40 + 10, w, 30) withFont:font];
// Dot 3 - Men's Color
UIColor *mensColor = color.closestMensColor;
rect.origin.x = size.width - 40;
path = [UIBezierPath bezierPathWithOvalInRect:rect];
[mensColor set];
[path fill];
[mensColor.contrastingColor set];
s = [NSString stringWithFormat:@" %0.2f", [color distanceFrom:mensColor]];
[s drawInRect:CGRectInset(rect, 0, 8) withFont:font];
}
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
imageView.image = image;
}
- (void) loadView
{
self.view = [[UIView alloc] init];
self.view.backgroundColor = [UIColor whiteColor];
imageView = [[UIImageView alloc] init];
imageView.translatesAutoresizingMaskIntoConstraints = NO;
imageView.contentMode = UIViewContentModeScaleAspectFit;
[self.view addSubview:imageView];
NSArray *constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[imageView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(imageView)];
[self.view addConstraints:constraints];
constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[imageView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(imageView)];
[self.view addConstraints:constraints];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Random" style:UIBarButtonItemStylePlain target:self action:@selector(randomPic)];
#define BUILD_COLOR_WHEEL 0
#if BUILD_COLOR_WHEEL
UIImage *wheel = [UIColor colorWheelOfSize:600];
[UIImagePNGRepresentation(wheel) writeToFile:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/foo.png"] atomically:YES];
#endif
#define BUILD_SPECTRUM 1
#if BUILD_SPECTRUM
NSDictionary *dict = [UIColor colorDictionaryNamed:@"xkcd"];
NSMutableArray *array = [NSMutableArray array];
for (NSString *colorKey in dict.allKeys)
{
NSString *hexValue = dict[colorKey];
UIColor *color = [UIColor colorWithHexString:hexValue];
[array addObject:@[colorKey, color]];
}
[array sortUsingComparator:^NSComparisonResult(NSArray *obj1, NSArray *obj2) {
UIColor *c1 = obj1[1];
UIColor *c2 = obj2[1];
// return [c1 compareSaturation:c2];
// return [c1 compareHue:c2];
// return [c1 compareBrightness:c2];
// return [c1 compareWarmth:c2];
return [c1 compareColorfulness:c2];
}];
UIGraphicsBeginImageContext(CGSizeMake(array.count * 10, 100));
CGRect rect = CGRectMake(0, 0, 10, 100);
for (NSArray *tuple in array)
{
UIColor *color = tuple[1];
CGContextFillRect(UIGraphicsGetCurrentContext(), rect);
[color set];
rect.origin.x += rect.size.width;
}
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[UIImagePNGRepresentation(image) writeToFile:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/foo.png"] atomically:YES];
#endif
#define GO_KEVIN 0
#if GO_KEVIN
// Kevin colors -- supply 2 colors, receive a 3rd that "matches".
// It's the complement of the average of the 2
NSDictionary *dict = [UIColor colorDictionaryNamed:@"Crayons"];
NSArray *keys = dict.allKeys;
UIGraphicsBeginImageContext(CGSizeMake(keys.count * 30, 116));
CGRect rect = CGRectMake(0, 0, 20, 33);
for (NSString *colorKey in dict.allKeys)
{
NSString *key2 = keys[random() % keys.count];
UIColor *c1 = [UIColor colorWithHexString:dict[colorKey]];
UIColor *c2 = [UIColor colorWithHexString:dict[key2]];
CGRect b = rect;
[c1 set];
CGContextFillRect(UIGraphicsGetCurrentContext(), b);
b.origin.y += 33 + 8;
[c2 set];
CGContextFillRect(UIGraphicsGetCurrentContext(), b);
UIColor *c3 = [c1 kevinColorWithColor:c2];
b.origin.y += 33 + 8;
[c3 set];
CGContextFillRect(UIGraphicsGetCurrentContext(), b);
rect.origin.x += 30;
}
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[UIImagePNGRepresentation(image) writeToFile:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/foo.png"] atomically:YES];
#endif
}
@end
#pragma mark -
#pragma mark Application Setup
@interface TestBedAppDelegate : NSObject <UIApplicationDelegate>
@property (nonatomic) UIWindow *window;
@end
@implementation TestBedAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
TestBedViewController *tbvc = [[TestBedViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tbvc];
_window.rootViewController = nav;
[_window makeKeyAndVisible];
return YES;
}
@end
int main(int argc, char *argv[]) {
@autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, @"TestBedAppDelegate");
return retVal;
}
} | {
"pile_set_name": "Github"
} |
/*
Copyright 2016 Kai Ryu <[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, see <http://www.gnu.org/licenses/>.
*/
/*
* scan matrix
*/
#include <stdint.h>
#include <stdbool.h>
#include <avr/io.h>
#include <util/delay.h>
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "expander.h"
#include "keymap_in_eeprom.h"
#include "timer.h"
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
#define IMPROVED_DEBOUNCE 1
#if IMPROVED_DEBOUNCE
#define DEBOUNCE_MASK ((1 << DEBOUNCE) - 1)
static uint8_t matrix_current_row;
static uint16_t matrix_row_timestamp[MATRIX_ROWS];
static uint8_t matrix_debouncing[MATRIX_ROWS][MATRIX_COLS];
#else
static uint8_t debouncing = DEBOUNCE;
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
static matrix_row_t read_row(void);
#endif
static uint16_t matrix_scan_timestamp;
static void read_cols(void);
static uint8_t get_col(uint8_t col);
static void init_cols(void);
static void unselect_rows(void);
static void select_row(uint8_t row);
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
void matrix_init(void)
{
// disable JTAG
MCUCR = (1<<JTD);
MCUCR = (1<<JTD);
timer_init();
_delay_ms(1);
matrix_scan_timestamp = timer_read();
// initialize row and col
unselect_rows();
init_cols();
// initialize matrix state: all keys off
#if IMPROVED_DEBOUNCE
for (uint8_t i = 0; i < matrix_rows(); i++) {
matrix[i] = 0;
matrix_current_row = 0;
matrix_row_timestamp[i] = timer_read();
for (uint8_t j = 0; j < matrix_cols(); j++) {
matrix_debouncing[i][j] = 0;
}
}
#else
for (uint8_t i=0; i < matrix_rows(); i++) {
matrix[i] = 0;
matrix_debouncing[i] = 0;
}
#endif
}
uint8_t matrix_scan(void)
{
if (timer_elapsed(matrix_scan_timestamp) >= 1000) {
dprintf("======== 1s task ========\n");
dprintf("Scan: %u\n", matrix_scan_timestamp);
matrix_scan_timestamp = timer_read();
expander_scan();
dprintf("=========================\n");
}
#if IMPROVED_DEBOUNCE
uint16_t elapsed = timer_elapsed(matrix_row_timestamp[matrix_current_row]);
if (elapsed >= 1) {
matrix_row_timestamp[matrix_current_row] = timer_read();
select_row(matrix_current_row);
_delay_us(30);
read_cols();
for (uint8_t i = 0; i < matrix_cols(); i++) {
uint8_t *debounce = &matrix_debouncing[matrix_current_row][i];
uint8_t col = get_col(i);
uint8_t count = elapsed;
do {
*debounce <<= 1;
*debounce |= col;
} while (--count);
matrix_row_t *row = &matrix[matrix_current_row];
matrix_row_t mask = ((matrix_row_t)1 << i);
switch (*debounce & DEBOUNCE_MASK) {
case DEBOUNCE_MASK:
#if DEBOUNCE > 1
case (DEBOUNCE_MASK >> 1):
#if DEBOUNCE > 2
case (DEBOUNCE_MASK >> 2):
#if DEBOUNCE > 3
case (DEBOUNCE_MASK >> 3):
#if DEBOUNCE > 4
case (DEBOUNCE_MASK >> 4):
#if DEBOUNCE > 5
case (DEBOUNCE_MASK >> 5):
#if DEBOUNCE > 6
case (DEBOUNCE_MASK >> 6):
#if DEBOUNCE > 7
case (DEBOUNCE_MASK >> 7):
#if DEBOUNCE > 8
case (DEBOUNCE_MASK >> 8):
#if DEBOUNCE > 9
case (DEBOUNCE_MASK >> 9):
#if DEBOUNCE > 10
case (DEBOUNCE_MASK >> 10):
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
if ((*row & mask) == 0) {
*row |= mask;
}
break;
#if DEBOUNCE > 1
case ((DEBOUNCE_MASK << 1) & DEBOUNCE_MASK):
#if DEBOUNCE > 2
case ((DEBOUNCE_MASK << 2) & DEBOUNCE_MASK):
#if DEBOUNCE > 3
case ((DEBOUNCE_MASK << 3) & DEBOUNCE_MASK):
#if DEBOUNCE > 4
case ((DEBOUNCE_MASK << 4) & DEBOUNCE_MASK):
#if DEBOUNCE > 5
case ((DEBOUNCE_MASK << 5) & DEBOUNCE_MASK):
#if DEBOUNCE > 6
case ((DEBOUNCE_MASK << 6) & DEBOUNCE_MASK):
#if DEBOUNCE > 7
case ((DEBOUNCE_MASK << 7) & DEBOUNCE_MASK):
#if DEBOUNCE > 8
case ((DEBOUNCE_MASK << 8) & DEBOUNCE_MASK):
#if DEBOUNCE > 9
case ((DEBOUNCE_MASK << 9) & DEBOUNCE_MASK):
#if DEBOUNCE > 10
case ((DEBOUNCE_MASK << 10) & DEBOUNCE_MASK):
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
break;
case 0:
if ((*row & mask) != 0) {
*row &= ~mask;
}
break;
default:
debug("bounce!: ");
debug_bin8(*debounce & DEBOUNCE_MASK);
debug("\n");
break;
}
}
unselect_rows();
}
matrix_current_row++;
if (matrix_current_row >= matrix_rows()) {
matrix_current_row = 0;
}
#else
for (uint8_t i = 0; i < matrix_rows(); i++) {
select_row(i);
_delay_us(30); // without this wait read unstable value.
matrix_row_t cols = read_row();
if (matrix_debouncing[i] != cols) {
matrix_debouncing[i] = cols;
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); debug("\n");
}
debouncing = DEBOUNCE;
}
unselect_rows();
}
if (debouncing) {
if (--debouncing) {
_delay_ms(1);
} else {
for (uint8_t i = 0; i < matrix_rows(); i++) {
matrix[i] = matrix_debouncing[i];
}
}
}
#endif
return 1;
}
#if IMPROVED_DEBOUNCE
#else
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
#endif
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & ((matrix_row_t)1<<col));
}
inline
matrix_row_t matrix_get_row(uint8_t row)
{
return matrix[row];
}
void matrix_print(void)
{
print("\nr/c 0123456789ABCDEF\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
print_bin_reverse32(matrix_get_row(row));
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < matrix_rows(); i++) {
count += bitpop32(matrix[i]);
}
return count;
}
/* Column pin configuration
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
* pin: EX EX EX EX EX EX EX D3 D2 D4 C6 D7 E6 B4
*/
static void init_cols(void)
{
// Input with pull-up(DDR:0, PORT:1)
DDRE &= ~(1<<PE6);
PORTE |= (1<<PE6);
DDRD &= ~(1<<PD2 | 1<<PD3 | 1<<PD4 | 1<<PD7);
PORTD |= (1<<PD2 | 1<<PD3 | 1<<PD4 | 1<<PD7);
DDRC &= ~(1<<PC6);
PORTC |= (1<<PC6);
DDRB &= ~(1<<PB4);
PORTB |= (1<<PB4);
// Init I/O expander
expander_init();
}
#if !IMPROVED_DEBOUNCE
static matrix_row_t read_row(void)
{
return expander_read_row() |
(PIND&(1<<PD3) ? 0 : (1<<7)) |
(PIND&(1<<PD2) ? 0 : (1<<8)) |
(PIND&(1<<PD4) ? 0 : (1<<9)) |
(PINC&(1<<PC6) ? 0 : (1<<10)) |
(PIND&(1<<PD7) ? 0 : (1<<11)) |
(PINE&(1<<PE6) ? 0 : (1<<12)) |
(PINB&(1<<PB4) ? 0 : (1<<13));
}
#endif
static void read_cols(void)
{
expander_read_cols();
}
static uint8_t get_col(uint8_t col)
{
switch (col) {
#ifdef VER_PROTOTYPE
case 0 ... 6:
return expander_get_col(col);
case 7:
return PIND&(1<<PD3) ? 0 : 1;
case 8:
return PIND&(1<<PD2) ? 0 : 1;
case 9:
return PIND&(1<<PD4) ? 0 : 1;
case 10:
return PINC&(1<<PC6) ? 0 : 1;
case 11:
return PIND&(1<<PD7) ? 0 : 1;
case 12:
return PINE&(1<<PE6) ? 0 : 1;
case 13:
return PINB&(1<<PB4) ? 0 : 1;
#else
case 0:
return PINB&(1<<PB4) ? 0 : 1;
case 1:
return PINE&(1<<PE6) ? 0 : 1;
case 2:
return PIND&(1<<PD7) ? 0 : 1;
case 3:
return PINC&(1<<PC6) ? 0 : 1;
case 4:
return PIND&(1<<PD4) ? 0 : 1;
case 5:
return PIND&(1<<PD2) ? 0 : 1;
case 6:
return PIND&(1<<PD3) ? 0 : 1;
case 7 ... 13:
return expander_get_col(13 - col);
#endif
default:
return 0;
}
}
/* Row pin configuration
* row: 0 1 2 3 4 5
* pin: F4 F5 F6 F7 B1 B2
*/
static void unselect_rows(void)
{
// Hi-Z(DDR:0, PORT:0) to unselect
DDRF &= ~(1<<PF4 | 1<<PF5 | 1<<PF6 | 1<<PF7);
PORTF &= ~(1<<PF4 | 1<<PF5 | 1<<PF6 | 1<<PF7);
DDRB &= ~(1<<PB1 | 1<<PB2);
PORTB &= ~(1<<PB1 | 1<<PB2);
// I/O expander
expander_unselect_rows();
}
static void select_row(uint8_t row)
{
// Output low(DDR:1, PORT:0) to select
switch (row) {
case 0:
DDRF |= (1<<PF4);
PORTF &= ~(1<<PF4);
break;
case 1:
DDRF |= (1<<PF5);
PORTF &= ~(1<<PF5);
break;
case 2:
DDRF |= (1<<PF6);
PORTF &= ~(1<<PF6);
break;
case 3:
DDRF |= (1<<PF7);
PORTF &= ~(1<<PF7);
break;
case 4:
DDRB |= (1<<PB1);
PORTB &= ~(1<<PB1);
break;
case 5:
DDRB |= (1<<PB2);
PORTB &= ~(1<<PB2);
break;
}
// I/O expander
expander_select_row(row);
}
| {
"pile_set_name": "Github"
} |
package org;
/*
* 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.
*/
public class MyClass
{
}
| {
"pile_set_name": "Github"
} |
.btn-default,
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
}
.btn-default:active,
.btn-primary:active,
.btn-success:active,
.btn-info:active,
.btn-warning:active,
.btn-danger:active,
.btn-default.active,
.btn-primary.active,
.btn-success.active,
.btn-info.active,
.btn-warning.active,
.btn-danger.active {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn:active,
.btn.active {
background-image: none;
}
.btn-default {
text-shadow: 0 1px 0 #fff;
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, 0%, #e6e6e6, 100%);
background-image: -moz-linear-gradient(top, #ffffff 0%, #e6e6e6 100%);
background-image: linear-gradient(to bottom, #ffffff 0%, #e6e6e6 100%);
background-repeat: repeat-x;
border-color: #e0e0e0;
border-color: #ccc;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
}
.btn-default:active,
.btn-default.active {
background-color: #e6e6e6;
border-color: #e0e0e0;
}
.btn-primary {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3071a9));
background-image: -webkit-linear-gradient(top, #428bca, 0%, #3071a9, 100%);
background-image: -moz-linear-gradient(top, #428bca 0%, #3071a9 100%);
background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
background-repeat: repeat-x;
border-color: #2d6ca2;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
}
.btn-primary:active,
.btn-primary.active {
background-color: #3071a9;
border-color: #2d6ca2;
}
.btn-success {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#449d44));
background-image: -webkit-linear-gradient(top, #5cb85c, 0%, #449d44, 100%);
background-image: -moz-linear-gradient(top, #5cb85c 0%, #449d44 100%);
background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
background-repeat: repeat-x;
border-color: #419641;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
}
.btn-success:active,
.btn-success.active {
background-color: #449d44;
border-color: #419641;
}
.btn-warning {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#ec971f));
background-image: -webkit-linear-gradient(top, #f0ad4e, 0%, #ec971f, 100%);
background-image: -moz-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
background-repeat: repeat-x;
border-color: #eb9316;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
}
.btn-warning:active,
.btn-warning.active {
background-color: #ec971f;
border-color: #eb9316;
}
.btn-danger {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c9302c));
background-image: -webkit-linear-gradient(top, #d9534f, 0%, #c9302c, 100%);
background-image: -moz-linear-gradient(top, #d9534f 0%, #c9302c 100%);
background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
background-repeat: repeat-x;
border-color: #c12e2a;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
}
.btn-danger:active,
.btn-danger.active {
background-color: #c9302c;
border-color: #c12e2a;
}
.btn-info {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#31b0d5));
background-image: -webkit-linear-gradient(top, #5bc0de, 0%, #31b0d5, 100%);
background-image: -moz-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
background-repeat: repeat-x;
border-color: #2aabd2;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
}
.btn-info:active,
.btn-info.active {
background-color: #31b0d5;
border-color: #2aabd2;
}
.thumbnail,
.img-thumbnail {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
background-color: #357ebd;
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
background-image: -webkit-linear-gradient(top, #428bca, 0%, #357ebd, 100%);
background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
}
.navbar {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#f8f8f8));
background-image: -webkit-linear-gradient(top, #ffffff, 0%, #f8f8f8, 100%);
background-image: -moz-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);
background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
background-repeat: repeat-x;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
}
.navbar .navbar-nav > .active > a {
background-color: #f8f8f8;
}
.navbar-brand,
.navbar-nav > li > a {
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.navbar-inverse {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#3c3c3c), to(#222222));
background-image: -webkit-linear-gradient(top, #3c3c3c, 0%, #222222, 100%);
background-image: -moz-linear-gradient(top, #3c3c3c 0%, #222222 100%);
background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
}
.navbar-inverse .navbar-nav > .active > a {
background-color: #222222;
}
.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-nav > li > a {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.navbar-static-top,
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
.alert {
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.alert-success {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#c8e5bc));
background-image: -webkit-linear-gradient(top, #dff0d8, 0%, #c8e5bc, 100%);
background-image: -moz-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
background-repeat: repeat-x;
border-color: #b2dba1;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
}
.alert-info {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#b9def0));
background-image: -webkit-linear-gradient(top, #d9edf7, 0%, #b9def0, 100%);
background-image: -moz-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
background-repeat: repeat-x;
border-color: #9acfea;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
}
.alert-warning {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#f8efc0));
background-image: -webkit-linear-gradient(top, #fcf8e3, 0%, #f8efc0, 100%);
background-image: -moz-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
background-repeat: repeat-x;
border-color: #f5e79e;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
}
.alert-danger {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#e7c3c3));
background-image: -webkit-linear-gradient(top, #f2dede, 0%, #e7c3c3, 100%);
background-image: -moz-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
background-repeat: repeat-x;
border-color: #dca7a7;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
}
.progress {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ebebeb), to(#f5f5f5));
background-image: -webkit-linear-gradient(top, #ebebeb, 0%, #f5f5f5, 100%);
background-image: -moz-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
}
.progress-bar {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3071a9));
background-image: -webkit-linear-gradient(top, #428bca, 0%, #3071a9, 100%);
background-image: -moz-linear-gradient(top, #428bca 0%, #3071a9 100%);
background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
}
.progress-bar-success {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#449d44));
background-image: -webkit-linear-gradient(top, #5cb85c, 0%, #449d44, 100%);
background-image: -moz-linear-gradient(top, #5cb85c 0%, #449d44 100%);
background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
}
.progress-bar-info {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#31b0d5));
background-image: -webkit-linear-gradient(top, #5bc0de, 0%, #31b0d5, 100%);
background-image: -moz-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
}
.progress-bar-warning {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#ec971f));
background-image: -webkit-linear-gradient(top, #f0ad4e, 0%, #ec971f, 100%);
background-image: -moz-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
}
.progress-bar-danger {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c9302c));
background-image: -webkit-linear-gradient(top, #d9534f, 0%, #c9302c, 100%);
background-image: -moz-linear-gradient(top, #d9534f 0%, #c9302c 100%);
background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
}
.list-group {
border-radius: 4px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
text-shadow: 0 -1px 0 #3071a9;
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3278b3));
background-image: -webkit-linear-gradient(top, #428bca, 0%, #3278b3, 100%);
background-image: -moz-linear-gradient(top, #428bca 0%, #3278b3 100%);
background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%);
background-repeat: repeat-x;
border-color: #3278b3;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);
}
.panel {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.panel-default > .panel-heading {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f5f5f5), to(#e8e8e8));
background-image: -webkit-linear-gradient(top, #f5f5f5, 0%, #e8e8e8, 100%);
background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
}
.panel-primary > .panel-heading {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
background-image: -webkit-linear-gradient(top, #428bca, 0%, #357ebd, 100%);
background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
}
.panel-success > .panel-heading {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#d0e9c6));
background-image: -webkit-linear-gradient(top, #dff0d8, 0%, #d0e9c6, 100%);
background-image: -moz-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
}
.panel-info > .panel-heading {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#c4e3f3));
background-image: -webkit-linear-gradient(top, #d9edf7, 0%, #c4e3f3, 100%);
background-image: -moz-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
}
.panel-warning > .panel-heading {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#faf2cc));
background-image: -webkit-linear-gradient(top, #fcf8e3, 0%, #faf2cc, 100%);
background-image: -moz-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
}
.panel-danger > .panel-heading {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#ebcccc));
background-image: -webkit-linear-gradient(top, #f2dede, 0%, #ebcccc, 100%);
background-image: -moz-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
}
.well {
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#e8e8e8), to(#f5f5f5));
background-image: -webkit-linear-gradient(top, #e8e8e8, 0%, #f5f5f5, 100%);
background-image: -moz-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
background-repeat: repeat-x;
border-color: #dcdcdc;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
} | {
"pile_set_name": "Github"
} |
// Package defaults is a collection of helpers to retrieve the SDK's default
// configuration and handlers.
//
// Generally this package shouldn't be used directly, but session.Session
// instead. This package is useful when you need to reset the defaults
// of a session or service client to the SDK defaults before setting
// additional parameters.
package defaults
import (
"fmt"
"net"
"net/http"
"net/url"
"os"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/credentials/endpointcreds"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/internal/shareddefaults"
)
// A Defaults provides a collection of default values for SDK clients.
type Defaults struct {
Config *aws.Config
Handlers request.Handlers
}
// Get returns the SDK's default values with Config and handlers pre-configured.
func Get() Defaults {
cfg := Config()
handlers := Handlers()
cfg.Credentials = CredChain(cfg, handlers)
return Defaults{
Config: cfg,
Handlers: handlers,
}
}
// Config returns the default configuration without credentials.
// To retrieve a config with credentials also included use
// `defaults.Get().Config` instead.
//
// Generally you shouldn't need to use this method directly, but
// is available if you need to reset the configuration of an
// existing service client or session.
func Config() *aws.Config {
return aws.NewConfig().
WithCredentials(credentials.AnonymousCredentials).
WithRegion(os.Getenv("AWS_REGION")).
WithHTTPClient(http.DefaultClient).
WithMaxRetries(aws.UseServiceDefaultRetries).
WithLogger(aws.NewDefaultLogger()).
WithLogLevel(aws.LogOff).
WithEndpointResolver(endpoints.DefaultResolver())
}
// Handlers returns the default request handlers.
//
// Generally you shouldn't need to use this method directly, but
// is available if you need to reset the request handlers of an
// existing service client or session.
func Handlers() request.Handlers {
var handlers request.Handlers
handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
handlers.Validate.AfterEachFn = request.HandlerListStopOnError
handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)
handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHander)
handlers.Build.AfterEachFn = request.HandlerListStopOnError
handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
handlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler)
handlers.Send.PushBackNamed(corehandlers.SendHandler)
handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)
handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler)
return handlers
}
// CredChain returns the default credential chain.
//
// Generally you shouldn't need to use this method directly, but
// is available if you need to reset the credentials of an
// existing service client or session's Config.
func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {
return credentials.NewCredentials(&credentials.ChainProvider{
VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),
Providers: CredProviders(cfg, handlers),
})
}
// CredProviders returns the slice of providers used in
// the default credential chain.
//
// For applications that need to use some other provider (for example use
// different environment variables for legacy reasons) but still fall back
// on the default chain of providers. This allows that default chaint to be
// automatically updated
func CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Provider {
return []credentials.Provider{
&credentials.EnvProvider{},
&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
RemoteCredProvider(*cfg, handlers),
}
}
const (
httpProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN"
httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
)
// RemoteCredProvider returns a credentials provider for the default remote
// endpoints such as EC2 or ECS Roles.
func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider {
if u := os.Getenv(httpProviderEnvVar); len(u) > 0 {
return localHTTPCredProvider(cfg, handlers, u)
}
if uri := os.Getenv(shareddefaults.ECSCredsProviderEnvVar); len(uri) > 0 {
u := fmt.Sprintf("%s%s", shareddefaults.ECSContainerCredentialsURI, uri)
return httpCredProvider(cfg, handlers, u)
}
return ec2RoleProvider(cfg, handlers)
}
var lookupHostFn = net.LookupHost
func isLoopbackHost(host string) (bool, error) {
ip := net.ParseIP(host)
if ip != nil {
return ip.IsLoopback(), nil
}
// Host is not an ip, perform lookup
addrs, err := lookupHostFn(host)
if err != nil {
return false, err
}
for _, addr := range addrs {
if !net.ParseIP(addr).IsLoopback() {
return false, nil
}
}
return true, nil
}
func localHTTPCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider {
var errMsg string
parsed, err := url.Parse(u)
if err != nil {
errMsg = fmt.Sprintf("invalid URL, %v", err)
} else {
host := aws.URLHostname(parsed)
if len(host) == 0 {
errMsg = "unable to parse host from local HTTP cred provider URL"
} else if isLoopback, loopbackErr := isLoopbackHost(host); loopbackErr != nil {
errMsg = fmt.Sprintf("failed to resolve host %q, %v", host, loopbackErr)
} else if !isLoopback {
errMsg = fmt.Sprintf("invalid endpoint host, %q, only loopback hosts are allowed.", host)
}
}
if len(errMsg) > 0 {
if cfg.Logger != nil {
cfg.Logger.Log("Ignoring, HTTP credential provider", errMsg, err)
}
return credentials.ErrorProvider{
Err: awserr.New("CredentialsEndpointError", errMsg, err),
ProviderName: endpointcreds.ProviderName,
}
}
return httpCredProvider(cfg, handlers, u)
}
func httpCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider {
return endpointcreds.NewProviderClient(cfg, handlers, u,
func(p *endpointcreds.Provider) {
p.ExpiryWindow = 5 * time.Minute
p.AuthorizationToken = os.Getenv(httpProviderAuthorizationEnvVar)
},
)
}
func ec2RoleProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider {
resolver := cfg.EndpointResolver
if resolver == nil {
resolver = endpoints.DefaultResolver()
}
e, _ := resolver.EndpointFor(endpoints.Ec2metadataServiceID, "")
return &ec2rolecreds.EC2RoleProvider{
Client: ec2metadata.NewClient(cfg, handlers, e.URL, e.SigningRegion),
ExpiryWindow: 5 * time.Minute,
}
}
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.accumulo.core.metadata.schema;
import java.util.Objects;
import org.apache.accumulo.core.client.admin.TimeType;
/**
* Immutable metadata time object
*/
public final class MetadataTime implements Comparable<MetadataTime> {
private final long time;
private final TimeType type;
public MetadataTime(long time, TimeType type) {
this.time = time;
this.type = type;
}
/**
* Creates a MetadataTime object from a string
*
* @param timestr
* string representation of a metatdata time, ex. "M12345678"
* @return a MetadataTime object represented by string
*/
public static MetadataTime parse(String timestr) throws IllegalArgumentException {
if (timestr != null && timestr.length() > 1) {
return new MetadataTime(Long.parseLong(timestr.substring(1)), getType(timestr.charAt(0)));
} else
throw new IllegalArgumentException("Unknown metadata time value " + timestr);
}
/**
* Converts timetypes to data codes used in the table data implementation
*
* @param code
* character M or L otherwise exception thrown
* @return a TimeType {@link TimeType} represented by code.
*/
public static TimeType getType(char code) {
switch (code) {
case 'M':
return TimeType.MILLIS;
case 'L':
return TimeType.LOGICAL;
default:
throw new IllegalArgumentException("Unknown time type code : " + code);
}
}
/**
* @return the single char code of this objects timeType
*/
public static char getCode(TimeType type) {
switch (type) {
case MILLIS:
return 'M';
case LOGICAL:
return 'L';
default: // this should never happen
throw new IllegalArgumentException("Unknown time type: " + type);
}
}
public char getCode() {
return getCode(this.type);
}
public String encode() {
return "" + getCode() + time;
}
public TimeType getType() {
return type;
}
public long getTime() {
return time;
}
@Override
public boolean equals(Object o) {
if (o instanceof MetadataTime) {
MetadataTime t = (MetadataTime) o;
return time == t.getTime() && type == t.getType();
}
return false;
}
@Override
public int hashCode() {
return Objects.hash(time, type);
}
@Override
public int compareTo(MetadataTime mtime) {
if (this.type.equals(mtime.getType()))
return Long.compare(this.time, mtime.getTime());
else
throw new IllegalArgumentException(
"Cannot compare different time types: " + this + " and " + mtime);
}
}
| {
"pile_set_name": "Github"
} |
package com.example.device;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.View.OnClickListener;
/**
* Created by ouyangshen on 2017/11/4.
*/
public class WeContactActivity extends AppCompatActivity {
private final static String TAG = "WeContactActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_we_contact);
// 从布局文件中获取名叫tl_head的工具栏
Toolbar tl_head = findViewById(R.id.tl_head);
// 设置工具栏的标题文本
tl_head.setTitle(getResources().getString(R.string.menu_second));
// 使用tl_head替换系统自带的ActionBar
setSupportActionBar(tl_head);
// 给tl_head设置导航图标的点击监听器
// setNavigationOnClickListener必须放到setSupportActionBar之后,不然不起作用
tl_head.setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
}
| {
"pile_set_name": "Github"
} |
#include "adapters/net.hpp"
#include <linux/nl80211.h>
#include <netlink/genl/ctrl.h>
#include <netlink/genl/genl.h>
#include "utils/file.hpp"
POLYBAR_NS
namespace net {
// class : wireless_network {{{
/**
* Query the wireless device for information
* about the current connection
*/
bool wireless_network::query(bool accumulate) {
if (!network::query(accumulate)) {
return false;
}
struct nl_sock* sk = nl_socket_alloc();
if (sk == nullptr) {
return false;
}
if (genl_connect(sk) < 0) {
return false;
}
int driver_id = genl_ctrl_resolve(sk, "nl80211");
if (driver_id < 0) {
nl_socket_free(sk);
return false;
}
if (nl_socket_modify_cb(sk, NL_CB_VALID, NL_CB_CUSTOM, scan_cb, this) != 0) {
nl_socket_free(sk);
return false;
}
struct nl_msg* msg = nlmsg_alloc();
if (msg == nullptr) {
nl_socket_free(sk);
return false;
}
if ((genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, driver_id, 0, NLM_F_DUMP, NL80211_CMD_GET_SCAN, 0) == nullptr) ||
nla_put_u32(msg, NL80211_ATTR_IFINDEX, m_ifid) < 0) {
nlmsg_free(msg);
nl_socket_free(sk);
return false;
}
// nl_send_sync always frees msg
if (nl_send_sync(sk, msg) < 0) {
nl_socket_free(sk);
return false;
}
nl_socket_free(sk);
return true;
}
/**
* Check current connection state
*/
bool wireless_network::connected() const {
if (!network::test_interface()) {
return false;
}
return !m_essid.empty();
}
/**
* ESSID reported by last query
*/
string wireless_network::essid() const {
return m_essid;
}
/**
* Signal strength percentage reported by last query
*/
int wireless_network::signal() const {
return m_signalstrength.percentage();
}
/**
* Link quality percentage reported by last query
*/
int wireless_network::quality() const {
return m_linkquality.percentage();
}
/**
* Callback to parse scan results
*/
int wireless_network::scan_cb(struct nl_msg* msg, void* instance) {
auto wn = static_cast<wireless_network*>(instance);
auto gnlh = static_cast<genlmsghdr*>(nlmsg_data(nlmsg_hdr(msg)));
struct nlattr* tb[NL80211_ATTR_MAX + 1];
struct nlattr* bss[NL80211_BSS_MAX + 1];
struct nla_policy bss_policy[NL80211_BSS_MAX + 1]{};
bss_policy[NL80211_BSS_TSF].type = NLA_U64;
bss_policy[NL80211_BSS_FREQUENCY].type = NLA_U32;
bss_policy[NL80211_BSS_BSSID].type = NLA_UNSPEC;
bss_policy[NL80211_BSS_BEACON_INTERVAL].type = NLA_U16;
bss_policy[NL80211_BSS_CAPABILITY].type = NLA_U16;
bss_policy[NL80211_BSS_INFORMATION_ELEMENTS].type = NLA_UNSPEC;
bss_policy[NL80211_BSS_SIGNAL_MBM].type = NLA_U32;
bss_policy[NL80211_BSS_SIGNAL_UNSPEC].type = NLA_U8;
bss_policy[NL80211_BSS_STATUS].type = NLA_U32;
if (nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), nullptr) < 0) {
return NL_SKIP;
}
if (tb[NL80211_ATTR_BSS] == nullptr) {
return NL_SKIP;
}
if (nla_parse_nested(bss, NL80211_BSS_MAX, tb[NL80211_ATTR_BSS], bss_policy) != 0) {
return NL_SKIP;
}
if (!wn->associated_or_joined(bss)) {
return NL_SKIP;
}
wn->parse_essid(bss);
wn->parse_frequency(bss);
wn->parse_signal(bss);
wn->parse_quality(bss);
return NL_SKIP;
}
/**
* Check for a connection to a AP
*/
bool wireless_network::associated_or_joined(struct nlattr** bss) {
if (bss[NL80211_BSS_STATUS] == nullptr) {
return false;
}
auto status = nla_get_u32(bss[NL80211_BSS_STATUS]);
switch (status) {
case NL80211_BSS_STATUS_ASSOCIATED:
case NL80211_BSS_STATUS_IBSS_JOINED:
case NL80211_BSS_STATUS_AUTHENTICATED:
return true;
default:
return false;
}
}
/**
* Set the ESSID
*/
void wireless_network::parse_essid(struct nlattr** bss) {
m_essid.clear();
if (bss[NL80211_BSS_INFORMATION_ELEMENTS] != nullptr) {
// Information Element ID from ieee80211.h
#define WLAN_EID_SSID 0
auto ies = static_cast<char*>(nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]));
auto ies_len = nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]);
const auto hdr_len = 2;
while (ies_len > hdr_len && ies[0] != WLAN_EID_SSID) {
ies_len -= ies[1] + hdr_len;
ies += ies[1] + hdr_len;
}
if (ies_len > hdr_len && ies_len > ies[1] + hdr_len) {
auto essid_begin = ies + hdr_len;
auto essid_end = essid_begin + ies[1];
std::copy(essid_begin, essid_end, std::back_inserter(m_essid));
}
}
}
/**
* Set frequency
*/
void wireless_network::parse_frequency(struct nlattr** bss) {
if (bss[NL80211_BSS_FREQUENCY] != nullptr) {
// in MHz
m_frequency = static_cast<int>(nla_get_u32(bss[NL80211_BSS_FREQUENCY]));
}
}
/**
* Set device driver quality values
*/
void wireless_network::parse_quality(struct nlattr** bss) {
if (bss[NL80211_BSS_SIGNAL_UNSPEC] != nullptr) {
// Signal strength in unspecified units, scaled to 0..100 (u8)
m_linkquality.val = nla_get_u8(bss[NL80211_BSS_SIGNAL_UNSPEC]);
m_linkquality.max = 100;
}
}
/**
* Set the signalstrength
*/
void wireless_network::parse_signal(struct nlattr** bss) {
if (bss[NL80211_BSS_SIGNAL_MBM] != nullptr) {
// signalstrength in dBm
int signalstrength = static_cast<int>(nla_get_u32(bss[NL80211_BSS_SIGNAL_MBM])) / 100;
// WiFi-hardware usually operates in the range -90 to -20dBm.
const int hardware_max = -20;
const int hardware_min = -90;
signalstrength = std::max(hardware_min, std::min(signalstrength, hardware_max));
// Shift for positive values
m_signalstrength.val = signalstrength - hardware_min;
m_signalstrength.max = hardware_max - hardware_min;
}
}
} // namespace net
POLYBAR_NS_END
| {
"pile_set_name": "Github"
} |
package com.github.czyzby.lml.vis.parser.impl.tag.validator;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.utils.ObjectSet;
import com.github.czyzby.kiwi.util.common.Strings;
import com.github.czyzby.kiwi.util.gdx.collection.GdxSets;
import com.github.czyzby.lml.parser.LmlParser;
import com.github.czyzby.lml.parser.impl.tag.AbstractLmlTag;
import com.github.czyzby.lml.parser.tag.LmlTag;
import com.github.czyzby.lml.util.LmlUtilities;
import com.github.czyzby.lml.vis.parser.impl.tag.FormValidatorLmlTag;
import com.kotcrab.vis.ui.util.InputValidator;
import com.kotcrab.vis.ui.util.form.FormInputValidator;
import com.kotcrab.vis.ui.util.form.ValidatorWrapper;
import com.kotcrab.vis.ui.widget.VisValidatableTextField;
/** Abstract base for {@link InputValidator} tags.
*
* @author MJ */
public abstract class AbstractValidatorLmlTag extends AbstractLmlTag {
public AbstractValidatorLmlTag(final LmlParser parser, final LmlTag parentTag, final StringBuilder rawTagData) {
super(parser, parentTag, rawTagData);
}
@Override
public void handleDataBetweenTags(final CharSequence rawData) {
if (Strings.isNotBlank(rawData)) {
getParser().throwErrorIfStrict("Validators cannot parse plain text between tags.");
}
}
@Override
public Actor getActor() {
return null;
}
/** @return managed {@link InputValidator}. */
@Override
public Object getManagedObject() {
return getInputValidator();
}
@Override
public void closeTag() {
if (getParent() == null) {
getParser().throwError("Validators need to be attached to a tag. No parent found for tag: " + getTagName());
}
}
@Override
public void handleChild(final LmlTag childTag) {
getParser().throwErrorIfStrict("Validators cannot have children.");
}
/** @return {@link InputValidator} supplied by this tag. Invoked once, when validator is attached to the actor. */
public abstract InputValidator getInputValidator();
@Override
protected boolean supportsNamedAttributes() {
return true;
}
@Override
public boolean isAttachable() {
return true;
}
@Override
public void attachTo(final LmlTag tag) {
final InputValidator validator = initiateValidator();
doBeforeAttach(validator);
if (tag.getActor() instanceof VisValidatableTextField) {
((VisValidatableTextField) tag.getActor()).addValidator(validator);
} else {
getParser().throwErrorIfStrict("Validators can be attached only to VisValidatableTextField actors.");
}
}
/** Invoked before the validator is attached.
*
* @param validator has been initiated. */
protected void doBeforeAttach(final InputValidator validator) {
}
private InputValidator initiateValidator() {
final InputValidator validator = getInputValidator();
if (isInForm() && !(validator instanceof FormInputValidator)) {
return wrapValidator(validator);
}
processAttributes(validator);
return validator;
}
private InputValidator wrapValidator(final InputValidator validator) {
final ObjectSet<String> processedAttributes = GdxSets.newSet();
processAttributes(validator, processedAttributes, false);
// Processing form validator-specific attributes:
final FormInputValidator formValidator = new ValidatorWrapper(Strings.EMPTY_STRING, validator);
processAttributes(formValidator, processedAttributes, true);
return formValidator;
}
/** @return true if the validator is attached to a widget in a form. */
protected boolean isInForm() {
LmlTag parent = getParent();
while (parent != null) {
if (parent instanceof FormValidatorLmlTag) {
return true;
}
parent = parent.getParent();
}
return false;
}
// Utility named attribute processing methods:
private void processAttributes(final InputValidator validator) {
processAttributes(validator, null, true);
}
private void processAttributes(final InputValidator validator, final ObjectSet<String> processedAttributes,
final boolean throwExceptionIfAttributeUnknown) {
LmlUtilities.processAttributes(validator, this, getParser(), processedAttributes,
throwExceptionIfAttributeUnknown);
}
}
| {
"pile_set_name": "Github"
} |
<?php
defined('YII_ENV') or exit('Access Denied');
use yii\widgets\LinkPager;
$urlManager = Yii::$app->urlManager;
$this->title = '退货地址列表';
?>
<div class="panel mb-3">
<div class="panel-header">
<span><?= $this->title ?></span>
<ul class="nav nav-right">
<li class="nav-item">
<a class="nav-link" href="<?= $urlManager->createUrl(['mch/refund-address/edit']) ?>">添加退货地址</a>
</li>
</ul>
<div class="panel-body">
<table class="table table-bordered bg-white">
<thead>
<tr>
<th>ID</th>
<th>姓名</th>
<th>联系电话</th>
<th>地址</th>
<th>操作</th>
</tr>
</thead>
<col style="width: 5%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 40%">
<col style="width: 10%">
<?php foreach ($list as $u) : ?>
<tr>
<td><?= $u->id ?></td>
<td><?= $u->name; ?></td>
<td><?= $u->mobile; ?></td>
<td><?= $u->address; ?></td>
<td>
<a class="btn btn-sm btn-primary" href="<?= $urlManager->createUrl(['mch/refund-address/edit', 'id' => $u->id]) ?>">编辑</a>
<a class="btn btn-sm btn-danger del" href="javascript:"
data-url="<?= $urlManager->createUrl(['mch/refund-address/del', 'id' => $u->id]) ?>"
data-content="是否删除?">删除</a>
</td>
</tr>
<?php endforeach; ?>
</table>
<nav aria-label="Page navigation example">
<?php echo LinkPager::widget([
'pagination' => $pagination,
'prevPageLabel' => '上一页',
'nextPageLabel' => '下一页',
'firstPageLabel' => '首页',
'lastPageLabel' => '尾页',
'maxButtonCount' => 5,
'options' => [
'class' => 'pagination',
],
'prevPageCssClass' => 'page-item',
'pageCssClass' => "page-item",
'nextPageCssClass' => 'page-item',
'firstPageCssClass' => 'page-item',
'lastPageCssClass' => 'page-item',
'linkOptions' => [
'class' => 'page-link',
],
'disabledListItemSubTagOptions' => ['tag' => 'a', 'class' => 'page-link'],
])
?>
</nav>
</div>
</div>
<script>
$(document).on('click', '.del', function () {
var a = $(this);
$.myConfirm({
content: a.data('content'),
confirm: function () {
$.ajax({
url: a.data('url'),
type: 'get',
dataType: 'json',
success: function (res) {
if (res.code == 0) {
window.location.reload();
} else {
$.myAlert({
title: res.msg
});
}
}
});
}
});
return false;
});
</script>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1996-2001
* Logica Mobile Networks Limited
* All rights reserved.
*
* This software is distributed under Logica Open Source License Version 1.0
* ("Licence Agreement"). You shall use it and distribute only in accordance
* with the terms of the License Agreement.
*
*/
package org.smpp.pdu;
import org.smpp.Data;
import org.smpp.util.*;
/**
* @author Logica Mobile Networks SMPP Open Source Team
* @version $Revision: 1.1 $
*/
public class UnbindResp extends Response {
public UnbindResp() {
super(Data.UNBIND_RESP);
}
public void setBody(ByteBuffer buffer)
throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, PDUException {
}
public ByteBuffer getBody() {
return null;
}
public String debugString() {
String dbgs = "(unbind_resp: ";
dbgs += super.debugString();
dbgs += ") ";
return dbgs;
}
}
/*
* $Log: not supported by cvs2svn $
*/
| {
"pile_set_name": "Github"
} |
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//
// Buffer Definitions:
//
// cbuffer CB_SHADOWS_DATA
// {
//
// struct ShadowsData
// {
//
// struct Camera
// {
//
// float4x4 m_View; // Offset: 0
// float4x4 m_Projection; // Offset: 64
// float4x4 m_ViewProjection; // Offset: 128
// float4x4 m_View_Inv; // Offset: 192
// float4x4 m_Projection_Inv; // Offset: 256
// float4x4 m_ViewProjection_Inv;// Offset: 320
// float3 m_Position; // Offset: 384
// float m_Fov; // Offset: 396
// float3 m_Direction; // Offset: 400
// float m_FarPlane; // Offset: 412
// float3 m_Right; // Offset: 416
// float m_NearPlane; // Offset: 428
// float3 m_Up; // Offset: 432
// float m_Aspect; // Offset: 444
// float4 m_Color; // Offset: 448
//
// } m_Viewer; // Offset: 0
// float2 m_Size; // Offset: 464
// float2 m_SizeInv; // Offset: 472
//
// struct ShadowsLightData
// {
//
// struct Camera
// {
//
// float4x4 m_View; // Offset: 480
// float4x4 m_Projection; // Offset: 544
// float4x4 m_ViewProjection;// Offset: 608
// float4x4 m_View_Inv; // Offset: 672
// float4x4 m_Projection_Inv;// Offset: 736
// float4x4 m_ViewProjection_Inv;// Offset: 800
// float3 m_Position; // Offset: 864
// float m_Fov; // Offset: 876
// float3 m_Direction; // Offset: 880
// float m_FarPlane; // Offset: 892
// float3 m_Right; // Offset: 896
// float m_NearPlane; // Offset: 908
// float3 m_Up; // Offset: 912
// float m_Aspect; // Offset: 924
// float4 m_Color; // Offset: 928
//
// } m_Camera; // Offset: 480
// float2 m_Size; // Offset: 944
// float2 m_SizeInv; // Offset: 952
// float4 m_Region; // Offset: 960
// float4 m_Weight; // Offset: 976
// float m_SunArea; // Offset: 992
// float m_DepthTestOffset; // Offset: 996
// float m_NormalOffsetScale; // Offset: 1000
// uint m_ArraySlice; // Offset: 1004
//
// } m_Light[6]; // Offset: 480
// uint m_ActiveLightCount; // Offset: 3648
// float3 pad3; // Offset: 3652
//
// } g_cbShadowsData; // Offset: 0 Size: 3664
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// g_scsPoint sampler_c NA NA s2 1
// g_t2dDepth texture float 2d t0 1
// g_t2dShadow texture float 2d t2 1
// CB_SHADOWS_DATA cbuffer NA NA cb0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xy
// TEXCOORD 0 xy 1 NONE float
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[229], dynamicIndexed
dcl_sampler s2, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t2
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
dcl_temps 6
mul r0.x, v0.x, cb0[29].z
mul r0.y, v0.y, -cb0[29].w
add r0.xy, r0.xyxx, l(-0.500000, 0.500000, 0.000000, 0.000000)
add r0.xy, r0.xyxx, r0.xyxx
ftoi r1.xy, v0.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.z, r1.xyzw, t0.yzxw
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb0[20].xyzw
dp4 r1.y, r0.xyzw, cb0[21].xyzw
dp4 r1.z, r0.xyzw, cb0[22].xyzw
dp4 r1.w, r0.xyzw, cb0[23].xyzw
div r0.xyzw, r1.xyzw, r1.wwww
add r1.xyz, r0.xyzx, -cb0[54].xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
max r1.w, |r1.z|, |r1.y|
max r1.w, r1.w, |r1.x|
eq r2.xyz, |r1.xyzx|, r1.wwww
lt r1.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r1.xyzx
movc r1.xyz, r1.xyzx, l(0,2,4,0), l(1,3,5,0)
movc r1.x, r2.x, r1.x, l(6)
movc r1.x, r2.y, r1.y, r1.x
movc r1.x, r2.z, r1.z, r1.x
imul null, r1.x, r1.x, l(33)
dp4 r2.x, r0.xyzw, cb0[r1.x + 38].xyzw
dp4 r2.y, r0.xyzw, cb0[r1.x + 39].xyzw
dp4 r2.z, r0.xyzw, cb0[r1.x + 40].xyzw
dp4 r0.x, r0.xyzw, cb0[r1.x + 41].xyzw
div r0.xyz, r2.xyzx, r0.xxxx
mad r2.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r0.x, -r2.y, l(1.000000)
ge r0.y, r2.x, l(0.000000)
ge r0.w, l(1.000000), r2.x
and r0.y, r0.w, r0.y
ge r0.w, r0.x, l(0.000000)
and r0.y, r0.w, r0.y
ge r0.x, l(1.000000), r0.x
and r0.x, r0.x, r0.y
ge r0.y, r0.z, l(0.000000)
and r0.x, r0.y, r0.x
ge r0.y, l(1.000000), r0.z
and r0.x, r0.y, r0.x
if_nz r0.x
add r3.xyzw, -cb0[r1.x + 60].xyxy, cb0[r1.x + 60].zwzw
add r0.x, r0.z, -cb0[r1.x + 62].y
add r2.z, -r2.y, l(1.000000)
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(-0.239308, 3.780662, -1.970040, 2.828731)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mul r0.z, r0.z, l(0.277911)
mad r0.y, r0.y, l(0.284623), r0.z
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(-0.173248, 1.542242, 1.107247, 2.025136)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
mad r0.y, r0.z, l(0.842772), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mad r0.y, r0.z, l(0.741247), r0.y
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(1.483141, 3.648070, 2.394908, 1.198109)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
mad r0.y, r0.z, l(0.298631), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mad r0.y, r0.z, l(0.635645), r0.y
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(1.097874, 0.582557, 2.561670, -0.191586)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
mad r0.y, r0.z, l(0.960334), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mad r0.y, r0.z, l(0.591307), r0.y
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(-0.794738, 0.264613, 3.733450, 1.770490)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
mad r0.y, r0.z, l(0.824963), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mad r0.y, r0.z, l(0.261574), r0.y
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(-2.476625, 0.607873, -1.066728, -1.990001)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
mad r0.y, r0.z, l(0.373152), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mad r0.y, r0.z, l(0.382266), r0.y
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(0.522746, -1.430310, -1.984528, -0.878844)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
mad r0.y, r0.z, l(0.660956), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mad r0.y, r0.z, l(0.407742), r0.y
mad r4.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(2.484003, -1.842571, 0.226518, -2.734874)
round_ni r4.xyzw, r4.xyzw
mul r4.xyzw, r4.xyzw, cb0[r1.x + 59].zwzw
mad r4.xyzw, r4.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
mad r0.y, r0.z, l(0.350954), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mad r0.y, r0.z, l(0.310050), r0.y
mad r2.xyzw, cb0[r1.x + 59].xyxy, r2.xzxz, l(3.858250, 0.163638, 2.590277, 2.786526)
round_ni r2.xyzw, r2.xyzw
mul r2.xyzw, r2.xyzw, cb0[r1.x + 59].zwzw
mad r1.xyzw, r2.xyzw, r3.xyzw, cb0[r1.x + 60].xyxy
gather4_c_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.xyxx, t2.xyzw, s2.x, r0.x
dp4 r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r2.xyzw
mad r0.y, r0.z, l(0.282052), r0.y
gather4_c_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.zwzz, t2.xyzw, s2.x, r0.x
dp4 r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.xyzw
mad r0.x, r0.x, l(0.344251), r0.y
mul r0.x, r0.x, l(0.028311)
else
mov r0.x, l(1.000000)
endif
mov o0.xyzw, r0.xxxx
ret
// Approximately 144 instruction slots used
#endif
const BYTE PS_SF_T2D_CUBE_UNIFORM_TEX_FETCH_GATHER4_TAP_TYPE_POISSON_NORMAL_OPTION_NONE_FILTER_SIZE_7_Data[] =
{
68, 88, 66, 67, 100, 177,
163, 129, 66, 51, 254, 89,
189, 238, 136, 73, 186, 31,
237, 40, 1, 0, 0, 0,
232, 28, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0,
236, 5, 0, 0, 68, 6,
0, 0, 120, 6, 0, 0,
76, 28, 0, 0, 82, 68,
69, 70, 176, 5, 0, 0,
1, 0, 0, 0, 240, 0,
0, 0, 4, 0, 0, 0,
60, 0, 0, 0, 0, 5,
255, 255, 0, 1, 0, 0,
124, 5, 0, 0, 82, 68,
49, 49, 60, 0, 0, 0,
24, 0, 0, 0, 32, 0,
0, 0, 40, 0, 0, 0,
36, 0, 0, 0, 12, 0,
0, 0, 0, 0, 0, 0,
188, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 199, 0, 0, 0,
2, 0, 0, 0, 5, 0,
0, 0, 4, 0, 0, 0,
255, 255, 255, 255, 0, 0,
0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 210, 0,
0, 0, 2, 0, 0, 0,
5, 0, 0, 0, 4, 0,
0, 0, 255, 255, 255, 255,
2, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0,
222, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0,
0, 0, 103, 95, 115, 99,
115, 80, 111, 105, 110, 116,
0, 103, 95, 116, 50, 100,
68, 101, 112, 116, 104, 0,
103, 95, 116, 50, 100, 83,
104, 97, 100, 111, 119, 0,
67, 66, 95, 83, 72, 65,
68, 79, 87, 83, 95, 68,
65, 84, 65, 0, 171, 171,
222, 0, 0, 0, 1, 0,
0, 0, 8, 1, 0, 0,
80, 14, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
48, 1, 0, 0, 0, 0,
0, 0, 80, 14, 0, 0,
2, 0, 0, 0, 88, 5,
0, 0, 0, 0, 0, 0,
255, 255, 255, 255, 0, 0,
0, 0, 255, 255, 255, 255,
0, 0, 0, 0, 103, 95,
99, 98, 83, 104, 97, 100,
111, 119, 115, 68, 97, 116,
97, 0, 83, 104, 97, 100,
111, 119, 115, 68, 97, 116,
97, 0, 109, 95, 86, 105,
101, 119, 101, 114, 0, 67,
97, 109, 101, 114, 97, 0,
109, 95, 86, 105, 101, 119,
0, 102, 108, 111, 97, 116,
52, 120, 52, 0, 3, 0,
3, 0, 4, 0, 4, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
99, 1, 0, 0, 109, 95,
80, 114, 111, 106, 101, 99,
116, 105, 111, 110, 0, 109,
95, 86, 105, 101, 119, 80,
114, 111, 106, 101, 99, 116,
105, 111, 110, 0, 109, 95,
86, 105, 101, 119, 95, 73,
110, 118, 0, 109, 95, 80,
114, 111, 106, 101, 99, 116,
105, 111, 110, 95, 73, 110,
118, 0, 109, 95, 86, 105,
101, 119, 80, 114, 111, 106,
101, 99, 116, 105, 111, 110,
95, 73, 110, 118, 0, 109,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 102, 108,
111, 97, 116, 51, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 3, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 234, 1,
0, 0, 109, 95, 70, 111,
118, 0, 102, 108, 111, 97,
116, 0, 0, 0, 3, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 30, 2,
0, 0, 109, 95, 68, 105,
114, 101, 99, 116, 105, 111,
110, 0, 109, 95, 70, 97,
114, 80, 108, 97, 110, 101,
0, 109, 95, 82, 105, 103,
104, 116, 0, 109, 95, 78,
101, 97, 114, 80, 108, 97,
110, 101, 0, 109, 95, 85,
112, 0, 109, 95, 65, 115,
112, 101, 99, 116, 0, 109,
95, 67, 111, 108, 111, 114,
0, 102, 108, 111, 97, 116,
52, 0, 1, 0, 3, 0,
1, 0, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 137, 2,
0, 0, 92, 1, 0, 0,
108, 1, 0, 0, 0, 0,
0, 0, 144, 1, 0, 0,
108, 1, 0, 0, 64, 0,
0, 0, 157, 1, 0, 0,
108, 1, 0, 0, 128, 0,
0, 0, 174, 1, 0, 0,
108, 1, 0, 0, 192, 0,
0, 0, 185, 1, 0, 0,
108, 1, 0, 0, 0, 1,
0, 0, 202, 1, 0, 0,
108, 1, 0, 0, 64, 1,
0, 0, 223, 1, 0, 0,
244, 1, 0, 0, 128, 1,
0, 0, 24, 2, 0, 0,
36, 2, 0, 0, 140, 1,
0, 0, 72, 2, 0, 0,
244, 1, 0, 0, 144, 1,
0, 0, 84, 2, 0, 0,
36, 2, 0, 0, 156, 1,
0, 0, 95, 2, 0, 0,
244, 1, 0, 0, 160, 1,
0, 0, 103, 2, 0, 0,
36, 2, 0, 0, 172, 1,
0, 0, 115, 2, 0, 0,
244, 1, 0, 0, 176, 1,
0, 0, 120, 2, 0, 0,
36, 2, 0, 0, 188, 1,
0, 0, 129, 2, 0, 0,
144, 2, 0, 0, 192, 1,
0, 0, 5, 0, 0, 0,
1, 0, 116, 0, 0, 0,
15, 0, 180, 2, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 85, 1,
0, 0, 109, 95, 83, 105,
122, 101, 0, 102, 108, 111,
97, 116, 50, 0, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 147, 3, 0, 0,
109, 95, 83, 105, 122, 101,
73, 110, 118, 0, 109, 95,
76, 105, 103, 104, 116, 0,
83, 104, 97, 100, 111, 119,
115, 76, 105, 103, 104, 116,
68, 97, 116, 97, 0, 109,
95, 67, 97, 109, 101, 114,
97, 0, 109, 95, 82, 101,
103, 105, 111, 110, 0, 109,
95, 87, 101, 105, 103, 104,
116, 0, 109, 95, 83, 117,
110, 65, 114, 101, 97, 0,
109, 95, 68, 101, 112, 116,
104, 84, 101, 115, 116, 79,
102, 102, 115, 101, 116, 0,
109, 95, 78, 111, 114, 109,
97, 108, 79, 102, 102, 115,
101, 116, 83, 99, 97, 108,
101, 0, 109, 95, 65, 114,
114, 97, 121, 83, 108, 105,
99, 101, 0, 100, 119, 111,
114, 100, 0, 171, 171, 171,
0, 0, 19, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 59, 4, 0, 0,
227, 3, 0, 0, 104, 3,
0, 0, 0, 0, 0, 0,
140, 3, 0, 0, 156, 3,
0, 0, 208, 1, 0, 0,
192, 3, 0, 0, 156, 3,
0, 0, 216, 1, 0, 0,
236, 3, 0, 0, 144, 2,
0, 0, 224, 1, 0, 0,
245, 3, 0, 0, 144, 2,
0, 0, 240, 1, 0, 0,
254, 3, 0, 0, 36, 2,
0, 0, 0, 2, 0, 0,
8, 4, 0, 0, 36, 2,
0, 0, 4, 2, 0, 0,
26, 4, 0, 0, 36, 2,
0, 0, 8, 2, 0, 0,
46, 4, 0, 0, 68, 4,
0, 0, 12, 2, 0, 0,
5, 0, 0, 0, 1, 0,
132, 0, 6, 0, 9, 0,
104, 4, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 210, 3, 0, 0,
109, 95, 65, 99, 116, 105,
118, 101, 76, 105, 103, 104,
116, 67, 111, 117, 110, 116,
0, 112, 97, 100, 51, 0,
76, 1, 0, 0, 104, 3,
0, 0, 0, 0, 0, 0,
140, 3, 0, 0, 156, 3,
0, 0, 208, 1, 0, 0,
192, 3, 0, 0, 156, 3,
0, 0, 216, 1, 0, 0,
202, 3, 0, 0, 212, 4,
0, 0, 224, 1, 0, 0,
248, 4, 0, 0, 68, 4,
0, 0, 64, 14, 0, 0,
11, 5, 0, 0, 244, 1,
0, 0, 68, 14, 0, 0,
5, 0, 0, 0, 1, 0,
148, 3, 0, 0, 6, 0,
16, 5, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 64, 1, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 48, 46, 49, 48,
48, 49, 49, 46, 49, 54,
51, 56, 52, 0, 73, 83,
71, 78, 80, 0, 0, 0,
2, 0, 0, 0, 8, 0,
0, 0, 56, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 3,
0, 0, 68, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 83, 86, 95, 80,
79, 83, 73, 84, 73, 79,
78, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 171,
171, 171, 79, 83, 71, 78,
44, 0, 0, 0, 1, 0,
0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 84, 97, 114,
103, 101, 116, 0, 171, 171,
83, 72, 69, 88, 204, 21,
0, 0, 80, 0, 0, 0,
115, 5, 0, 0, 106, 8,
0, 1, 89, 8, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 229, 0, 0, 0,
90, 8, 0, 3, 0, 96,
16, 0, 2, 0, 0, 0,
88, 24, 0, 4, 0, 112,
16, 0, 0, 0, 0, 0,
85, 85, 0, 0, 88, 24,
0, 4, 0, 112, 16, 0,
2, 0, 0, 0, 85, 85,
0, 0, 100, 32, 0, 4,
50, 16, 16, 0, 0, 0,
0, 0, 1, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
104, 0, 0, 2, 6, 0,
0, 0, 56, 0, 0, 8,
18, 0, 16, 0, 0, 0,
0, 0, 10, 16, 16, 0,
0, 0, 0, 0, 42, 128,
32, 0, 0, 0, 0, 0,
29, 0, 0, 0, 56, 0,
0, 9, 34, 0, 16, 0,
0, 0, 0, 0, 26, 16,
16, 0, 0, 0, 0, 0,
58, 128, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
29, 0, 0, 0, 0, 0,
0, 10, 50, 0, 16, 0,
0, 0, 0, 0, 70, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 191, 0, 0, 0, 63,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 7,
50, 0, 16, 0, 0, 0,
0, 0, 70, 0, 16, 0,
0, 0, 0, 0, 70, 0,
16, 0, 0, 0, 0, 0,
27, 0, 0, 5, 50, 0,
16, 0, 1, 0, 0, 0,
70, 16, 16, 0, 0, 0,
0, 0, 54, 0, 0, 8,
194, 0, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 45, 0,
0, 137, 194, 0, 0, 128,
67, 85, 21, 0, 66, 0,
16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 1, 0,
0, 0, 150, 124, 16, 0,
0, 0, 0, 0, 54, 0,
0, 5, 130, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
17, 0, 0, 8, 18, 0,
16, 0, 1, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 20, 0,
0, 0, 17, 0, 0, 8,
34, 0, 16, 0, 1, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
21, 0, 0, 0, 17, 0,
0, 8, 66, 0, 16, 0,
1, 0, 0, 0, 70, 14,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 22, 0, 0, 0,
17, 0, 0, 8, 130, 0,
16, 0, 1, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 23, 0,
0, 0, 14, 0, 0, 7,
242, 0, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0,
1, 0, 0, 0, 246, 15,
16, 0, 1, 0, 0, 0,
0, 0, 0, 9, 114, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 54, 0, 0, 0,
16, 0, 0, 7, 130, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 130, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 1, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 1, 0, 0, 0,
246, 15, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 52, 0,
0, 9, 130, 0, 16, 0,
1, 0, 0, 0, 42, 0,
16, 128, 129, 0, 0, 0,
1, 0, 0, 0, 26, 0,
16, 128, 129, 0, 0, 0,
1, 0, 0, 0, 52, 0,
0, 8, 130, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 128, 129, 0,
0, 0, 1, 0, 0, 0,
24, 0, 0, 8, 114, 0,
16, 0, 2, 0, 0, 0,
70, 2, 16, 128, 129, 0,
0, 0, 1, 0, 0, 0,
246, 15, 16, 0, 1, 0,
0, 0, 49, 0, 0, 10,
114, 0, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
55, 0, 0, 15, 114, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 0, 2, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 2, 64,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0,
55, 0, 0, 9, 18, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 64,
0, 0, 6, 0, 0, 0,
55, 0, 0, 9, 18, 0,
16, 0, 1, 0, 0, 0,
26, 0, 16, 0, 2, 0,
0, 0, 26, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
55, 0, 0, 9, 18, 0,
16, 0, 1, 0, 0, 0,
42, 0, 16, 0, 2, 0,
0, 0, 42, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
38, 0, 0, 8, 0, 208,
0, 0, 18, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
1, 64, 0, 0, 33, 0,
0, 0, 17, 0, 0, 10,
18, 0, 16, 0, 2, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 70, 142,
32, 6, 0, 0, 0, 0,
38, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
17, 0, 0, 10, 34, 0,
16, 0, 2, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 142, 32, 6,
0, 0, 0, 0, 39, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 17, 0,
0, 10, 66, 0, 16, 0,
2, 0, 0, 0, 70, 14,
16, 0, 0, 0, 0, 0,
70, 142, 32, 6, 0, 0,
0, 0, 40, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 17, 0, 0, 10,
18, 0, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 70, 142,
32, 6, 0, 0, 0, 0,
41, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
14, 0, 0, 7, 114, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 2, 0,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 50, 0,
0, 15, 50, 0, 16, 0,
2, 0, 0, 0, 70, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 63, 0, 0, 0, 63,
0, 0, 0, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 63, 0, 0,
0, 63, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 8, 18, 0, 16, 0,
0, 0, 0, 0, 26, 0,
16, 128, 65, 0, 0, 0,
2, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
29, 0, 0, 7, 34, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 2, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 29, 0,
0, 7, 130, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
10, 0, 16, 0, 2, 0,
0, 0, 1, 0, 0, 7,
34, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 26, 0,
16, 0, 0, 0, 0, 0,
29, 0, 0, 7, 130, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 1, 0,
0, 7, 34, 0, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
26, 0, 16, 0, 0, 0,
0, 0, 29, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 10, 0,
16, 0, 0, 0, 0, 0,
1, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 26, 0, 16, 0,
0, 0, 0, 0, 29, 0,
0, 7, 34, 0, 16, 0,
0, 0, 0, 0, 42, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
0, 0, 1, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 26, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
29, 0, 0, 7, 34, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
128, 63, 42, 0, 16, 0,
0, 0, 0, 0, 1, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 26, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 31, 0, 4, 3,
10, 0, 16, 0, 0, 0,
0, 0, 0, 0, 0, 14,
242, 0, 16, 0, 3, 0,
0, 0, 70, 132, 32, 134,
65, 0, 0, 0, 0, 0,
0, 0, 60, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 230, 142, 32, 6,
0, 0, 0, 0, 60, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 0, 0,
0, 11, 18, 0, 16, 0,
0, 0, 0, 0, 42, 0,
16, 0, 0, 0, 0, 0,
26, 128, 32, 134, 65, 0,
0, 0, 0, 0, 0, 0,
62, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
0, 0, 0, 8, 66, 0,
16, 0, 2, 0, 0, 0,
26, 0, 16, 128, 65, 0,
0, 0, 2, 0, 0, 0,
1, 64, 0, 0, 0, 0,
128, 63, 50, 0, 0, 15,
242, 0, 16, 0, 4, 0,
0, 0, 70, 132, 32, 6,
0, 0, 0, 0, 59, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 134, 8,
16, 0, 2, 0, 0, 0,
2, 64, 0, 0, 72, 13,
117, 190, 94, 246, 113, 64,
70, 42, 252, 191, 238, 9,
53, 64, 65, 0, 0, 5,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 56, 0,
0, 10, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
230, 142, 32, 6, 0, 0,
0, 0, 59, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 50, 0, 0, 12,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 3, 0, 0, 0,
70, 132, 32, 6, 0, 0,
0, 0, 60, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 126, 0, 0, 141,
194, 0, 0, 128, 67, 85,
21, 0, 242, 0, 16, 0,
5, 0, 0, 0, 70, 0,
16, 0, 4, 0, 0, 0,
70, 126, 16, 0, 2, 0,
0, 0, 10, 96, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
17, 0, 0, 10, 34, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 70, 14, 16, 0,
5, 0, 0, 0, 126, 0,
0, 141, 194, 0, 0, 128,
67, 85, 21, 0, 242, 0,
16, 0, 4, 0, 0, 0,
230, 10, 16, 0, 4, 0,
0, 0, 70, 126, 16, 0,
2, 0, 0, 0, 10, 96,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 17, 0, 0, 10,
66, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 70, 14,
16, 0, 4, 0, 0, 0,
56, 0, 0, 7, 66, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
93, 74, 142, 62, 50, 0,
0, 9, 34, 0, 16, 0,
0, 0, 0, 0, 26, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 13, 186,
145, 62, 42, 0, 16, 0,
0, 0, 0, 0, 50, 0,
0, 15, 242, 0, 16, 0,
4, 0, 0, 0, 70, 132,
32, 6, 0, 0, 0, 0,
59, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
134, 8, 16, 0, 2, 0,
0, 0, 2, 64, 0, 0,
244, 103, 49, 190, 48, 104,
197, 63, 68, 186, 141, 63,
212, 155, 1, 64, 65, 0,
0, 5, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
56, 0, 0, 10, 242, 0,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 4, 0,
0, 0, 230, 142, 32, 6,
0, 0, 0, 0, 59, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 50, 0,
0, 12, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 3, 0,
0, 0, 70, 132, 32, 6,
0, 0, 0, 0, 60, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 126, 0,
0, 141, 194, 0, 0, 128,
67, 85, 21, 0, 242, 0,
16, 0, 5, 0, 0, 0,
70, 0, 16, 0, 4, 0,
0, 0, 70, 126, 16, 0,
2, 0, 0, 0, 10, 96,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 17, 0, 0, 10,
66, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 70, 14,
16, 0, 5, 0, 0, 0,
50, 0, 0, 9, 34, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
228, 191, 87, 63, 26, 0,
16, 0, 0, 0, 0, 0,
126, 0, 0, 141, 194, 0,
0, 128, 67, 85, 21, 0,
242, 0, 16, 0, 4, 0,
0, 0, 230, 10, 16, 0,
4, 0, 0, 0, 70, 126,
16, 0, 2, 0, 0, 0,
10, 96, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 17, 0,
0, 10, 66, 0, 16, 0,
0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
70, 14, 16, 0, 4, 0,
0, 0, 50, 0, 0, 9,
34, 0, 16, 0, 0, 0,
0, 0, 42, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 98, 194, 61, 63,
26, 0, 16, 0, 0, 0,
0, 0, 50, 0, 0, 15,
242, 0, 16, 0, 4, 0,
0, 0, 70, 132, 32, 6,
0, 0, 0, 0, 59, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 134, 8,
16, 0, 2, 0, 0, 0,
2, 64, 0, 0, 148, 215,
189, 63, 251, 121, 105, 64,
44, 70, 25, 64, 164, 91,
153, 63, 65, 0, 0, 5,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 56, 0,
0, 10, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
230, 142, 32, 6, 0, 0,
0, 0, 59, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 50, 0, 0, 12,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 3, 0, 0, 0,
70, 132, 32, 6, 0, 0,
0, 0, 60, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 126, 0, 0, 141,
194, 0, 0, 128, 67, 85,
21, 0, 242, 0, 16, 0,
5, 0, 0, 0, 70, 0,
16, 0, 4, 0, 0, 0,
70, 126, 16, 0, 2, 0,
0, 0, 10, 96, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
17, 0, 0, 10, 66, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 70, 14, 16, 0,
5, 0, 0, 0, 50, 0,
0, 9, 34, 0, 16, 0,
0, 0, 0, 0, 42, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 49, 230,
152, 62, 26, 0, 16, 0,
0, 0, 0, 0, 126, 0,
0, 141, 194, 0, 0, 128,
67, 85, 21, 0, 242, 0,
16, 0, 4, 0, 0, 0,
230, 10, 16, 0, 4, 0,
0, 0, 70, 126, 16, 0,
2, 0, 0, 0, 10, 96,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 17, 0, 0, 10,
66, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 70, 14,
16, 0, 4, 0, 0, 0,
50, 0, 0, 9, 34, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
165, 185, 34, 63, 26, 0,
16, 0, 0, 0, 0, 0,
50, 0, 0, 15, 242, 0,
16, 0, 4, 0, 0, 0,
70, 132, 32, 6, 0, 0,
0, 0, 59, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 134, 8, 16, 0,
2, 0, 0, 0, 2, 64,
0, 0, 34, 135, 140, 63,
125, 34, 21, 63, 103, 242,
35, 64, 36, 47, 68, 190,
65, 0, 0, 5, 242, 0,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 4, 0,
0, 0, 56, 0, 0, 10,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 230, 142,
32, 6, 0, 0, 0, 0,
59, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
50, 0, 0, 12, 242, 0,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
3, 0, 0, 0, 70, 132,
32, 6, 0, 0, 0, 0,
60, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
126, 0, 0, 141, 194, 0,
0, 128, 67, 85, 21, 0,
242, 0, 16, 0, 5, 0,
0, 0, 70, 0, 16, 0,
4, 0, 0, 0, 70, 126,
16, 0, 2, 0, 0, 0,
10, 96, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 17, 0,
0, 10, 66, 0, 16, 0,
0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
70, 14, 16, 0, 5, 0,
0, 0, 50, 0, 0, 9,
34, 0, 16, 0, 0, 0,
0, 0, 42, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 112, 216, 117, 63,
26, 0, 16, 0, 0, 0,
0, 0, 126, 0, 0, 141,
194, 0, 0, 128, 67, 85,
21, 0, 242, 0, 16, 0,
4, 0, 0, 0, 230, 10,
16, 0, 4, 0, 0, 0,
70, 126, 16, 0, 2, 0,
0, 0, 10, 96, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
17, 0, 0, 10, 66, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 70, 14, 16, 0,
4, 0, 0, 0, 50, 0,
0, 9, 34, 0, 16, 0,
0, 0, 0, 0, 42, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 234, 95,
23, 63, 26, 0, 16, 0,
0, 0, 0, 0, 50, 0,
0, 15, 242, 0, 16, 0,
4, 0, 0, 0, 70, 132,
32, 6, 0, 0, 0, 0,
59, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
134, 8, 16, 0, 2, 0,
0, 0, 2, 64, 0, 0,
244, 115, 75, 191, 84, 123,
135, 62, 216, 240, 110, 64,
107, 159, 226, 63, 65, 0,
0, 5, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
56, 0, 0, 10, 242, 0,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 4, 0,
0, 0, 230, 142, 32, 6,
0, 0, 0, 0, 59, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 50, 0,
0, 12, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 3, 0,
0, 0, 70, 132, 32, 6,
0, 0, 0, 0, 60, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 126, 0,
0, 141, 194, 0, 0, 128,
67, 85, 21, 0, 242, 0,
16, 0, 5, 0, 0, 0,
70, 0, 16, 0, 4, 0,
0, 0, 70, 126, 16, 0,
2, 0, 0, 0, 10, 96,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 17, 0, 0, 10,
66, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 70, 14,
16, 0, 5, 0, 0, 0,
50, 0, 0, 9, 34, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
194, 48, 83, 63, 26, 0,
16, 0, 0, 0, 0, 0,
126, 0, 0, 141, 194, 0,
0, 128, 67, 85, 21, 0,
242, 0, 16, 0, 4, 0,
0, 0, 230, 10, 16, 0,
4, 0, 0, 0, 70, 126,
16, 0, 2, 0, 0, 0,
10, 96, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 17, 0,
0, 10, 66, 0, 16, 0,
0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
70, 14, 16, 0, 4, 0,
0, 0, 50, 0, 0, 9,
34, 0, 16, 0, 0, 0,
0, 0, 42, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 6, 237, 133, 62,
26, 0, 16, 0, 0, 0,
0, 0, 50, 0, 0, 15,
242, 0, 16, 0, 4, 0,
0, 0, 70, 132, 32, 6,
0, 0, 0, 0, 59, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 134, 8,
16, 0, 2, 0, 0, 0,
2, 64, 0, 0, 6, 129,
30, 192, 151, 157, 27, 63,
139, 138, 136, 191, 90, 184,
254, 191, 65, 0, 0, 5,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 56, 0,
0, 10, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
230, 142, 32, 6, 0, 0,
0, 0, 59, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 50, 0, 0, 12,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 3, 0, 0, 0,
70, 132, 32, 6, 0, 0,
0, 0, 60, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 126, 0, 0, 141,
194, 0, 0, 128, 67, 85,
21, 0, 242, 0, 16, 0,
5, 0, 0, 0, 70, 0,
16, 0, 4, 0, 0, 0,
70, 126, 16, 0, 2, 0,
0, 0, 10, 96, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
17, 0, 0, 10, 66, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 70, 14, 16, 0,
5, 0, 0, 0, 50, 0,
0, 9, 34, 0, 16, 0,
0, 0, 0, 0, 42, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 188, 13,
191, 62, 26, 0, 16, 0,
0, 0, 0, 0, 126, 0,
0, 141, 194, 0, 0, 128,
67, 85, 21, 0, 242, 0,
16, 0, 4, 0, 0, 0,
230, 10, 16, 0, 4, 0,
0, 0, 70, 126, 16, 0,
2, 0, 0, 0, 10, 96,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 17, 0, 0, 10,
66, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 70, 14,
16, 0, 4, 0, 0, 0,
50, 0, 0, 9, 34, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
103, 184, 195, 62, 26, 0,
16, 0, 0, 0, 0, 0,
50, 0, 0, 15, 242, 0,
16, 0, 4, 0, 0, 0,
70, 132, 32, 6, 0, 0,
0, 0, 59, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 134, 8, 16, 0,
2, 0, 0, 0, 2, 64,
0, 0, 175, 210, 5, 63,
102, 20, 183, 191, 4, 5,
254, 191, 236, 251, 96, 191,
65, 0, 0, 5, 242, 0,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 4, 0,
0, 0, 56, 0, 0, 10,
242, 0, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
4, 0, 0, 0, 230, 142,
32, 6, 0, 0, 0, 0,
59, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
50, 0, 0, 12, 242, 0,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 4, 0,
0, 0, 70, 14, 16, 0,
3, 0, 0, 0, 70, 132,
32, 6, 0, 0, 0, 0,
60, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
126, 0, 0, 141, 194, 0,
0, 128, 67, 85, 21, 0,
242, 0, 16, 0, 5, 0,
0, 0, 70, 0, 16, 0,
4, 0, 0, 0, 70, 126,
16, 0, 2, 0, 0, 0,
10, 96, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 17, 0,
0, 10, 66, 0, 16, 0,
0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
70, 14, 16, 0, 5, 0,
0, 0, 50, 0, 0, 9,
34, 0, 16, 0, 0, 0,
0, 0, 42, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 103, 52, 41, 63,
26, 0, 16, 0, 0, 0,
0, 0, 126, 0, 0, 141,
194, 0, 0, 128, 67, 85,
21, 0, 242, 0, 16, 0,
4, 0, 0, 0, 230, 10,
16, 0, 4, 0, 0, 0,
70, 126, 16, 0, 2, 0,
0, 0, 10, 96, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
17, 0, 0, 10, 66, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 70, 14, 16, 0,
4, 0, 0, 0, 50, 0,
0, 9, 34, 0, 16, 0,
0, 0, 0, 0, 42, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 136, 195,
208, 62, 26, 0, 16, 0,
0, 0, 0, 0, 50, 0,
0, 15, 242, 0, 16, 0,
4, 0, 0, 0, 70, 132,
32, 6, 0, 0, 0, 0,
59, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
134, 8, 16, 0, 2, 0,
0, 0, 2, 64, 0, 0,
232, 249, 30, 64, 94, 217,
235, 191, 66, 244, 103, 62,
45, 8, 47, 192, 65, 0,
0, 5, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
56, 0, 0, 10, 242, 0,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 4, 0,
0, 0, 230, 142, 32, 6,
0, 0, 0, 0, 59, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 50, 0,
0, 12, 242, 0, 16, 0,
4, 0, 0, 0, 70, 14,
16, 0, 4, 0, 0, 0,
70, 14, 16, 0, 3, 0,
0, 0, 70, 132, 32, 6,
0, 0, 0, 0, 60, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 126, 0,
0, 141, 194, 0, 0, 128,
67, 85, 21, 0, 242, 0,
16, 0, 5, 0, 0, 0,
70, 0, 16, 0, 4, 0,
0, 0, 70, 126, 16, 0,
2, 0, 0, 0, 10, 96,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 17, 0, 0, 10,
66, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 70, 14,
16, 0, 5, 0, 0, 0,
50, 0, 0, 9, 34, 0,
16, 0, 0, 0, 0, 0,
42, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
56, 176, 179, 62, 26, 0,
16, 0, 0, 0, 0, 0,
126, 0, 0, 141, 194, 0,
0, 128, 67, 85, 21, 0,
242, 0, 16, 0, 4, 0,
0, 0, 230, 10, 16, 0,
4, 0, 0, 0, 70, 126,
16, 0, 2, 0, 0, 0,
10, 96, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 17, 0,
0, 10, 66, 0, 16, 0,
0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
70, 14, 16, 0, 4, 0,
0, 0, 50, 0, 0, 9,
34, 0, 16, 0, 0, 0,
0, 0, 42, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 215, 190, 158, 62,
26, 0, 16, 0, 0, 0,
0, 0, 50, 0, 0, 15,
242, 0, 16, 0, 2, 0,
0, 0, 70, 132, 32, 6,
0, 0, 0, 0, 59, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 134, 8,
16, 0, 2, 0, 0, 0,
2, 64, 0, 0, 145, 237,
118, 64, 178, 144, 39, 62,
25, 199, 37, 64, 113, 86,
50, 64, 65, 0, 0, 5,
242, 0, 16, 0, 2, 0,
0, 0, 70, 14, 16, 0,
2, 0, 0, 0, 56, 0,
0, 10, 242, 0, 16, 0,
2, 0, 0, 0, 70, 14,
16, 0, 2, 0, 0, 0,
230, 142, 32, 6, 0, 0,
0, 0, 59, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 50, 0, 0, 12,
242, 0, 16, 0, 1, 0,
0, 0, 70, 14, 16, 0,
2, 0, 0, 0, 70, 14,
16, 0, 3, 0, 0, 0,
70, 132, 32, 6, 0, 0,
0, 0, 60, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 126, 0, 0, 141,
194, 0, 0, 128, 67, 85,
21, 0, 242, 0, 16, 0,
2, 0, 0, 0, 70, 0,
16, 0, 1, 0, 0, 0,
70, 126, 16, 0, 2, 0,
0, 0, 10, 96, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
17, 0, 0, 10, 66, 0,
16, 0, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 70, 14, 16, 0,
2, 0, 0, 0, 50, 0,
0, 9, 34, 0, 16, 0,
0, 0, 0, 0, 42, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 23, 105,
144, 62, 26, 0, 16, 0,
0, 0, 0, 0, 126, 0,
0, 141, 194, 0, 0, 128,
67, 85, 21, 0, 242, 0,
16, 0, 1, 0, 0, 0,
230, 10, 16, 0, 1, 0,
0, 0, 70, 126, 16, 0,
2, 0, 0, 0, 10, 96,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 17, 0, 0, 10,
18, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 70, 14,
16, 0, 1, 0, 0, 0,
50, 0, 0, 9, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
170, 65, 176, 62, 26, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
227, 236, 231, 60, 18, 0,
0, 1, 54, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 21, 0,
0, 1, 54, 0, 0, 5,
242, 32, 16, 0, 0, 0,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84,
148, 0, 0, 0, 144, 0,
0, 0, 6, 0, 0, 0,
0, 0, 0, 0, 2, 0,
0, 0, 106, 0, 0, 0,
1, 0, 0, 0, 5, 0,
0, 0, 2, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 4, 0, 0, 0,
4, 0, 0, 0, 10, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0
};
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.spring.boot.actuate.endpoint.metadata;
import org.apache.dubbo.config.spring.ServiceBean;
import org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor;
import org.springframework.stereotype.Component;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
import static org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistries;
/**
* Dubbo Shutdown
*
* @since 2.7.0
*/
@Component
public class DubboShutdownMetadata extends AbstractDubboMetadata {
public Map<String, Object> shutdown() throws Exception {
Map<String, Object> shutdownCountData = new LinkedHashMap<>();
// registries
int registriesCount = getRegistries().size();
// protocols
int protocolsCount = getProtocolConfigsBeanMap().size();
shutdownCountData.put("registries", registriesCount);
shutdownCountData.put("protocols", protocolsCount);
// Service Beans
Map<String, ServiceBean> serviceBeansMap = getServiceBeansMap();
if (!serviceBeansMap.isEmpty()) {
for (ServiceBean serviceBean : serviceBeansMap.values()) {
serviceBean.destroy();
}
}
shutdownCountData.put("services", serviceBeansMap.size());
// Reference Beans
ReferenceAnnotationBeanPostProcessor beanPostProcessor = getReferenceAnnotationBeanPostProcessor();
int referencesCount = beanPostProcessor.getReferenceBeans().size();
beanPostProcessor.destroy();
shutdownCountData.put("references", referencesCount);
// Set Result to complete
Map<String, Object> shutdownData = new TreeMap<>();
shutdownData.put("shutdown.count", shutdownCountData);
return shutdownData;
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2017 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package github
import (
"context"
"fmt"
)
// ProjectListOptions specifies the optional parameters to the
// OrganizationsService.ListProjects and RepositoriesService.ListProjects methods.
type ProjectListOptions struct {
// Indicates the state of the projects to return. Can be either open, closed, or all. Default: open
State string `url:"state,omitempty"`
ListOptions
}
// ListProjects lists the projects for a repo.
//
// GitHub API docs: https://developer.github.com/v3/projects/#list-repository-projects
func (s *RepositoriesService) ListProjects(ctx context.Context, owner, repo string, opt *ProjectListOptions) ([]*Project, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/projects", owner, repo)
u, err := addOptions(u, opt)
if err != nil {
return nil, nil, err
}
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
// TODO: remove custom Accept headers when APIs fully launch.
req.Header.Set("Accept", mediaTypeProjectsPreview)
var projects []*Project
resp, err := s.client.Do(ctx, req, &projects)
if err != nil {
return nil, resp, err
}
return projects, resp, nil
}
// CreateProject creates a GitHub Project for the specified repository.
//
// GitHub API docs: https://developer.github.com/v3/projects/#create-a-repository-project
func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opt *ProjectOptions) (*Project, *Response, error) {
u := fmt.Sprintf("repos/%v/%v/projects", owner, repo)
req, err := s.client.NewRequest("POST", u, opt)
if err != nil {
return nil, nil, err
}
// TODO: remove custom Accept headers when APIs fully launch.
req.Header.Set("Accept", mediaTypeProjectsPreview)
project := &Project{}
resp, err := s.client.Do(ctx, req, project)
if err != nil {
return nil, resp, err
}
return project, resp, nil
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<title>ConnectedNodeDescription Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/ConnectedNodeDescription" class="dashAnchor"></a>
<a title="ConnectedNodeDescription Protocol Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">Katana Docs</a> (99% documented)</p>
<p class="header-right"><a href="https://github.com/BendingSpoons/katana-swift"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">Katana Reference</a>
<img id="carat" src="../img/carat.png" />
ConnectedNodeDescription Protocol Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/EmptySideEffectDependencyContainer.html">EmptySideEffectDependencyContainer</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Node.html">Node</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PlasticNode.html">PlasticNode</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PlasticView.html">PlasticView</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Renderer.html">Renderer</a>
</li>
<li class="nav-group-task">
<a href="../Classes/StateMockProvider.html">StateMockProvider</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Store.html">Store</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ViewsContainer.html">ViewsContainer</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/AnimationType.html">AnimationType</a>
</li>
<li class="nav-group-task">
<a href="../Enums/AsyncActionState.html">AsyncActionState</a>
</li>
<li class="nav-group-task">
<a href="../Enums.html#/s:O6Katana9EmptyKeys">EmptyKeys</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Extensions/Array.html">Array</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/CGSize.html">CGSize</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/UIView.html">UIView</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/Action.html">Action</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ActionWithSideEffect.html">ActionWithSideEffect</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyAsyncAction.html">AnyAsyncAction</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyConnectedNodeDescription.html">AnyConnectedNodeDescription</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyNode.html">AnyNode</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyNodeDescription.html">AnyNodeDescription</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyNodeDescriptionProps.html">AnyNodeDescriptionProps</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyNodeDescriptionWithChildren.html">AnyNodeDescriptionWithChildren</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyNodeDescriptionWithRefProps.html">AnyNodeDescriptionWithRefProps</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyPlasticNodeDescription.html">AnyPlasticNodeDescription</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyPlatformNativeViewWithRef.html">AnyPlatformNativeViewWithRef</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AnyStore.html">AnyStore</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/AsyncAction.html">AsyncAction</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/Childrenable.html">Childrenable</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/ConnectedNodeDescription.html">ConnectedNodeDescription</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LinkeableAction.html">LinkeableAction</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NativeViewRef.html">NativeViewRef</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NativeViewWithRef.html">NativeViewWithRef</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NodeDescription.html">NodeDescription</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NodeDescriptionProps.html">NodeDescriptionProps</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NodeDescriptionState.html">NodeDescriptionState</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NodeDescriptionWithChildren.html">NodeDescriptionWithChildren</a>
</li>
<li class="nav-group-task">
<a href="../Protocols.html#/s:P6Katana22NodeDescriptionWithRef">NodeDescriptionWithRef</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/NodeDescriptionWithRefProps.html">NodeDescriptionWithRefProps</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/PlasticNodeDescription.html">PlasticNodeDescription</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/PlasticReferenceSizeable.html">PlasticReferenceSizeable</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/PlatformNativeView.html">PlatformNativeView</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/SideEffectDependencyContainer.html">SideEffectDependencyContainer</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/State.html">State</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/ActionLinker.html">ActionLinker</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ActionLinks.html">ActionLinks</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Anchor.html">Anchor</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Anchor/Kind.html">– Kind</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Animation.html">Animation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/AnimationContainer.html">AnimationContainer</a>
</li>
<li class="nav-group-task">
<a href="../Structs/AnimationOptions.html">AnimationOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/AnimationProps.html">AnimationProps</a>
</li>
<li class="nav-group-task">
<a href="../Structs/ChildrenAnimations.html">ChildrenAnimations</a>
</li>
<li class="nav-group-task">
<a href="../Structs/EdgeInsets.html">EdgeInsets</a>
</li>
<li class="nav-group-task">
<a href="../Structs/EmptyProps.html">EmptyProps</a>
</li>
<li class="nav-group-task">
<a href="../Structs/EmptyState.html">EmptyState</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Size.html">Size</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Value.html">Value</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Typealiases.html">Typealiases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana25AnimationPropsTransformer">AnimationPropsTransformer</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana21AnyRefCallbackClosure">AnyRefCallbackClosure</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana20NodeUpdateCompletion">NodeUpdateCompletion</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana18RefCallbackClosure">RefCallbackClosure</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana13StoreDispatch">StoreDispatch</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana13StoreListener">StoreListener</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana15StoreMiddleware">StoreMiddleware</a>
</li>
<li class="nav-group-task">
<a href="../Typealiases.html#/s:6Katana16StoreUnsubscribe">StoreUnsubscribe</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Associated Types.html">Associated Types</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Associated Types.html#/s:P6Katana27NodeDescriptionWithChildren9PropsType">PropsType</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ConnectedNodeDescription</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">ConnectedNodeDescription</span><span class="p">:</span> <span class="kt"><a href="../Protocols/AnyConnectedNodeDescription.html">AnyConnectedNodeDescription</a></span><span class="p">,</span> <span class="kt"><a href="../Protocols/NodeDescription.html">NodeDescription</a></span></code></pre>
</div>
</div>
<p>In applications developed with Katana, the application information is stored in a central Store.
There are cases where you want to take pieces of information from the central store and use them in your UI.
<code>ConnectedNodeDescription</code> is the protocol that is used to implement this behaviour.</p>
<p>By implementing this protocol in a description you get two behaviours: store information merging and automatic UI update.</p>
<p><a href='#merge-description-39-s-props-and-store-39-s-state' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h3 id='merge-description-39-s-props-and-store-39-s-state'>Merge description’s props and Store’s state</h3></p>
<p>Every time there is an UI update (e.g., because either props or state are changed), Katana allows you to
inject in the props information that are taken from the central Store. You can use the <code>connect</code>
method to implement this behaviour.</p>
<p><a href='#automatic-ui-update' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h3 id='automatic-ui-update'>Automatic UI update</h3></p>
<p>Every time the Store’s state changes, you may want to update the UI. When you adopt the <code>ConnectedNodeDescription</code>
protocol, Katana will trigger an UI update to all the nodes that are related to the description.
The system will search for all the nodes that have a description that implements this protocol. It will then
calculate the new props, by invoking <code>connect</code>. If the properties are changed, then the UI update is triggered.
In this way we are able to effectively trigger UI changes only where and when needed.</p>
<div class="aside aside-see-also">
<p class="aside-title">See also</p>
<code><a href="../Classes/Store.html">Store</a></code>
</div>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:ZFP6Katana24ConnectedNodeDescription7connectFT5propsRwx9PropsType2towx10StoreState_T_"></a>
<a name="//apple_ref/swift/Method/connect(props:to:)" class="dashAnchor"></a>
<a class="token" href="#/s:ZFP6Katana24ConnectedNodeDescription7connectFT5propsRwx9PropsType2towx10StoreState_T_">connect(props:to:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>This method is used to update the properties with pieces of information taken from the
central Store state.</p>
<p>The idea of this method is that it takes the properties defined by the parent in the
<code>childrenDescriptions</code> method and the store state.
The implementation should update the props with all the information that are needed to properly
render the UI.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">connect</span><span class="p">(</span><span class="nv">props</span><span class="p">:</span> <span class="k">inout</span> <span class="kt"><a href="../Associated Types.html#/s:P6Katana27NodeDescriptionWithChildren9PropsType">PropsType</a></span><span class="p">,</span> <span class="n">to</span> <span class="nv">storeState</span><span class="p">:</span> <span class="kt"><a href="../Protocols/ConnectedNodeDescription.html#/s:P6Katana24ConnectedNodeDescription10StoreState">StoreState</a></span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>props</em>
</code>
</td>
<td>
<div>
<p>the props defined by the parent</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>storeState</em>
</code>
</td>
<td>
<div>
<p>the state of the Store</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="slightly-smaller">
<a href="https://github.com/BendingSpoons/katana-swift/tree/0.8.10/Katana/Core/StoreConnection/ConnectedNodeDescription.swift#L59">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:P6Katana24ConnectedNodeDescription10StoreState"></a>
<a name="//apple_ref/swift/Alias/StoreState" class="dashAnchor"></a>
<a class="token" href="#/s:P6Katana24ConnectedNodeDescription10StoreState">StoreState</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The State used in the application</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="k">associatedtype</span> <span class="kt">StoreState</span><span class="p">:</span> <span class="kt"><a href="../Protocols/State.html">State</a></span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/BendingSpoons/katana-swift/tree/0.8.10/Katana/Core/StoreConnection/ConnectedNodeDescription.swift#L45">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:ZFE6KatanaPS_24ConnectedNodeDescription10anyConnectFT11parentPropsP_10storeStateP__P_"></a>
<a name="//apple_ref/swift/Method/anyConnect(parentProps:storeState:)" class="dashAnchor"></a>
<a class="token" href="#/s:ZFE6KatanaPS_24ConnectedNodeDescription10anyConnectFT11parentPropsP_10storeStateP__P_">anyConnect(parentProps:storeState:)</a>
</code>
<span class="declaration-note">
Extension method
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Default implementation of <code>anyConnect</code>. It invokes <code><a href="../Protocols/ConnectedNodeDescription.html#/s:ZFP6Katana24ConnectedNodeDescription7connectFT5propsRwx9PropsType2towx10StoreState_T_">connect(props:to:)</a></code> by casting the parameters
to the proper types.</p>
<div class="aside aside-see-also">
<p class="aside-title">See also</p>
<code><a href="../Protocols/AnyConnectedNodeDescription.html">AnyConnectedNodeDescription</a></code>
</div>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">anyConnect</span><span class="p">(</span><span class="nv">parentProps</span><span class="p">:</span> <span class="kt">Any</span><span class="p">,</span> <span class="nv">storeState</span><span class="p">:</span> <span class="kt">Any</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Any</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/BendingSpoons/katana-swift/tree/0.8.10/Katana/Core/StoreConnection/ConnectedNodeDescription.swift#L69-L78">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2017 <a class="link" href="http://bendingspoons.com" target="_blank" rel="external">Bending Spoons Team</a>. All rights reserved. (Last updated: 2017-07-31)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
| {
"pile_set_name": "Github"
} |
/******************************************************************************
*
* Copyright (C) 2014 - 2015 Xilinx, Inc. All rights reserved.
*
* 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.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* 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
* XILINX 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.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/*****************************************************************************/
/**
*
* @file xreg_cortexr5.h
*
* This header file contains definitions for using inline assembler code. It is
* written specifically for the GNU, IAR, ARMCC compiler.
*
* All of the ARM Cortex R5 GPRs, SPRs, and Debug Registers are defined along
* with the positions of the bits within the registers.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- -------- -------- -----------------------------------------------
* 5.00 pkp 02/10/14 Initial version
* </pre>
*
******************************************************************************/
#ifndef XREG_CORTEXR5_H /* prevent circular inclusions */
#define XREG_CORTEXR5_H /* by using protection macros */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* GPRs */
#define XREG_GPR0 r0
#define XREG_GPR1 r1
#define XREG_GPR2 r2
#define XREG_GPR3 r3
#define XREG_GPR4 r4
#define XREG_GPR5 r5
#define XREG_GPR6 r6
#define XREG_GPR7 r7
#define XREG_GPR8 r8
#define XREG_GPR9 r9
#define XREG_GPR10 r10
#define XREG_GPR11 r11
#define XREG_GPR12 r12
#define XREG_GPR13 r13
#define XREG_GPR14 r14
#define XREG_GPR15 r15
#define XREG_CPSR cpsr
/* Coprocessor number defines */
#define XREG_CP0 0
#define XREG_CP1 1
#define XREG_CP2 2
#define XREG_CP3 3
#define XREG_CP4 4
#define XREG_CP5 5
#define XREG_CP6 6
#define XREG_CP7 7
#define XREG_CP8 8
#define XREG_CP9 9
#define XREG_CP10 10
#define XREG_CP11 11
#define XREG_CP12 12
#define XREG_CP13 13
#define XREG_CP14 14
#define XREG_CP15 15
/* Coprocessor control register defines */
#define XREG_CR0 cr0
#define XREG_CR1 cr1
#define XREG_CR2 cr2
#define XREG_CR3 cr3
#define XREG_CR4 cr4
#define XREG_CR5 cr5
#define XREG_CR6 cr6
#define XREG_CR7 cr7
#define XREG_CR8 cr8
#define XREG_CR9 cr9
#define XREG_CR10 cr10
#define XREG_CR11 cr11
#define XREG_CR12 cr12
#define XREG_CR13 cr13
#define XREG_CR14 cr14
#define XREG_CR15 cr15
/* Current Processor Status Register (CPSR) Bits */
#define XREG_CPSR_THUMB_MODE 0x20U
#define XREG_CPSR_MODE_BITS 0x1FU
#define XREG_CPSR_SYSTEM_MODE 0x1FU
#define XREG_CPSR_UNDEFINED_MODE 0x1BU
#define XREG_CPSR_DATA_ABORT_MODE 0x17U
#define XREG_CPSR_SVC_MODE 0x13U
#define XREG_CPSR_IRQ_MODE 0x12U
#define XREG_CPSR_FIQ_MODE 0x11U
#define XREG_CPSR_USER_MODE 0x10U
#define XREG_CPSR_IRQ_ENABLE 0x80U
#define XREG_CPSR_FIQ_ENABLE 0x40U
#define XREG_CPSR_N_BIT 0x80000000U
#define XREG_CPSR_Z_BIT 0x40000000U
#define XREG_CPSR_C_BIT 0x20000000U
#define XREG_CPSR_V_BIT 0x10000000U
/*MPU region definitions*/
#define REGION_32B 0x00000004U
#define REGION_64B 0x00000005U
#define REGION_128B 0x00000006U
#define REGION_256B 0x00000007U
#define REGION_512B 0x00000008U
#define REGION_1K 0x00000009U
#define REGION_2K 0x0000000AU
#define REGION_4K 0x0000000BU
#define REGION_8K 0x0000000CU
#define REGION_16K 0x0000000DU
#define REGION_32K 0x0000000EU
#define REGION_64K 0x0000000FU
#define REGION_128K 0x00000010U
#define REGION_256K 0x00000011U
#define REGION_512K 0x00000012U
#define REGION_1M 0x00000013U
#define REGION_2M 0x00000014U
#define REGION_4M 0x00000015U
#define REGION_8M 0x00000016U
#define REGION_16M 0x00000017U
#define REGION_32M 0x00000018U
#define REGION_64M 0x00000019U
#define REGION_128M 0x0000001AU
#define REGION_256M 0x0000001BU
#define REGION_512M 0x0000001CU
#define REGION_1G 0x0000001DU
#define REGION_2G 0x0000001EU
#define REGION_4G 0x0000001FU
#define REGION_EN 0x00000001U
#define SHAREABLE 0x00000004U /*shareable */
#define STRONG_ORDERD_SHARED 0x00000000U /*strongly ordered, always shareable*/
#define DEVICE_SHARED 0x00000001U /*device, shareable*/
#define DEVICE_NONSHARED 0x00000010U /*device, non shareable*/
#define NORM_NSHARED_WT_NWA 0x00000002U /*Outer and Inner write-through, no write-allocate non-shareable*/
#define NORM_SHARED_WT_NWA 0x00000006U /*Outer and Inner write-through, no write-allocate shareable*/
#define NORM_NSHARED_WB_NWA 0x00000003U /*Outer and Inner write-back, no write-allocate non shareable*/
#define NORM_SHARED_WB_NWA 0x00000007U /*Outer and Inner write-back, no write-allocate shareable*/
#define NORM_NSHARED_NCACHE 0x00000008U /*Outer and Inner Non cacheable non shareable*/
#define NORM_SHARED_NCACHE 0x0000000CU /*Outer and Inner Non cacheable shareable*/
#define NORM_NSHARED_WB_WA 0x0000000BU /*Outer and Inner write-back non shared*/
#define NORM_SHARED_WB_WA 0x0000000FU /*Outer and Inner write-back shared*/
/* inner and outer cache policies can be combined for different combinations */
#define NORM_IN_POLICY_NCACHE 0x00000020U /*inner non cacheable*/
#define NORM_IN_POLICY_WB_WA 0x00000021U /*inner write back write allocate*/
#define NORM_IN_POLICY_WT_NWA 0x00000022U /*inner write through no write allocate*/
#define NORM_IN_POLICY_WB_NWA 0x00000023U /*inner write back no write allocate*/
#define NORM_OUT_POLICY_NCACHE 0x00000020U /*outer non cacheable*/
#define NORM_OUT_POLICY_WB_WA 0x00000028U /*outer write back write allocate*/
#define NORM_OUT_POLICY_WT_NWA 0x00000030U /*outer write through no write allocate*/
#define NORM_OUT_POLICY_WB_NWA 0x00000038U /*outer write back no write allocate*/
#define NO_ACCESS (0x00000000U<<8U) /*No access*/
#define PRIV_RW_USER_NA (0x00000001U<<8U) /*Privileged access only*/
#define PRIV_RW_USER_RO (0x00000002U<<8U) /*Writes in User mode generate permission faults*/
#define PRIV_RW_USER_RW (0x00000003U<<8U) /*Full Access*/
#define PRIV_RO_USER_NA (0x00000005U<<8U) /*Privileged eead only*/
#define PRIV_RO_USER_RO (0x00000006U<<8U) /*Privileged/User read-only*/
#define EXECUTE_NEVER (0x00000001U<<12U) /* Bit 12*/
/* CP15 defines */
/* C0 Register defines */
#define XREG_CP15_MAIN_ID "p15, 0, %0, c0, c0, 0"
#define XREG_CP15_CACHE_TYPE "p15, 0, %0, c0, c0, 1"
#define XREG_CP15_TCM_TYPE "p15, 0, %0, c0, c0, 2"
#define XREG_CP15_TLB_TYPE "p15, 0, %0, c0, c0, 3"
#define XREG_CP15_MPU_TYPE "p15, 0, %0, c0, c0, 4"
#define XREG_CP15_MULTI_PROC_AFFINITY "p15, 0, %0, c0, c0, 5"
#define XREG_CP15_PROC_FEATURE_0 "p15, 0, %0, c0, c1, 0"
#define XREG_CP15_PROC_FEATURE_1 "p15, 0, %0, c0, c1, 1"
#define XREG_CP15_DEBUG_FEATURE_0 "p15, 0, %0, c0, c1, 2"
#define XREG_CP15_MEMORY_FEATURE_0 "p15, 0, %0, c0, c1, 4"
#define XREG_CP15_MEMORY_FEATURE_1 "p15, 0, %0, c0, c1, 5"
#define XREG_CP15_MEMORY_FEATURE_2 "p15, 0, %0, c0, c1, 6"
#define XREG_CP15_MEMORY_FEATURE_3 "p15, 0, %0, c0, c1, 7"
#define XREG_CP15_INST_FEATURE_0 "p15, 0, %0, c0, c2, 0"
#define XREG_CP15_INST_FEATURE_1 "p15, 0, %0, c0, c2, 1"
#define XREG_CP15_INST_FEATURE_2 "p15, 0, %0, c0, c2, 2"
#define XREG_CP15_INST_FEATURE_3 "p15, 0, %0, c0, c2, 3"
#define XREG_CP15_INST_FEATURE_4 "p15, 0, %0, c0, c2, 4"
#define XREG_CP15_INST_FEATURE_5 "p15, 0, %0, c0, c2, 5"
#define XREG_CP15_CACHE_SIZE_ID "p15, 1, %0, c0, c0, 0"
#define XREG_CP15_CACHE_LEVEL_ID "p15, 1, %0, c0, c0, 1"
#define XREG_CP15_AUXILARY_ID "p15, 1, %0, c0, c0, 7"
#define XREG_CP15_CACHE_SIZE_SEL "p15, 2, %0, c0, c0, 0"
/* C1 Register Defines */
#define XREG_CP15_SYS_CONTROL "p15, 0, %0, c1, c0, 0"
#define XREG_CP15_AUX_CONTROL "p15, 0, %0, c1, c0, 1"
#define XREG_CP15_CP_ACCESS_CONTROL "p15, 0, %0, c1, c0, 2"
/* XREG_CP15_CONTROL bit defines */
#define XREG_CP15_CONTROL_TE_BIT 0x40000000U
#define XREG_CP15_CONTROL_AFE_BIT 0x20000000U
#define XREG_CP15_CONTROL_TRE_BIT 0x10000000U
#define XREG_CP15_CONTROL_NMFI_BIT 0x08000000U
#define XREG_CP15_CONTROL_EE_BIT 0x02000000U
#define XREG_CP15_CONTROL_HA_BIT 0x00020000U
#define XREG_CP15_CONTROL_RR_BIT 0x00004000U
#define XREG_CP15_CONTROL_V_BIT 0x00002000U
#define XREG_CP15_CONTROL_I_BIT 0x00001000U
#define XREG_CP15_CONTROL_Z_BIT 0x00000800U
#define XREG_CP15_CONTROL_SW_BIT 0x00000400U
#define XREG_CP15_CONTROL_B_BIT 0x00000080U
#define XREG_CP15_CONTROL_C_BIT 0x00000004U
#define XREG_CP15_CONTROL_A_BIT 0x00000002U
#define XREG_CP15_CONTROL_M_BIT 0x00000001U
/* C2 Register Defines */
/* Not Used */
/* C3 Register Defines */
/* Not Used */
/* C4 Register Defines */
/* Not Used */
/* C5 Register Defines */
#define XREG_CP15_DATA_FAULT_STATUS "p15, 0, %0, c5, c0, 0"
#define XREG_CP15_INST_FAULT_STATUS "p15, 0, %0, c5, c0, 1"
#define XREG_CP15_AUX_DATA_FAULT_STATUS "p15, 0, %0, c5, c1, 0"
#define XREG_CP15_AUX_INST_FAULT_STATUS "p15, 0, %0, c5, c1, 1"
/* C6 Register Defines */
#define XREG_CP15_DATA_FAULT_ADDRESS "p15, 0, %0, c6, c0, 0"
#define XREG_CP15_INST_FAULT_ADDRESS "p15, 0, %0, c6, c0, 2"
#define XREG_CP15_MPU_REG_BASEADDR "p15, 0, %0, c6, c1, 0"
#define XREG_CP15_MPU_REG_SIZE_EN "p15, 0, %0, c6, c1, 2"
#define XREG_CP15_MPU_REG_ACCESS_CTRL "p15, 0, %0, c6, c1, 4"
#define XREG_CP15_MPU_MEMORY_REG_NUMBER "p15, 0, %0, c6, c2, 0"
/* C7 Register Defines */
#define XREG_CP15_NOP "p15, 0, %0, c7, c0, 4"
#define XREG_CP15_INVAL_IC_POU "p15, 0, %0, c7, c5, 0"
#define XREG_CP15_INVAL_IC_LINE_MVA_POU "p15, 0, %0, c7, c5, 1"
/* The CP15 register access below has been deprecated in favor of the new
* isb instruction in Cortex R5.
*/
#define XREG_CP15_INST_SYNC_BARRIER "p15, 0, %0, c7, c5, 4"
#define XREG_CP15_INVAL_BRANCH_ARRAY "p15, 0, %0, c7, c5, 6"
#define XREG_CP15_INVAL_BRANCH_ARRAY_LINE "p15, 0, %0, c7, c5, 7"
#define XREG_CP15_INVAL_DC_LINE_MVA_POC "p15, 0, %0, c7, c6, 1"
#define XREG_CP15_INVAL_DC_LINE_SW "p15, 0, %0, c7, c6, 2"
#define XREG_CP15_CLEAN_DC_LINE_MVA_POC "p15, 0, %0, c7, c10, 1"
#define XREG_CP15_CLEAN_DC_LINE_SW "p15, 0, %0, c7, c10, 2"
#define XREG_CP15_INVAL_DC_ALL "p15, 0, %0, c15, c5, 0"
/* The next two CP15 register accesses below have been deprecated in favor
* of the new dsb and dmb instructions in Cortex R5.
*/
#define XREG_CP15_DATA_SYNC_BARRIER "p15, 0, %0, c7, c10, 4"
#define XREG_CP15_DATA_MEMORY_BARRIER "p15, 0, %0, c7, c10, 5"
#define XREG_CP15_CLEAN_DC_LINE_MVA_POU "p15, 0, %0, c7, c11, 1"
#define XREG_CP15_NOP2 "p15, 0, %0, c7, c13, 1"
#define XREG_CP15_CLEAN_INVAL_DC_LINE_MVA_POC "p15, 0, %0, c7, c14, 1"
#define XREG_CP15_CLEAN_INVAL_DC_LINE_SW "p15, 0, %0, c7, c14, 2"
/* C8 Register Defines */
/* Not Used */
/* C9 Register Defines */
#define XREG_CP15_ATCM_REG_SIZE_ADDR "p15, 0, %0, c9, c1, 1"
#define XREG_CP15_BTCM_REG_SIZE_ADDR "p15, 0, %0, c9, c1, 0"
#define XREG_CP15_TCM_SELECTION "p15, 0, %0, c9, c2, 0"
#define XREG_CP15_PERF_MONITOR_CTRL "p15, 0, %0, c9, c12, 0"
#define XREG_CP15_COUNT_ENABLE_SET "p15, 0, %0, c9, c12, 1"
#define XREG_CP15_COUNT_ENABLE_CLR "p15, 0, %0, c9, c12, 2"
#define XREG_CP15_V_FLAG_STATUS "p15, 0, %0, c9, c12, 3"
#define XREG_CP15_SW_INC "p15, 0, %0, c9, c12, 4"
#define XREG_CP15_EVENT_CNTR_SEL "p15, 0, %0, c9, c12, 5"
#define XREG_CP15_PERF_CYCLE_COUNTER "p15, 0, %0, c9, c13, 0"
#define XREG_CP15_EVENT_TYPE_SEL "p15, 0, %0, c9, c13, 1"
#define XREG_CP15_PERF_MONITOR_COUNT "p15, 0, %0, c9, c13, 2"
#define XREG_CP15_USER_ENABLE "p15, 0, %0, c9, c14, 0"
#define XREG_CP15_INTR_ENABLE_SET "p15, 0, %0, c9, c14, 1"
#define XREG_CP15_INTR_ENABLE_CLR "p15, 0, %0, c9, c14, 2"
/* C10 Register Defines */
/* Not used */
/* C11 Register Defines */
/* Not used */
/* C12 Register Defines */
/* Not used */
/* C13 Register Defines */
#define XREG_CP15_CONTEXT_ID "p15, 0, %0, c13, c0, 1"
#define USER_RW_THREAD_PID "p15, 0, %0, c13, c0, 2"
#define USER_RO_THREAD_PID "p15, 0, %0, c13, c0, 3"
#define USER_PRIV_THREAD_PID "p15, 0, %0, c13, c0, 4"
/* C14 Register Defines */
/* not used */
/* C15 Register Defines */
#define XREG_CP15_SEC_AUX_CTRL "p15, 0, %0, c15, c0, 0"
/* MPE register definitions */
#define XREG_FPSID c0
#define XREG_FPSCR c1
#define XREG_MVFR1 c6
#define XREG_MVFR0 c7
#define XREG_FPEXC c8
#define XREG_FPINST c9
#define XREG_FPINST2 c10
/* FPSID bits */
#define XREG_FPSID_IMPLEMENTER_BIT (24U)
#define XREG_FPSID_IMPLEMENTER_MASK (0x000000FFU << FPSID_IMPLEMENTER_BIT)
#define XREG_FPSID_SOFTWARE (0X00000001U << 23U)
#define XREG_FPSID_ARCH_BIT (16U)
#define XREG_FPSID_ARCH_MASK (0x0000000FU << FPSID_ARCH_BIT)
#define XREG_FPSID_PART_BIT (8U)
#define XREG_FPSID_PART_MASK (0x000000FFU << FPSID_PART_BIT)
#define XREG_FPSID_VARIANT_BIT (4U)
#define XREG_FPSID_VARIANT_MASK (0x0000000FU << FPSID_VARIANT_BIT)
#define XREG_FPSID_REV_BIT (0U)
#define XREG_FPSID_REV_MASK (0x0000000FU << FPSID_REV_BIT)
/* FPSCR bits */
#define XREG_FPSCR_N_BIT (0X00000001U << 31U)
#define XREG_FPSCR_Z_BIT (0X00000001U << 30U)
#define XREG_FPSCR_C_BIT (0X00000001U << 29U)
#define XREG_FPSCR_V_BIT (0X00000001U << 28U)
#define XREG_FPSCR_QC (0X00000001U << 27U)
#define XREG_FPSCR_AHP (0X00000001U << 26U)
#define XREG_FPSCR_DEFAULT_NAN (0X00000001U << 25U)
#define XREG_FPSCR_FLUSHTOZERO (0X00000001U << 24U)
#define XREG_FPSCR_ROUND_NEAREST (0X00000000U << 22U)
#define XREG_FPSCR_ROUND_PLUSINF (0X00000001U << 22U)
#define XREG_FPSCR_ROUND_MINUSINF (0X00000002U << 22U)
#define XREG_FPSCR_ROUND_TOZERO (0X00000003U << 22U)
#define XREG_FPSCR_RMODE_BIT (22U)
#define XREG_FPSCR_RMODE_MASK (0X00000003U << FPSCR_RMODE_BIT)
#define XREG_FPSCR_STRIDE_BIT (20U)
#define XREG_FPSCR_STRIDE_MASK (0X00000003U << FPSCR_STRIDE_BIT)
#define XREG_FPSCR_LENGTH_BIT (16U)
#define XREG_FPSCR_LENGTH_MASK (0X00000007U << FPSCR_LENGTH_BIT)
#define XREG_FPSCR_IDC (0X00000001U << 7U)
#define XREG_FPSCR_IXC (0X00000001U << 4U)
#define XREG_FPSCR_UFC (0X00000001U << 3U)
#define XREG_FPSCR_OFC (0X00000001U << 2U)
#define XREG_FPSCR_DZC (0X00000001U << 1U)
#define XREG_FPSCR_IOC (0X00000001U << 0U)
/* MVFR0 bits */
#define XREG_MVFR0_RMODE_BIT (28U)
#define XREG_MVFR0_RMODE_MASK (0x0000000FU << XREG_MVFR0_RMODE_BIT)
#define XREG_MVFR0_SHORT_VEC_BIT (24U)
#define XREG_MVFR0_SHORT_VEC_MASK (0x0000000FU << XREG_MVFR0_SHORT_VEC_BIT)
#define XREG_MVFR0_SQRT_BIT (20U)
#define XREG_MVFR0_SQRT_MASK (0x0000000FU << XREG_MVFR0_SQRT_BIT)
#define XREG_MVFR0_DIVIDE_BIT (16U)
#define XREG_MVFR0_DIVIDE_MASK (0x0000000FU << XREG_MVFR0_DIVIDE_BIT)
#define XREG_MVFR0_EXEC_TRAP_BIT (12U)
#define XREG_MVFR0_EXEC_TRAP_MASK (0x0000000FU << XREG_MVFR0_EXEC_TRAP_BIT)
#define XREG_MVFR0_DP_BIT (8U)
#define XREG_MVFR0_DP_MASK (0x0000000FU << XREG_MVFR0_DP_BIT)
#define XREG_MVFR0_SP_BIT (4U)
#define XREG_MVFR0_SP_MASK (0x0000000FU << XREG_MVFR0_SP_BIT)
#define XREG_MVFR0_A_SIMD_BIT (0U)
#define XREG_MVFR0_A_SIMD_MASK (0x0000000FU << MVFR0_A_SIMD_BIT)
/* FPEXC bits */
#define XREG_FPEXC_EX (0X00000001U << 31U)
#define XREG_FPEXC_EN (0X00000001U << 30U)
#define XREG_FPEXC_DEX (0X00000001U << 29U)
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* XREG_CORTEXR5_H */
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<doc>
<members>
<assembly>
<name>UnityEngine.SharedInternalsModule</name>
</assembly>
<member name="A:UnityEngine.SharedInternalsModule">
<summary>
<para>SharedInternals is a module used internally to provide low-level functionality needed by other modules.</para>
</summary>
</member>
</members>
</doc>
| {
"pile_set_name": "Github"
} |
unit RestRegister;
interface
procedure Register;
implementation
uses Classes, RestClient;
procedure Register;
begin
RegisterComponents('Rest', [TRestClient]);
end;
end.
| {
"pile_set_name": "Github"
} |
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2016-01-06 13:06-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Translate Toolkit 1.12.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: media/js/common/upload-base.js:61
msgid "The filetype you uploaded isn't recognized."
msgstr ""
#: media/js/common/upload-base.js:83
msgid "You cancelled the upload."
msgstr ""
#: media/js/common/upload-image.js:98
msgid "Images must be either PNG or JPG."
msgstr ""
#: media/js/common/upload-image.js:102
msgid "Videos must be in WebM."
msgstr ""
#: media/js/common/upload-image.js:129 media/js/common/upload-packaged-app.js:34
msgid "There was a problem contacting the server."
msgstr ""
#: media/js/common/upload-packaged-app.js:52
msgid "Select a file..."
msgstr ""
#: media/js/common/upload-packaged-app.js:53
msgid "Your packaged app should end with <code>.zip</code>."
msgstr ""
#. L10n: {0} is the percent of the file that has been uploaded.
#: media/js/common/upload-packaged-app.js:89
#, python-format
msgid "{0}% complete"
msgstr ""
#. L10n: "{bytes uploaded} of {total filesize}".
#: media/js/common/upload-packaged-app.js:92
msgid "{0} of {1}"
msgstr ""
#: media/js/common/upload-packaged-app.js:120
msgid "Cancel"
msgstr ""
#: media/js/common/upload-packaged-app.js:142
msgid "Uploading {0}"
msgstr ""
#: media/js/common/upload-packaged-app.js:164
msgid "Error with {0}"
msgstr ""
#: media/js/common/upload-packaged-app.js:169 media/js/devreg/devhub.js:203
msgid "Your app failed validation with {0} error."
msgid_plural "Your app failed validation with {0} errors."
msgstr[0] ""
msgstr[1] ""
#: media/js/common/upload-packaged-app.js:184
msgid "…and {0} more"
msgid_plural "…and {0} more"
msgstr[0] ""
msgstr[1] ""
#: media/js/common/upload-packaged-app.js:199 media/js/common/upload-packaged-app.js:325 media/js/devreg/devhub.js:165
msgid "See full validation report"
msgstr ""
#: media/js/common/upload-packaged-app.js:211
msgid "Validating {0}"
msgstr ""
#. L10n: first argument is an HTTP status code
#: media/js/common/upload-packaged-app.js:247
msgid "Received an empty response from the server; status: {0}"
msgstr ""
#: media/js/common/upload-packaged-app.js:257
msgid "Unexpected server error while validating."
msgstr ""
#: media/js/common/upload-packaged-app.js:294
msgid "Finished validating {0}"
msgstr ""
#: media/js/common/upload-packaged-app.js:300
msgid "Your app passed validation with no errors and {0} warning."
msgid_plural "Your app passed validation with no errors and {0} warnings."
msgstr[0] ""
msgstr[1] ""
#: media/js/common/upload-packaged-app.js:305
msgid "Your app passed validation with no errors or warnings."
msgstr ""
#: media/js/devreg/apps.js:84
msgid "The manifest could not be found at the given location."
msgstr ""
#: media/js/devreg/apps.js:87
msgid "App host could not be reached."
msgstr ""
#: media/js/devreg/apps.js:90
msgid "App manifest is unparsable."
msgstr ""
#: media/js/devreg/apps.js:93
msgid "App manifest is invalid."
msgstr ""
#: media/js/devreg/apps.js:96
msgid "App is already installed."
msgstr ""
#: media/js/devreg/apps.js:100
msgid "Internal server error."
msgstr ""
#: media/js/devreg/apps.js:103
msgid "Internal server error on app installation."
msgstr ""
#: media/js/devreg/apps.js:106
msgid "Install failed. Please try again later."
msgstr ""
#: media/js/devreg/devhub.js:208
msgid "Your app failed validation with {0} error and {1} message(s)."
msgid_plural "Your app failed validation with {0} errors and {1} message(s)."
msgstr[0] ""
msgstr[1] ""
#: media/js/devreg/devhub.js:222
msgid "Your app passed validation with no errors and {0} message."
msgid_plural "Your app passed validation with no errors and {0} messages."
msgstr[0] ""
msgstr[1] ""
#: media/js/devreg/devhub.js:227
msgid "Your app passed validation with no errors or messages."
msgstr ""
#: media/js/devreg/devhub.js:442
msgid "Changes Saved"
msgstr ""
#: media/js/devreg/devhub.js:458
msgid "Enter a new team member's email address"
msgstr ""
#: media/js/devreg/devhub.js:471
msgid "Manifest refreshed"
msgstr ""
#: media/js/devreg/devhub.js:476
msgid "Could not refresh manifest. Try again later."
msgstr ""
#: media/js/devreg/devhub.js:657
msgid "There was an error uploading your file."
msgstr ""
#: media/js/devreg/devhub.js:1140
msgid "Image changes being processed"
msgstr ""
#: media/js/devreg/ecosystem.js:26
msgid "This video requires a browser with support for open video "
msgstr ""
#: media/js/devreg/ecosystem.js:27
msgid "or the <a href=\"http://www.adobe.com/go/getflashplayer\">Adobe "
msgstr ""
#: media/js/devreg/ecosystem.js:28
msgid "Flash Player</a>."
msgstr ""
#: media/js/devreg/in_app_products.js:281
msgid "Enabled"
msgstr ""
#: media/js/devreg/in_app_products.js:283
msgid "Disabled"
msgstr ""
#: media/js/devreg/init.js:35
msgid "This feature is temporarily disabled while we perform website maintenance. Please check back a little later."
msgstr ""
#: media/js/devreg/l10n.js:45
msgid "Remove this localization"
msgstr ""
#: media/js/devreg/login.js:126
msgid "Persona login failed. Maybe you don't have an account under that email address?"
msgstr ""
#: media/js/devreg/login.js:131
msgid "Persona login failed. A server error was encountered."
msgstr ""
#: media/js/devreg/lookup-tool.js:39
msgid "Status successfully changed to \"{0}\""
msgstr ""
#: media/js/devreg/lookup-tool.js:44
msgid "Could not change status to \"{0}\""
msgstr ""
#: media/js/devreg/lookup-tool.js:70
msgid "Group membership \"{0}\" added"
msgstr ""
#: media/js/devreg/lookup-tool.js:84
msgid "Could not add group \"{0}\""
msgstr ""
#: media/js/devreg/lookup-tool.js:108
msgid "Group membership \"{0}\" removed"
msgstr ""
#: media/js/devreg/lookup-tool.js:114
msgid "Could not remove group \"{0}\""
msgstr ""
#: media/js/devreg/lookup-tool.js:183
msgid "Show All Results"
msgstr ""
#: media/js/devreg/lookup-tool.js:186
msgid "Over {0} results found, consider refining your search."
msgstr ""
#: media/js/devreg/manifest.js:47
msgid "Requested Permissions:"
msgstr ""
#: media/js/devreg/manifest.js:55
msgid "Certified"
msgstr ""
#: media/js/devreg/manifest.js:58
msgid "Privileged"
msgstr ""
#: media/js/devreg/manifest.js:61
msgid "Unprivileged"
msgstr ""
#: media/js/devreg/manifest.js:67
msgid "No reason given"
msgstr ""
#: media/js/devreg/overlay.js:41
msgid "OK"
msgstr ""
#: media/js/devreg/payments-enroll.js:9
msgid "Spanish Banking Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:11
msgid "Irish Sort Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:13
msgid "Belgian Sort Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:15
msgid "Spanish/French/Italian/Dutch Banking Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:17
msgid "Dutch/US Sort Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:19
msgid "Canadian Transit Number/German Routing Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:21
msgid "Korean Bank and Branch/Indonesian Bank Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:23
msgid "Greek HEBIC/Indonesian Bank Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:25
msgid "UK/Irish Sort Code or NZ Account Prefix or Australian BSB Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:27
msgid "Austrian/Swiss Bank Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:29
msgid "Danish/Swiss Bank Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:31
msgid "Swiss/Iraqi Bank Code"
msgstr ""
#: media/js/devreg/payments-enroll.js:33
msgid "Iraqi Bank Code"
msgstr ""
#. L10n: {0} is the name of a bank detected from the bank account code.
#: media/js/devreg/payments-enroll.js:136
msgid "Detected: {0}"
msgstr ""
#. L10n: This sentence introduces a list of applications.
#: media/js/devreg/payments-manage.js:32
msgid "Deleting payment account \"{0}\" will remove the payment account from the following apps. Applications without a payment account will no longer be available for sale."
msgid_plural "Deleting payment account \"{0}\" will remove the payment account from the following app. Applications without a payment account will no longer be available for sale."
msgstr[0] ""
msgstr[1] ""
#: media/js/devreg/payments-manage.js:45
msgid "{appName} payment accounts:"
msgstr ""
#: media/js/devreg/payments-manage.js:112 media/js/devreg/payments-manage.js:175 media/js/devreg/validator.js:191 media/js/devreg/validator.js:437 media/js/devreg/validator.js:456
#: media/js/devreg/reviewers/buttons.js:85 media/js/devreg/reviewers/buttons.js:94
msgid "Error"
msgstr ""
#: media/js/devreg/payments-manage.js:113 media/js/devreg/payments-manage.js:176
msgid "There was a problem contacting the payment server."
msgstr ""
#: media/js/devreg/payments-manage.js:143
msgid "Authentication error"
msgstr ""
#: media/js/devreg/payments-manage.js:199
msgid "You do not currently have any payment accounts."
msgstr ""
#: media/js/devreg/suggestions.js:66
msgid "Search themes for <b>{0}</b>"
msgstr ""
#: media/js/devreg/suggestions.js:68
msgid "Search apps for <b>{0}</b>"
msgstr ""
#: media/js/devreg/suggestions.js:70
msgid "Search add-ons for <b>{0}</b>"
msgstr ""
#. L10n: {0} is the number of characters left.
#: media/js/devreg/utils.js:89
msgid "{0} character left."
msgid_plural "{0} characters left."
msgstr[0] ""
msgstr[1] ""
#: media/js/devreg/validator.js:71
msgid "All tests passed successfully."
msgstr ""
#: media/js/devreg/validator.js:74 media/js/devreg/validator.js:356
msgid "These tests were not run."
msgstr ""
#: media/js/devreg/validator.js:117 media/js/devreg/validator.js:130
msgid "Tests"
msgstr ""
#: media/js/devreg/validator.js:192
msgid "Warning"
msgstr ""
#: media/js/devreg/validator.js:279
msgid "Compatibility Tests"
msgstr ""
#: media/js/devreg/validator.js:327
msgid "App failed validation."
msgstr ""
#: media/js/devreg/validator.js:329
msgid "App passed validation."
msgstr ""
#: media/js/devreg/validator.js:359
msgid "{0} error"
msgid_plural "{0} errors"
msgstr[0] ""
msgstr[1] ""
#: media/js/devreg/validator.js:361
msgid "{0} warning"
msgid_plural "{0} warnings"
msgstr[0] ""
msgstr[1] ""
#: media/js/devreg/validator.js:439
msgid "Validation task could not complete or completed with errors"
msgstr ""
#: media/js/devreg/validator.js:457
msgid "Internal server error"
msgstr ""
#: media/js/devreg/reviewers/buttons.js:38
msgid "Purchasing"
msgstr ""
#: media/js/devreg/reviewers/buttons.js:44
msgid "Purchased"
msgstr ""
#: media/js/devreg/reviewers/buttons.js:70
msgid "Launch"
msgstr ""
#: media/js/devreg/reviewers/editors.js:138
msgid "{name} was viewing this page first."
msgstr ""
#: media/js/devreg/reviewers/editors.js:188
msgid "Receipt checked by app."
msgstr ""
#: media/js/devreg/reviewers/editors.js:190
msgid "Receipt was not checked by app."
msgstr ""
#: media/js/devreg/reviewers/editors.js:241
msgid "{name} was viewing this app first."
msgstr ""
#: media/js/devreg/reviewers/editors.js:252
msgid "Loading…"
msgstr ""
#: media/js/devreg/reviewers/editors.js:257
msgid "Version Notes"
msgstr ""
#: media/js/devreg/reviewers/editors.js:262
msgid "Notes for Reviewers"
msgstr ""
#: media/js/devreg/reviewers/editors.js:267
msgid "No version notes found"
msgstr ""
#: media/js/devreg/reviewers/editors.js:292
msgid "Select an application first"
msgstr ""
#: media/js/devreg/reviewers/editors.js:356
msgid "Error loading translation"
msgstr ""
#: media/js/devreg/reviewers/expandable.js:15
msgid "more..."
msgstr ""
#: media/js/devreg/reviewers/expandable.js:18
msgid "less..."
msgstr ""
#: media/js/devreg/reviewers/mobile_review_actions.js:7
msgid "Keep review / Remove flags"
msgstr ""
#: media/js/devreg/reviewers/mobile_review_actions.js:8
msgid "Delete review"
msgstr ""
#: media/js/devreg/reviewers/mobile_review_actions.js:9
msgid "Skip for now"
msgstr ""
#: media/js/devreg/reviewers/payments.js:69
msgid "Payment failed. Try again later."
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:97
msgid "Packaged App"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:101
msgid "Privileged App"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:104
msgid "More Information Requested"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:107
msgid "Contains Editor Comment"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:111
msgid "Premium App"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:114
msgid "Escalated"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:122
msgid "Free"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:219
msgid "Any"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:246 media/js/devreg/reviewers/reviewers.js:297
msgid "Approved app: {app}"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:249 media/js/devreg/reviewers/reviewers.js:300
msgid "Rejected app: {app}"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:255
msgid "Error approving app: {app}"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:256
msgid "Error rejecting app: {app}"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:307
msgid "Error passing app: {app}"
msgstr ""
#: media/js/devreg/reviewers/reviewers.js:308
msgid "Error failing app: {app}"
msgstr ""
#: media/js/devreg/reviewers/reviewers_commbadge.js:66
msgid "Sorry! We had an error fetching the review history. Please try logging in again.<p>"
msgstr ""
#. L10n: {0} is author of note, {1} is a datetime. (e.g., "by Kevin on Feburary
#. 18th 2014 12:12 pm").
#: media/js/devreg/reviewers/reviewers_commbadge.js:86
msgid "By {0} on {1}"
msgstr ""
| {
"pile_set_name": "Github"
} |
//------------------------------------------------------------------
//
// @@@ START COPYRIGHT @@@
//
// 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.
//
// @@@ END COPYRIGHT @@@
//
// IMPLEMENTATION-NOTES:
// Use pthread primitives directly
//
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/unistd.h> // gettid
#include "threadtlsx.h"
#include "util.h"
#define gettid() static_cast<pid_t>(syscall(__NR_gettid))
//
// SB_trace_assert_fun will be called instead of SB_util_assert_fun
//
#define SB_util_assert_fun SB_thread_assert_fun
enum { MAX_TLS_KEYS = 100 };
typedef struct SB_TLS_Key_Info_Type {
const char *ip_desc;
} SB_TLS_Key_Info_Type;
SB_TLS_Key_Info_Type ga_sb_tls_keys[MAX_TLS_KEYS];
bool gv_sb_tls_inited = false;
int gv_sb_tls_key_max = MAX_TLS_KEYS;
const char *gp_sb_tls_key_null = "";
pthread_mutex_t gv_sb_tls_mutex = PTHREAD_MUTEX_INITIALIZER;
void SB_thread_assert_fun(const char *pp_exp,
const char *pp_file,
unsigned pv_line,
const char *pp_fun) {
char la_buf[512];
char la_cmdline[512];
FILE *lp_file;
char *lp_s;
lp_file = fopen("/proc/self/cmdline", "r");
if (lp_file != NULL) {
lp_s = fgets(la_cmdline, sizeof(la_cmdline), lp_file);
fclose(lp_file);
} else
lp_s = NULL;
if (lp_s == NULL)
lp_s = const_cast<char *>("<unknown>");
sprintf(la_buf, "%s (%d-%d): %s:%u %s: Assertion '%s' failed.\n",
lp_s,
getpid(), gettid(),
pp_file, pv_line, pp_fun,
pp_exp);
fprintf(stderr, "%s", la_buf);
fflush(stderr);
abort(); // can't use SB_util_abort
}
void SB_add_tls_key(int pv_key, const char *pp_desc) {
int lv_inx;
int lv_status;
lv_status = pthread_mutex_lock(&gv_sb_tls_mutex);
SB_util_assert(lv_status == 0);
if (!gv_sb_tls_inited) {
gv_sb_tls_inited = true;
for (lv_inx = 0; lv_inx < MAX_TLS_KEYS; lv_inx++)
ga_sb_tls_keys[lv_inx].ip_desc = gp_sb_tls_key_null;
}
SB_util_assert(pv_key >= 0);
SB_util_assert(pv_key < MAX_TLS_KEYS);
ga_sb_tls_keys[pv_key].ip_desc = pp_desc;
lv_status = pthread_mutex_unlock(&gv_sb_tls_mutex);
SB_util_assert(lv_status == 0);
}
int SB_create_tls_key(SB_Thread::Sthr::Dtor_Function pp_dtor,
const char *pp_desc) {
pthread_key_t lv_key;
int lv_status;
lv_status = pthread_key_create(&lv_key, pp_dtor);
SB_util_assert(lv_status == 0);
SB_add_tls_key(lv_key, pp_desc);
return lv_key;
}
| {
"pile_set_name": "Github"
} |
# HTTPAccess2 - HTTP accessing library.
# Copyright (C) 2000-2007 NAKAMURA, Hiroshi <[email protected]>.
# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
# redistribute it and/or modify it under the same terms of Ruby's license;
# either the dual license version in 2003, or any later version.
# http-access2.rb is based on http-access.rb in http-access/0.0.4. Some
# part of it is copyrighted by Maebashi-san who made and published
# http-access/0.0.4. http-access/0.0.4 did not include license notice but
# when I asked Maebashi-san he agreed that I can redistribute it under the
# same terms of Ruby. Many thanks to Maebashi-san.
require 'httpclient'
module HTTPAccess2
VERSION = ::HTTPClient::VERSION
RUBY_VERSION_STRING = ::HTTPClient::RUBY_VERSION_STRING
SSLEnabled = ::HTTPClient::SSLEnabled
SSPIEnabled = ::HTTPClient::SSPIEnabled
DEBUG_SSL = true
Util = ::HTTPClient::Util
class Client < ::HTTPClient
class RetryableResponse < StandardError
end
end
SSLConfig = ::HTTPClient::SSLConfig
BasicAuth = ::HTTPClient::BasicAuth
DigestAuth = ::HTTPClient::DigestAuth
NegotiateAuth = ::HTTPClient::NegotiateAuth
AuthFilterBase = ::HTTPClient::AuthFilterBase
WWWAuth = ::HTTPClient::WWWAuth
ProxyAuth = ::HTTPClient::ProxyAuth
Site = ::HTTPClient::Site
Connection = ::HTTPClient::Connection
SessionManager = ::HTTPClient::SessionManager
SSLSocketWrap = ::HTTPClient::SSLSocket
DebugSocket = ::HTTPClient::DebugSocket
class Session < ::HTTPClient::Session
class Error < StandardError
end
class InvalidState < Error
end
class BadResponse < Error
end
class KeepAliveDisconnected < Error
end
end
end
| {
"pile_set_name": "Github"
} |
; 23
#######
#### #####
# # $ $ #
##$.#$ . . ##
## # .######
##$.#* * $ #
# . @ . #
# $ * *#.$##
######. # ##
## . . $#.$##
# $ $ # #
##### ####
#######
| {
"pile_set_name": "Github"
} |
---
name: Feature Request
about: Have an idea for something new? Tell us about it.
title: ''
labels: feature request
assignees: ''
---
_Before filing your enhancement, please search existing issues to make sure a similar one doesn't already exist. If one does, please leave a comment or reaction in support of the issue rather than creating a new one._
_To fill out the report, please leave the below headers (**) in tact, and fill out each section. If a section isn't applicable, leave it blank or write n/a under it. Please do not delete any template sections._
**What's your request?**
**What would this feature help you accomplish, and why is that important to you?**
**Have you considered any alternative solutions or features?**
---
**Any attachments or reference images? (Drag them here)**
**Are there any other products or services that do this well?**
**What's the URL to your PubPub community?**
**Who requested this? (If not you)***
| {
"pile_set_name": "Github"
} |
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
| {
"pile_set_name": "Github"
} |
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
//
// NOTE: This file is intended to be "#include" multiple times. The call site must define the macro
// "DEF_OP" to be executed for each entry.
//
#if !defined(DEF_OP)
#error DEF_OP must be defined before including this file
#endif
// Define the extended byte code opcode range
#define MACRO_EXTEND_WITH_DBG_ATTR(opcode, layout, attr, dbgAttr) DEF_OP(opcode, layout, attr, dbgAttr)
#define MACRO_EXTEND_WMS_WITH_DBG_ATTR(opcode, layout, attr, dbgAttr) DEF_OP(opcode, layout, OpHasMultiSizeLayout|attr, dbgAttr)
#include "OpCodes.h"
| {
"pile_set_name": "Github"
} |
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc. and/or its affiliates,
* and individual contributors as indicated by the @author tags.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* (C) 2010,
* @author JBoss, by Red Hat.
*/
package org.jboss.jbossts.txbridge.tests.outbound.junit;
import org.jboss.arquillian.container.test.api.*;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.jbossts.txbridge.tests.common.AbstractBasicTests;
import org.jboss.jbossts.txbridge.tests.outbound.client.TestClient;
import org.jboss.jbossts.txbridge.tests.outbound.service.TestServiceImpl;
import org.jboss.jbossts.txbridge.tests.outbound.utility.TestDurableParticipant;
import org.jboss.jbossts.txbridge.tests.outbound.utility.TestVolatileParticipant;
import org.jboss.shrinkwrap.api.Archive;
import org.junit.*;
import org.jboss.byteman.contrib.dtest.*;
import org.junit.runner.RunWith;
import com.arjuna.ats.arjuna.coordinator.BasicAction;
import com.arjuna.mwlabs.wst.at.participants.VolatileTwoPhaseCommitParticipant;
import java.net.URL;
/**
* Basic (i.e. non-crashrec) test cases for the outbound side of the transaction bridge.
*
* @author Jonathan Halliday ([email protected]) 2010-05
* @author Ivo Studensky ([email protected])
*/
@RunWith(Arquillian.class)
@RunAsClient
public class OutboundBasicTests extends AbstractBasicTests {
@Deployment(name = OUTBOUND_SERVICE_DEPLOYMENT_NAME, testable = false)
@TargetsContainer(CONTAINER)
public static Archive<?> createServiceArchive() {
return getOutboundServiceArchive();
}
@Deployment(name = OUTBOUND_CLIENT_DEPLOYMENT_NAME, testable = false)
@TargetsContainer(CONTAINER)
public static Archive<?> createClientArchive() {
return getOutboundClientArchive();
}
@ArquillianResource
private ContainerController controller;
private InstrumentedClass instrumentedTestVolatileParticipant;
private InstrumentedClass instrumentedTestDurableParticipant;
@Before
public void setUp() throws Exception {
// start up the appserver
controller.start(CONTAINER);
instrumentor.setRedirectedSubmissionsFile(null);
instrumentedTestVolatileParticipant = instrumentor.instrumentClass(TestVolatileParticipant.class);
instrumentedTestDurableParticipant = instrumentor.instrumentClass(TestDurableParticipant.class);
instrumentor.injectOnCall(TestServiceImpl.class, "doNothing", "$0.enlistVolatileParticipant(1), $0.enlistDurableParticipant(1)");
}
@After
public void tearDown() throws Exception {
instrumentor.removeAllInstrumentation();
// shut down the appserver
controller.stop(CONTAINER);
}
@Test
@OperateOnDeployment(OUTBOUND_CLIENT_DEPLOYMENT_NAME)
public void testRollback(@ArquillianResource URL baseURL) throws Exception {
execute(baseURL.toString() + TestClient.URL_PATTERN);
instrumentedTestVolatileParticipant.assertKnownInstances(1);
instrumentedTestVolatileParticipant.assertMethodNotCalled("prepare");
instrumentedTestVolatileParticipant.assertMethodNotCalled("commit");
instrumentedTestVolatileParticipant.assertMethodCalled("rollback");
instrumentedTestDurableParticipant.assertKnownInstances(1);
instrumentedTestDurableParticipant.assertMethodNotCalled("prepare");
instrumentedTestDurableParticipant.assertMethodNotCalled("commit");
instrumentedTestDurableParticipant.assertMethodCalled("rollback");
}
@Test
@OperateOnDeployment(OUTBOUND_CLIENT_DEPLOYMENT_NAME)
public void testCommit(@ArquillianResource URL baseURL) throws Exception {
instrumentor.injectOnCall(TestClient.class, "terminateTransaction", "$1 = true"); // shouldCommit=true
execute(baseURL.toString() + TestClient.URL_PATTERN);
instrumentedTestVolatileParticipant.assertKnownInstances(1);
instrumentedTestVolatileParticipant.assertMethodCalled("prepare");
instrumentedTestVolatileParticipant.assertMethodCalled("commit");
instrumentedTestVolatileParticipant.assertMethodNotCalled("rollback");
instrumentedTestDurableParticipant.assertKnownInstances(1);
instrumentedTestDurableParticipant.assertMethodCalled("prepare");
instrumentedTestDurableParticipant.assertMethodCalled("commit");
instrumentedTestDurableParticipant.assertMethodNotCalled("rollback");
}
@Test
@OperateOnDeployment(OUTBOUND_CLIENT_DEPLOYMENT_NAME)
public void testBeforeCompletionFailure(@ArquillianResource URL baseURL) throws Exception {
instrumentor.injectOnCall(TestVolatileParticipant.class, "prepare", "return new com.arjuna.wst.Aborted()");
instrumentor.injectOnCall(TestClient.class, "terminateTransaction", "$1 = true"); // shouldCommit=true
execute(baseURL.toString() + TestClient.URL_PATTERN);
instrumentedTestVolatileParticipant.assertKnownInstances(1);
instrumentedTestVolatileParticipant.assertMethodNotCalled("rollback");
instrumentedTestVolatileParticipant.assertMethodNotCalled("commit");
instrumentedTestDurableParticipant.assertKnownInstances(1);
instrumentedTestDurableParticipant.assertMethodNotCalled("prepare");
instrumentedTestDurableParticipant.assertMethodCalled("rollback");
instrumentedTestDurableParticipant.assertMethodNotCalled("commit");
}
/**
* Reproducing trouble of possible NullPointerException being thrown from the BasicAction#doAbort.
* See JBTM-2948 for more details.
*/
@Test
@OperateOnDeployment(OUTBOUND_CLIENT_DEPLOYMENT_NAME)
public void testSynchronizationFailure(@ArquillianResource URL baseURL) throws Exception {
instrumentor.injectFault(VolatileTwoPhaseCommitParticipant.class, "beforeCompletion",
RuntimeException.class, new Object[]{"injected BeforeCompletion fault"});
instrumentor.injectFault(com.arjuna.wst11.stub.ParticipantStub.class, "rollback",
com.arjuna.wst.SystemException.class, new Object[]{"injected bridge participant fault"});
instrumentor.injectOnCall(TestClient.class, "terminateTransaction", "$1 = true"); // shouldCommit=true
InstrumentedClass basicActionInstrumented = instrumentor.instrumentClass(BasicAction.class);
String output = execute(baseURL.toString() + TestClient.URL_PATTERN);
Assert.assertTrue("Failure was injected, rollback was expected", output.contains("RollbackException"));
// if clean from NPE then the cause of the doAbort call can be saved as deffered exception
// at least one instrumented BasicAction has to do so
for(InstrumentedInstance ic: basicActionInstrumented.getInstances()) {
if(ic.getInvocationCount("addDeferredThrowables") > 0)
return;
}
Assert.fail("There was thrown NullPointerException on BasicAction#doAbort, consult server.log");
}
@Test
@OperateOnDeployment(OUTBOUND_CLIENT_DEPLOYMENT_NAME)
public void testPrepareReadonly(@ArquillianResource URL baseURL) throws Exception {
instrumentor.injectOnCall(TestDurableParticipant.class, "prepare", "return new com.arjuna.wst.ReadOnly()");
instrumentor.injectOnCall(TestClient.class, "terminateTransaction", "$1 = true"); // shouldCommit=true
execute(baseURL.toString() + TestClient.URL_PATTERN);
instrumentedTestVolatileParticipant.assertKnownInstances(1);
instrumentedTestVolatileParticipant.assertMethodCalled("prepare");
instrumentedTestVolatileParticipant.assertMethodNotCalled("rollback");
instrumentedTestVolatileParticipant.assertMethodCalled("commit");
instrumentedTestDurableParticipant.assertKnownInstances(1);
instrumentedTestDurableParticipant.assertMethodNotCalled("rollback");
instrumentedTestDurableParticipant.assertMethodNotCalled("commit");
}
@Test
@OperateOnDeployment(OUTBOUND_CLIENT_DEPLOYMENT_NAME)
public void testPrepareFailure(@ArquillianResource URL baseURL) throws Exception {
instrumentor.injectOnCall(TestDurableParticipant.class, "prepare", "return new com.arjuna.wst.Aborted()");
instrumentor.injectOnCall(TestClient.class, "terminateTransaction", "$1 = true"); // shouldCommit=true
execute(baseURL.toString() + TestClient.URL_PATTERN);
instrumentedTestVolatileParticipant.assertKnownInstances(1);
instrumentedTestVolatileParticipant.assertMethodCalled("prepare");
instrumentedTestVolatileParticipant.assertMethodCalled("rollback");
instrumentedTestVolatileParticipant.assertMethodNotCalled("commit");
instrumentedTestDurableParticipant.assertKnownInstances(1);
instrumentedTestDurableParticipant.assertMethodNotCalled("rollback");
instrumentedTestDurableParticipant.assertMethodNotCalled("commit");
}
}
| {
"pile_set_name": "Github"
} |
---
title: Document.RemoveDateAndTime Property (Word)
keywords: vbawd10.chm158007780
f1_keywords:
- vbawd10.chm158007780
ms.prod: word
api_name:
- Word.Document.RemoveDateAndTime
ms.assetid: 43520dad-0374-06c9-184e-da71de304360
ms.date: 06/08/2017
---
# Document.RemoveDateAndTime Property (Word)
Sets or returns a **Boolean** indicating whether a document stores the date and time metadata for tracked changes. .
## Syntax
_expression_ . **RemoveDateAndTime**
_expression_ A variable that represents a **[Document](document-object-word.md)** object.
## Remarks
**True** removes date and time stamp information from tracked changes. **False** does not remove date and time stamp information from tracked changes. Use the **RemoveDateAndTime** property in conjunction with the **[RemovePersonalInformation](document-removepersonalinformation-property-word.md)** property to help remove personal information from the document properties.
## Example
The following example removes personal information from the active document, and it removes date and time information from any tracked changes in the document.
```vb
ActiveDocument.RemovePersonalInformation = True
ActiveDocument.RemoveDateAndTime = True
```
## See also
#### Concepts
[Document Object](document-object-word.md)
| {
"pile_set_name": "Github"
} |
// wrapped by build app
define("dojox/wire/XmlWire", ["dijit","dojo","dojox","dojo/require!dojox/xml/parser,dojox/wire/Wire"], function(dijit,dojo,dojox){
dojo.provide("dojox.wire.XmlWire");
dojo.require("dojox.xml.parser");
dojo.require("dojox.wire.Wire");
dojo.declare("dojox.wire.XmlWire", dojox.wire.Wire, {
// summary:
// A Wire for XML nodes or values (element, attribute and text)
// description:
// This class accesses XML nodes or value with a simplified XPath
// specified to 'path' property.
// The root object for this class must be an DOM document or element
// node.
// "@name" accesses to an attribute value of an element and "text()"
// accesses to a text value of an element.
// The hierarchy of the elements from the root node can be specified
// with slash-separated list, such as "a/b/@c", which specifies
// the value of an attribute named "c" of an element named "b" as
// a child of another element named "a" of a child of the root node.
_wireClass: "dojox.wire.XmlWire",
constructor: function(/*Object*/args){
// summary:
// Initialize properties
// description:
// 'args' is just mixed in with no further processing.
// args:
// Arguments to initialize properties:
//
// - path: A simplified XPath to an attribute, a text or elements
},
_getValue: function(/*Node*/object){
// summary:
// Return an attribute value, a text value or an array of elements
// description:
// This method first uses a root node passed in 'object' argument
// and 'path' property to identify an attribute, a text or
// elements.
// If 'path' starts with a slash (absolute), the first path
// segment is ignored assuming it point to the root node.
// (That is, "/a/b/@c" and "b/@c" against a root node access
// the same attribute value, assuming the root node is an element
// with a tag name, "a".)
// object:
// A root node
// returns:
// A value found, otherwise 'undefined'
if(!object || !this.path){
return object; //Node
}
var node = object;
var path = this.path;
var i;
if(path.charAt(0) == '/'){ // absolute
// skip the first expression (supposed to select the top node)
i = path.indexOf('/', 1);
path = path.substring(i + 1);
}
var list = path.split('/');
var last = list.length - 1;
for(i = 0; i < last; i++){
node = this._getChildNode(node, list[i]);
if(!node){
return undefined; //undefined
}
}
var value = this._getNodeValue(node, list[last]);
return value; //String||Array
},
_setValue: function(/*Node*/object, /*String*/value){
// summary:
// Set an attribute value or a child text value to an element
// description:
// This method first uses a root node passed in 'object' argument
// and 'path' property to identify an attribute, a text or
// elements.
// If an intermediate element does not exist, it creates
// an element of the tag name in the 'path' segment as a child
// node of the current node.
// Finally, 'value' argument is set to an attribute or a text
// (a child node) of the leaf element.
// object:
// A root node
// value:
// A value to set
if(!this.path){
return object; //Node
}
var node = object;
var doc = this._getDocument(node);
var path = this.path;
var i;
if(path.charAt(0) == '/'){ // absolute
i = path.indexOf('/', 1);
if(!node){
var name = path.substring(1, i);
node = doc.createElement(name);
object = node; // to be returned as a new object
}
// skip the first expression (supposed to select the top node)
path = path.substring(i + 1);
}else{
if(!node){
return undefined; //undefined
}
}
var list = path.split('/');
var last = list.length - 1;
for(i = 0; i < last; i++){
var child = this._getChildNode(node, list[i]);
if(!child){
child = doc.createElement(list[i]);
node.appendChild(child);
}
node = child;
}
this._setNodeValue(node, list[last], value);
return object; //Node
},
_getNodeValue: function(/*Node*/node, /*String*/exp){
// summary:
// Return an attribute value, a text value or an array of elements
// description:
// If 'exp' starts with '@', an attribute value of the specified
// attribute is returned.
// If 'exp' is "text()", a child text value is returned.
// Otherwise, an array of child elements, the tag name of which
// match 'exp', is returned.
// node:
// A node
// exp:
// An expression for attribute, text or elements
// returns:
// A value found, otherwise 'undefined'
var value = undefined;
if(exp.charAt(0) == '@'){
var attribute = exp.substring(1);
value = node.getAttribute(attribute);
}else if(exp == "text()"){
var text = node.firstChild;
if(text){
value = text.nodeValue;
}
}else{ // assume elements
value = [];
for(var i = 0; i < node.childNodes.length; i++){
var child = node.childNodes[i];
if(child.nodeType === 1 /* ELEMENT_NODE */ && child.nodeName == exp){
value.push(child);
}
}
}
return value; //String||Array
},
_setNodeValue: function(/*Node*/node, /*String*/exp, /*String*/value){
// summary:
// Set an attribute value or a child text value to an element
// description:
// If 'exp' starts with '@', 'value' is set to the specified
// attribute.
// If 'exp' is "text()", 'value' is set to a child text.
// node:
// A node
// exp:
// An expression for attribute or text
// value:
// A value to set
if(exp.charAt(0) == '@'){
var attribute = exp.substring(1);
if(value){
node.setAttribute(attribute, value);
}else{
node.removeAttribute(attribute);
}
}else if(exp == "text()"){
while(node.firstChild){
node.removeChild(node.firstChild);
}
if(value){
var text = this._getDocument(node).createTextNode(value);
node.appendChild(text);
}
}
// else not supported
},
_getChildNode: function(/*Node*/node, /*String*/name){
// summary:
// Return a child node
// description:
// A child element of the tag name specified with 'name' is
// returned.
// If 'name' ends with an array index, it is used to pick up
// the corresponding element from multiple child elements.
// node:
// A parent node
// name:
// A tag name
// returns:
// A child node
var index = 1;
var i1 = name.indexOf('[');
if(i1 >= 0){
var i2 = name.indexOf(']');
index = name.substring(i1 + 1, i2);
name = name.substring(0, i1);
}
var count = 1;
for(var i = 0; i < node.childNodes.length; i++){
var child = node.childNodes[i];
if(child.nodeType === 1 /* ELEMENT_NODE */ && child.nodeName == name){
if(count == index){
return child; //Node
}
count++;
}
}
return null; //null
},
_getDocument: function(/*Node*/node){
// summary:
// Return a DOM document
// description:
// If 'node' is specified, a DOM document of the node is returned.
// Otherwise, a DOM document is created.
// returns:
// A DOM document
if(node){
return (node.nodeType == 9 /* DOCUMENT_NODE */ ? node : node.ownerDocument); //Document
}else{
return dojox.xml.parser.parse(); //Document
}
}
});
});
| {
"pile_set_name": "Github"
} |
;;; standard-ediff-theme.el --- standard-ediff theme
;; Copyright (C) 2005, 2006 Xavier Maillard <[email protected]>
;; Copyright (C) 2005, 2006 Brian Palmer <[email protected]>
;; Copyright (C) 2013 by Syohei YOSHIDA
;; Author: Syohei YOSHIDA <[email protected]>
;; URL: https://github.com/emacs-jp/replace-colorthemes
;; Version: 0.01
;; 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/>.
;;; Commentary:
;;
;; Port of standard-ediff theme from `color-themes'
;;; Code:
(deftheme standard-ediff
"standard-ediff theme")
(custom-theme-set-faces
'standard-ediff
'(ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
'(ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
'(ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
'(ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
'(ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
'(ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
'(ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
'(ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
'(ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
'(ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
'(ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
'(ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
'(ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
'(ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
'(ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
'(ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White")))))
;;;###autoload
(when load-file-name
(add-to-list 'custom-theme-load-path
(file-name-as-directory (file-name-directory load-file-name))))
(provide-theme 'standard-ediff)
;;; standard-ediff-theme.el ends here
| {
"pile_set_name": "Github"
} |
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CLIENT_PICTURE_CACHE_H_
#define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CLIENT_PICTURE_CACHE_H_
#include <stdint.h>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "base/logging.h"
#include "base/macros.h"
#include "blimp/common/compositor/reference_tracker.h"
#include "cc/blimp/client_picture_cache.h"
#include "cc/blimp/engine_picture_cache.h"
#include "cc/blimp/picture_data.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkRefCnt.h"
namespace blimp {
namespace client {
// BlimpClientPictureCache provides functionality for caching SkPictures once
// they are received from the engine, and cleaning up once the pictures are no
// longer in use. It is required to update this cache when an SkPicture starts
// being used and when it is not longer in use by calling
// MarkPictureForRegistration and MarkPictureForUnregistration respectively.
class BlimpClientPictureCache : public cc::ClientPictureCache {
public:
explicit BlimpClientPictureCache(
SkPicture::InstallPixelRefProc pixel_deserializer);
~BlimpClientPictureCache() override;
// cc::ClientPictureCache implementation.
sk_sp<const SkPicture> GetPicture(uint32_t engine_picture_id) override;
void ApplyCacheUpdate(
const std::vector<cc::PictureData>& cache_update) override;
void Flush() override;
void MarkUsed(uint32_t engine_picture_id) override;
private:
// Removes all pictures specified in |picture_ids| from |pictures_|. The
// picture IDs passed to this function must refer to the pictures that are no
// longer in use.
void RemoveUnusedPicturesFromCache(const std::vector<uint32_t>& picture_ids);
// Retrieves the SkPicture with the given |picture_id| from the cache. The
// given |picture_id| is the unique ID that the engine used to identify the
// picture in the cc::PictureCacheUpdate that contained the image.
sk_sp<const SkPicture> GetPictureFromCache(uint32_t picture_id);
// Verify that the incoming cache update matches the new items that were added
// to the |reference_tracker_|.
void VerifyCacheUpdateMatchesReferenceTrackerData(
const std::vector<uint32_t>& new_tracked_items);
#if DCHECK_IS_ON()
// A set of the items that were added when the last cache update was applied.
// Used for verifying that the calculation from the registry matches the
// expectations.
std::unordered_set<uint32_t> last_added_;
#endif // DCHECK_IS_ON()
// A function pointer valid to use for deserializing images when
// using SkPicture::CreateFromStream to create an SkPicture from a stream.
SkPicture::InstallPixelRefProc pixel_deserializer_;
// The current cache of SkPictures. The key is the unique ID used by the
// engine, and the value is the SkPicture itself.
std::unordered_map<uint32_t, sk_sp<const SkPicture>> pictures_;
// The reference tracker maintains the reference count of used SkPictures.
ReferenceTracker reference_tracker_;
DISALLOW_COPY_AND_ASSIGN(BlimpClientPictureCache);
};
} // namespace client
} // namespace blimp
#endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CLIENT_PICTURE_CACHE_H_
| {
"pile_set_name": "Github"
} |
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT(ld64, 134.9, http://www.i-soft.com.cn)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE([1.10 no-define no-dist-gzip dist-bzip2 tar-ustar])
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
CC=clang
CXX=clang++
# Checks for programs.
AC_CHECK_PROG([CC], [clang],[clang],[clang not found])
if test "$CC" = "clang not found"; then
AC_MSG_ERROR("Couldn't find clang.")
fi
AC_CHECK_PROG([CXX], [clang++],[clang++],[clang++ not found])
if test "$CXX" = "clang++ not found"; then
AC_MSG_ERROR("Couldn't find clang++.")
fi
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
if test "$CC" != "clang"; then
AC_MSG_ERROR("You must use clang to compile it")
fi
if test "$CXX" != "clang++"; then
AC_MSG_ERROR("You must use clang to compile it")
fi
WARNINGS=""
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wall"
AC_MSG_CHECKING([if -Wall is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wall"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wno-long-long"
AC_MSG_CHECKING([if -Wno-long-long is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wno-long-long"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wno-import"
AC_MSG_CHECKING([if -Wno-import is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wno-import"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wno-format"
AC_MSG_CHECKING([if -Wno-format is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wno-format"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wno-deprecated"
AC_MSG_CHECKING([if -Wno-deprecated is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wno-deprecated"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wno-unused-variable"
AC_MSG_CHECKING([if -Wno-unused-variable is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wno-unused-variable"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wno-invalid-offsetof"
AC_MSG_CHECKING([if -Wno-invalid-offsetof is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wno-invalid-offsetof"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wno-unused-private-field"
AC_MSG_CHECKING([if -Wno-unused-private-field is supported])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])],
[WARNINGS="$WARNINGS -Wno-unused-private-field"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
CFLAGS=$ORIGCFLAGS
AC_SUBST([WARNINGS], [$WARNINGS])
# Checks for header files.
AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h])
LT_PREREQ([2.2.6])
LT_INIT(disable-static)
# Checks for typedefs, structures, and compiler characteristics.
#AC_CHECK_HEADER_STDBOOL
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_CHECK_FUNCS([memset strdup strrchr strtoul])
AC_CHECK_LIB([dl],[dlopen],[
DL_LIBS=-ldl
])
AC_SUBST(DL_LIBS)
AC_CHECK_LIB([pthread],[pthread_create],[
PTHREAD_LDFLAG=-pthread
])
AC_SUBST(PTHREAD_LDFLAG)
AC_CHECK_LIB([uuid],[uuid_generate_random],[
UUID_LIBS=-luuid
])
AC_SUBST(UUID_LIBS)
AC_CHECK_LIB([crypto],[MD5_Init],[
CRYPT_LIBS=-lcrypto
])
AC_SUBST(CRYPT_LIBS)
# Check LTO
AC_CHECK_PROG([llvm_config], [llvm-config],[yes],[no])
if test "x$llvm-config" = "xno"; then
AC_MSG_ERROR("Could not find llvm-config.")
else
LLVM_LIBDIR=`llvm-config --libdir`
if test -f $LLVM_LIBDIR/libLTO.so;then
LTO_LIBS="-L`llvm-config --libdir` -lLTO"
LTO_DEFS="-DLTO_SUPPORT=1"
fi
fi
AC_SUBST(LTO_LIBS)
AC_SUBST(LTO_DEFS)
AC_C_BIGENDIAN([AC_SUBST([ENDIAN_FLAG],[-D__BIG_ENDIAN__=1])],
[AC_SUBST([ENDIAN_FLAG],[-D__LITTLE_ENDIAN__=1])])
AC_OUTPUT([
Makefile
src/Makefile
src/3rd/Makefile
src/3rd/BlocksRuntime/Makefile
src/ld/Makefile
src/ld/parsers/Makefile
src/ld/passes/Makefile
src/other/Makefile
])
| {
"pile_set_name": "Github"
} |
// Copyright 2017, 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.md file.
package value
import (
"fmt"
"math"
"reflect"
"sort"
)
// SortKeys sorts a list of map keys, deduplicating keys if necessary.
// The type of each value must be comparable.
func SortKeys(vs []reflect.Value) []reflect.Value {
if len(vs) == 0 {
return vs
}
// Sort the map keys.
sort.SliceStable(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) })
// Deduplicate keys (fails for NaNs).
vs2 := vs[:1]
for _, v := range vs[1:] {
if isLess(vs2[len(vs2)-1], v) {
vs2 = append(vs2, v)
}
}
return vs2
}
// isLess is a generic function for sorting arbitrary map keys.
// The inputs must be of the same type and must be comparable.
func isLess(x, y reflect.Value) bool {
switch x.Type().Kind() {
case reflect.Bool:
return !x.Bool() && y.Bool()
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return x.Int() < y.Int()
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
return x.Uint() < y.Uint()
case reflect.Float32, reflect.Float64:
// NOTE: This does not sort -0 as less than +0
// since Go maps treat -0 and +0 as equal keys.
fx, fy := x.Float(), y.Float()
return fx < fy || math.IsNaN(fx) && !math.IsNaN(fy)
case reflect.Complex64, reflect.Complex128:
cx, cy := x.Complex(), y.Complex()
rx, ix, ry, iy := real(cx), imag(cx), real(cy), imag(cy)
if rx == ry || (math.IsNaN(rx) && math.IsNaN(ry)) {
return ix < iy || math.IsNaN(ix) && !math.IsNaN(iy)
}
return rx < ry || math.IsNaN(rx) && !math.IsNaN(ry)
case reflect.Ptr, reflect.UnsafePointer, reflect.Chan:
return x.Pointer() < y.Pointer()
case reflect.String:
return x.String() < y.String()
case reflect.Array:
for i := 0; i < x.Len(); i++ {
if isLess(x.Index(i), y.Index(i)) {
return true
}
if isLess(y.Index(i), x.Index(i)) {
return false
}
}
return false
case reflect.Struct:
for i := 0; i < x.NumField(); i++ {
if isLess(x.Field(i), y.Field(i)) {
return true
}
if isLess(y.Field(i), x.Field(i)) {
return false
}
}
return false
case reflect.Interface:
vx, vy := x.Elem(), y.Elem()
if !vx.IsValid() || !vy.IsValid() {
return !vx.IsValid() && vy.IsValid()
}
tx, ty := vx.Type(), vy.Type()
if tx == ty {
return isLess(x.Elem(), y.Elem())
}
if tx.Kind() != ty.Kind() {
return vx.Kind() < vy.Kind()
}
if tx.String() != ty.String() {
return tx.String() < ty.String()
}
if tx.PkgPath() != ty.PkgPath() {
return tx.PkgPath() < ty.PkgPath()
}
// This can happen in rare situations, so we fallback to just comparing
// the unique pointer for a reflect.Type. This guarantees deterministic
// ordering within a program, but it is obviously not stable.
return reflect.ValueOf(vx.Type()).Pointer() < reflect.ValueOf(vy.Type()).Pointer()
default:
// Must be Func, Map, or Slice; which are not comparable.
panic(fmt.Sprintf("%T is not comparable", x.Type()))
}
}
| {
"pile_set_name": "Github"
} |
[](https://www.npmjs.com/package/backpack.css) [](https://github.com/chris-pearce/backpack.css/blob/master/LICENSE) [](https://david-dm.org/chris-pearce/backpack.css) [](https://david-dm.org/chris-pearce/backpack.css?type=dev) [](https://github.com/chris-pearce/backpack.css/blob/master/CODE_OF_CONDUCT.md) [](http://makeapullrequest.com) [](https://www.npmjs.com/package/backpack.css)
# backpack.css 🎒 <!-- omit in toc -->
A lightweight and somewhat opinionated CSS foundation that is best suited to applications.
## Table of contents <!-- omit in toc -->
- [Installation](#installation)
- [npm](#npm)
- [Download](#download)
- [CDN](#cdn)
- [How to use](#how-to-use)
- [With a bundler (webpack)](#with-a-bundler-webpack)
- [JS](#js)
- [CSS](#css)
- [No bundler](#no-bundler)
- [Overriding](#overriding)
- [Bundle size](#bundle-size)
- [Motivation](#motivation)
- [What it does](#what-it-does)
- [OpenType features](#opentype-features)
- [Evolution](#evolution)
- [Browser support](#browser-support)
- [Contributing](#contributing)
- [Versioning](#versioning)
- [Credits](#credits)
- [License](#license)
## Installation
### npm
Run the following command using [npm](https://www.npmjs.com/):
```bash
npm install backpack.css --save-dev
```
If you prefer [Yarn](https://yarnpkg.com/en/), use this command instead:
```bash
yarn add backpack.css --dev
```
### Download
- [Unminified](https://cdn.jsdelivr.net/npm/backpack.css/lib/backpack.css)
- [Minified](https://cdn.jsdelivr.net/npm/backpack.css/lib/backpack.min.css)
### CDN
- [jsDelivr](https://www.jsdelivr.com/package/npm/backpack.css)
- [unpkg](https://unpkg.com/backpack.css)
_[cdnjs](https://cdnjs.com/) coming soon ([see here](https://github.com/cdnjs/cdnjs/issues/13224))._
## How to use
backpack.css is pretty easy to use. The one strict rule is that it **must** come before your project's CSS to ensure correct ordering of your styles and to be able to override any of backpack.css styles.
### With a bundler (webpack)
#### JS
```js
import 'backpack.css';
import '[path(s)-to-your-project-css]';
```
#### CSS
If you're using webpack, then use the tilde (`~`) prefix at the start of the path, e.g.:
```css
@import '~backpack.css';
@import '[path(s)-to-your-project-css]';
```
### No bundler
Link to backpack.css using a `<link>` element in your HTML Head, e.g.:
```html
<head>
[…]
<link rel="stylesheet" href="https://unpkg.com/backpack.css" />
<link rel="stylesheet" href="[path-to-your-project-css]" />
</head>
```
### Overriding
backpack.css is just CSS so you can easily override any of its styles just as you would override any CSS, as in, via the rules of the cascade and specificity.
For example, if you don't want to use the global system font-stack defined in [`main-root.css`](src/main-root.css) then override it in your project CSS like so:
```css
html {
font-family: serif;
}
```
## Bundle size
[](https://bundlephobia.com/result?p=backpack.css) [](https://bundlephobia.com/result?p=backpack.css)
## Motivation
Nowadays I'm building [React](https://reactjs.org/) applications that have highly componentised User Interfaces (UI) making use of native CSS layout mechanisms such as [Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) and [Grid](https://css-tricks.com/snippets/css/complete-guide-grid/). I'm no longer finding the need for heavy-handed CSS frameworks that handle most of my UI concerns, especially layout and utilities. Instead, I build components with a smidgen of global styles.
What I do need, however, are a bunch of smart and sensible foundational styles suited for applications that I would typically forget project to project—think [Normalize.css](http://necolas.github.io/normalize.css/) and then some. Something lightweight, super easy to integrate, and can easily be overridden or allow for modular use, thus giving birth to backpack.css 🙂🎒.
## What it does
- Applies sensible form element resets, normalisations, and fixes, e.g. _remove all user-agent styles from buttons_.
- Applies sensible interactive styles, e.g. _avoid 300ms click delay on touch devices_.
- Applies foundational print styles.
- Applies a system font, including monospace fonts.
- Applies the nicer `border-box` value for the `box-sizing` property to all elements.
- Applies sensible OpenType features (see [OpenType features](#opentype-features) below).
- Makes all images and videos responsive.
- Removes margins, paddings, and borders from all elements except `<input>` so that everything is on an even playing field.
- Removes the bullets from lists.
- Removes all user-agent styles from heading elements and resets them to have the same styles as the body copy.
- Removes the "focus ring" for mouse users.
_And more…_
All of the CSS is very well documented if you want to dig deeper.
### OpenType features
As mentioned above, backpack.css applies sensible OpenType features. However, due to the poor support of the `font-variant-` properties, backpack.css has to declare their equivalents via the better supported, but harder to maintain, `font-feature-settings` property (the `font-feature-settings` properties should always come first).
Here are some resources on this:
- [Utility OpenType](http://utility-opentype.kennethormandy.com)
- [Normalize-OpenType.css](http://kennethormandy.com/journal/normalize-opentype-css)
- [Syntax for OpenType features in CSS](https://helpx.adobe.com/typekit/using/open-type-syntax.html)
- [Caring about OpenType features](https://practice.typekit.com/lesson/caring-about-opentype-features)
- [OpenType features in CSS](https://typotheque.com/articles/opentype_features_in_css)
## Evolution
backpack.css is the third CSS framework/library I've created. Looking at each one lets you see how UI development has evolved over the years with each iteration getting smaller and smaller.
1. [Scally](https://github.com/chris-pearce/scally) _circa 2014_
2. [Shell](https://github.com/campaignmonitor/shell) _circa 2016_
3. [backpack.css](https://github.com/chris-pearce/backpack.css) _circa 2018_
## Browser support
Here is the [Browserslist](https://github.com/browserslist/browserslist) query backpack.css uses:
```bash
last 4 versions and > 0.5%,
Firefox ESR,
not ie < 11,
not op_mini all,
not dead
```
Which you can see [here](https://browserl.ist/?q=last+4+versions+and+%3E+0.5%25%2C+Firefox+ESR%2C+not+ie+%3C+11%2C+not+op_mini+all%2C+not+dead).
Browserslist is used for [Autoprefixer](https://github.com/postcss/autoprefixer). Autoprefixer only adds a tiny amount of vendor prefixes, the main properties being prefixed are:
- `font-feature-settings`
- `font-variant-ligatures`
_This doesn't mean that backpack.css cannot be used in browsers outside of the above Browserslist query, just that compatibility is ensured with the ones within the query._
## Contributing
Please see our [contributing guidelines](CONTRIBUTING.md).
## Versioning
backpack.css is maintained under the [Semantic Versioning guidelines](http://semver.org/). We'll do our best to adhere to those guidelines and strive to maintain backwards compatibility.
See the [change log](CHANGELOG.md).
## Credits
- [Normalize.css](http://necolas.github.io/normalize.css/)
- [modern-normalize](https://github.com/sindresorhus/modern-normalize)
- [sanitize.css](https://csstools.github.io/sanitize.css/)
- [HTML5 Boilerplate](https://html5boilerplate.com/)
- [Utility OpenType](http://utility-opentype.kennethormandy.com/)
And anyone else who's been so kind to share their work out in the open.
❤️ open source.
## License
The code is available under the [MIT license](https://github.com/chris-pearce/backpack.css/blob/master/LICENSE).
| {
"pile_set_name": "Github"
} |
pipeline {
agent {
kubernetes {
label 'migration'
}
}
tools {
maven 'apache-maven-latest'
jdk 'adoptopenjdk-hotspot-jdk8-latest'
}
stages {
stage('Build') {
steps {
sh "mvn \
--batch-mode --show-version \
clean verify \
-P production \
-Dmaven.repo.local=/home/jenkins/.m2/repository \
--settings /home/jenkins/.m2/settings.xml \
"
}
}
stage('Upload') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh './scripts/jenkins/builds-upload.sh'
}
}
}
}
post {
success {
// if/when tests are added, the results can be collected by uncommenting the next line
// junit '*/*/target/surefire-reports/*.xml'
archiveArtifacts 'repositories/ilg.gnumcueclipse.repository/target/ilg.gnumcueclipse.repository-*.zip'
}
}
}
| {
"pile_set_name": "Github"
} |
:107E000001C0B7C0112484B790E89093610010922C
:107E10006100882361F0982F9A70923041F081FFC1
:107E200002C097EF94BF282E80E0C6D0E9C085E05D
:107E30008093810082E08093C00088E18093C1003C
:107E400081E08093C40086E08093C2008EE0B4D0CD
:107E5000279A84E02CE03FEF91E030938500209357
:107E6000840096BBB09BFECF1F9AA8954091C0009E
:107E700047FD02C0815089F793D0813479F490D0C6
:107E8000182FA0D0123811F480E004C088E0113817
:107E900009F083E07ED080E17CD0EECF823419F40B
:107EA00084E198D0F8CF853411F485E0FACF853598
:107EB00041F476D0C82F74D0D82FCC0FDD1F82D0DC
:107EC000EACF863519F484E085D0DECF843691F58B
:107ED00067D066D0F82E64D0D82E00E011E05801AB
:107EE0008FEFA81AB80A5CD0F80180838501FA10D8
:107EF000F6CF68D0F5E4DF1201C0FFCF50E040E0DC
:107F000063E0CE0136D08E01E0E0F1E06F0182E067
:107F1000C80ED11C4081518161E0C8012AD00E5F9A
:107F20001F4FF601FC10F2CF50E040E065E0CE01BB
:107F300020D0B1CF843771F433D032D0F82E30D086
:107F400041D08E01F80185918F0123D0FA94F11070
:107F5000F9CFA1CF853739F435D08EE11AD085E934
:107F600018D085E197CF813509F0A9CF88E024D0DA
:107F7000A6CFFC010A0167BFE895112407B600FCF3
:107F8000FDCF667029F0452B19F481E187BFE89594
:107F900008959091C00095FFFCCF8093C60008958E
:107FA0008091C00087FFFCCF8091C00084FD01C09C
:107FB000A8958091C6000895E0E6F0E098E19083EE
:107FC00080830895EDDF803219F088E0F5DFFFCF80
:107FD00084E1DFCFCF93C82FE3DFC150E9F7CF9122
:027FE000F1CFDF
:027FFE00000879
:0400000300007E007B
:00000001FF
| {
"pile_set_name": "Github"
} |
/*
* Legal Notice
*
* This document and associated source code (the "Work") is a part of a
* benchmark specification maintained by the TPC.
*
* The TPC reserves all right, title, and interest to the Work as provided
* under U.S. and international laws, including without limitation all patent
* and trademark rights therein.
*
* No Warranty
*
* 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION
* CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE
* AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER
* WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
* INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES,
* DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
* PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF
* WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE.
* ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT,
* QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT
* WITH REGARD TO THE WORK.
* 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO
* ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE
* COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS
* OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT,
* INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY,
* OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT
* RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD
* ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
*
* Contributors:
* Gradient Systems
*/
#ifndef S_CLASS_H
#define S_CLASS_H
#define RS_CLASS_DESC 50
#define S_CLASS_DESC_MIN 35
/*
* S_CLASS table structure
*/
struct S_CLASS_TBL {
ds_key_t id;
ds_key_t subcat_id;
char desc[RS_CLASS_DESC + 1];
};
int mk_s_class(void *pDest, ds_key_t kIndex);
int pr_s_class(void *pSrc);
int ld_s_class(void *pSrc);
#endif
| {
"pile_set_name": "Github"
} |
---
title: DefaultAutoFilter Property, Project [vbapj.chm131724]
keywords: vbapj.chm131724
f1_keywords:
- vbapj.chm131724
ms.prod: office
ms.assetid: 4bf60671-f3e7-4af4-af63-d4b1d875612e
ms.date: 06/08/2017
localization_priority: Normal
---
# DefaultAutoFilter Property, Project [vbapj.chm131724]
Hi there! You have landed on one of our F1 Help redirector pages. Please select the topic you were looking for below.
[Application.DefaultAutoFilter Property (Project)](https://msdn.microsoft.com/library/ef2301d0-6a57-7d88-75ee-6b57909317e9%28Office.15%29.aspx)
[Task.DeliverableFinish Property (Project)](https://msdn.microsoft.com/library/255a464b-ba2d-0701-f991-ba2b4b6cffd9%28Office.15%29.aspx)
[!include[Support and feedback](~/includes/feedback-boilerplate.md)] | {
"pile_set_name": "Github"
} |
{
"name": "debug",
"version": "2.2.0",
"repository": {
"type": "git",
"url": "git://github.com/visionmedia/debug.git"
},
"description": "small debugging utility",
"keywords": [
"debug",
"log",
"debugger"
],
"author": {
"name": "TJ Holowaychuk",
"email": "[email protected]"
},
"contributors": [
{
"name": "Nathan Rajlich",
"email": "[email protected]",
"url": "http://n8.io"
}
],
"license": "MIT",
"dependencies": {
"ms": "0.7.1"
},
"devDependencies": {
"browserify": "9.0.3",
"mocha": "*"
},
"main": "./node.js",
"browser": "./browser.js",
"component": {
"scripts": {
"debug/index.js": "browser.js",
"debug/debug.js": "debug.js"
}
},
"gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35",
"bugs": {
"url": "https://github.com/visionmedia/debug/issues"
},
"homepage": "https://github.com/visionmedia/debug",
"_id": "[email protected]",
"scripts": {},
"_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da",
"_from": "debug@>=2.2.0 <2.3.0",
"_npmVersion": "2.7.4",
"_nodeVersion": "0.12.2",
"_npmUser": {
"name": "tootallnate",
"email": "[email protected]"
},
"maintainers": [
{
"name": "tjholowaychuk",
"email": "[email protected]"
},
{
"name": "tootallnate",
"email": "[email protected]"
}
],
"dist": {
"shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da",
"tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"readme": "ERROR: No README data found!"
}
| {
"pile_set_name": "Github"
} |
################################################################################
#
# pcsc-lite
#
################################################################################
PCSC_LITE_VERSION = 1.8.10
PCSC_LITE_SOURCE = pcsc-lite-$(PCSC_LITE_VERSION).tar.bz2
PCSC_LITE_SITE = http://alioth.debian.org/frs/download.php/file/3963
PCSC_LITE_INSTALL_STAGING = YES
PCSC_LITE_DEPENDENCIES = host-pkgconf
PCSC_LITE_LICENSE = BSD-3c
PCSC_LITE_LICENSE_FILES = COPYING
PCSC_LITE_AUTORECONF = YES
# - libudev and libusb are optional
# - libudev and libusb can't be used together
# - libudev has a priority over libusb
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
PCSC_LITE_CONF_OPTS += --enable-libudev --disable-libusb
PCSC_LITE_DEPENDENCIES += udev
else
ifeq ($(BR2_PACKAGE_LIBUSB),y)
PCSC_LITE_CONF_OPTS += --enable-libusb --disable-libudev
PCSC_LITE_DEPENDENCIES += libusb
else
PCSC_LITE_CONF_OPTS += --disable-libusb --disable-libudev
endif
endif
ifeq ($(PACKAGE_PCSC_LITE_DEBUGATR),y)
PCSC_LITE_CONF_OPTS += --enable-debugatr
endif
ifeq ($(PACKAGE_PCSC_LITE_EMBEDDED),y)
PCSC_LITE_CONF_OPTS += --enable-embedded
endif
$(eval $(autotools-package))
| {
"pile_set_name": "Github"
} |
# json-stable-stringify
This is the same as https://github.com/substack/json-stable-stringify but it doesn't depend on libraries without licenses (jsonify).
deterministic version of `JSON.stringify()` so you can get a consistent hash
from stringified results
You can also pass in a custom comparison function.
[](https://ci.testling.com/substack/json-stable-stringify)
[](http://travis-ci.org/substack/json-stable-stringify)
# example
``` js
var stringify = require('json-stable-stringify');
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
console.log(stringify(obj));
```
output:
```
{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}
```
# methods
``` js
var stringify = require('json-stable-stringify')
```
## var str = stringify(obj, opts)
Return a deterministic stringified string `str` from the object `obj`.
## options
### cmp
If `opts` is given, you can supply an `opts.cmp` to have a custom comparison
function for object keys. Your function `opts.cmp` is called with these
parameters:
``` js
opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue })
```
For example, to sort on the object key names in reverse order you could write:
``` js
var stringify = require('json-stable-stringify');
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
var s = stringify(obj, function (a, b) {
return a.key < b.key ? 1 : -1;
});
console.log(s);
```
which results in the output string:
```
{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}
```
Or if you wanted to sort on the object values in reverse order, you could write:
```
var stringify = require('json-stable-stringify');
var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
return a.value < b.value ? 1 : -1;
});
console.log(s);
```
which outputs:
```
{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10}
```
### space
If you specify `opts.space`, it will indent the output for pretty-printing.
Valid values are strings (e.g. `{space: \t}`) or a number of spaces
(`{space: 3}`).
For example:
```js
var obj = { b: 1, a: { foo: 'bar', and: [1, 2, 3] } };
var s = stringify(obj, { space: ' ' });
console.log(s);
```
which outputs:
```
{
"a": {
"and": [
1,
2,
3
],
"foo": "bar"
},
"b": 1
}
```
### replacer
The replacer parameter is a function `opts.replacer(key, value)` that behaves
the same as the replacer
[from the core JSON object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter).
# install
With [npm](https://npmjs.org) do:
```
npm install json-stable-stringify
```
# license
MIT
| {
"pile_set_name": "Github"
} |
{
"use_ELMo": false,
"num_word_lstm_units": 100,
"embeddings_name": "glove-840B",
"use_crf": true,
"batch_size": 20,
"word_embedding_size": 300,
"char_embedding_size": 25,
"case_vocab_size": 8,
"char_vocab_size": 103,
"dropout": 0.5,
"model_type": "BidLSTM_CRF",
"model_name": "grobid-figure",
"recurrent_dropout": 0.5,
"fold_number": 1,
"num_char_lstm_units": 25,
"case_embedding_size": 5,
"use_char_feature": true,
"max_char_length": 30
} | {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=constant.PRIO_DARWIN_PROCESS.html">
</head>
<body>
<p>Redirecting to <a href="constant.PRIO_DARWIN_PROCESS.html">constant.PRIO_DARWIN_PROCESS.html</a>...</p>
<script>location.replace("constant.PRIO_DARWIN_PROCESS.html" + location.search + location.hash);</script>
</body>
</html> | {
"pile_set_name": "Github"
} |
#!/bin/bash
#
# Environment configuration for mariadb
# The values for all environment variables will be set in the below order of precedence
# 1. Custom environment variables defined below after Bitnami defaults
# 2. Constants defined in this file (environment variables with no default), i.e. BITNAMI_ROOT_DIR
# 3. Environment variables overridden via external files using *_FILE variables (see below)
# 4. Environment variables set externally (i.e. current Bash context/Dockerfile/userdata)
export BITNAMI_ROOT_DIR="/opt/bitnami"
export BITNAMI_VOLUME_DIR="/bitnami"
# Logging configuration
export MODULE="${MODULE:-mariadb}"
export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}"
# By setting an environment variable matching *_FILE to a file path, the prefixed environment
# variable will be overridden with the value specified in that file
mariadb_env_vars=(
ALLOW_EMPTY_PASSWORD
MARIADB_AUTHENTICATION_PLUGIN
MARIADB_ROOT_USER
MARIADB_ROOT_PASSWORD
MARIADB_USER
MARIADB_PASSWORD
MARIADB_DATABASE
MARIADB_MASTER_HOST
MARIADB_MASTER_PORT_NUMBER
MARIADB_MASTER_ROOT_USER
MARIADB_MASTER_ROOT_PASSWORD
MARIADB_REPLICATION_USER
MARIADB_REPLICATION_PASSWORD
MARIADB_PORT_NUMBER
MARIADB_REPLICATION_MODE
MARIADB_EXTRA_FLAGS
MARIADB_INIT_SLEEP_TIME
MARIADB_CHARACTER_SET
MARIADB_COLLATE
MARIADB_BIND_ADDRESS
MARIADB_SQL_MODE
)
for env_var in "${mariadb_env_vars[@]}"; do
file_env_var="${env_var}_FILE"
if [[ -n "${!file_env_var:-}" ]]; then
export "${env_var}=$(< "${!file_env_var}")"
unset "${file_env_var}"
fi
done
unset mariadb_env_vars
export DB_FLAVOR="mariadb"
# Paths
export DB_BASE_DIR="${BITNAMI_ROOT_DIR}/mariadb"
export DB_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/mariadb"
export DB_DATA_DIR="${DB_VOLUME_DIR}/data"
export DB_BIN_DIR="${DB_BASE_DIR}/bin"
export DB_SBIN_DIR="${DB_BASE_DIR}/sbin"
export DB_CONF_DIR="${DB_BASE_DIR}/conf"
export DB_LOGS_DIR="${DB_BASE_DIR}/logs"
export DB_TMP_DIR="${DB_BASE_DIR}/tmp"
export DB_CONF_FILE="${DB_CONF_DIR}/my.cnf"
export DB_PID_FILE="${DB_TMP_DIR}/mysqld.pid"
export DB_SOCKET_FILE="${DB_TMP_DIR}/mysql.sock"
export PATH="${DB_SBIN_DIR}:${DB_BIN_DIR}:/opt/bitnami/common/bin:${PATH}"
# System users (when running with a privileged user)
export DB_DAEMON_USER="mysql"
export DB_DAEMON_GROUP="mysql"
# Default configuration (build-time)
export MARIADB_DEFAULT_PORT_NUMBER="3306"
export DB_DEFAULT_PORT_NUMBER="$MARIADB_DEFAULT_PORT_NUMBER" # only used at build time
export MARIADB_DEFAULT_CHARACTER_SET="utf8"
export DB_DEFAULT_CHARACTER_SET="$MARIADB_DEFAULT_CHARACTER_SET" # only used at build time
export MARIADB_DEFAULT_COLLATE="utf8_general_ci"
export DB_DEFAULT_COLLATE="$MARIADB_DEFAULT_COLLATE" # only used at build time
export MARIADB_DEFAULT_BIND_ADDRESS="0.0.0.0"
export DB_DEFAULT_BIND_ADDRESS="$MARIADB_DEFAULT_BIND_ADDRESS" # only used at build time
# MariaDB authentication.
export ALLOW_EMPTY_PASSWORD="${ALLOW_EMPTY_PASSWORD:-no}"
export MARIADB_AUTHENTICATION_PLUGIN="${MARIADB_AUTHENTICATION_PLUGIN:-}"
export DB_AUTHENTICATION_PLUGIN="$MARIADB_AUTHENTICATION_PLUGIN"
export MARIADB_ROOT_USER="${MARIADB_ROOT_USER:-root}"
export DB_ROOT_USER="$MARIADB_ROOT_USER" # only used during the first initialization
export MARIADB_ROOT_PASSWORD="${MARIADB_ROOT_PASSWORD:-}"
export DB_ROOT_PASSWORD="$MARIADB_ROOT_PASSWORD" # only used during the first initialization
export MARIADB_USER="${MARIADB_USER:-}"
export DB_USER="$MARIADB_USER" # only used during the first initialization
export MARIADB_PASSWORD="${MARIADB_PASSWORD:-}"
export DB_PASSWORD="$MARIADB_PASSWORD" # only used during the first initialization
export MARIADB_DATABASE="${MARIADB_DATABASE:-}"
export DB_DATABASE="$MARIADB_DATABASE" # only used during the first initialization
export MARIADB_MASTER_HOST="${MARIADB_MASTER_HOST:-}"
export DB_MASTER_HOST="$MARIADB_MASTER_HOST" # only used during the first initialization
export MARIADB_MASTER_PORT_NUMBER="${MARIADB_MASTER_PORT_NUMBER:-3306}"
export DB_MASTER_PORT_NUMBER="$MARIADB_MASTER_PORT_NUMBER" # only used during the first initialization
export MARIADB_MASTER_ROOT_USER="${MARIADB_MASTER_ROOT_USER:-root}"
export DB_MASTER_ROOT_USER="$MARIADB_MASTER_ROOT_USER" # only used during the first initialization
export MARIADB_MASTER_ROOT_PASSWORD="${MARIADB_MASTER_ROOT_PASSWORD:-}"
export DB_MASTER_ROOT_PASSWORD="$MARIADB_MASTER_ROOT_PASSWORD" # only used during the first initialization
export MARIADB_REPLICATION_USER="${MARIADB_REPLICATION_USER:-}"
export DB_REPLICATION_USER="$MARIADB_REPLICATION_USER" # only used during the first initialization
export MARIADB_REPLICATION_PASSWORD="${MARIADB_REPLICATION_PASSWORD:-}"
export DB_REPLICATION_PASSWORD="$MARIADB_REPLICATION_PASSWORD" # only used during the first initialization
# Settings
export MARIADB_PORT_NUMBER="${MARIADB_PORT_NUMBER:-}"
export DB_PORT_NUMBER="$MARIADB_PORT_NUMBER"
export MARIADB_REPLICATION_MODE="${MARIADB_REPLICATION_MODE:-}"
export DB_REPLICATION_MODE="$MARIADB_REPLICATION_MODE"
export MARIADB_EXTRA_FLAGS="${MARIADB_EXTRA_FLAGS:-}"
export DB_EXTRA_FLAGS="$MARIADB_EXTRA_FLAGS"
export MARIADB_INIT_SLEEP_TIME="${MARIADB_INIT_SLEEP_TIME:-}"
export DB_INIT_SLEEP_TIME="$MARIADB_INIT_SLEEP_TIME"
export MARIADB_CHARACTER_SET="${MARIADB_CHARACTER_SET:-}"
export DB_CHARACTER_SET="$MARIADB_CHARACTER_SET"
# MARIADB_COLLATION is deprecated in favor of MARIADB_COLLATE
MARIADB_COLLATE="${MARIADB_COLLATE:-"${MARIADB_COLLATION:-}"}"
export MARIADB_COLLATE="${MARIADB_COLLATE:-}"
export DB_COLLATE="$MARIADB_COLLATE"
export MARIADB_BIND_ADDRESS="${MARIADB_BIND_ADDRESS:-}"
export DB_BIND_ADDRESS="$MARIADB_BIND_ADDRESS"
export MARIADB_SQL_MODE="${MARIADB_SQL_MODE:-}"
export DB_SQL_MODE="$MARIADB_SQL_MODE"
# Custom environment variables may be defined below
| {
"pile_set_name": "Github"
} |
--TEST--
phpunit --verbose DependencyTestSuite ../_files/DependencyTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--verbose';
$_SERVER['argv'][3] = 'DependencyTestSuite';
$_SERVER['argv'][4] = __DIR__ . '/../_files/DependencyTestSuite.php';
require __DIR__ . '/../bootstrap.php';
PHPUnit_TextUI_Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Runtime: %s
...FSSS 7 / 7 (100%)
Time: %s, Memory: %s
There was 1 failure:
1) DependencyFailureTest::testOne
%s:%i
--
There were 3 skipped tests:
1) DependencyFailureTest::testTwo
This test depends on "DependencyFailureTest::testOne" to pass.
2) DependencyFailureTest::testThree
This test depends on "DependencyFailureTest::testTwo" to pass.
3) DependencyFailureTest::testFour
This test depends on "DependencyFailureTest::testOne" to pass.
FAILURES!
Tests: 7, Assertions: 0, Failures: 1, Skipped: 3.
| {
"pile_set_name": "Github"
} |
import torch
import utility
import data
import model
import loss
from option import args
from trainer import Trainer
torch.manual_seed(args.seed)
checkpoint = utility.checkpoint(args)
if checkpoint.ok:
loader = data.Data(args)
model = model.Model(args, checkpoint)
loss = loss.Loss(args, checkpoint) if not args.test_only else None
t = Trainer(args, loader, model, loss, checkpoint)
while not t.terminate():
t.train()
t.test()
checkpoint.done()
| {
"pile_set_name": "Github"
} |
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package pkcs12
import (
"bytes"
"testing"
)
func TestThatPBKDFWorksCorrectlyForLongKeys(t *testing.T) {
cipherInfo := shaWithTripleDESCBC{}
salt := []byte("\xff\xff\xff\xff\xff\xff\xff\xff")
password, _ := bmpString("sesame")
key := cipherInfo.deriveKey(salt, password, 2048)
if expected := []byte("\x7c\xd9\xfd\x3e\x2b\x3b\xe7\x69\x1a\x44\xe3\xbe\xf0\xf9\xea\x0f\xb9\xb8\x97\xd4\xe3\x25\xd9\xd1"); bytes.Compare(key, expected) != 0 {
t.Fatalf("expected key '%x', but found '%x'", expected, key)
}
}
func TestThatPBKDFHandlesLeadingZeros(t *testing.T) {
// This test triggers a case where I_j (in step 6C) ends up with leading zero
// byte, meaning that len(Ijb) < v (leading zeros get stripped by big.Int).
// This was previously causing bug whereby certain inputs would break the
// derivation and produce the wrong output.
key := pbkdf(sha1Sum, 20, 64, []byte("\xf3\x7e\x05\xb5\x18\x32\x4b\x4b"), []byte("\x00\x00"), 2048, 1, 24)
expected := []byte("\x00\xf7\x59\xff\x47\xd1\x4d\xd0\x36\x65\xd5\x94\x3c\xb3\xc4\xa3\x9a\x25\x55\xc0\x2a\xed\x66\xe1")
if bytes.Compare(key, expected) != 0 {
t.Fatalf("expected key '%x', but found '%x'", expected, key)
}
}
| {
"pile_set_name": "Github"
} |
$NetBSD: patch-ad,v 1.1 2005/12/04 01:21:00 joerg Exp $
--- mysystem.c.orig 2005-12-04 00:58:03.000000000 +0000
+++ mysystem.c
@@ -1,15 +1,12 @@
#include <errno.h>
#include <signal.h>
#include <stdio.h>
+#include <stdlib.h>
#include <X11/Xos.h>
#include <X11/Intrinsic.h>
#include "mysystem.h"
#include "appres.h"
-extern char *malloc();
-extern char *getenv();
-
-extern int errno;
extern Argc;
extern char **Argv;
extern AppResources app_resources;
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2002-2007, Vanderbilt University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
* - Neither the name of the copyright holder nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Miklos Maroti
*/
#include <message.h>
module DiagMsgP
{
provides
{
interface DiagMsg;
}
uses
{
interface AMSend;
interface Packet;
}
}
#ifndef DIAGMSG_BASE_STATION
#define DIAGMSG_BASE_STATION AM_BROADCAST_ADDR
#endif
#ifndef DIAGMSG_RETRY_COUNT
#define DIAGMSG_RETRY_COUNT 2
#endif
#ifndef DIAGMSG_RECORDED_MSGS
#define DIAGMSG_RECORDED_MSGS 10
#endif
implementation
{
enum
{
STATE_READY = 1,
STATE_RECORDING_FIRST = 2, // recording the first 4-bit descriptor
STATE_RECORDING_SECOND = 3, // recording the second 4-bit descriptor
STATE_MSG_FULL = 4,
STATE_BUFFER_FULL = 5,
};
norace volatile uint8_t state = STATE_READY; // the state of the recording
message_t msgs[DIAGMSG_RECORDED_MSGS]; // circular buffer of messages
norace message_t *recording = msgs; // the message that is beeing or going to be recorded
message_t *sending = 0; // the message that is beeing sent, or the null pointer
norace uint8_t nextData; // points to the next unsued byte
norace uint8_t prevType; // points to the type descriptor
norace uint8_t retries; // number of remaining retries
// two type fields are stored in on byte
enum
{
TYPE_END = 0,
TYPE_INT8 = 1,
TYPE_UINT8 = 2,
TYPE_HEX8 = 3,
TYPE_INT16 = 4,
TYPE_UINT16 = 5,
TYPE_HEX16 = 6,
TYPE_INT32 = 7,
TYPE_UINT32 = 8,
TYPE_HEX32 = 9,
TYPE_FLOAT = 10,
TYPE_CHAR = 11,
TYPE_INT64 = 12,
TYPE_UINT64 = 13,
TYPE_ARRAY = 15,
};
/*
The format of the payload is as follows:
Each value has an associated data type descriptor. The descriptor takes 4-bits,
and two descriptors are packed into one byte. The double-descriptor is followed
by the data bytes needed to store the corresponding value. Two sample layouts are:
[D2, D1] [V1] ... [V1] [V2] ... [V2]
[D2, D1] [V1] ... [V1] [V2] ... [V2] [0, D3] [V3] ... [V3]
where D1, D2, D3 denotes the data type descriptors, and V1, V2 and V3
denotes the bytes where the corresponding values are stored. If there is an odd
number of data descriptors, then a zero data descriptor <code>TYPE_END</code>
is inserted.
Each data type (except arrays) uses a fixed number of bytes to store the value.
For arrays, the first byte of the array holds the data type of the array (higer
4 bits) and the length of the array (lower 4 bits). The actual data follows
this first byte.
*/
async command bool DiagMsg.record()
{
atomic
{
// currently recording or no more space
if( state != STATE_READY )
return FALSE;
state = STATE_RECORDING_FIRST;
nextData = 0;
}
return TRUE;
}
/**
* Allocates space in the message for <code>size</code> bytes
* and sets the type information to <code>type</code>.
* Returns the index in <code>msg.data</code> where the data
* should be stored or <code>-1</code> if no more space is avaliable.
*/
int8_t allocate(uint8_t size, uint8_t type)
{
int8_t ret = -1;
if( state == STATE_RECORDING_FIRST )
{
if( nextData + 1 + size <= TOSH_DATA_LENGTH )
{
state = STATE_RECORDING_SECOND;
prevType = nextData++;
((uint8_t*) &(recording->data))[prevType] = type;
ret = nextData;
nextData += size;
}
else
state = STATE_MSG_FULL;
}
else if( state == STATE_RECORDING_SECOND )
{
if( nextData + size <= TOSH_DATA_LENGTH )
{
state = STATE_RECORDING_FIRST;
((uint8_t*) &(recording->data))[prevType] += (type << 4);
ret = nextData;
nextData += size;
}
else
state = STATE_MSG_FULL;
}
return ret;
}
void copyData(uint8_t size, uint8_t type2, const void* data)
{
int8_t start = allocate(size, type2);
if( start >= 0 )
memcpy(&(recording->data[start]), data, size);
}
void copyArray(uint8_t size, uint8_t type2, const void* data, uint8_t len)
{
int8_t start;
if( len > 15 )
len = 15;
start = allocate(size*len + 1, TYPE_ARRAY);
if( start >= 0 )
{
recording->data[start] = (type2 << 4) + len;
memcpy(&(recording->data[start + 1]), data, size*len);
}
}
#define IMPLEMENT(NAME, TYPE, TYPE2) \
async command void DiagMsg.NAME(TYPE value) { copyData(sizeof(TYPE), TYPE2, &value); } \
async command void DiagMsg.NAME##s(const TYPE *value, uint8_t len) { copyArray(sizeof(TYPE), TYPE2, value, len); }
IMPLEMENT(int8, int8_t, TYPE_INT8)
IMPLEMENT(uint8, uint8_t, TYPE_UINT8)
IMPLEMENT(hex8, uint8_t, TYPE_HEX8)
IMPLEMENT(int16, int16_t, TYPE_INT16)
IMPLEMENT(uint16, uint16_t, TYPE_UINT16)
IMPLEMENT(hex16, uint16_t, TYPE_HEX16)
IMPLEMENT(int32, int32_t, TYPE_INT32)
IMPLEMENT(uint32, uint32_t, TYPE_UINT32)
IMPLEMENT(hex32, uint32_t, TYPE_HEX32)
IMPLEMENT(int64, int64_t, TYPE_INT64)
IMPLEMENT(uint64, uint64_t, TYPE_UINT64)
IMPLEMENT(real, float, TYPE_FLOAT)
IMPLEMENT(chr, char, TYPE_CHAR)
async command void DiagMsg.str(const char* str)
{
int8_t len = 0;
while( str[len] != 0 && len < 15 )
++len;
call DiagMsg.chrs(str, len);
}
// TODO: this is a hack because setPayloadLength should be async
inline void setPayloadLength(message_t* msg, uint8_t length)
{
(*(uint8_t*) &(msg->header)) = length;
}
inline uint8_t getPayloadLength(message_t* msg)
{
return *(uint8_t*) &(msg->header);
}
task void send()
{
message_t* msg;
atomic msg = sending;
// if the stack is not started, then drop the message
// (cannot spin with tasks becasue we might be in software or hardware init)
if( call AMSend.send(DIAGMSG_BASE_STATION, msg, getPayloadLength(msg)) != SUCCESS )
atomic sending = 0;
}
// calculates the next message_t pointer in the <code>msgs</code> circular buffer
static inline message_t* nextPointer(message_t* ptr)
{
if( ++ptr >= msgs + DIAGMSG_RECORDED_MSGS )
return msgs;
else
return ptr;
}
async command void DiagMsg.send()
{
// no message recorded
if( state == STATE_READY )
return;
// store the length
setPayloadLength(recording, nextData);
atomic
{
if( sending == 0 )
{
sending = recording;
retries = DIAGMSG_RETRY_COUNT;
post send();
}
recording = nextPointer(recording);
if( recording == sending )
state = STATE_BUFFER_FULL;
else
state = STATE_READY;
}
}
event void AMSend.sendDone(message_t* p, error_t error)
{
atomic
{
// retry if not successful
if( error != SUCCESS && --retries > 0 )
post send();
else
{
p = nextPointer(sending);
if( p != recording )
{
sending = p;
retries = DIAGMSG_RETRY_COUNT;
post send();
}
else
{
sending = 0;
if( state == STATE_BUFFER_FULL )
{
state = STATE_READY;
if( call DiagMsg.record() )
{
call DiagMsg.str("DiagMsgOverflow");
call DiagMsg.send();
}
}
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
<cfadmin
action="getDebugData"
returnVariable="debugging"><!--
<cfscript>
function print(string title,array labels, query data) {
// get maxlength of columns
var lengths=array();
var i=1;
var y=1;
var tmp=0;
var total=1;
var collen=arrayLen(labels);
for(;i LTE collen;i=i+1) {
lengths[i]=len(labels[i]);
for(y=1;y LTE data.recordcount;y=y+1) {
data[labels[i]][y]=trim(rereplace(data[labels[i]][y],"[[:space:]]+"," ","all"));
tmp=len(data[labels[i]][y]);
if(tmp GT lengths[i])lengths[i]=tmp;
}
lengths[i]=lengths[i]+3;
total=total+lengths[i];
}
// now wrie out
writeOutput(chr(13));
writeOutput(RepeatString("=",total)&chr(13));
writeOutput(ljustify(" "&ucase(title)&" " ,total));
writeOutput(chr(13));
writeOutput(RepeatString("=",total)&chr(13));
for(y=1;y LTE collen;y=y+1) {
writeOutput(ljustify("| "&uCase(labels[y])&" " ,lengths[y]));
}
writeOutput("|"&chr(13));
for(i=1;i LTE data.recordcount;i=i+1) {
writeOutput(RepeatString("-",total)&chr(13));
for(y=1;y LTE collen;y=y+1) {
writeOutput(ljustify("| "&data[labels[y]][i]&" " ,lengths[y]));
}
writeOutput("|"&chr(13));
}
writeOutput(RepeatString("=",total)&chr(13)&chr(13));
}
writeOutput("RAILO DEBUGGING OUTPUT"&chr(13));
print("Pages",array('src','count','load','query','app','total'),debugging.pages);
print("Queries",array('src','datasource','name','sql','time','count'),debugging.queries);
print("Timers",array('template','label','time'),debugging.timers);
print("Traces",array('template','type','category','text','line','varname','varvalue','time'),debugging.traces);
</cfscript>--> | {
"pile_set_name": "Github"
} |
/*
Copyright The Pharmer Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package digitalocean
import (
"pharmer.dev/pharmer/cloud"
clusterapi "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1"
)
func (cm *ClusterManager) NewNodeTemplateData(machine *clusterapi.Machine, token string, td cloud.TemplateData) cloud.TemplateData {
td.ExternalProvider = true // DigitalOcean uses out-of-tree CCM
// ref: https://kubernetes.io/docs/admin/kubeadm/#cloud-provider-integrations-experimental
td.KubeletExtraArgs["cloud-provider"] = "external" // --cloud-config is not needed
//td.KubeletExtraArgs["enable-controller-attach-detach"] = "false"
//td.KubeletExtraArgs["keep-terminated-pod-volumes"] = "true"
joinConf, _ := td.JoinConfigurationYAML()
td.JoinConfiguration = joinConf
return td
}
func (cm *ClusterManager) NewMasterTemplateData(machine *clusterapi.Machine, token string, td cloud.TemplateData) cloud.TemplateData {
td.ClusterConfiguration = cloud.GetDefaultKubeadmClusterConfig(cm.Cluster, nil)
return td
}
var (
customTemplate = `
{{ define "init-os" }}
# We rely on DNS for a lot, and it's just not worth doing a whole lot of startup work if this isn't ready yet.
# ref: https://github.com/kubernetes/kubernetes/blob/443908193d564736d02efdca4c9ba25caf1e96fb/cluster/gce/configure-vm.sh#L24
ensure_basic_networking() {
until getent hosts $(hostname -f || echo _error_) &>/dev/null; do
echo 'Waiting for functional DNS (trying to resolve my own FQDN)...'
sleep 3
done
until getent hosts $(hostname -i || echo _error_) &>/dev/null; do
echo 'Waiting for functional DNS (trying to resolve my own IP)...'
sleep 3
done
echo "Networking functional on $(hostname) ($(hostname -i))"
}
ensure_basic_networking
{{ end }}
{{ define "install-storage-plugin" }}
# Deploy storage RBAC
cmd='kubectl apply --kubeconfig /etc/kubernetes/admin.conf -f https://raw.githubusercontent.com/pharmer/addons/release-1.13.1/cloud-storage/rbac.yaml'
exec_until_success "$cmd"
#Deploy plugin
cmd='kubectl apply --kubeconfig /etc/kubernetes/admin.conf -f https://raw.githubusercontent.com/pharmer/addons/release-1.13.1/cloud-storage/{{ .Provider }}/flexplugin.yaml'
exec_until_success "$cmd"
#Deploy provisioner
cmd='kubectl apply --kubeconfig /etc/kubernetes/admin.conf -f https://raw.githubusercontent.com/pharmer/addons/release-1.13.1/cloud-storage/{{ .Provider }}/provisioner.yaml'
exec_until_success "$cmd"
{{ end }}
{{ define "prepare-host" }}
NODE_NAME=$(hostname)
{{ end }}
`
)
| {
"pile_set_name": "Github"
} |
var NAVTREEINDEX8 =
{
"group__msp.html#ga8c499862db0fcf07692989aae3d84c9e":[37,8,27],
"group__msp.html#ga9a981adf6eea7e55d11c1a0b02592a6e":[37,8,7],
"group__msp.html#ga9d492cbb6af86eaf0afb264e886072e5":[37,8,28],
"group__msp.html#gab68e234c9dccbd3d62659023db9f9486":[37,8,16],
"group__msp.html#gab9219b764ce65abb21bec0ea54538c14":[37,8,21],
"group__msp.html#gac949528775cd2346a95c4f89b91567d6":[37,8,25],
"group__msp.html#gad15f054306792846a00a5f4e9e5426be":[37,8,8],
"group__msp.html#gae9a75fa230b1db6d8316405d4a6065cc":[37,8,22],
"group__msp.html#gaf8709cab1b4bbbbd78010f765e83b328":[37,8,23],
"group__msp.html#gafd451e217e2ffd6b8e158b8861fcf866":[37,8,13],
"group__msp.html#ggaac34dfe6c6b73b43a4656c9dce041034a29738f7ba126b5468181b4c017e573d0":[37,8,19,0],
"group__mutex.html":[37,12,1],
"group__mutex.html#ga57c63515a67e9739aa0f916ae05e8a18":[37,12,1,3],
"group__mutex.html#ga5fdfbb20bfe5b9e6b223436758ea88b1":[37,12,1,0],
"group__mutex.html#ga6a3bea4c2f5e5d133d25d78b51fb15bf":[37,12,1,1],
"group__mutex.html#ga74aae707e650844be8a4e51a217c9b5f":[37,12,1,5],
"group__mutex.html#gaa8cae78764c59883566ac4f861dd534e":[37,12,1,2],
"group__mutex.html#gafa0cef91ad29e8e0625d35eadde52002":[37,12,1,4],
"group__obj.html":[37,9],
"group__obj.html#ga020d01fb1a55690dc760450bac6a624a":[37,9,21],
"group__obj.html#ga035c5ca1d7d25921533b59451d730c44":[37,9,19],
"group__obj.html#ga046f517695486f4008ae9b25ce5e41d7":[37,9,31],
"group__obj.html#ga059445066cc5e1bb358db166e79b8d47":[37,9,6],
"group__obj.html#ga10a31e85ef4ede5cea7fa5bf4f26fcc7":[37,9,59],
"group__obj.html#ga24a3ab7c91801d4b0ae377d15adfc117":[37,9,8],
"group__obj.html#ga2a4bb953a5f7a9afee4f2f8196c4226e":[37,9,44],
"group__obj.html#ga2b5b3327e03edbefe753ebd6c8b7e152":[37,9,62],
"group__obj.html#ga308d41d63efacb1187ace7d3b50b99e1":[37,9,36],
"group__obj.html#ga337cb8efd58c2dcb7a95653f90384943":[37,9,61],
"group__obj.html#ga3759846cb356195532c41e35b87522ee":[37,9,27],
"group__obj.html#ga3854b233b015cf2e157b03819ce9b65e":[37,9,25],
"group__obj.html#ga39385fe83cc9706cfec023563aa106bf":[37,9,42],
"group__obj.html#ga42025069e4317aef6dbe5c21c316fd85":[37,9,14],
"group__obj.html#ga443dee482af22e0fe83e68955d367226":[37,9,45],
"group__obj.html#ga459c71aca6316e345379eeb424ad56ff":[37,9,48],
"group__obj.html#ga5432f19c374fb8850faa7ff062561db0":[37,9,40],
"group__obj.html#ga5867964e5091b93147e77f7c4eaf555e":[37,9,37],
"group__obj.html#ga5ddeb48f167ded23b1508d502e571427":[37,9,43],
"group__obj.html#ga5de96f9ed649a42b2133d21c38e3476b":[37,9,7],
"group__obj.html#ga6122e56af8de90fa7aad43ee405c6bb6":[37,9,24],
"group__obj.html#ga6297b81c3a70f7fb2201c7262e96bba3":[37,9,49],
"group__obj.html#ga6765e9533a3ae0d67d302f1e038c66ac":[37,9,22],
"group__obj.html#ga6a34cbfaa7491720d82f37a6b187cb75":[37,9,60],
"group__obj.html#ga6d212c17722cc783102a6f5a623596c9":[37,9,54],
"group__obj.html#ga736ef8fbda2c79dd13a88f6ab81a9f9f":[37,9,33],
"group__obj.html#ga73adb1c1e2db98f7a500f50ac447add5":[37,9,16],
"group__obj.html#ga76657298bcd43ae4f9098e3ed2b97c72":[37,9,15],
"group__obj.html#ga8d2c36fbeff377ea30d4ac9d898a3d77":[37,9,32],
"group__obj.html#ga8e08b5bc9657c1800ee8a452e9d14d3d":[37,9,9],
"group__obj.html#ga941f7a1161a097394a6924df0c03a1ea":[37,9,41],
"group__obj.html#ga94630370ae389fb1189282fa0742f310":[37,9,3],
"group__obj.html#ga95edf6b869d6c5be94a59e49dddb0935":[37,9,50],
"group__obj.html#ga975e42fc3823dadc594232652291d26d":[37,9,38],
"group__obj.html#ga9afc2f1b4cbdd3a2ccdc37de0e4146d6":[37,9,10],
"group__obj.html#ga9be48cfb39024dc20239079eb60295cd":[37,9,23],
"group__obj.html#ga9d653fc9249f24c462f14657b969cc4d":[37,9,58],
"group__obj.html#gaa5ff59d2297a2dde60e3f2fe3e02eceb":[37,9,46],
"group__obj.html#gaa7fbd3be9a16b2abf1e5a27fec9cff74":[37,9,12],
"group__obj.html#gaaa202dcda859bb5dcd1f186f88a43796":[37,9,28],
"group__obj.html#gaaa262193055c44fff144e3395443597a":[37,9,34],
"group__obj.html#gaaa97beba179d6aebd3f3ede1b5c781fa":[37,9,56],
"group__obj.html#gab033973cea2f4a0b17bb48ab2f22f051":[37,9,29],
"group__obj.html#gaba3a848eba4f4b834c1f89377c75e281":[37,9,51],
"group__obj.html#gabc9d226ff11897e7c094c221de654f3a":[37,9,63],
"group__obj.html#gabcf7aaca1f307e806e38100355cc97ac":[37,9,55],
"group__obj.html#gabd57e5e8ce873c5aa12dfc60db6cb6f1":[37,9,35],
"group__obj.html#gabf8c1d20a4f4e731d185c02820c91593":[37,9,5],
"group__obj.html#gac4523e68b4be4deb6db0ea91948d3553":[37,9,20],
"group__obj.html#gac4b370265c776db4f545d257089af1cf":[37,9,47],
"group__obj.html#gac4eb1b3d30abbbb754ddc38701ff1c77":[37,9,53],
"group__obj.html#gac903f406c571b246ce397e6f8aa6e612":[37,9,18],
"group__obj.html#gacb89ef27c34b45e9037d877375804284":[37,9,13],
"group__obj.html#gaccdb93572405a2e9f065086f9c3dfe41":[37,9,52],
"group__obj.html#gad098f6e3ad3ab917b2bf59c402c4cf3f":[37,9,4],
"group__obj.html#gada17aabe9fe096a4c20eb59022a4ec04":[37,9,39],
"group__obj.html#gadeb570bcae0e9bbf389d571e85d16bfa":[37,9,26],
"group__obj.html#gae2e5fa312640bb7236488a4395ed1632":[37,9,57],
"group__obj.html#gae740749094827ac5adc2b7145db1c596":[37,9,30],
"group__obj.html#gaed2c4e1d0c80d929b97ccf07a886faeb":[37,9,11],
"group__obj.html#gaf92de17862db8bba568ddc015a7e2aac":[37,9,17],
"group__objectmod.html":[37,5,4],
"group__objectmod.html#ga03b2bb6645b076c4afbba3efbd5f14b9":[37,5,4,2],
"group__objectmod.html#ga0a34d363db7343083457a3dcf5fffb3e":[37,5,4,18],
"group__objectmod.html#ga213166e8beeb29aca36c57cd07c722f1":[37,5,4,0],
"group__objectmod.html#ga21f77a08c1a98aaf68e4b2913487be0f":[37,5,4,21],
"group__objectmod.html#ga27743559fe82c0adb99d45b87fd71196":[37,5,4,16],
"group__objectmod.html#ga29a1be851f1e88aa459689681d8b996e":[37,5,4,14],
"group__objectmod.html#ga2d3302646e6bf59b4960dd0656632095":[37,5,4,5],
"group__objectmod.html#ga328c0beb469f32437b756852fe8583bf":[37,5,4,10],
"group__objectmod.html#ga4bbd50b2d1e34de44d36e1a66a477b9f":[37,5,4,19],
"group__objectmod.html#ga4fdf2959d720fe67e1ecc777189caa63":[37,5,4,6],
"group__objectmod.html#ga62d196313913e245d4baa69ed2308f01":[37,5,4,8],
"group__objectmod.html#ga64970b62e5afe7a2cbd57efd6e9e9f74":[37,5,4,12],
"group__objectmod.html#ga6d62c09fe37fc74bcaaa6ab326064b6f":[37,5,4,1],
"group__objectmod.html#ga9be3b8c2e695b471dee3e9242691c472":[37,5,4,9],
"group__objectmod.html#ga9c9b8591a887cddd19b313c8e995fbea":[37,5,4,17],
"group__objectmod.html#gaa286218b643371fe28cbe261facd5b21":[37,5,4,7],
"group__objectmod.html#gab5c10166fd7e2505b76a25e1cf0b6b09":[37,5,4,3],
"group__objectmod.html#gabcf088a00f36b6af8ce5896b81e4d0ef":[37,5,4,20],
"group__objectmod.html#gacbb8c55e2c6c564d6018b8550cf7f98f":[37,5,4,15],
"group__objectmod.html#gaeba4eb06443064c2cb4b9c45edeb7ab2":[37,5,4,13],
"group__objectmod.html#gaecadd79da84aa20fe845cc4916f25721":[37,5,4,4],
"group__objectmod.html#gaf59274b20cbf6a44cc4269a0a4165745":[37,5,4,11],
"group__opvecmod.html":[37,5,14],
"group__opvecmod.html#ga00e97f99263939c023aaf3e8b661131d":[37,5,14,65],
"group__opvecmod.html#ga041bdada970cd8a0b999df5ebfbea61b":[37,5,14,36],
"group__opvecmod.html#ga047be97619e283805d362677cf79c21a":[37,5,14,146],
"group__opvecmod.html#ga06089d7ed6a436ec5b392fa5de518efd":[37,5,14,34],
"group__opvecmod.html#ga07a76e07019b86d5e0cc26f7113f756d":[37,5,14,6],
"group__opvecmod.html#ga086051a9de64af7a3e788d496b720faa":[37,5,14,108],
"group__opvecmod.html#ga0ac36294ad3e20269d31ef23a27efdb9":[37,5,14,68],
"group__opvecmod.html#ga0c242c1894814e6026aba91f82f88ba8":[37,5,14,94],
"group__opvecmod.html#ga0c9a6939ee7f08cd26758a368ad36d85":[37,5,14,181],
"group__opvecmod.html#ga0d0a7fc3ff8faae67b16d6706dc35fd6":[37,5,14,124],
"group__opvecmod.html#ga0e650f8993bb50aa1ad6761d40925ad0":[37,5,14,1],
"group__opvecmod.html#ga111c6eea3e8f091ca2e18b1f4a447673":[37,5,14,40],
"group__opvecmod.html#ga12fa0c0f124217b6703c6f02bccee9d2":[37,5,14,168],
"group__opvecmod.html#ga1c047117c29b033974b73cc99e7b6de1":[37,5,14,162],
"group__opvecmod.html#ga1d3e0b24be891526c13c4f0365250d9d":[37,5,14,51],
"group__opvecmod.html#ga1de814c8a85b052f304e5403c82a8b29":[37,5,14,159],
"group__opvecmod.html#ga1ef0e86107326c19fbe174b99aa8fb35":[37,5,14,174],
"group__opvecmod.html#ga2151258ba2425ee38eefff33f6d88ae0":[37,5,14,19],
"group__opvecmod.html#ga22fa0793f8dfa1cc5165c160defea3db":[37,5,14,17],
"group__opvecmod.html#ga230643676f4cda9a87d8a47d8a8c23a9":[37,5,14,110],
"group__opvecmod.html#ga237b6d40cedfb2768fd1632dae8f234b":[37,5,14,5],
"group__opvecmod.html#ga23ab889981eec3cbbbcd8bc506fbb4e6":[37,5,14,98],
"group__opvecmod.html#ga26c4d87db1be85cc1823e00c3a7dd14f":[37,5,14,142],
"group__opvecmod.html#ga26f840eb263eb7892a5bdf4f3ab09af5":[37,5,14,46],
"group__opvecmod.html#ga276550a47face9505e6b9faf385a3ffb":[37,5,14,129],
"group__opvecmod.html#ga2865fb03ed572a6cf1034f150217784d":[37,5,14,143],
"group__opvecmod.html#ga2c87b24c84943232aa0dfdb15cf2ac4c":[37,5,14,45],
"group__opvecmod.html#ga2cf7bbc7506303fbe7b33fb6325ba5be":[37,5,14,91],
"group__opvecmod.html#ga2dfff20e34210f289f81daa3659e9e01":[37,5,14,24],
"group__opvecmod.html#ga2ed64ce3dc74e0c5b3500dba435c4df6":[37,5,14,89],
"group__opvecmod.html#ga30cfcfb6333f08dda447d2ce64fe0326":[37,5,14,12],
"group__opvecmod.html#ga31a5c6806af3992c08dbc58650cd9e6f":[37,5,14,137],
"group__opvecmod.html#ga32839a95ee648910de8a951d1f64f5af":[37,5,14,155],
"group__opvecmod.html#ga3357a8134a44c8229dcfbbc94950bd5f":[37,5,14,16],
"group__opvecmod.html#ga3777baffdb18d40fb2d5b6c0af754459":[37,5,14,71],
"group__opvecmod.html#ga39ea14122ac8e782d5065144e71be3aa":[37,5,14,118],
"group__opvecmod.html#ga3a5f3fe93afa4f4042a943de3ec0124f":[37,5,14,15],
"group__opvecmod.html#ga3cfd2857a5964e63449d406452e303fb":[37,5,14,122],
"group__opvecmod.html#ga3f7e9eec50ba1e410fca39b4eb1cbe82":[37,5,14,18],
"group__opvecmod.html#ga40972e92305f4e7a0355b12a858d25d1":[37,5,14,157],
"group__opvecmod.html#ga4124b406dd10e8428d450afa27110c3d":[37,5,14,39],
"group__opvecmod.html#ga41ab0fc29cd955acb975666ebdc5b109":[37,5,14,160],
"group__opvecmod.html#ga429cbb18b30dddf38c26e3c40af428d6":[37,5,14,167],
"group__opvecmod.html#ga459487a4b3d6adca2f44ddb7e39037ba":[37,5,14,86],
"group__opvecmod.html#ga468e2155800862b807f3d5c6c506d9e8":[37,5,14,56],
"group__opvecmod.html#ga46d0ebc25d8e255f31926e84e358f5c5":[37,5,14,8],
"group__opvecmod.html#ga4cb86d8baf03ef12a90096aef213784d":[37,5,14,99],
"group__opvecmod.html#ga4dd92a9aaa3d3fa78864561cfa386087":[37,5,14,80],
"group__opvecmod.html#ga4f3eeb3b5ef9cb726fcb7fb06827528d":[37,5,14,164],
"group__opvecmod.html#ga508039e2b5d271fda853ff5cc16fd619":[37,5,14,50],
"group__opvecmod.html#ga50c14b50b918b96fc426e73781c365a4":[37,5,14,116],
"group__opvecmod.html#ga537bd927f9580bad702b6f41f5681014":[37,5,14,151],
"group__opvecmod.html#ga5519709ea63d802d96aef03267e2361e":[37,5,14,49],
"group__opvecmod.html#ga555351ea64c1fe8079afefd0496fbbdf":[37,5,14,113],
"group__opvecmod.html#ga5574fb7eb3d8abcc20dbc1db15b0e68b":[37,5,14,153],
"group__opvecmod.html#ga563f5161f3b5f3262cdde07883cfcfd5":[37,5,14,180],
"group__opvecmod.html#ga57204f20348af7decab1537293a7d55d":[37,5,14,178],
"group__opvecmod.html#ga5a286b075af860bac30e6e223cc900b8":[37,5,14,48],
"group__opvecmod.html#ga5a6cef334e4a169eb9dc02191406230c":[37,5,14,29],
"group__opvecmod.html#ga5bff93b6a9da2d5de668c7edd111fffa":[37,5,14,121],
"group__opvecmod.html#ga5d0dbfe0061f261edeaa94fad0016e2f":[37,5,14,109],
"group__opvecmod.html#ga5dce1f9d51fe30b8d600551f0f792b10":[37,5,14,87],
"group__opvecmod.html#ga5ddfa9c091f3f2bf01e498ad6bfd2a67":[37,5,14,41],
"group__opvecmod.html#ga606351534a911aea16e44faa411f2e01":[37,5,14,53],
"group__opvecmod.html#ga609e019f00f9ddd83a91a9bfbf0bf78e":[37,5,14,76],
"group__opvecmod.html#ga6121a753bfd1d3d16663ea3a0a635cbd":[37,5,14,149],
"group__opvecmod.html#ga62f19f6a8c37832e5e7a9bc8586a91c6":[37,5,14,130],
"group__opvecmod.html#ga679a961f96238211a994318ac2ef9758":[37,5,14,173],
"group__opvecmod.html#ga68eefadefa7143d0d6e34fa12e5b5a9c":[37,5,14,30],
"group__opvecmod.html#ga69741058015d7aa7ec0c0874e3b20192":[37,5,14,126],
"group__opvecmod.html#ga6afcf9e93db2e15454448ce58a1c6217":[37,5,14,158],
"group__opvecmod.html#ga6b9d8110037905bd2f5be2634bcee094":[37,5,14,27],
"group__opvecmod.html#ga6d9c3e715f7b275e11614dc58d2e9b4f":[37,5,14,139],
"group__opvecmod.html#ga6eb8c731eafa72ddc056782f7c3449d0":[37,5,14,100],
"group__opvecmod.html#ga6eef3546ccd1cc2d269725eb95ef159c":[37,5,14,145],
"group__opvecmod.html#ga718042764418c7fd79c70105564c8eb6":[37,5,14,117],
"group__opvecmod.html#ga728da0f73896508903d8be5d225627e1":[37,5,14,52],
"group__opvecmod.html#ga738a6c10eeeae9ab6d01e02d8cb6f1af":[37,5,14,31],
"group__opvecmod.html#ga770d0b1d90b002fa00e2f52fe4915983":[37,5,14,141],
"group__opvecmod.html#ga78061bb22cdd68b8aff44ee2d1a01ce0":[37,5,14,64],
"group__opvecmod.html#ga796ea33b72e94a4ceef0077be3def292":[37,5,14,20],
"group__opvecmod.html#ga79b3b3a9e216deb72c603c4e2212b549":[37,5,14,47],
"group__opvecmod.html#ga7b55e59d347017d8ef5169243774a3a2":[37,5,14,182],
"group__opvecmod.html#ga7cda6bd2a2d1163a7431f0be8015b0f5":[37,5,14,0],
"group__opvecmod.html#ga7d05b7545d222540949003a22fdb60c4":[37,5,14,88],
"group__opvecmod.html#ga7e20091f22eff18d921e3bba2ac20ece":[37,5,14,170],
"group__opvecmod.html#ga7ecdd3b9dfb769c315b26123622f058c":[37,5,14,95],
"group__opvecmod.html#ga7faee9edbbe6f5583f4c38ff39ddb5de":[37,5,14,127],
"group__opvecmod.html#ga7fd4a4b51016115efe6f35273b00983a":[37,5,14,115],
"group__opvecmod.html#ga803e8bd78c4e3644eb331831704f3ab7":[37,5,14,85],
"group__opvecmod.html#ga80ad91dae3359d0e7160afb855811b50":[37,5,14,73],
"group__opvecmod.html#ga80b59aa6c97eabedf5e4f5973e8530ed":[37,5,14,2],
"group__opvecmod.html#ga824a2770fb804d1a31a53465bbcc15a6":[37,5,14,105],
"group__opvecmod.html#ga83500ff0d582205c900648a0cf2de281":[37,5,14,38],
"group__opvecmod.html#ga85c60d306d73bb29cf675c6d1da91e44":[37,5,14,104],
"group__opvecmod.html#ga86f24545ec76bb050b4272e9e95f3574":[37,5,14,55],
"group__opvecmod.html#ga895cbfbc2d6e888797444c1b89a1a35a":[37,5,14,14],
"group__opvecmod.html#ga898b59610da31b4e3e40545673c60400":[37,5,14,92],
"group__opvecmod.html#ga89dcc71ebb58320ca582b2bfb59b1566":[37,5,14,22],
"group__opvecmod.html#ga8a042249e30eef59453dab03202874b8":[37,5,14,58],
"group__opvecmod.html#ga8b26e3d9b7e06608165cbadf5238df12":[37,5,14,23],
"group__opvecmod.html#ga8d105c8f794e923c3858dea7dc23eea1":[37,5,14,101],
"group__opvecmod.html#ga8d6b5c9c995ed85836407486c1338cc5":[37,5,14,4],
"group__opvecmod.html#ga8e524cd5872ab508e3e85bade504a427":[37,5,14,3],
"group__opvecmod.html#ga8e5c012f8dcf346065ce6011a676a8dc":[37,5,14,161],
"group__opvecmod.html#ga92ff286eb573295576e46b3155100e3c":[37,5,14,150],
"group__opvecmod.html#ga937a5b0d8e54b7f4fd596350821f3aaf":[37,5,14,84],
"group__opvecmod.html#ga9566b7501771b726d1d1b740beaa434b":[37,5,14,165],
"group__opvecmod.html#ga962dedc87c39d85e6bd21d765a865a67":[37,5,14,103],
"group__opvecmod.html#ga9a93eeba3437c85fdaeb1b43f208593e":[37,5,14,21],
"group__opvecmod.html#ga9b5e0c3167af07d96829bde185ccb1de":[37,5,14,57],
"group__opvecmod.html#ga9d662157694e9cf219851e07c5d95955":[37,5,14,106],
"group__opvecmod.html#gaa3a4995b1eda5ef6f7576c458215d56f":[37,5,14,144],
"group__opvecmod.html#gaa3b54514a3ba3b8e6a32e7111fe1f41c":[37,5,14,42],
"group__opvecmod.html#gaa4cb0f4c15c7b67c371696298b705474":[37,5,14,112],
"group__opvecmod.html#gaa584a1fe47a2f462540d65b00e3db0aa":[37,5,14,152],
"group__opvecmod.html#gaa737541b153a2de2a2a2a7877ce89394":[37,5,14,9],
"group__opvecmod.html#gaac636c8abca5ee168c14e535fca9eb78":[37,5,14,78],
"group__opvecmod.html#gaac77d494c9dbb01feb79bda7316886d5":[37,5,14,119],
"group__opvecmod.html#gaafc329ba4b3589f415349f592b435465":[37,5,14,171],
"group__opvecmod.html#gab141096b192c0b8e4cd6a22d7137ff5b":[37,5,14,28],
"group__opvecmod.html#gab1d87cd5a79ba9d336d75442d996c7b4":[37,5,14,166],
"group__opvecmod.html#gab2f7a15d7c4057dc2e3a348525b6b240":[37,5,14,156],
"group__opvecmod.html#gab9dbf960d557a8a0762805ede759a295":[37,5,14,60],
"group__opvecmod.html#gaba8a6b1cff6bf9770ea3994d8be30e38":[37,5,14,44],
"group__opvecmod.html#gabb14bd485004dafe45778194102e2dae":[37,5,14,176],
"group__opvecmod.html#gabc5acddc043079dbc7cb1cce21aba954":[37,5,14,63],
"group__opvecmod.html#gabc934a68c0591042bf2d2fccd5847f78":[37,5,14,32],
"group__opvecmod.html#gabd1f654ed99061d886bd768c80493a54":[37,5,14,135],
"group__opvecmod.html#gac04014050c3a66b79f388e205c2b3d76":[37,5,14,148],
"group__opvecmod.html#gac14fe8ff474f94a361a659cf9b6dca15":[37,5,14,179],
"group__opvecmod.html#gac2f5fb251d5b09fdb1aa28ec6735b27b":[37,5,14,183],
"group__opvecmod.html#gac322162e3b3e0a31c8b9aa5739de8f00":[37,5,14,66],
"group__opvecmod.html#gac48c6a346ad364916edfdcc5604b8279":[37,5,14,140],
"group__opvecmod.html#gac673d3a9b0d7691e89ebe13bd09d0863":[37,5,14,132],
"group__opvecmod.html#gac88aff075d135ad68d64506f0127e788":[37,5,14,67],
"group__opvecmod.html#gacae820f353fd3677af02f3690d9beebf":[37,5,14,7],
"group__opvecmod.html#gaccb4600e174f75b40a45144986dbfe01":[37,5,14,175],
"group__opvecmod.html#gacd8f8cd6465da63a372b0b613d6da9ff":[37,5,14,13],
"group__opvecmod.html#gad0572850562b94c6f691d4a53bdb8eba":[37,5,14,120],
"group__opvecmod.html#gad07318c7b4b42c9ea83e4d08abac3f57":[37,5,14,133],
"group__opvecmod.html#gad0984d6a7094705a0dc5aa10f890f8b9":[37,5,14,10],
"group__opvecmod.html#gad0a57e536071468ec58cf85c95ece970":[37,5,14,138],
"group__opvecmod.html#gad2010efed21ed81ac35efb96a3ee65ec":[37,5,14,111],
"group__opvecmod.html#gad3182b8739f7c992998de4c6ed76fc54":[37,5,14,77],
"group__opvecmod.html#gad4e50db9a86b53204f8d1ff8305aedd0":[37,5,14,128]
};
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library pub.validator;
import 'dart:async';
import 'entrypoint.dart';
import 'log.dart' as log;
import 'utils.dart';
import 'validator/compiled_dartdoc.dart';
import 'validator/dependency.dart';
import 'validator/dependency_override.dart';
import 'validator/directory.dart';
import 'validator/executable.dart';
import 'validator/license.dart';
import 'validator/name.dart';
import 'validator/pubspec_field.dart';
import 'validator/sdk_constraint.dart';
import 'validator/size.dart';
import 'validator/utf8_readme.dart';
/// The base class for validators that check whether a package is fit for
/// uploading.
///
/// Each validator should override [errors], [warnings], or both to return
/// lists of errors or warnings to display to the user. Errors will cause the
/// package not to be uploaded; warnings will require the user to confirm the
/// upload.
abstract class Validator {
/// The entrypoint that's being validated.
final Entrypoint entrypoint;
/// The accumulated errors for this validator.
///
/// Filled by calling [validate].
final errors = <String>[];
/// The accumulated warnings for this validator.
///
/// Filled by calling [validate].
final warnings = <String>[];
Validator(this.entrypoint);
/// Validates the entrypoint, adding any errors and warnings to [errors] and
/// [warnings], respectively.
Future validate();
/// Run all validators on the [entrypoint] package and print their results.
///
/// The future completes with the error and warning messages, respectively.
///
/// [packageSize], if passed, should complete to the size of the tarred
/// package, in bytes. This is used to validate that it's not too big to
/// upload to the server.
static Future<Pair<List<String>, List<String>>> runAll(
Entrypoint entrypoint, [Future<int> packageSize]) {
var validators = [
new LicenseValidator(entrypoint),
new NameValidator(entrypoint),
new PubspecFieldValidator(entrypoint),
new DependencyValidator(entrypoint),
new DependencyOverrideValidator(entrypoint),
new DirectoryValidator(entrypoint),
new ExecutableValidator(entrypoint),
new CompiledDartdocValidator(entrypoint),
new Utf8ReadmeValidator(entrypoint),
new SdkConstraintValidator(entrypoint)
];
if (packageSize != null) {
validators.add(new SizeValidator(entrypoint, packageSize));
}
return Future.wait(validators.map((validator) => validator.validate()))
.then((_) {
var errors =
flatten(validators.map((validator) => validator.errors));
var warnings =
flatten(validators.map((validator) => validator.warnings));
if (!errors.isEmpty) {
log.error("Missing requirements:");
for (var error in errors) {
log.error("* ${error.split('\n').join('\n ')}");
}
log.error("");
}
if (!warnings.isEmpty) {
log.warning("Suggestions:");
for (var warning in warnings) {
log.warning("* ${warning.split('\n').join('\n ')}");
}
log.warning("");
}
return new Pair<List<String>, List<String>>(errors, warnings);
});
}
}
| {
"pile_set_name": "Github"
} |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{B180E3D7-5F42-49CE-84F1-042196300A37}</ProjectGuid>
<ProjectVersion>18.8</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>articles_crud_vcl_client_api_binder.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<VerInfo_Locale>1040</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<DCC_UnitSearchPath>..\..\lib\loggerpro;..\..\lib\delphistompclient;..\..\lib\dmustache;..\..\..\delphiredisclient\sources;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<SanitizedProjectName>articles_crud_vcl_client_api_binder</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;SampleListViewMultiDetailAppearancePackage;FireDACPgDriver;fmx;IndySystem;TeeDB;tethering;ITDevCon2012AdapterPackage;inetdbbde;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;CodeSiteExpressPkg;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;adortl;CustomAdaptersMDPackage;FireDACASADriver;bindcompfmx;vcldbx;FireDACODBCDriver;RESTBackendComponents;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;SampleListViewRatingsAppearancePackage;Tee;DBXOdbcDriver;vclFireDAC;xmlrtl;DataSnapNativeClient;svnui;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindcompdbx;bindengine;vclactnband;soaprtl;FMXTee;TeeUI;bindcompvcl;vclie;FireDACADSDriver;vcltouch;VclSmp;FireDACMSSQLDriver;FireDAC;DBXInformixDriver;Intraweb;VCLRESTComponents;DataSnapConnectors;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;SampleGenerator1Package;inet;fmxobj;FireDACMySQLDriver;soapmidas;vclx;svn;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;bdertl;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<DCC_UsePackage>FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;TeeDB;tethering;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;adortl;FireDACASADriver;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;Tee;DBXOdbcDriver;vclFireDAC;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindcompdbx;bindengine;vclactnband;soaprtl;FMXTee;TeeUI;bindcompvcl;vclie;FireDACADSDriver;vcltouch;VclSmp;FireDACMSSQLDriver;FireDAC;DBXInformixDriver;Intraweb;VCLRESTComponents;DataSnapConnectors;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;inet;fmxobj;FireDACMySQLDriver;soapmidas;vclx;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="MainFormU.pas">
<Form>MainForm</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="..\..\sources\MVCFramework.Serializer.Defaults.pas"/>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">articles_crud_vcl_client_api_binder.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k240.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp240.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k240.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp240.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="Win32\Debug\articles_crud_vcl_client_api_binder.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>articles_crud_vcl_client_api_binder.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeX86File"/>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1024">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1024x768">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1536">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1536x2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1668">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1668x2388">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048x1536">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048x2732">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2224">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2388x1668">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2732x2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch768">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch768x1024">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1125">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1136x640">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1242">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1242x2688">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1334">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1792">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2208">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2436">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2688x1242">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch320">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch640">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch640x1136">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch750">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch828">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceResourceRules">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements">
<Platform Name="iOSDevice32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSInfoPList">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug">
<Platform Name="OSX64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Rgaa32016 Test.5.7.2 NMI 06</title>
</head>
<body class="NMI">
<div>
<h1>Rgaa32016 Test.5.7.2 NMI 06</h1>
<!-- START [test-detail] -->
<div class="test-detail" lang="fr">
Chaque en-tête (balise <code lang="en">th</code>) s’appliquant à la totalité de la ligne ou de la colonne et possédant un attribut <code lang="en">scope</code> vérifie-t-il une de ces conditions ? <ul><li>L’en-tête possède un attribut <code lang="en">scope</code> avec la valeur <code lang="en">"row"</code> pour les <a href="http://references.modernisation.gouv.fr/rgaa-accessibilite/2016/glossaire.html#entte-de-colonne-ou-de-ligne">en-tête de lignes</a> ;</li> <li>L’en-tête possède un attribut <code lang="en">scope</code> avec la valeur <code lang="en">"col"</code> pour les <a href="http://references.modernisation.gouv.fr/rgaa-accessibilite/2016/glossaire.html#entte-de-colonne-ou-de-ligne">en-tête de colonnes</a>.</li> </ul>
</div>
<!-- END [test-detail] -->
<div class="testcase">
<table class="class-data-table">
<tbody>
<tr>
<th>Header 1 table 1</th>
<th>Header 2 table 1</th>
</tr>
<tr>
<td>Value 1</td>
<td>Value 2</td>
</tr>
</tbody>
</table>
<table id="table-test">
<tbody>
<tr>
<th>Header 1 table 2</th>
<td>Value 1 table 2</td>
</tr>
<tr>
<th>Header 2 </th>
<td>Value 2</td>
</tr>
</tbody>
</table>
</div>
<div class="test-explanation">
NMI : The page contains one table with headers identified as data table by marker and one with headers not identified as data table
</div>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.management;
import java.util.List;
import sun.management.counter.Counter;
/**
* An interface for the monitoring and management of the
* Java virtual machine.
*/
public interface VMManagement {
// Optional supports
public boolean isCompilationTimeMonitoringSupported();
public boolean isThreadContentionMonitoringSupported();
public boolean isThreadContentionMonitoringEnabled();
public boolean isCurrentThreadCpuTimeSupported();
public boolean isOtherThreadCpuTimeSupported();
public boolean isThreadCpuTimeEnabled();
public boolean isBootClassPathSupported();
public boolean isObjectMonitorUsageSupported();
public boolean isSynchronizerUsageSupported();
public boolean isThreadAllocatedMemorySupported();
public boolean isThreadAllocatedMemoryEnabled();
public boolean isGcNotificationSupported();
public boolean isRemoteDiagnosticCommandsSupported();
// Class Loading Subsystem
public long getTotalClassCount();
public int getLoadedClassCount();
public long getUnloadedClassCount();
public boolean getVerboseClass();
// Memory Subsystem
public boolean getVerboseGC();
// Runtime Subsystem
public String getManagementVersion();
public String getVmId();
public String getVmName();
public String getVmVendor();
public String getVmVersion();
public String getVmSpecName();
public String getVmSpecVendor();
public String getVmSpecVersion();
public String getClassPath();
public String getLibraryPath();
public String getBootClassPath();
public List<String> getVmArguments();
public long getStartupTime();
public long getUptime();
public int getAvailableProcessors();
// Compilation Subsystem
public String getCompilerName();
public long getTotalCompileTime();
// Thread Subsystem
public long getTotalThreadCount();
public int getLiveThreadCount();
public int getPeakThreadCount();
public int getDaemonThreadCount();
// Operating System
public String getOsName();
public String getOsArch();
public String getOsVersion();
// Hotspot-specific Runtime support
public long getSafepointCount();
public long getTotalSafepointTime();
public long getSafepointSyncTime();
public long getTotalApplicationNonStoppedTime();
public long getLoadedClassSize();
public long getUnloadedClassSize();
public long getClassLoadingTime();
public long getMethodDataSize();
public long getInitializedClassCount();
public long getClassInitializationTime();
public long getClassVerificationTime();
// Performance counter support
public List<Counter> getInternalCounters(String pattern);
}
| {
"pile_set_name": "Github"
} |
//----------------------------------------------
// NGUI: Next-Gen UI kit
// Copyright © 2011-2014 Tasharen Entertainment
//----------------------------------------------
using UnityEngine;
/// <summary>
/// Equip the specified items on the character when the script is started.
/// </summary>
[AddComponentMenu("NGUI/Examples/Equip Items")]
public class EquipItems : MonoBehaviour
{
public int[] itemIDs;
void Start ()
{
if (itemIDs != null && itemIDs.Length > 0)
{
InvEquipment eq = GetComponent<InvEquipment>();
if (eq == null) eq = gameObject.AddComponent<InvEquipment>();
int qualityLevels = (int)InvGameItem.Quality._LastDoNotUse;
for (int i = 0, imax = itemIDs.Length; i < imax; ++i)
{
int index = itemIDs[i];
InvBaseItem item = InvDatabase.FindByID(index);
if (item != null)
{
InvGameItem gi = new InvGameItem(index, item);
gi.quality = (InvGameItem.Quality)Random.Range(0, qualityLevels);
gi.itemLevel = NGUITools.RandomRange(item.minItemLevel, item.maxItemLevel);
eq.Equip(gi);
}
else
{
Debug.LogWarning("Can't resolve the item ID of " + index);
}
}
}
Destroy(this);
}
} | {
"pile_set_name": "Github"
} |
View specific fields of npm packages
Registry user accounts for npm
Tab completion in `npm`
Current Lifecycle Event
Scoped packages | {
"pile_set_name": "Github"
} |
/******************************************************************************
* Product: ADempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2006-2017 ADempiere Foundation, All Rights Reserved. *
* This program is free software, you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* or (at your option) any later version. *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program, if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* or via [email protected] or http://www.adempiere.net/license.html *
*****************************************************************************/
package org.spin.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.model.*;
import org.compiere.util.KeyNamePair;
/** Generated Interface for T_OpenItemToDate
* @author Adempiere (generated)
* @version Release 3.9.2
*/
public interface I_T_OpenItemToDate
{
/** TableName=T_OpenItemToDate */
public static final String Table_Name = "T_OpenItemToDate";
/** AD_Table_ID=54277 */
public static final int Table_ID = MTable.getTable_ID(Table_Name);
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 3 - Client - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(3);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_PInstance_ID */
public static final String COLUMNNAME_AD_PInstance_ID = "AD_PInstance_ID";
/** Set Process Instance.
* Instance of the process
*/
public void setAD_PInstance_ID (int AD_PInstance_ID);
/** Get Process Instance.
* Instance of the process
*/
public int getAD_PInstance_ID();
public org.compiere.model.I_AD_PInstance getAD_PInstance() throws RuntimeException;
/** Column name C_Activity_ID */
public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID";
/** Set Activity.
* Business Activity
*/
public void setC_Activity_ID (int C_Activity_ID);
/** Get Activity.
* Business Activity
*/
public int getC_Activity_ID();
public org.compiere.model.I_C_Activity getC_Activity() throws RuntimeException;
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
/** Column name C_Campaign_ID */
public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID";
/** Set Campaign.
* Marketing Campaign
*/
public void setC_Campaign_ID (int C_Campaign_ID);
/** Get Campaign.
* Marketing Campaign
*/
public int getC_Campaign_ID();
public org.compiere.model.I_C_Campaign getC_Campaign() throws RuntimeException;
/** Column name C_ConversionType_ID */
public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID";
/** Set Currency Type.
* Currency Conversion Rate Type
*/
public void setC_ConversionType_ID (int C_ConversionType_ID);
/** Get Currency Type.
* Currency Conversion Rate Type
*/
public int getC_ConversionType_ID();
public org.compiere.model.I_C_ConversionType getC_ConversionType() throws RuntimeException;
/** Column name C_Currency_ID */
public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
/** Set Currency.
* The Currency for this record
*/
public void setC_Currency_ID (int C_Currency_ID);
/** Get Currency.
* The Currency for this record
*/
public int getC_Currency_ID();
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
/** Column name C_DocType_ID */
public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID";
/** Set Document Type.
* Document type or rules
*/
public void setC_DocType_ID (int C_DocType_ID);
/** Get Document Type.
* Document type or rules
*/
public int getC_DocType_ID();
public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException;
/** Column name C_InvoicePaySchedule_ID */
public static final String COLUMNNAME_C_InvoicePaySchedule_ID = "C_InvoicePaySchedule_ID";
/** Set Invoice Payment Schedule.
* Invoice Payment Schedule
*/
public void setC_InvoicePaySchedule_ID (int C_InvoicePaySchedule_ID);
/** Get Invoice Payment Schedule.
* Invoice Payment Schedule
*/
public int getC_InvoicePaySchedule_ID();
public org.compiere.model.I_C_InvoicePaySchedule getC_InvoicePaySchedule() throws RuntimeException;
/** Column name C_Invoice_ID */
public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID";
/** Set Invoice.
* Invoice Identifier
*/
public void setC_Invoice_ID (int C_Invoice_ID);
/** Get Invoice.
* Invoice Identifier
*/
public int getC_Invoice_ID();
public org.compiere.model.I_C_Invoice getC_Invoice() throws RuntimeException;
/** Column name C_Order_ID */
public static final String COLUMNNAME_C_Order_ID = "C_Order_ID";
/** Set Order.
* Order
*/
public void setC_Order_ID (int C_Order_ID);
/** Get Order.
* Order
*/
public int getC_Order_ID();
public org.compiere.model.I_C_Order getC_Order() throws RuntimeException;
/** Column name C_PaymentTerm_ID */
public static final String COLUMNNAME_C_PaymentTerm_ID = "C_PaymentTerm_ID";
/** Set Payment Term.
* The terms of Payment (timing, discount)
*/
public void setC_PaymentTerm_ID (int C_PaymentTerm_ID);
/** Get Payment Term.
* The terms of Payment (timing, discount)
*/
public int getC_PaymentTerm_ID();
public org.compiere.model.I_C_PaymentTerm getC_PaymentTerm() throws RuntimeException;
/** Column name C_Project_ID */
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
/** Set Project.
* Financial Project
*/
public void setC_Project_ID (int C_Project_ID);
/** Get Project.
* Financial Project
*/
public int getC_Project_ID();
public org.compiere.model.I_C_Project getC_Project() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name DateAcct */
public static final String COLUMNNAME_DateAcct = "DateAcct";
/** Set Account Date.
* Accounting Date
*/
public void setDateAcct (Timestamp DateAcct);
/** Get Account Date.
* Accounting Date
*/
public Timestamp getDateAcct();
/** Column name DateInvoiced */
public static final String COLUMNNAME_DateInvoiced = "DateInvoiced";
/** Set Date Invoiced.
* Date printed on Invoice
*/
public void setDateInvoiced (Timestamp DateInvoiced);
/** Get Date Invoiced.
* Date printed on Invoice
*/
public Timestamp getDateInvoiced();
/** Column name DateTo */
public static final String COLUMNNAME_DateTo = "DateTo";
/** Set Date To.
* End date of a date range
*/
public void setDateTo (Timestamp DateTo);
/** Get Date To.
* End date of a date range
*/
public Timestamp getDateTo();
/** Column name DaysDue */
public static final String COLUMNNAME_DaysDue = "DaysDue";
/** Set Days due.
* Number of days due (negative: due in number of days)
*/
public void setDaysDue (int DaysDue);
/** Get Days due.
* Number of days due (negative: due in number of days)
*/
public int getDaysDue();
/** Column name DiscountAmt */
public static final String COLUMNNAME_DiscountAmt = "DiscountAmt";
/** Set Discount Amount.
* Calculated amount of discount
*/
public void setDiscountAmt (BigDecimal DiscountAmt);
/** Get Discount Amount.
* Calculated amount of discount
*/
public BigDecimal getDiscountAmt();
/** Column name DiscountDate */
public static final String COLUMNNAME_DiscountDate = "DiscountDate";
/** Set Discount Date.
* Last Date for payments with discount
*/
public void setDiscountDate (Timestamp DiscountDate);
/** Get Discount Date.
* Last Date for payments with discount
*/
public Timestamp getDiscountDate();
/** Column name DocumentNo */
public static final String COLUMNNAME_DocumentNo = "DocumentNo";
/** Set Document No.
* Document sequence number of the document
*/
public void setDocumentNo (String DocumentNo);
/** Get Document No.
* Document sequence number of the document
*/
public String getDocumentNo();
/** Column name DueDate */
public static final String COLUMNNAME_DueDate = "DueDate";
/** Set Due Date.
* Date when the payment is due
*/
public void setDueDate (Timestamp DueDate);
/** Get Due Date.
* Date when the payment is due
*/
public Timestamp getDueDate();
/** Column name GrandTotal */
public static final String COLUMNNAME_GrandTotal = "GrandTotal";
/** Set Grand Total.
* Total amount of document
*/
public void setGrandTotal (BigDecimal GrandTotal);
/** Get Grand Total.
* Total amount of document
*/
public BigDecimal getGrandTotal();
/** Column name InvoiceCollectionType */
public static final String COLUMNNAME_InvoiceCollectionType = "InvoiceCollectionType";
/** Set Collection Status.
* Invoice Collection Status
*/
public void setInvoiceCollectionType (String InvoiceCollectionType);
/** Get Collection Status.
* Invoice Collection Status
*/
public String getInvoiceCollectionType();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name IsPayScheduleValid */
public static final String COLUMNNAME_IsPayScheduleValid = "IsPayScheduleValid";
/** Set Pay Schedule valid.
* Is the Payment Schedule is valid
*/
public void setIsPayScheduleValid (boolean IsPayScheduleValid);
/** Get Pay Schedule valid.
* Is the Payment Schedule is valid
*/
public boolean isPayScheduleValid();
/** Column name IsSOTrx */
public static final String COLUMNNAME_IsSOTrx = "IsSOTrx";
/** Set Sales Transaction.
* This is a Sales Transaction
*/
public void setIsSOTrx (boolean IsSOTrx);
/** Get Sales Transaction.
* This is a Sales Transaction
*/
public boolean isSOTrx();
/** Column name NetDays */
public static final String COLUMNNAME_NetDays = "NetDays";
/** Set Net Days.
* Net Days in which payment is due
*/
public void setNetDays (int NetDays);
/** Get Net Days.
* Net Days in which payment is due
*/
public int getNetDays();
/** Column name OpenAmt */
public static final String COLUMNNAME_OpenAmt = "OpenAmt";
/** Set Open Amount.
* Open item amount
*/
public void setOpenAmt (BigDecimal OpenAmt);
/** Get Open Amount.
* Open item amount
*/
public BigDecimal getOpenAmt();
/** Column name PaidAmt */
public static final String COLUMNNAME_PaidAmt = "PaidAmt";
/** Set Paid Amount */
public void setPaidAmt (BigDecimal PaidAmt);
/** Get Paid Amount */
public BigDecimal getPaidAmt();
/** Column name UUID */
public static final String COLUMNNAME_UUID = "UUID";
/** Set Immutable Universally Unique Identifier.
* Immutable Universally Unique Identifier
*/
public void setUUID (String UUID);
/** Get Immutable Universally Unique Identifier.
* Immutable Universally Unique Identifier
*/
public String getUUID();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}
| {
"pile_set_name": "Github"
} |
package com.gracecode.tracker.ui.activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.gracecode.tracker.R;
import com.gracecode.tracker.dao.ArchiveMeta;
import com.gracecode.tracker.dao.Archiver;
import com.gracecode.tracker.ui.activity.base.Activity;
public class Modify extends Activity implements View.OnClickListener {
private Button mBtnConfirm;
private EditText mDescription;
private String archiveFileName;
private Archiver archive;
private ArchiveMeta archiveMeta;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.modify);
mBtnConfirm = (Button) findViewById(R.id.confirm);
mDescription = (EditText) findViewById(R.id.description);
archiveFileName = getIntent().getStringExtra(Records.INTENT_ARCHIVE_FILE_NAME);
}
@Override
public void onStart() {
super.onStart();
archive = new Archiver(context, archiveFileName, Archiver.MODE_READ_WRITE);
if (archive == null || !archive.exists()) {
helper.showShortToast(getString(R.string.archive_not_exists));
finish();
return;
}
archiveMeta = archive.getMeta();
actionBar.setTitle(getString(R.string.title_modify));
mDescription.setText(archiveMeta.getDescription());
mBtnConfirm.setOnClickListener(this);
}
@Override
public void onPause() {
if (archive != null) {
archive.close();
}
super.onPause();
}
@Override
public void onClick(View view) {
String description = mDescription.getText().toString().trim();
try {
if (description.length() > 0 && archiveMeta.setDescription(description)) {
helper.showLongToast(getString(R.string.has_benn_saved));
finish();
}
} catch (Exception e) {
helper.showLongToast(getString(R.string.shit_happens));
}
}
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
# -*- bash -*-
: << =cut
=head1 NAME
haproxy_response_compressor_backend -Haproxy Response Compressed
=head1 CONFIGURATION
[haproxy*]
user root
env.backend backend_name_1 backend_name_2 backend_name_3
env.frontend frontend_name_1 frontend_name_2 frontend_name_3
# You can use url o socket option, use one of them, not both!
env.url http://user:passwd@IP:port/admin?stats;csv
# or
env.socket /var/lib/haproxy/stats.socket
=head1 AUTHOR
Ricardo Fraile <[email protected]>
=head1 LICENSE
GPLv2
=head1 MAGICK MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
. $MUNIN_LIBDIR/plugins/plugin.sh
function parse_url {
# Modify ifs variable
OIFS=$IFS;
IFS=",";
PXNAME="$1"
SVNAME="$2"
VALUE="$3"
if [ ! -z "$url" ]; then
LINE1=`curl -s "$url" | head -1 | sed 's/# //'`
LINE2=`curl -s "$url" | grep "$PXNAME,$SVNAME"`
fi
if [ ! -z "$socket" ]; then
LINE1=`echo 'show stat' | socat unix-connect:"$socket" stdio | head -1 | sed 's/# //'`
LINE2=`echo 'show stat' | socat unix-connect:"$socket" stdio | grep "$PXNAME,$SVNAME"`
fi
ARRAY1=($LINE1);
# Find values
for ((i=0; i<${#ARRAY1[@]}; ++i));
do
# Get data
if [[ "${ARRAY1[$i]}" == "${VALUE}" ]]; then
o=$i;
o=`expr $o + 1`
echo ${LINE2} | cut -d" " -f $o
fi
done
# Reset ifs
IFS=$OIFS;
}
SVNAME='FRONTEND'
LIST="$frontend"
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo "graph_title Responses compressed ${SVNAME}"
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel Responses'
echo 'graph_scale no'
echo 'graph_category loadbalancer'
echo "graph_info HTTP responses that were compressed ${SVNAME}"
for i in ${LIST}; do
echo "comp_rsp`echo $i | md5sum | cut -d - -f1 | sed 's/ //g'`.label Responses compressed$i"
echo "comp_rsp`echo $i | md5sum | cut -d - -f1 | sed 's/ //g'`.type DERIVE"
echo "comp_rsp`echo $i | md5sum | cut -d - -f1 | sed 's/ //g'`.min 0"
echo "comp_rsp`echo $i | md5sum | cut -d - -f1 | sed 's/ //g'`.info HTTP responses that were compressed $i"
done
exit 0
fi
for i in ${LIST}; do
RSP=`parse_url ${i} ${SVNAME} comp_rsp`
echo "comp_rsp`echo $i | md5sum | cut -d - -f1 | sed 's/ //g'`.value $RSP"
done
| {
"pile_set_name": "Github"
} |
/** Broadcast a (POSIX threads) signal to all running threads, where the
* number of threads can be specified on the command line. This test program
* is intended not only to test the correctness of drd but also to test
* whether performance does not degrade too much when the number of threads
* increases.
*/
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
// Counting semaphore.
struct csema
{
pthread_mutex_t m_mutex;
pthread_cond_t m_cond;
int m_count;
};
void csema_ctr(struct csema* p)
{
memset(p, 0, sizeof(*p));
pthread_mutex_init(&p->m_mutex, 0);
pthread_cond_init(&p->m_cond, 0);
}
void csema_dtr(struct csema* p)
{
pthread_cond_destroy(&p->m_cond);
pthread_mutex_destroy(&p->m_mutex);
}
void csema_p(struct csema* p, const int n)
{
pthread_mutex_lock(&p->m_mutex);
while (p->m_count < n)
pthread_cond_wait(&p->m_cond, &p->m_mutex);
p->m_count -= n;
pthread_cond_signal(&p->m_cond);
pthread_mutex_unlock(&p->m_mutex);
}
void csema_v(struct csema* p)
{
pthread_mutex_lock(&p->m_mutex);
p->m_count++;
pthread_cond_signal(&p->m_cond);
pthread_mutex_unlock(&p->m_mutex);
}
struct cthread
{
pthread_t m_thread;
int m_threadnum;
struct csema* m_sema;
};
void cthread_ctr(struct cthread* p)
{
p->m_thread = 0;
p->m_sema = 0;
}
void cthread_dtr(struct cthread* p)
{ }
// Local variables.
static int s_debug = 0;
static int s_trace = 0;
static int s_signal_count;
static pthread_mutex_t s_mutex;
static pthread_cond_t s_cond;
// Function definitions.
static void thread_func(struct cthread* thread_info)
{
int i;
pthread_mutex_lock(&s_mutex);
for (i = 0; i < s_signal_count; i++)
{
if (s_trace)
{
printf("thread %d [%d] (1)\n", thread_info->m_threadnum, i);
}
csema_v(thread_info->m_sema);
// Wait until the main thread signals us via pthread_cond_broadcast().
pthread_cond_wait(&s_cond, &s_mutex);
if (s_trace)
{
printf("thread %d [%d] (2)\n", thread_info->m_threadnum, i);
}
}
pthread_mutex_unlock(&s_mutex);
}
int main(int argc, char** argv)
{
int optchar;
int thread_count;
while ((optchar = getopt(argc, argv, "d")) != EOF)
{
switch (optchar)
{
case 'd':
s_debug = 1;
break;
default:
assert(0);
break;
}
}
/* This test should complete in 15s or less. If the test does not complete */
/* within that time, abort the test via the signal SIGALRM. */
alarm(100);
s_signal_count = argc > optind ? atoi(argv[optind]) : 10;
thread_count = argc > optind + 1 ? atoi(argv[optind + 1]) : 10;
if (s_debug)
printf("&s_cond = %p\n", &s_cond);
pthread_mutex_init(&s_mutex, 0);
pthread_cond_init(&s_cond, 0);
{
int i;
struct csema sema;
struct cthread* p;
struct cthread* thread_vec;
csema_ctr(&sema);
thread_vec = malloc(sizeof(struct cthread) * thread_count);
for (p = thread_vec; p != thread_vec + thread_count; p++)
{
cthread_ctr(p);
p->m_threadnum = p - thread_vec;
p->m_sema = &sema;
pthread_create(&p->m_thread, 0,
(void*(*)(void*))thread_func, &*p);
}
for (i = 0; i < s_signal_count; i++)
{
if (s_trace)
printf("main [%d] (1)\n", i);
csema_p(&sema, thread_count);
if (s_trace)
printf("main [%d] (2)\n", i);
pthread_mutex_lock(&s_mutex);
pthread_cond_broadcast(&s_cond);
pthread_mutex_unlock(&s_mutex);
if (s_trace)
printf("main [%d] (3)\n", i);
}
for (i = 0; i < thread_count; i++)
{
pthread_join(thread_vec[i].m_thread, 0);
cthread_dtr(&thread_vec[i]);
}
free(thread_vec);
csema_dtr(&sema);
}
pthread_cond_destroy(&s_cond);
pthread_mutex_destroy(&s_mutex);
fprintf(stderr, "Done.\n");
return 0;
}
| {
"pile_set_name": "Github"
} |
require "./model"
module Amber::CLI
class Model < Generator
command :model
directory "#{__DIR__}/../templates/model"
property migration : Generator
def initialize(name, fields)
super(name, fields)
@migration = Amber::CLI::Migration.new(name, fields)
add_timestamp_fields
end
def pre_render(directory, **args)
add_dependencies
end
def render(directory, **args)
super(directory, **args)
migration.render(directory, **args)
end
private def add_dependencies
add_dependencies <<-DEPENDENCY
require "../src/models/**"
DEPENDENCY
end
end
end
| {
"pile_set_name": "Github"
} |
<template>
<div :class="{'has-logo':showLogo}">
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu
:default-active="activeMenu"
:collapse="isCollapse"
:background-color="variables.menuBg"
:text-color="variables.menuText"
:unique-opened="false"
:active-text-color="variables.menuActiveText"
:collapse-transition="false"
mode="vertical"
>
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
</el-menu>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
export default {
components: { SidebarItem, Logo },
computed: {
...mapGetters([
'sidebar'
]),
routes() {
return this.$router.options.routes
},
activeMenu() {
const route = this.$route
const { meta, path } = route
// if set path, the sidebar will highlight the path you set
if (meta.activeMenu) {
return meta.activeMenu
}
return path
},
showLogo() {
return this.$store.state.settings.sidebarLogo
},
variables() {
return variables
},
isCollapse() {
return !this.sidebar.opened
}
}
}
</script>
| {
"pile_set_name": "Github"
} |
/* boost random/shuffle_output.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: shuffle_output.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
#define BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
#include <boost/random/shuffle_order.hpp>
namespace boost {
namespace random {
/// \cond
template<typename URNG, int k,
typename URNG::result_type val = 0>
class shuffle_output : public shuffle_order_engine<URNG, k>
{
typedef shuffle_order_engine<URNG, k> base_t;
typedef typename base_t::result_type result_type;
public:
shuffle_output() {}
template<class T>
shuffle_output(T& arg) : base_t(arg) {}
template<class T>
shuffle_output(const T& arg) : base_t(arg) {}
template<class It>
shuffle_output(It& first, It last) : base_t(first, last) {}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{ return (this->base().min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{ return (this->base().max)(); }
};
/// \endcond
}
}
#endif // BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
| {
"pile_set_name": "Github"
} |
#ifndef BTRFS_EXPORT_H
#define BTRFS_EXPORT_H
#include <linux/exportfs.h>
extern const struct export_operations btrfs_export_ops;
struct btrfs_fid {
u64 objectid;
u64 root_objectid;
u32 gen;
u64 parent_objectid;
u32 parent_gen;
u64 parent_root_objectid;
} __attribute__ ((packed));
#endif
| {
"pile_set_name": "Github"
} |
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://wix-rich-content/image-content-data-schema.json",
"type": "object",
"required": ["src"],
"properties": {
"config": {
"$id": "/properties/config",
"type": "object",
"title": "configuration",
"properties": {
"size": {
"$id": "/properties/config/properties/size",
"enum": ["content", "small", "original", "fullWidth", "inline"],
"title": "size",
"examples": ["content", "small", "original", "fullWidth", "inline"]
},
"alignment": {
"$id": "/properties/config/properties/alignment",
"enum": ["left", "right", "center"],
"title": "alignment",
"examples": ["left", "right", "center"]
},
"showTitle": {
"$id": "/properties/config/properties/showTitle",
"type": "boolean",
"title": "show title",
"default": false,
"examples": [true]
},
"showDescription": {
"$id": "/properties/config/properties/showDescription",
"type": "boolean",
"title": "show description",
"default": false,
"examples": [true]
},
"anchor": {
"$id": "/properties/config/properties/anchor",
"type": "string",
"title": "anchor",
"examples": ["2jlo1"]
},
"link": {
"$id": "/properties/config/properties/link",
"type": ["object", "null"],
"required": ["url"],
"properties": {
"url": {
"$id": "/properties/config/properties/link/properties/url",
"type": "string",
"title": "URL",
"examples": ["wix.com"]
},
"target": {
"$id": "/properties/config/properties/link/properties/target",
"enum": ["_blank", "_self", "_top"],
"title": "link target",
"examples": ["_blank"]
},
"rel": {
"$id": "/properties/config/properties/link/properties/rel",
"type": "string",
"title": "link rel",
"default": "noopener",
"examples": ["nofollow", "noreferrer"]
}
}
}
}
},
"src": {
"$id": "/properties/src",
"type": ["object", "string", "null"],
"properties": {
"id": {
"$id": "/properties/src/properties/id",
"type": "string",
"title": "id",
"examples": ["8310d26374ed948918b9914ea076e411"]
},
"original_file_name": {
"$id": "/properties/src/properties/original_file_name",
"type": "string",
"title": "The original file name",
"examples": ["8bb438_b5957febd0ed45d3be9a0e91669c65b4.jpg"]
},
"file_name": {
"$id": "/properties/src/properties/file_name",
"type": "string",
"title": "The file name",
"examples": ["8bb438_b5957febd0ed45d3be9a0e91669c65b4.jpg"]
},
"width": {
"$id": "/properties/src/properties/width",
"type": "integer",
"title": "image width",
"default": 0,
"examples": [1621]
},
"height": {
"$id": "/properties/src/properties/height",
"type": "integer",
"title": "image height",
"default": 0,
"examples": [1081]
}
}
},
"metadata": {
"$id": "/properties/metadata",
"type": "object",
"properties": {
"alt": {
"$id": "/properties/metadata/properties/alt",
"type": "string",
"title": "alt text",
"examples": ["alt"]
},
"caption": {
"$id": "/properties/metadata/properties/caption",
"type": "string",
"title": "Image caption",
"examples": ["Wanted dead or alive"]
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
{
"topology_description": {
"type": "ReplicaSetNoPrimary",
"servers": [
{
"address": "b:27017",
"avg_rtt_ms": 5,
"type": "RSSecondary",
"tags": {
"data_center": "nyc"
}
},
{
"address": "c:27017",
"avg_rtt_ms": 100,
"type": "RSSecondary",
"tags": {
"data_center": "nyc"
}
}
]
},
"operation": "read",
"read_preference": {
"mode": "Nearest",
"tag_sets": [
{
"data_center": "nyc"
}
]
},
"suitable_servers": [
{
"address": "b:27017",
"avg_rtt_ms": 5,
"type": "RSSecondary",
"tags": {
"data_center": "nyc"
}
},
{
"address": "c:27017",
"avg_rtt_ms": 100,
"type": "RSSecondary",
"tags": {
"data_center": "nyc"
}
}
],
"in_latency_window": [
{
"address": "b:27017",
"avg_rtt_ms": 5,
"type": "RSSecondary",
"tags": {
"data_center": "nyc"
}
}
]
}
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2015 Gael Guennebaud <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_SPARSE_REF_H
#define EIGEN_SPARSE_REF_H
namespace Eigen {
enum {
StandardCompressedFormat = 2
};
namespace internal {
template<typename Derived> class SparseRefBase;
template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
struct traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
: public traits<SparseMatrix<MatScalar,MatOptions,MatIndex> >
{
typedef SparseMatrix<MatScalar,MatOptions,MatIndex> PlainObjectType;
enum {
Options = _Options,
Flags = traits<PlainObjectType>::Flags | CompressedAccessBit | NestByRefBit
};
template<typename Derived> struct match {
enum {
StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)),
MatchAtCompileTime = (Derived::Flags&CompressedAccessBit) && StorageOrderMatch
};
typedef typename internal::conditional<MatchAtCompileTime,internal::true_type,internal::false_type>::type type;
};
};
template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
struct traits<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
: public traits<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
{
enum {
Flags = (traits<SparseMatrix<MatScalar,MatOptions,MatIndex> >::Flags | CompressedAccessBit | NestByRefBit) & ~LvalueBit
};
};
template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
struct traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
: public traits<SparseVector<MatScalar,MatOptions,MatIndex> >
{
typedef SparseVector<MatScalar,MatOptions,MatIndex> PlainObjectType;
enum {
Options = _Options,
Flags = traits<PlainObjectType>::Flags | CompressedAccessBit | NestByRefBit
};
template<typename Derived> struct match {
enum {
MatchAtCompileTime = (Derived::Flags&CompressedAccessBit) && Derived::IsVectorAtCompileTime
};
typedef typename internal::conditional<MatchAtCompileTime,internal::true_type,internal::false_type>::type type;
};
};
template<typename MatScalar, int MatOptions, typename MatIndex, int _Options, typename _StrideType>
struct traits<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
: public traits<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, _Options, _StrideType> >
{
enum {
Flags = (traits<SparseVector<MatScalar,MatOptions,MatIndex> >::Flags | CompressedAccessBit | NestByRefBit) & ~LvalueBit
};
};
template<typename Derived>
struct traits<SparseRefBase<Derived> > : public traits<Derived> {};
template<typename Derived> class SparseRefBase
: public SparseMapBase<Derived>
{
public:
typedef SparseMapBase<Derived> Base;
EIGEN_SPARSE_PUBLIC_INTERFACE(SparseRefBase)
SparseRefBase()
: Base(RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime, 0, 0, 0, 0, 0)
{}
protected:
template<typename Expression>
void construct(Expression& expr)
{
if(expr.outerIndexPtr()==0)
::new (static_cast<Base*>(this)) Base(expr.size(), expr.nonZeros(), expr.innerIndexPtr(), expr.valuePtr());
else
::new (static_cast<Base*>(this)) Base(expr.rows(), expr.cols(), expr.nonZeros(), expr.outerIndexPtr(), expr.innerIndexPtr(), expr.valuePtr(), expr.innerNonZeroPtr());
}
};
} // namespace internal
/**
* \ingroup Sparse_Module
*
* \brief A sparse matrix expression referencing an existing sparse expression
*
* \tparam PlainObjectType the equivalent sparse matrix type of the referenced data
* \tparam Options specifies whether the a standard compressed format is required \c Options is \c #StandardCompressedFormat, or \c 0.
* The default is \c 0.
* \tparam StrideType Only used for dense Ref
*
* \sa class Ref
*/
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
class Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType >
: public internal::SparseRefBase<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType > >
{
typedef SparseMatrix<MatScalar,MatOptions,MatIndex> PlainObjectType;
typedef internal::traits<Ref> Traits;
template<int OtherOptions>
inline Ref(const SparseMatrix<MatScalar,OtherOptions,MatIndex>& expr);
template<int OtherOptions>
inline Ref(const MappedSparseMatrix<MatScalar,OtherOptions,MatIndex>& expr);
public:
typedef internal::SparseRefBase<Ref> Base;
EIGEN_SPARSE_PUBLIC_INTERFACE(Ref)
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<int OtherOptions>
inline Ref(SparseMatrix<MatScalar,OtherOptions,MatIndex>& expr)
{
EIGEN_STATIC_ASSERT(bool(Traits::template match<SparseMatrix<MatScalar,OtherOptions,MatIndex> >::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) );
Base::construct(expr.derived());
}
template<int OtherOptions>
inline Ref(MappedSparseMatrix<MatScalar,OtherOptions,MatIndex>& expr)
{
EIGEN_STATIC_ASSERT(bool(Traits::template match<SparseMatrix<MatScalar,OtherOptions,MatIndex> >::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) );
Base::construct(expr.derived());
}
template<typename Derived>
inline Ref(const SparseCompressedBase<Derived>& expr)
#else
template<typename Derived>
inline Ref(SparseCompressedBase<Derived>& expr)
#endif
{
EIGEN_STATIC_ASSERT(bool(internal::is_lvalue<Derived>::value), THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
EIGEN_STATIC_ASSERT(bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) );
Base::construct(expr.const_cast_derived());
}
};
// this is the const ref version
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
class Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType>
: public internal::SparseRefBase<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> >
{
typedef SparseMatrix<MatScalar,MatOptions,MatIndex> TPlainObjectType;
typedef internal::traits<Ref> Traits;
public:
typedef internal::SparseRefBase<Ref> Base;
EIGEN_SPARSE_PUBLIC_INTERFACE(Ref)
template<typename Derived>
inline Ref(const SparseMatrixBase<Derived>& expr)
{
construct(expr.derived(), typename Traits::template match<Derived>::type());
}
inline Ref(const Ref& other) : Base(other) {
// copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy
}
template<typename OtherRef>
inline Ref(const RefBase<OtherRef>& other) {
construct(other.derived(), typename Traits::template match<OtherRef>::type());
}
protected:
template<typename Expression>
void construct(const Expression& expr,internal::true_type)
{
if((Options & int(StandardCompressedFormat)) && (!expr.isCompressed()))
{
TPlainObjectType* obj = reinterpret_cast<TPlainObjectType*>(m_object_bytes);
::new (obj) TPlainObjectType(expr);
Base::construct(*obj);
}
else
{
Base::construct(expr);
}
}
template<typename Expression>
void construct(const Expression& expr, internal::false_type)
{
TPlainObjectType* obj = reinterpret_cast<TPlainObjectType*>(m_object_bytes);
::new (obj) TPlainObjectType(expr);
Base::construct(*obj);
}
protected:
char m_object_bytes[sizeof(TPlainObjectType)];
};
/**
* \ingroup Sparse_Module
*
* \brief A sparse vector expression referencing an existing sparse vector expression
*
* \tparam PlainObjectType the equivalent sparse matrix type of the referenced data
* \tparam Options Not used for SparseVector.
* \tparam StrideType Only used for dense Ref
*
* \sa class Ref
*/
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
class Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType >
: public internal::SparseRefBase<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType > >
{
typedef SparseVector<MatScalar,MatOptions,MatIndex> PlainObjectType;
typedef internal::traits<Ref> Traits;
template<int OtherOptions>
inline Ref(const SparseVector<MatScalar,OtherOptions,MatIndex>& expr);
public:
typedef internal::SparseRefBase<Ref> Base;
EIGEN_SPARSE_PUBLIC_INTERFACE(Ref)
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<int OtherOptions>
inline Ref(SparseVector<MatScalar,OtherOptions,MatIndex>& expr)
{
EIGEN_STATIC_ASSERT(bool(Traits::template match<SparseVector<MatScalar,OtherOptions,MatIndex> >::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
Base::construct(expr.derived());
}
template<typename Derived>
inline Ref(const SparseCompressedBase<Derived>& expr)
#else
template<typename Derived>
inline Ref(SparseCompressedBase<Derived>& expr)
#endif
{
EIGEN_STATIC_ASSERT(bool(internal::is_lvalue<Derived>::value), THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
EIGEN_STATIC_ASSERT(bool(Traits::template match<Derived>::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH);
Base::construct(expr.const_cast_derived());
}
};
// this is the const ref version
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
class Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType>
: public internal::SparseRefBase<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> >
{
typedef SparseVector<MatScalar,MatOptions,MatIndex> TPlainObjectType;
typedef internal::traits<Ref> Traits;
public:
typedef internal::SparseRefBase<Ref> Base;
EIGEN_SPARSE_PUBLIC_INTERFACE(Ref)
template<typename Derived>
inline Ref(const SparseMatrixBase<Derived>& expr)
{
construct(expr.derived(), typename Traits::template match<Derived>::type());
}
inline Ref(const Ref& other) : Base(other) {
// copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy
}
template<typename OtherRef>
inline Ref(const RefBase<OtherRef>& other) {
construct(other.derived(), typename Traits::template match<OtherRef>::type());
}
protected:
template<typename Expression>
void construct(const Expression& expr,internal::true_type)
{
Base::construct(expr);
}
template<typename Expression>
void construct(const Expression& expr, internal::false_type)
{
TPlainObjectType* obj = reinterpret_cast<TPlainObjectType*>(m_object_bytes);
::new (obj) TPlainObjectType(expr);
Base::construct(*obj);
}
protected:
char m_object_bytes[sizeof(TPlainObjectType)];
};
namespace internal {
// FIXME shall we introduce a general evaluatior_ref that we can specialize for any sparse object once, and thus remove this copy-pasta thing...
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
struct evaluator<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> >
: evaluator<SparseCompressedBase<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
{
typedef evaluator<SparseCompressedBase<Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > > Base;
typedef Ref<SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> XprType;
evaluator() : Base() {}
explicit evaluator(const XprType &mat) : Base(mat) {}
};
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
struct evaluator<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> >
: evaluator<SparseCompressedBase<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
{
typedef evaluator<SparseCompressedBase<Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> > > Base;
typedef Ref<const SparseMatrix<MatScalar,MatOptions,MatIndex>, Options, StrideType> XprType;
evaluator() : Base() {}
explicit evaluator(const XprType &mat) : Base(mat) {}
};
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
struct evaluator<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> >
: evaluator<SparseCompressedBase<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
{
typedef evaluator<SparseCompressedBase<Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > > Base;
typedef Ref<SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> XprType;
evaluator() : Base() {}
explicit evaluator(const XprType &mat) : Base(mat) {}
};
template<typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
struct evaluator<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> >
: evaluator<SparseCompressedBase<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > >
{
typedef evaluator<SparseCompressedBase<Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> > > Base;
typedef Ref<const SparseVector<MatScalar,MatOptions,MatIndex>, Options, StrideType> XprType;
evaluator() : Base() {}
explicit evaluator(const XprType &mat) : Base(mat) {}
};
}
} // end namespace Eigen
#endif // EIGEN_SPARSE_REF_H
| {
"pile_set_name": "Github"
} |
#
# FreeType 2 configuration file to detect an BeOS host platform.
#
# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
.PHONY: setup
ifeq ($(PLATFORM),ansi)
ifdef BE_HOST_CPU
PLATFORM := beos
endif # test MACHTYPE beos
endif
ifeq ($(PLATFORM),beos)
DELETE := rm -f
CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/beos
CONFIG_FILE := beos.mk
setup: std_setup
endif # test PLATFORM beos
# EOF
| {
"pile_set_name": "Github"
} |
system canOfWorms
{
category LightFX
technique
{
visual_particle_quota 2000
emitted_emitter_quota 20
material PUMediaPack/Flare_04
default_particle_width 1.2
default_particle_height 1.2
renderer Billboard
{
}
emitter Point Core
{
emission_rate 3
angle 360
time_to_live 4
velocity 9
emits emitter_particle Worms
}
emitter Point Worms
{
emission_rate 60
angle 360
time_to_live 2
velocity 0.45
direction 0 -1 0
colour 1 0.6 0.6 1
}
affector SineForce
{
exclude_emitter Worms
force_vector 15 15 15
min_frequency 5
max_frequency 5
}
}
}
| {
"pile_set_name": "Github"
} |
.loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: $blue;
z-index: 4;
&.hidden {
display: none !important;
}
.loader__circle {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 200px;
height: 200px;
border-radius: 50%;
//box-shadow: inset 0 0 0 12px $blue;
z-index: 1;
}
.loader__line-mask {
position: absolute;
left: 50%;
top: 50%;
width: 100px;
height: 200px;
margin-left: -100px;
margin-top: -100px;
overflow: hidden;
z-index: 2;
transform-origin: 100px 100px;
mask-image: linear-gradient(to bottom, rgba(255, 255, 255,1), rgba(255, 255, 255,0));
animation: rotate 1.2s infinite linear;
transition: all .3s;
.loader__line {
height: 200px;
width: 200px;
border-radius: 50%;
box-shadow: inset 0 0 0 12px lighten($blue, 20%);
}
}
@keyframes rotate {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loader__logo {
position: absolute;
top: -10px;
bottom: 0;
left: 0;
right: 0;
opacity: .8;
margin: auto;
fill: $white;
width: 300px;
height: 300px;
transform: scale(0.45);
}
}
.loader-small,
.loader-small:after {
border-radius: 50%;
width: 20px;
height: 20px;
}
.loader-small {
display: none;
border-top: 1px solid rgba(0, 0, 0, 0.1);
border-right: 1px solid rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
border-left: 1px solid $blue;
transform: translateZ(0);
animation: spinner 1.1s infinite linear;
&.inverted {
border-color: rgba(255,255,255,0.2);
border-left-color: $white;
}
@keyframes spinner {
0% { transform: rotate(0deg) }
100% { transform: rotate(360deg) }
}
} | {
"pile_set_name": "Github"
} |
#!/bin/sh
#############################################################################
# Copyright (C) 2013-2015 Lawrence Livermore National Security, LLC.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Albert Chu <[email protected]>
# LLNL-CODE-644248
#
# This file is part of Magpie, scripts for running Hadoop on
# traditional HPC systems. For details, see https://github.com/llnl/magpie.
#
# Magpie 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.
#
# Magpie 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 Magpie. If not, see <http://www.gnu.org/licenses/>.
#############################################################################
############################################################################
# Moab Customizations
############################################################################
# Node count. Node count should include one node for the
# head/management/master node. For example, if you want 8 compute
# nodes to process data, specify 9 nodes below.
#
# If including Zookeeper, include expected Zookeeper nodes. For
# example, if you want 8 Hadoop compute nodes and 3 Zookeeper nodes,
# specify 12 nodes (1 master, 8 Hadoop, 3 Zookeeper)
#
# Also take into account additional nodes needed for other services.
#
# Many of the below can be configured on the command line. If you are
# more comfortable specifying these on the command line, feel free to
# delete the customizations below.
#PBS -N <my_job_name>
#PBS -A <my_account_string>
#PBS -l nodes=<my_node_count>
#PBS -o moab-%j.out
#PBS -l partition=<my_partition>
#PBS -q <my_batch_queue>
# Note defaults of MAGPIE_STARTUP_TIME & MAGPIE_SHUTDOWN_TIME, the
# walltime should be a fair amount larger than them combined.
#PBS -l walltime=<my_time_in_seconds_or_HH:MM:SS>
#PBS -l resfailpolicy=ignore
# Need to tell Magpie how you are submitting this job
#
# IMPORTANT: This submit file assumes torque is the underlying resource
# manager. If it is not, a new Magpie submission type should be added
# into Magpie.
export MAGPIE_SUBMISSION_TYPE="msubtorquepdsh"
############################################################################
# Magpie Configurations
############################################################################
# Directory your launching scripts/files are stored
#
# Normally an NFS mount, someplace magpie can be reached on all nodes.
export MAGPIE_SCRIPTS_HOME="${HOME}/magpie"
# Path to store data local to each cluster node, typically something
# in /tmp. This will store local conf files and log files for your
# job. If local scratch space is not available, consider using the
# MAGPIE_NO_LOCAL_DIR option. See README for more details.
#
export MAGPIE_LOCAL_DIR="/tmp/${USER}/magpie"
# Magpie job type
#
# "spark" - Run a job according to the settings of SPARK_JOB.
#
# "testall" - Run a job that runs all basic sanity tests for all
# software that is configured to be setup. This is a good
# way to sanity check that everything has been setup
# correctly and the way you like.
#
# For Spark, testall will run sparkpi
#
# "script" - Run arbitraty script, as specified by MAGPIE_JOB_SCRIPT.
# You can find example job scripts in examples/.
#
# "interactive" - manually interact with job run to submit jobs,
# peruse data (e.g. HDFS), move data, etc. See job
# output for instructions to access your job
# allocation.
#
# "setuponly" - do not launch any daemons or services, only setup
# configuration files. Useful for debugging or
# development.
#
export MAGPIE_JOB_TYPE="spark"
# Specify script and arguments to execute for "script" mode in
# MAGPIE_JOB_TYPE
#
# export MAGPIE_JOB_SCRIPT="${HOME}/my-job-script"
# Specify script startup / shutdown time window
#
# Specifies the amount of time to give startup / shutdown activities a
# chance to succeed before Magpie will give up (or in the case of
# shutdown, when the resource manager/scheduler may kill the running
# job). Defaults to 30 minutes for startup, 30 minutes for shutdown.
#
# The startup time in particular may need to be increased if you have
# a large amount of data. As an example, HDFS may need to spend a
# significant amount of time determine all of the blocks in HDFS
# before leaving safemode.
#
# The stop time in particular may need to be increased if you have a
# large amount of cleanup to be done. HDFS will save its NameSpace
# before shutting down. Hbase will do a compaction before shutting
# down.
#
# The startup & shutdown window must together be smaller than the
# timelimit specified for the job.
#
# MAGPIE_STARTUP_TIME and MAGPIE_SHUTDOWN_TIME at minimum must be 5
# minutes. If MAGPIE_POST_JOB_RUN is specified below,
# MAGPIE_SHUTDOWN_TIME must be at minimum 10 minutes.
#
# export MAGPIE_STARTUP_TIME=30
# export MAGPIE_SHUTDOWN_TIME=30
# Magpie One Time Run
#
# Normally, Magpie assumes that when a user runs a job, data created
# and stored within that job will be desired to be accessed again. For
# example, data created and stored within HDFS will be accessed again.
#
# Under a number of scenarios, this may not be desired. For example
# during testing.
#
# To improve useability and performance, setting MAGPIE_ONE_TIME_RUN
# below to yes will have two effects on the Magpie job.
#
# 1) A number of data paths (such as for HDFS) will be put into unique
# paths for this job. Therefore, no other job should be able to
# access the data again. This is particularly useful if you wish
# to run performance tests with this job script over and over
# again.
#
# Magpie will not remove data that was written, so be sure to clean up
# your directories later.
#
# 2) In order to improve job throughout, Magpie will take shortcuts by
# not properly tearing down the job. As data corruption should not be
# a concern on job teardown, the job can complete more quickly.
#
# export MAGPIE_ONE_TIME_RUN=yes
# Convenience Scripts
#
# Specify script to be executed to before / after your job. It is run
# on all nodes.
#
# Typically the pre-job script is used to set something up or get
# debugging info. It can also be used to determine if system
# conditions meet the expectations of your job. The primary job
# running script (magpie-run) will not be executed if the
# MAGPIE_PRE_JOB_RUN exits with a non-zero exit code.
#
# The post-job script is typically used for cleaning up something or
# gathering info (such as logs) for post-debugging/analysis. If it is
# set, MAGPIE_SHUTDOWN_TIME above must be > 5.
#
# See example magpie-example-pre-job-script and
# magpie-example-post-job-script for ideas of what you can do w/ these
# scripts
#
# Multiple scripts can be specified separated by comma. Arguments can
# be passed to scripts as well.
#
# A number of convenient scripts are available in the
# ${MAGPIE_SCRIPTS_HOME}/scripts directory.
#
# export MAGPIE_PRE_JOB_RUN="${MAGPIE_SCRIPTS_HOME}/scripts/pre-job-run-scripts/my-pre-job-script"
# export MAGPIE_POST_JOB_RUN="${MAGPIE_SCRIPTS_HOME}/scripts/post-job-run-scripts/my-post-job-script"
#
# Similar to the MAGPIE_PRE_JOB_RUN and MAGPIE_POST_JOB_RUN, scripts can be
# run after the stack is setup but prior to the script or interactive mode
# begins. This enables frontends and other processes that depend on the stack
# to be started up and torn down. In similar fashion the cleanup will be done
# immediately after the script or interactive mode exits before the stack is
# shutdown.
#
# export MAGPIE_PRE_EXECUTE_RUN="${MAGPIE_SCRIPTS_HOME}/scripts/pre-job-run-scripts/my-pre-job-script"
# export MAGPIE_POST_EXECUTE_RUN="${MAGPIE_SCRIPTS_HOME}/scripts/post-job-run-scripts/my-post-job-script"
# Environment Variable Script
#
# When working with Magpie interactively by logging into the master
# node of your job allocation, many environment variables may need to
# be set. For example, environment variables for config file
# directories (e.g. HADOOP_CONF_DIR, HBASE_CONF_DIR, etc.) and home
# directories (e.g. HADOOP_HOME, HBASE_HOME, etc.) and more general
# environment variables (e.g. JAVA_HOME) may need to be set before you
# begin interacting with your big data setup.
#
# The standard job output from Magpie provides instructions on all the
# environment variables typically needed to interact with your job.
# However, this can be tedious if done by hand.
#
# If the environment variable specified below is set, Magpie will
# create the file and put into it every environment variable that
# would be useful when running your job interactively. That way, it
# can be sourced easily if you will be running your job interactively.
# It can also be loaded or used by other job scripts.
#
# export MAGPIE_ENVIRONMENT_VARIABLE_SCRIPT="${HOME}/my-job-env"
# Environment Variable Shell Type
#
# Magpie outputs environment variables in help output and
# MAGPIE_ENVIRONMENT_VARIABLE_SCRIPT based on your SHELL environment
# variable.
#
# If you would like to output in a different shell type (perhaps you
# have programmed scripts in a different shell), specify that shell
# here.
#
# export MAGPIE_ENVIRONMENT_VARIABLE_SCRIPT_SHELL="/bin/bash"
# Remote Shell
#
# Magpie requires a passwordless remote shell command to launch
# necessary daemons across your job allocation. Magpie defaults to
# ssh, but it may be an alternate command in some environments. An
# alternate ssh-equivalent remote command can be specified by setting
# MAGPIE_REMOTE_CMD below.
#
# If using ssh, Magpie requires keys to be setup ahead of time so it
# can be executed without passwords.
#
# Specify options to the remote shell command if necessary.
#
# export MAGPIE_REMOTE_CMD="ssh"
# export MAGPIE_REMOTE_CMD_OPTS=""
############################################################################
# General Configuration
############################################################################
# Necessary for most projects
export JAVA_HOME="/usr/lib/jvm/jre-1.8.0/"
# MAGPIE_PYTHON path used for:
# - Spark PySpark path
# - Launching tensorflow tasks
export MAGPIE_PYTHON="/usr/bin/python"
############################################################################
# Spark Core Configurations
############################################################################
# Should Spark be run
#
# Specify yes or no. Defaults to no.
#
export SPARK_SETUP=yes
# Set Spark Setup Type
#
# Will inform scripts on how to setup config files and what daemons to
# launch/setup.
#
# STANDALONE - Launch Spark stand alone scheduler
# YARN - do not setup stand alone scheduler, use Yarn scheduler
#
# For most users, the stand alone scheulder is likely preferred.
# Resources do not need to be competed for in a Magpie environment
# (you the user have all the resources allocated via the
# scheduler/resource manager of your cluster).
#
# However, portability and integration with other services may require
# Spark to work with Yarn instead. If SPARK_SETUP_TYPE is set to
# YARN:
#
# - The Spark standalone scheduler will not be launched
# - The default Spark master will be set to 'yarn-client' in all
# appropriate locations (e.g. spark-defaults.conf)
# - All situations that would otherwise use the standalone scheduler
# (e.g. SPARK_JOB="sparkpi") will now use Yarn instead.
#
# Make sure that HADOOP_SETUP_TYPE is set to MR or YARN for the
# SPARK_SETUP_TYPE="YARN".
#
export SPARK_SETUP_TYPE="STANDALONE"
# Version
#
export SPARK_VERSION="3.0.0-bin-hadoop3.2"
# Path to your Spark build/binaries
#
# This should be accessible on all nodes in your allocation. Typically
# this is in an NFS mount.
#
# Ensure the build matches the Hadoop/HDFS version this will run against.
#
export SPARK_HOME="${HOME}/spark-${SPARK_VERSION}"
# Path to store data local to each cluster node, typically something
# in /tmp. This will store local conf files and log files for your
# job. If local scratch space is not available, consider using the
# MAGPIE_NO_LOCAL_DIR_DIR option. See README for more details.
#
export SPARK_LOCAL_DIR="/tmp/${USER}/spark"
# Directory where alternate Spark configuration templates are stored
#
# If you wish to tweak the configuration files used by Magpie, set
# SPARK_CONF_FILES below, copy configuration templates from
# $MAGPIE_SCRIPTS_HOME/conf/spark into SPARK_CONF_FILES, and modify as
# you desire. Magpie will still use configuration files in
# $MAGPIE_SCRIPTS_HOME/conf/spark if any of the files it needs are not
# found in SPARK_CONF_FILES.
#
# export SPARK_CONF_FILES="${HOME}/myconf"
# Worker Cores per Node
#
# If not specified, a reasonable estimate will be calculated based on
# number of CPUs on the system.
#
# Be aware of the number of tasks and the amount of memory that may be
# needed by other software.
#
# export SPARK_WORKER_CORES_PER_NODE=8
# Worker Memory
#
# Specified in M. If not specified, a reasonable estimate will be
# calculated based on total memory available and number of CPUs on the
# system.
#
# Be aware of the number of tasks and the amount of memory that may be
# needed by other software.
#
# export SPARK_WORKER_MEMORY_PER_NODE=16000
# Worker Directory
#
# Directory to run applications in, which will include both logs and
# scratch space for local jars. If not specified, defaults to
# SPARK_LOCAL_DIR/work.
#
# Generally speaking, this is best if this is a tmp directory such as
# in /tmp
#
# export SPARK_WORKER_DIRECTORY=/tmp/${USER}/spark/work
# SPARK_JOB_MEMORY
#
# Memory for spark jobs. Defaults to being set equal to
# SPARK_WORKER_MEMORY_PER_NODE, but users may wish to lower it if
# multiple Spark jobs will be submitted at the same time.
#
# In Spark parlance, this will set both the executor and driver memory
# for Spark.
#
# export SPARK_JOB_MEMORY="2048"
# SPARK_DRIVER_MEMORY
#
# Beginning in Spark 1.0, driver memory could be configured separately
# from executor memory. If SPARK_DRIVER_MEMORY is set below, driver
# memory will be configured differently than the executor memory
# indicated above with SPARK_JOB_MEMORY.
#
# If running Spark < 1.0, this option does nothing.
#
# export SPARK_DRIVER_MEMORY="2048"
# Daemon Heap Max
#
# Heap maximum for Spark daemons, specified in megs.
#
# If not specified, defaults to 1000
#
# May need to be increased if you are scaling large, get OutofMemory
# errors, or perhaps have a lot of cores on a node.
#
# export SPARK_DAEMON_HEAP_MAX=2000
# Environment Extra
#
# Specify extra environment information that should be passed into
# Spark. This file will simply be appended into the spark-env.sh.
#
# By default, a reasonable estimate for max user processes and open
# file descriptors will be calculated and put into spark-env.sh.
# However, it's always possible they may need to be set
# differently. Everyone's cluster/situation can be slightly different.
#
# See the example example-environment-extra for examples on
# what you can/should do with adding extra environment settings.
#
# export SPARK_ENVIRONMENT_EXTRA_PATH="${HOME}/spark-my-environment"
############################################################################
# Spark Job/Run Configurations
############################################################################
# Set spark job for MAGPIE_JOB_TYPE = spark
#
# "sparkpi" - run sparkpi example. Useful for making sure things are
# setup the way you like.
#
# There are additional configuration options for this
# example listed below.
#
# "sparkwordcount" - run wordcount example. Useful for making sure
# things are setup the way you like.
#
# See below for additional required configuration
# for this example.
#
export SPARK_JOB="sparkpi"
# SPARK_DEFAULT_PARALLELISM
#
# Default number of tasks to use across the cluster for distributed
# shuffle operations (groupByKey, reduceByKey, etc) when not set by
# user.
#
# For Spark versions < 1.3.0. Defaults to number compute nodes
# (i.e. 1 per node) This is something you (the user) almost definitely
# want to set as this is non-optimal for most jobs.
#
# For Spark versions >= 1.3.0, will not be set by Magpie if the below
# is commented out. Internally, Spark defaults this to the largest
# number of partitions in a parent RDD. Or for operations without a
# parent, defaults to nodes X cores.
#
# export SPARK_DEFAULT_PARALLELISM=8
# SPARK_MEMORY_FRACTION
#
# Fraction of heap space used for execution and storage. The lower
# this is, the more frequently spills and cached data eviction occur.
#
# This configuration only works for Spark versions >= 1.6.0. See
# SPARK_STORAGE_MEMORY_FRACTION and SPARK_SHUFFLE_MEMORY_FRACTION for
# older versions.
#
# Defaults to 0.6
#
# export SPARK_MEMORY_FRACTION=0.6
# SPARK_MEMORY_STORAGE_FRACTION
#
# Amount of storage memory immune to eviction, expressed as a fraction
# of the size of the region set aside by SPARK_MEMORY_FRACTION. The
# higher this is, the less working memory may be available to
# executiona nd tasks may spill to disk more often.
#
# This configuration only works for Spark versions >= 1.6.0. See
# SPARK_STORAGE_MEMORY_FRACTION and SPARK_SHUFFLE_MEMORY_FRACTION for
# older versions.
#
# Defaults to 0.5
#
# export SPARK_MEMORY_STORAGE_FRACTION=0.5
# SPARK_STORAGE_MEMORY_FRACTION
#
# Configure fraction of Java heap to use for Spark's memory cache.
# This should not be larger than the "old" generation of objects in
# the JVM. This can highly affect performance due to interruption due
# to JVM garbage collection. If a large amount of time is spent in
# garbage collection, consider shrinking this value, such as to 0.5 or
# 0.4.
#
# This configuration only works for Spark versions < 1.6.0. Starting
# with 1.6.0, see SPARK_MEMORY_FRACTION and
# SPARK_MEMORY_STORAGE_FRACTION.
#
# Defaults to 0.6
#
# export SPARK_STORAGE_MEMORY_FRACTION=0.6
# SPARK_SHUFFLE_MEMORY_FRACTION
#
# Fraction of Java heap to use for aggregation and cogroups during
# shuffles. At any given time, the collective size of all in-memory
# maps used for shuffles is bounded by this limit, beyond which the
# contents will begin to spill to disk. If spills are often, consider
# increasing this value at the expense of storage memory fraction
# (SPARK_STORAGE_MEMORY_FRACTION above).
#
# This configuration only works for Spark versions < 1.6.0. Starting
# with 1.6.0, see SPARK_MEMORY_FRACTION and
# SPARK_MEMORY_STORAGE_FRACTION.
#
# Defaults to 0.2
#
# export SPARK_SHUFFLE_MEMORY_FRACTION=0.2
# SPARK_RDD_COMPRESS
#
# Should RDD's be compressed by default? Defaults to true. In HPC
# environments with parallel file systems or local storage, the cost
# of compressing / decompressing RDDs is likely a be a net win over
# writing data to a parallel file system or using up the limited
# amount of local storage space available. However, for some users
# this cost may not be worthwhile and should be disabled.
#
# Note that only serialized RDDs are compressed, such as with storage
# level MEMORY_ONLY_SER or MEMORY_AND_DISK_SER. All python RDDs are
# serialized by default.
#
# Defaults to true.
#
# export SPARK_RDD_COMPRESS=true
# SPARK_IO_COMPRESSION_CODEC
#
# Defaults to lz4, can specify snappy, lz4, lzf, snappy, or zstd
#
# export SPARK_IO_COMPRESSION_CODEC=lz4
# SPARK_DEPLOY_SPREADOUT
#
# Per Spark documentation, "Whether the standalone cluster manager
# should spread applications out across nodes or try to consolidate
# them onto as few nodes as possible. Spreading out is usually better
# for data locality in HDFS, but consolidating is more efficient for
# compute-intensive workloads."
#
# If you are hard coding parallelism in certain parts of your
# application because those individual actions do not scale well, it
# may be beneficial to disable this.
#
# Defaults to true
#
# export SPARK_DEPLOY_SPREADOUT=true
# SPARK_JOB_CLASSPATH
#
# May be necessary to set to get certain code/scripts to work.
#
# e.g. to run a Spark example, you may need to set
#
# export SPARK_JOB_CLASSPATH="examples/target/spark-examples-assembly-0.9.1.jar"
#
# Note that this is primarily for Spark 0.9.1 and earlier versions.
# You likely want to use the --driver-class-path option in
# spark-submit now.
#
# export SPARK_JOB_CLASSPATH=""
# SPARK_JOB_LIBRARY_PATH
#
# May be necessary to set to get certain code/scripts to work.
#
# Note that this is primarily for Spark 0.9.1 and earlier versions.
# You likely want to use the --driver-library-path option in
# spark-submit now.
#
# export SPARK_JOB_LIBRARY_PATH=""
# SPARK_JOB_JAVA_OPTS
#
# May be necessary to set options to set Spark options
#
# e.g. -Dspark.default.parallelism=16
#
# Magpie will set several options on its own, however, these options
# will be appended last, ensuring they override anything that Magpie
# will set by default.
#
# Note that many of the options that were set in SPARK_JAVA_OPTS in
# Spark 0.9.1 and earlier have been deprecated. You likely want to
# use the --driver-java-options option in spark-submit now.
#
# export SPARK_JOB_JAVA_OPTS=""
# SPARK_LOCAL_SCRATCH_DIR
#
# By default, if Hadoop is setup with a file system, the Spark local
# scratch directory, where scratch data is placed, will automatically
# be calculated and configured. If Hadoop is not setup, the following
# must be specified.
#
# If you have local SSDs or NVRAM stored on the nodes of your system,
# it may be in your interest to set this to a local drive. It can
# improve performance of both shuffling and disk based RDD
# persistence. If you want to specify multiple paths (such as
# multiple drives), make them comma separated
# (e.g. /dir1,/dir2,/dir3).
#
# Note that this field will not work if SPARK_SETUP_TYPE="YARN".
# Please set HADOOP_LOCALSTORE to inform Yarn to set a local SSD for
# Yarn to use for local scratch.
#
export SPARK_LOCAL_SCRATCH_DIR="/lustre/${USER}/sparkscratch/"
# SPARK_LOCAL_SCRATCH_DIR_CLEAR
#
# After your job has completed, if SPARK_LOCAL_SCRATCH_DIR_CLEAR is
# set to yes, Magpie will do a rm -rf on all directories in
# SPARK_LOCAL_SCRATCH_DIR. This is particularly useful if the local
# scratch directory is on local storage and you want to clean up your
# work before the next user uses the node.
#
# export SPARK_LOCAL_SCRATCH_DIR_CLEAR="yes"
# SPARK_NETWORK_TIMEOUT
#
# This will configure many network timeout configurations within
# Spark. If you see that your jobs are regularly failing with timeout
# issues, try increasing this value. On large HPC systems, timeouts
# may occur more often, such as on loaded parallel file systems or
# busy networks.
#
# As of this version, this will configure:
#
# spark.network.timeout
# spark.files.fetchTimeout
# spark.rpc.askTimeout
# spark.rpc.lookupTimeout
# spark.core.connection.ack.wait.timeout
# spark.shuffle.registration.timeout
# spark.network.auth.rpcTimeout
# spark.shuffle.sasl.timeout
#
# Note that some of this fields will only effect newer spark versions.
#
# Specified in seconds, by default 120.
#
# export SPARK_NETWORK_TIMEOUT=120
# SPARK_YARN_STAGING_DIR
#
# By default, Spark w/ Yarn will use your home directory for staging
# files for a job. This home directory must be accessible by all
# nodes.
#
# This may pose a problem if you are not using HDFS and your home
# directory is not NFS or network mounted. Set this value to a
# network location as your staging directory. Be sure to prefix this
# path the appropriate scheme, such as file://.
#
# This option is only available beginning in Spark 2.0.
#
# export SPARK_YARN_STAGING_DIR="file:///lustre/${USER}/sparkStaging/"
############################################################################
# Spark SparkPi Configuration
############################################################################
# SparkPi Slices
#
# Number of "slices" to parallelize in Pi estimation. Generally
# speaking, more should lead to more accurate estimates.
#
# If not specified, equals number of nodes.
#
# export SPARK_SPARKPI_SLICES=4
############################################################################
# Spark SparkWordCount Configuration
############################################################################
# SparkWordCount File
#
# Specify the file to do the word count on. Specify the scheme, such
# as hdfs://, alluxio:// or file://, appropriately.
#
# export SPARK_SPARKWORDCOUNT_FILE="file:///path/mywordcountfile"
# SparkWordCount Copy In File
#
# In some cases, a file must be copied in before it can be used. Most
# notably, this can be the case if the file is not yet in HDFS or Alluxio.
#
# If specified below, the file will be copied to the location
# specified by SPARK_SPARKWORDCOUNT_FILE before the word count is
# executed.
#
# Specify the scheme appropriately. At this moment, the schemes of
# file://, alluxio://, and hdfs:// are recognized for this option.
#
# Note that this is not required. The file could be copied in any
# number of other ways, such as through a previous job or through a
# script specified via MAGPIE_PRE_JOB_RUN.
#
# export SPARK_SPARKWORDCOUNT_COPY_IN_FILE="file:///mywordcountinfile"
############################################################################
# Run Job
############################################################################
ENV=$(env | grep -E '^MAGPIE|^HADOOP|^PIG|^ZOOKEEPER|^KAFKA|^ZEPPELIN|^PHOENIX|^HBASE|^SPARK|^STORM|^JAVA|^LD_LIBRARY_PATH|^MOAB|^PATH|^PBS|RAMDISK'\
| sed 's/^/export /;s/=/="/;s/$/"/')
pdsh "$ENV;
$MAGPIE_SCRIPTS_HOME/magpie-check-inputs &&
$MAGPIE_SCRIPTS_HOME/magpie-setup-core &&
$MAGPIE_SCRIPTS_HOME/magpie-setup-projects &&
$MAGPIE_SCRIPTS_HOME/magpie-setup-post &&
$MAGPIE_SCRIPTS_HOME/magpie-pre-run &&
$MAGPIE_SCRIPTS_HOME/magpie-run &&
$MAGPIE_SCRIPTS_HOME/magpie-cleanup &&
$MAGPIE_SCRIPTS_HOME/magpie-post-run
"
| {
"pile_set_name": "Github"
} |
7 5 12 4
5173 3849 3279 1511
9111 5309 6000 1234
1079 2136 9999 1237
0 0 0 0
| {
"pile_set_name": "Github"
} |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* 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 .
*/
#ifndef __com_sun_star_rendering_FontRequest_idl__
#define __com_sun_star_rendering_FontRequest_idl__
#include <com/sun/star/rendering/FontInfo.idl>
#include <com/sun/star/lang/Locale.idl>
module com { module sun { module star { module rendering {
/** This structure contains all information necessary to describe a
font to be queried from XCanvas.<p>
Note: Outline fonts are to be requested as a special family, set
FontInfo::FamilyName appropriately. Emboss/relief
must be emulated by upper layers.<p>
Leave the FontInfo::FamilyName and
FontInfo::StyleName empty, if font selection
should only happen via the PANOSE description.
@since OOo 2.0
*/
struct FontRequest
{
/** The description of the font.<p>
This member contains the description of the font as returned
by the font listing methods.<p>
*/
FontInfo FontDescription;
/** The size of the font in <em>device</em> coordinate space.<p>
This value corresponds to the font height in Western scripts,
but is independent of the writing direction (see
FontRequest::IsVertical below). That
means, the value specified here is always measured orthogonal
to the text advancement (height for horizontal writing, and
width for vertical writing).<p>
When this value is negative, its absolute value is taken as
the character size of the font. If this value is positive,
it's taken as the cell size of the font.<p>
This member and the referenceAdvancement member are mutually
exclusive, one of them has to be set to 0 (which means don't
care).<p>
For distorted fonts, the render transformation must be
used. That is, the size specified here corresponds to device
pixel only if the combined render transformation during text
output equals the identity transform. This also applies to all
query methods, for both XCanvasFont and
XTextLayout.<p>
*/
double CellSize;
/** This value specifies the size of the font in the writing
direction (i.e. width for horizontal writing, and height for
vertical writing).<p>
It is equivalent to the referenceCharSize of the FontMetrics
structure.<p>
This member and the cellSize member are mutually exclusive,
one of them has to be set to 0 (which means don't care). For
distorted fonts, the font matrix must be used.<p>
*/
double ReferenceAdvancement;
/** The locale this font should be able to render.<p>
This member supplements the
FontInfo::UnicodeRange0 entry with a specific
locale; this is e.g. important when selecting between
traditional and simplified Chinese is necessary (since the
letters have the same Unicode ranges and character values).<p>
*/
::com::sun::star::lang::Locale Locale;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
| {
"pile_set_name": "Github"
} |
<?php
/**
* @package Campsite
*
* @author Petr Jasek <[email protected]>
* @copyright 2010 Sourcefabric o.p.s.
* @license http://www.gnu.org/licenses/gpl.txt
* @link http://www.sourcefabric.org
*/
/**
* Geo Location interface
*/
interface IGeoLocation
{
/**
* Get location latitude
* @return float
*/
public function getLatitude();
/**
* Get location longitude
* @return float
*/
public function getLongitude();
}
| {
"pile_set_name": "Github"
} |
package errors
import (
"bytes"
"errors"
"fmt"
"strings"
)
// Aliases to the standard errors package.
var (
New = errors.New
Is = errors.Is
As = errors.As
)
// New is an alias for errors.New.
// WithCause annotates a symptom error with a cause.
//
// Both errors can be discovered by the Is and As methods.
func WithCause(symptom, cause error) error {
return annotated{
cause: cause,
symptom: symptom,
}
}
func WithDetails(err error, details ...string) error {
if err == nil {
return nil
}
return detailed{err, details}
}
func Details(err error) string {
var (
buffer bytes.Buffer
dErr detailed
)
for errors.As(err, &dErr) {
// Append all details of this error.
for _, d := range dErr.details {
buffer.WriteString("\n - ")
buffer.WriteString(strings.ReplaceAll(d, "\n", "\n "))
}
// Continue down the chain.
err = dErr.error
}
return buffer.String()
}
type detailed struct {
error
details []string
}
type annotated struct {
cause error
symptom error
}
func (e annotated) Error() string {
return fmt.Sprintf("%s: %s", e.cause, e.symptom)
}
func (e annotated) Unwrap() error {
return e.cause
}
func (e annotated) Is(target error) bool {
return errors.Is(e.symptom, target) || errors.Is(e.cause, target)
}
func (e annotated) As(target interface{}) bool {
if errors.As(e.symptom, target) {
return true
}
return errors.As(e.cause, target)
}
| {
"pile_set_name": "Github"
} |
// Platform services for *nix-like platforms: -DOS_MAC, -DOS_LINUX
#if defined(OS_MAC)
#elif defined(OS_LINUX)
#else
#error "Invalid OS"
#endif
#include <arpa/inet.h>
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <netdb.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/socket.h> // socket()
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h> // clock()
#include <unistd.h>
#include <x86intrin.h>
#if defined(OS_MAC)
// dispatch_semaphore_t semaphore;
// semaphore = dispatch_semaphore_create(1); // init with value of 1
#elif defined(OS_LINUX)
#endif
#if defined(OS_MAC)
#include <sys/event.h> // kqueue, kevent
#include <dispatch/dispatch.h> // dispatch_semaphore_create, etc
#include <mach-o/dyld.h> // _NSGetExecutablePath
#elif defined(OS_LINUX)
#include <sys/epoll.h> // epoll_*
#endif
PLATFORM_ALLOCATE_MEMORY(nix_allocate_memory)
{
pt_Memory mem;
u64 stride = (1ull << alignment);
u64 aligned_size = size + stride - 1;
mem.handle = malloc(aligned_size);
Assert(mem.handle && "Could not allocate enough memory");
mem.memblock.begin = (void*) RALIGN((u64) mem.handle, stride);
mem.memblock.end = mem.memblock.begin + size;
return mem;
};
/* b8 name(pt_Memory* mem, u64 new_size, u8 alignment) */
PLATFORM_RESIZE_MEMORY(nix_resize_memory)
{
u64 size = mem->memblock.end - mem->memblock.begin;
s64 stride = (1ull << alignment);
s64 offset = mem->memblock.begin - (char*) mem->handle;
u64 aligned_new_size = new_size + stride - 1;
void *new_handle = realloc(mem->handle, aligned_new_size);
if (!new_handle) {
return 0;
}
if (alignment) {
char *it_src = (char*) new_handle + offset;
char *it_dst = (char*) RALIGN((u64) new_handle, stride);
s64 delta = it_dst - it_src;
s64 bytes_to_copy = MIN(size,new_size);
Assert(bytes_to_copy);
if (delta < 0) {
char *it_dst_end = it_dst + bytes_to_copy;
while (it_dst != it_dst_end) {
*it_dst = *it_src;
++it_src;
++it_dst;
}
} else if (delta > 0) {
char *it_dst_rev = it_dst + bytes_to_copy - 1;
char *it_dst_rev_end = it_dst - 1;
char *it_src_rev = it_src + bytes_to_copy - 1;
while (it_dst_rev != it_dst_rev_end) {
*it_dst_rev = *it_src_rev;
--it_dst_rev;
--it_src_rev;
}
}
mem->handle = new_handle;
mem->memblock.begin = it_dst;
mem->memblock.end = mem->memblock.begin + new_size;
Assert(((u64) it_dst % stride) == 0);
} else {
/* replace block into mem struct */
mem->handle = new_handle;
mem->memblock.begin = (char*) new_handle + offset;
mem->memblock.end = mem->memblock.begin + new_size;
}
return 1;
};
PLATFORM_FREE_MEMORY(nix_free_memory)
{
/* should be robust to null pointer */
free(pm->handle);
}
PLATFORM_COPY_MEMORY(nix_copy_memory)
{
memcpy(dest, src, count);
}
PLATFORM_OPEN_MMAP_FILE(nix_open_mmap_file)
{
struct stat file_stat;
char file_name[1024];
Assert(file_end - file_begin + 1 < 1024);
u64 len = pt_copy_bytes(file_begin, file_end, file_name, file_name + 1023);
file_name[len] = 0;
pt_MappedFile mapped_file;
pt_fill((char*) &mapped_file, (char*) &mapped_file + sizeof(pt_MappedFile), 0);
if (read && !write) {
s32 file_descriptor = open(file_name, O_RDONLY);
if (file_descriptor == -1) {
return mapped_file;
}
if (fstat(file_descriptor, &file_stat) == -1) {
return mapped_file;
}
if (!S_ISREG(file_stat.st_mode)) {
return mapped_file;
}
mapped_file.size = file_stat.st_size;
/* map file in a shared fashion for reading */
mapped_file.handle = mmap (0, file_stat.st_size, PROT_READ, MAP_SHARED, file_descriptor, 0);
if (mapped_file.handle == MAP_FAILED) {
return mapped_file;
}
if (close(file_descriptor) == -1) {
return mapped_file;
}
mapped_file.read = 1;
mapped_file.mapped = 1;
mapped_file.begin = (char*) mapped_file.handle;
} else if (read && write) {
s32 file_descriptor = open(file_name, O_RDWR);
if (file_descriptor == -1) {
return mapped_file;
}
if (fstat(file_descriptor, &file_stat) == -1) {
return mapped_file;
}
if (!S_ISREG(file_stat.st_mode)) {
return mapped_file;
}
mapped_file.size = file_stat.st_size;
/* map file in a shared fashion for reading */
mapped_file.handle = mmap (0, file_stat.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, file_descriptor, 0);
if (mapped_file.handle == MAP_FAILED) {
return mapped_file;
}
if (close(file_descriptor) == -1) {
return mapped_file;
}
mapped_file.write = 1;
mapped_file.read = 1;
mapped_file.mapped = 1;
mapped_file.begin = (char*) mapped_file.handle;
return mapped_file;
}
return mapped_file;
}
PLATFORM_RESIZE_FILE(nix_resize_file)
{
char file_name[1024];
Assert(file_end - file_begin + 1 < 1024);
u64 len = pt_copy_bytes(file_begin, file_end, file_name, file_name + 1023);
file_name[len] = 0;
s32 file_descriptor = open(file_name, O_RDWR);
s32 result = !ftruncate(file_descriptor, new_size);
close(file_descriptor);
return result;
}
PLATFORM_CLOSE_MMAP_FILE(nix_close_mmap_file)
{
Assert(mapped_file->mapped);
if (munmap(mapped_file->handle, mapped_file->size) == -1) {
return;
}
mapped_file->mapped = 0;
mapped_file->unmapped = 1;
mapped_file->handle = 0;
mapped_file->begin = 0;
}
PLATFORM_OPEN_READ_FILE(nix_open_read_file)
{
char *name = malloc(file_end - file_begin + 1);
u64 len = file_end - file_begin;
pt_copy_bytes(file_begin, file_end, name, name + len);
*(name + len) = 0;
FILE *fp = fopen(name, "rb");
free(name);
pt_File pfh;
if (fp) {
fseek(fp, 0L, SEEK_END);
pfh.size = ftell(fp);
fseek(fp, 0L, SEEK_SET);
} else {
pfh.size = 0;
}
pfh.open = fp ? 1 : 0;
pfh.eof = 0;
pfh.last_read = 0;
pfh.last_seek_success = 0;
pfh.handle = fp;
pfh.read = 1;
pfh.write = 0;
return pfh;
}
PLATFORM_OPEN_WRITE_FILE(nix_open_write_file)
{
char *name = malloc(file_end - file_begin + 1);
u64 len = file_end - file_begin;
pt_copy_bytes(file_begin, file_end, name, name + len);
*(name + len) = 0;
FILE *fp = fopen(name, "wb");
free(name);
pt_File pfh;
pfh.open = fp ? 1 : 0;
pfh.eof = 0;
pfh.last_read = 0;
pfh.last_seek_success = 0;
pfh.handle = fp;
pfh.read = 0;
pfh.write = 1;
pfh.size = 0;
return pfh;
}
PLATFORM_READ_NEXT_FILE_CHUNK(nix_read_next_file_chunk)
{
Assert(pfh->open && !pfh->eof && pfh->read);
FILE* fp = (FILE*) pfh->handle;
u64 buflen = buffer_end - buffer_begin;
pfh->last_read = fread(buffer_begin, 1, buflen, fp);
if (pfh->last_read < buflen) {
// if read less than buffer size expect eof flag is on
// and no error flag is set
Assert(feof(fp) && !ferror(fp) && "FileTokenizer: error reading");
pfh->eof = 1;
}
}
// void name(PlatformFileHandle *pfh, u64 offset)
PLATFORM_SEEK_FILE(nix_seek_file)
{
Assert(pfh->open);
FILE* fp = (FILE*) pfh->handle;
int err = fseek(fp, (s64) offset, SEEK_SET);
pfh->last_seek_success = !err;
}
// void name(PlatformFileHandle *pfh)
PLATFORM_CLOSE_FILE(nix_close_file)
{
Assert(pfh->open);
FILE* fp = (FILE*) pfh->handle;
fclose(fp);
pfh->open = 0;
}
// b8 name(PlatformFileHandle *pfh, char *begin, char* end)
PLATFORM_WRITE_TO_FILE(nix_write_to_file)
{
Assert(pfh->write && pfh->open);
FILE* fp = (FILE*) pfh->handle;
size_t size = (size_t) (end-begin);
size_t written = fwrite(begin, 1, size, fp);
fflush(fp);
return written == size;
}
PLATFORM_GET_TIME(nix_get_time)
{
return (f64) time(0); // clock() / (f64) CLOCKS_PER_SEC;
}
PLATFORM_CREATE_MUTEX(nix_create_mutex)
{
pthread_mutex_t *raw_mutex = (pthread_mutex_t*) malloc(sizeof(pthread_mutex_t));
return (pt_Mutex) { .handle = raw_mutex };
}
PLATFORM_RELEASE_MUTEX(nix_release_mutex)
{
pthread_mutex_t *raw_mutex = (pthread_mutex_t*) mutex.handle;
free(raw_mutex);
}
PLATFORM_LOCK_MUTEX(nix_lock_mutex)
{
pthread_mutex_lock((pthread_mutex_t*) mutex.handle);
}
PLATFORM_UNLOCK_MUTEX(nix_unlock_mutex)
{
pthread_mutex_unlock((pthread_mutex_t*) mutex.handle);
}
internal
PLATFORM_CYCLE_COUNT_CPU(nix_cycle_count_cpu)
{
// defined in #include "x86intrin.h"
return (u64) __rdtsc();
}
//
// BEGIN executable_path
//
#if defined(OS_MAC)
// void name(FilePath *fp)
PLATFORM_EXECUTABLE_PATH(nix_executable_path)
{
u32 buf_size = MAX_FILE_PATH_SIZE;
_NSGetExecutablePath( fp->full_path, &buf_size);
fp->end = fp->full_path + buf_size;
fp->name = fp->full_path;
for(char *it=fp->full_path;*it;++it)
{
if(*it == '/')
{
fp->name = it + 1;
}
}
}
#elif defined(OS_LINUX)
PLATFORM_EXECUTABLE_PATH(nix_executable_path)
{
char path[MAX_FILE_PATH_SIZE];
pid_t pid = getpid();
sprintf(path, "/proc/%d/exe", pid);
ssize_t buf_size = readlink(path, fp->full_path, MAX_FILE_PATH_SIZE);
Assert(buf_size >= 0);
{
fp->end = fp->full_path + buf_size;
fp->name = fp->full_path;
for(char *it=fp->full_path;*it;++it)
{
if(*it == '/')
{
fp->name = it + 1;
}
}
}
}
#endif
//
// END executable_path
//
/************* Work Queue Support ************/
typedef struct {
PlatformWorkQueueCallback *callback;
void *data;
} pt_WorkQueueEntry;
struct pt_WorkQueue {
u32 volatile completion_goal;
u32 volatile completion_count;
u32 volatile next_entry_to_write;
u32 volatile next_entry_to_read;
/* platform dependent semaphore primitive */
#if defined(OS_MAC)
dispatch_semaphore_t semaphore_handle;
#elif defined(OS_LINUX)
sem_t *semaphore_handle;
sem_t semaphore_handle_storage;
#endif
u32 num_threads;
u32 done;
pt_WorkQueueEntry entries[256];
};
internal b8
pt_WorkQueue_init(pt_WorkQueue *self, u32 semaphore_initial_value)
{
self->completion_goal = 0;
self->completion_count = 0;
self->next_entry_to_write = 0;
self->next_entry_to_read = 0;
s32 err = 0;
#if defined(OS_MAC)
self->semaphore_handle = dispatch_semaphore_create(0);
err = self->semaphore_handle == 0;
#elif defined(OS_LINUX)
err = sem_init(&self->semaphore_handle_storage, 0, 0);
self->semaphore_handle = &self->semaphore_handle_storage;
// self->semaphore_handle = sem_open("/workqueue", O_EXCL); // exclusive O_CREAT); // , 700, 0);
// self->semaphore_handle = sem_open("/nanocube_workqueue", O_CREAT, 700, 0); // exclusive O_CREAT); // , 700, 0);
// return self->semaphore_handle != SEM_FAILED;
#endif
self->done = 0;
self->num_threads = 0;
return err == 0;
}
// #define COMPILER_BARRIER() asm volatile("" ::: "memory")
// #define INTERLOCKED_COMPARE_EXCHANGE(a,b,c) asm volatile("" ::: "memory")
PLATFORM_WORK_QUEUE_ADD_ENTRY(nix_work_queue_add_entry)
{
// TODO(llins): Assuming single producer for now
// TODO(casey): Switch to InterlockedCompareExchange eventually
// so that any thread can add?
u32 new_next_entry_to_write = (queue->next_entry_to_write + 1) % ArrayCount(queue->entries);
Assert(new_next_entry_to_write != queue->next_entry_to_read);
pt_WorkQueueEntry *entry = queue->entries + queue->next_entry_to_write;
entry->callback = callback;
entry->data = data;
++queue->completion_goal;
// _WriteBarrier();
// OSMemoryBarrier();
// COMPILER_BARRIER();
__sync_synchronize();
queue->next_entry_to_write = new_next_entry_to_write;
#if defined(OS_MAC)
dispatch_semaphore_signal(queue->semaphore_handle);
#elif defined(OS_LINUX)
sem_post(queue->semaphore_handle);
#endif
/* ReleaseSemaphore(queue->semaphore_handle, 1, 0); */
}
internal b8
nix_work_queue_work_on_next_entry(pt_WorkQueue *queue)
{
b8 we_should_sleep = 0;
u32 original_next_entry_to_read = queue->next_entry_to_read;
u32 new_next_entry_to_read = (original_next_entry_to_read + 1) % ArrayCount(queue->entries);
if(original_next_entry_to_read != queue->next_entry_to_write) {
u32 index = (u32) __sync_val_compare_and_swap_4((s32*) &queue->next_entry_to_read,
original_next_entry_to_read,
new_next_entry_to_read);
// on win32
// InterlockedCompareExchange((LONG volatile *)&queue->next_entryToRead, NewNextEntryToRead,
// OriginalNextEntryToRead);
if(index == original_next_entry_to_read) {
pt_WorkQueueEntry entry = queue->entries[index];
entry.callback(queue, entry.data);
__sync_fetch_and_add_4(&queue->completion_count, 1);
// InterlockedIncrement((LONG volatile *)&Queue->CompletionCount);
}
}
else {
we_should_sleep = 1;
}
return(we_should_sleep);
}
internal
PLATFORM_WORK_QUEUE_COMPLETE_ALL_WORK(nix_work_queue_complete_all_work)
{
while(queue->completion_goal != queue->completion_count) {
nix_work_queue_work_on_next_entry(queue);
}
queue->completion_goal = 0;
queue->completion_count = 0;
}
internal
PLATFORM_WORK_QUEUE_FINISHED(nix_work_queue_finished)
{
return queue->completion_goal == queue->completion_count;
}
PLATFORM_WORK_QUEUE_CALLBACK(nix_work_queue_thread_stop)
{
pt_WorkQueue *queue2 = (pt_WorkQueue*) data;
pt_atomic_sub_u32(&queue2->num_threads,1);
pthread_exit(0);
}
global_variable pthread_key_t nix_thread_index_key;
global_variable b8 nix_app_state_interrupted;
/* should be called by the main thread */
internal void
nix_init()
{
nix_app_state_interrupted = 0;
pthread_key_create(&nix_thread_index_key,0);
}
internal void*
nix_work_queue_thread_run(void* data)
{
pt_WorkQueue *queue = (pt_WorkQueue*) data;
// increment
u32 index = pt_atomic_add_u32(&queue->num_threads,1);
pthread_setspecific(nix_thread_index_key, (void*) ((u64) index));
// u32 TestThreadID = GetThreadID();
// Assert(TestThreadID == GetCurrentThreadId());
for(;;) {
if(nix_work_queue_work_on_next_entry(queue)) {
#if defined(OS_MAC)
dispatch_semaphore_wait(queue->semaphore_handle, DISPATCH_TIME_FOREVER);
#elif defined(OS_LINUX)
sem_wait(queue->semaphore_handle);
#endif
// WaitForSingleObjectEx(Queue->SemaphoreHandle, INFINITE, FALSE);
}
}
return 0;
// return(0);
}
//
// internal void*
// nix_thread_procedure(void* data)
// {
// nix_ThreadInfo *thread_info = (nix_ThreadInfo*) data;
// pt_WorkQueue *queue = thread_info->queue;
// // u32 TestThreadID = GetThreadID();
// // Assert(TestThreadID == GetCurrentThreadId());
// for(;;) {
// if(nix_WorkQueue_work_on_next_entry(queue)) {
// dispatch_semaphore_wait(queue->semaphore_handle, DISPATCH_TIME_FOREVER);
// // sem_wait(queue->semaphore_handle);
// // WaitForSingleObjectEx(Queue->SemaphoreHandle, INFINITE, FALSE);
// }
// }
// return 0;
// // return(0);
// }
//
internal
PLATFORM_WORK_QUEUE_CREATE(nix_work_queue_create)
{
pt_WorkQueue *queue = (pt_WorkQueue*) malloc(sizeof(pt_WorkQueue));
if (!pt_WorkQueue_init(queue, num_threads)) {
free(queue);
return 0;
}
for (u32 i=0;i<num_threads;++i) {
// pthread_attr_t attr;
// pthread_attr_init(&attr);
// pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
// pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_t thread;
s32 error = pthread_create(&thread, 0, nix_work_queue_thread_run, queue);
Assert(!error);
pthread_detach(thread);
}
while (queue->num_threads != num_threads) {
usleep(10);
}
return queue;
}
// internal b8
// nix_init_work_queue(pt_WorkQueue *queue, nix_ThreadInfo *thread_begin, u32 thread_count)
// {
// if (!pt_WorkQueue_init(queue, thread_count))
// return 0;
//
// for (u32 i=0;i<thread_count;++i) {
// nix_ThreadInfo *thread_info = thread_begin + i;
// thread_info->queue = queue;
//
// // pthread_attr_t attr;
// // pthread_attr_init(&attr);
// // pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
// // pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
//
// pthread_t thread;
//
// s32 error = pthread_create(&thread, 0, nix_thread_procedure, thread_info);
// Assert(!error);
// pthread_detach(thread);
// }
// return 1;
// }
//
internal
PLATFORM_GET_THREAD_INDEX(nix_get_thread_index)
{
return (u64) pthread_getspecific(nix_thread_index_key);
}
internal
PLATFORM_THREAD_SLEEP(nix_thread_sleep)
{
usleep(millisecs);
}
/* this should be called fro the same thread that called start */
internal
PLATFORM_WORK_QUEUE_DESTROY(nix_work_queue_destroy)
{
if (!queue)
return;
Assert(!queue->done);
queue->done = 1;
// schedule exit of the threads
s32 num_threads = queue->num_threads;
__sync_synchronize();
// schedule exit of the threads
for (s32 i=0;i<num_threads;++i) {
nix_work_queue_add_entry(queue, nix_work_queue_thread_stop, queue);
}
while (queue->num_threads > 0) {
usleep(10);
}
#if defined(OS_MAC)
dispatch_release(queue->semaphore_handle);
#elif defined(OS_LINUX)
sem_destroy(queue->semaphore_handle);
#endif
free(queue);
}
/************* End Work Queue Support ************/
/************* Simple HTTP Server over TCP ************/
//
// Include a notion of a complete request. Use a subset notion of HTTP requests.
// HTTP-request-message = request-line *(header-field CRLF) CRLF [message-body]
// How to recover from unknown input?
//
// #define nix_tcp_LOCAL_ADDR "127.0.0.1"
#define nix_tcp_LOCAL_ADDR "0.0.0.0"
#define nix_tcp_PORT 8888
#define nix_tcp_MAX_CONNECTIONS 64
#define nix_tcp_MAX_SOCKETS 256
#define nix_tcp_MAX_EVENTS 64
#define nix_tcp_TIMEOUT_MILLISECONDS 0
#define nix_tcp_TIMEOUT_SECONDS 1
#define nix_tcp_Socket_FREE 0
#define nix_tcp_Socket_ACTIVATIING 1
#define nix_tcp_Socket_INUSE 2
#define nix_tcp_Socket_CLOSED 3
#define nix_tcp_BUFFER_SIZE 4096
#define nix_tcp_MAX_SERVERS 16
// struct nix_tcp_Connection {
// int file_descriptor;
// int status;
// s32 index;
// struct kevent ev;
// struct nix_tcp_Connection *prev;
// struct nix_tcp_Connection *next;
// // when retriggering a connection for more data
// nix_tcp_Server *nix_server;
// f64 start_time;
// };
// A listen socket is associated with a port from which new client
// connections can be established. A server socket is one that gets
// data from a client socket and pushed this data through the handler
// #define nix_tcp_LISTEN_SOCKET 1
// #define nix_tcp_CLIENT_SOCKET 2
// #define nix_tcp_SERVER_SOCKET 3
typedef struct nix_tcp_Engine nix_tcp_Engine;
typedef struct nix_tcp_Socket nix_tcp_Socket;
struct nix_tcp_Socket {
int file_descriptor;
s32 type;
s32 index;
// struct to register into event signaling of this socket
#if defined(OS_MAC)
struct kevent ev;
#elif defined(OS_LINUX)
struct epoll_event ev;
#endif
s32 status;
union {
struct {
s32 port;
u32 num_connections;
} listen;
//
// One should not write on a server socket only
// wait for data that will trigger the read handler
// (in some arbitrary thread).
// On the client socket one can write on it and
// wait for the read handler to be triggered
// when some data arrives.
//
struct {
/* increase, decrease number of connections */
struct nix_tcp_Socket *listen_socket;
} server;
struct {
char *hostname; /* this is only valid if the client preserves it */
s32 port;
} client;
};
PlatformTCPCallback *callback;
f64 start_time;
void *user_data;
// which socket are we talking about
struct nix_tcp_Socket *prev;
struct nix_tcp_Socket *next;
nix_tcp_Engine *tcp;
};
#define nix_tcp_TASK_QUEUE_SIZE 256
#define nix_tcp_TASK_QUEUE_MASK 0xff
#define nix_tcp_LISTEN_TASK 0x10
#define nix_tcp_CLIENT_TASK 0x11
typedef struct {
s32 type;
//
// make sure ready is 0 always except when it is
// ready to be processed (last step a producer
// does is to set ready to 1 with a memory barrier
// to everything before
//
s32 ready;
union {
struct {
// NOTE(llins): it is simple to add a
// limit to number of connections per port
} listen;
struct {
char *hostname;
} client;
};
// use the pointer below when scheduling tasks
// to indicate what happened
s32 port;
void *callback;
void *user_data;
pt_TCP_Feedback *feedback;
} nix_tcp_Task;
struct nix_tcp_Engine {
#if defined(OS_MAC)
int kqueue_fd;
struct kevent events[nix_tcp_MAX_EVENTS];
#elif defined(OS_LINUX)
int epoll_fd;
struct epoll_event events[nix_tcp_MAX_EVENTS];
#endif
nix_tcp_Socket sockets[nix_tcp_MAX_SOCKETS];
nix_tcp_Socket *free_sockets;
/* some active_connections might have had its file descriptor closed */
/* retrieve closed connections once a new connection is requested */
nix_tcp_Socket *active_sockets;
//
// last thing that should be activated on a task
// is its status (only when it is totally ready)
//
// tasks include: create a new listen port
// create a new connection
//
// implement a single consumer, multiple producer
// thread safe mechanism
//
struct {
// at one tcp engine cycle we don't expect to
// get more than 256 tasks
nix_tcp_Task queue[nix_tcp_TASK_QUEUE_SIZE];
// empty config (only look at the least significant byte of the numbers below)
//
// empty/initial: [s] [c,p ] [] [] [] [] [] ... []
// after 1 produce: [s] [c/t1] [p] [] [] [] [] ... []
// after 2 produce: [s] [c/t1] [t2] [p] [] [] [] ... []
// after 1 consume: [ ] [s ] [c/t2] [p] [] [] [] ... []
//
u64 sentinel; // to detect a full queue (consumer is 1 plus sentinel)
u64 end; // multi-threades atomic access
} tasks;
};
global_variable nix_tcp_Engine nix_tcp_engines[nix_tcp_MAX_SERVERS];
global_variable u32 nix_tcp_num_engines = 0;
// OS set filedescriptor to be non-blocking
internal void
nix_tcp_set_nonblocking_fd(int fd)
{
int opts = fcntl(fd, F_GETFL);
Assert(opts >= 0);
opts = opts | O_NONBLOCK;
int update_error = fcntl(fd, F_SETFL, opts);
Assert(!update_error);
}
// nix_tcp_Socket
internal void
nix_tcp_Socket_init_empty(nix_tcp_Socket *self, nix_tcp_Engine *tcp, s32 index)
{
//TODO(llins): revise this one
pt_filln((char*) self, sizeof(nix_tcp_Socket), 0);
self->status = nix_tcp_Socket_FREE; // status;
self->tcp = tcp;
self->index = index;
self->file_descriptor = -1; // fd;
#if defined(OS_MAC)
EV_SET(&self->ev, 0, 0, 0, 0, 0, 0);
#elif defined(OS_LINUX)
self->ev.data.ptr = 0;
self->ev.events = 0;
#endif
self->prev = 0;
self->next = 0;
self->start_time = 0;
self->user_data = 0;
}
// the kevent call is different than the epoll one,
// we always pass the list of events we are interested
// in a contiguous array
internal void
nix_tcp_Socket_kqueue_retrigger(nix_tcp_Socket *self)
{
#if defined(OS_MAC)
kevent(self->tcp->kqueue_fd, &self->ev, 1, 0, 0, 0);
#elif defined(OS_LINUX)
epoll_ctl(self->tcp->epoll_fd, EPOLL_CTL_MOD, self->file_descriptor, &self->ev);
#endif
}
internal void
nix_tcp_Socket_kqueue_insert(nix_tcp_Socket *self)
{
#if defined(OS_MAC)
kevent(self->tcp->kqueue_fd, &self->ev, 1, 0, 0, 0);
#elif defined(OS_LINUX)
epoll_ctl(self->tcp->epoll_fd, EPOLL_CTL_ADD, self->file_descriptor, &self->ev);
#endif
}
internal void
nix_tcp_Socket_init_listen(nix_tcp_Socket *self, int file_descriptor, s32 port, void *user_data, PlatformTCPCallback *callback, u64 start_time)
{
self->file_descriptor = file_descriptor;
self->type = pt_TCP_LISTEN_SOCKET;
#if defined(OS_MAC)
//
// kevent we are interested
//
// intptr_t ident; /* identifier for this event */
// short filter; /* filter for event */
// u_short flags; /* action flags for kqueue */
// u_int fflags; /* filter flag value */
// intptr_t data; /* filter data value */
// void *udata; /* opaque user data identifier */
//
EV_SET(&self->ev, file_descriptor, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, self);
#elif defined(OS_LINUX)
self->ev.data.ptr = self;
self->ev.events = EPOLLIN | EPOLLET;
// edge triggered (not oneshot for the listen socket)
#endif
self->status = nix_tcp_Socket_INUSE;
self->listen.port = port;
self->callback = callback;
self->user_data = user_data;
self->start_time = start_time;
}
internal void
nix_tcp_Socket_init_server(nix_tcp_Socket *self, nix_tcp_Socket *listen_socket, int file_descriptor, void *user_data, PlatformTCPCallback *callback, u64 start_time)
{
Assert(self->status == nix_tcp_Socket_FREE);
self->file_descriptor = file_descriptor;
self->type = pt_TCP_SERVER_SOCKET;
#if defined(OS_MAC)
EV_SET(&self->ev, file_descriptor, EVFILT_READ, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, self);
#elif defined(OS_LINUX)
self->ev.data.ptr = self;
self->ev.events = EPOLLIN | EPOLLET | EPOLLONESHOT;
#endif
self->server.listen_socket = listen_socket;
self->status = nix_tcp_Socket_INUSE;
self->callback = callback;
self->user_data = user_data;
self->start_time = start_time;
}
internal void
nix_tcp_Socket_init_client(nix_tcp_Socket *self, int file_descriptor, void *user_data, s32 port, char *hostname, PlatformTCPCallback *callback, u64 start_time)
{
Assert(self->status == nix_tcp_Socket_FREE);
self->file_descriptor = file_descriptor;
self->type = pt_TCP_CLIENT_SOCKET;
#if defined(OS_MAC)
EV_SET(&self->ev, file_descriptor, EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, self);
#elif defined(OS_LINUX)
self->ev.data.ptr = self;
self->ev.events = EPOLLIN | EPOLLET | EPOLLONESHOT;
#endif
self->status = nix_tcp_Socket_INUSE;
self->callback = callback;
self->user_data = user_data;
self->start_time = start_time;
}
internal void
nix_tcp_Socket_close(nix_tcp_Socket *self)
{
//TODO(llins): revise this one
Assert(self->status == nix_tcp_Socket_INUSE);
self->status = nix_tcp_Socket_CLOSED;
}
// nix_tcp_Engine
internal void
nix_tcp_Engine_init(nix_tcp_Engine *self)
{
#if defined(OS_MAC)
/* create kqueue object */
self->kqueue_fd = kqueue();
Assert(self->kqueue_fd);
#elif defined(OS_LINUX)
/* create epoll object */
self->epoll_fd = epoll_create(nix_tcp_MAX_EVENTS);
Assert(self->epoll_fd);
#endif
nix_tcp_Socket *prev = 0;
for (s32 i=0;i<ArrayCount(self->sockets);++i) {
nix_tcp_Socket_init_empty(self->sockets + i, self, i);
if (i < ArrayCount(self->sockets)-1) {
self->sockets[i].next = self->sockets + i + 1;
} else {
self->sockets[i].next = 0;
}
self->sockets[i].prev = prev;
}
self->free_sockets = self->sockets;
self->active_sockets = 0;
/* initialize tasks infrastructure */
self->tasks.sentinel = 0;
self->tasks.end = 1;
for (s32 i=0;i<ArrayCount(self->tasks.queue);++i) {
self->tasks.queue[i].ready = 0;
}
}
internal void
nix_tcp_Engine_destroy(nix_tcp_Engine *self)
{
#if defined(OS_MAC)
Assert(self->kqueue_fd);
#elif defined(OS_LINUX)
Assert(self->epoll_fd);
#endif
nix_tcp_Socket *it = self->active_sockets;
while (it) {
if (it->status == nix_tcp_Socket_INUSE) {
close(it->file_descriptor);
printf("[tcp_destroy] socket: %d type: %d status: %d was INUSE and is being closed\n", it->index, it->type, it->status);
} else if (it->status == nix_tcp_Socket_CLOSED) {
printf("[tcp_destroy] socket: %d type: %d status: %d was already CLOSED\n", it->index, it->type, it->status);
} else {
printf("[tcp_destroy] socket: %d type: %d status: %d is either FREE or ACTIVATING (not closing it)\n", it->index, it->type, it->status);
}
it = it->next;
}
#if defined(OS_MAC)
close(self->kqueue_fd);
#elif defined(OS_LINUX)
close(self->epoll_fd);
#endif
char *p = (char*) self;
pt_fill(p, p +sizeof(nix_tcp_Engine), 0);
}
internal void
nix_tcp_Engine_release_socket(nix_tcp_Engine *self, nix_tcp_Socket *socket)
{
Assert(socket->status==nix_tcp_Socket_INUSE || socket->status==nix_tcp_Socket_CLOSED);
nix_tcp_Socket *prev = socket->prev;
nix_tcp_Socket *next = socket->next;
if (prev) {
prev->next = next;
}
if (next) {
next->prev = prev;
}
if (self->active_sockets == socket) {
Assert(socket->prev == 0);
self->active_sockets = next;
}
socket->next = self->free_sockets;
socket->prev = 0;
socket->file_descriptor = 0;
self->free_sockets = socket;
socket->status = nix_tcp_Socket_FREE;
}
internal void
nix_tcp_Engine_collect_closed_sockets(nix_tcp_Engine *self)
{
nix_tcp_Socket *it = self->active_sockets;
s32 count = 0;
while (it) {
nix_tcp_Socket *it_next = it->next;
if (it->status == nix_tcp_Socket_CLOSED) {
nix_tcp_Engine_release_socket(self, it);
++count;
}
it = it_next;
}
printf("[SERVER] Collect Closed Socket %d\n", count);
}
internal nix_tcp_Socket*
nix_tcp_Engine_reserve_socket(nix_tcp_Engine *self)
{
if (!self->free_sockets) {
/* collect closed sockets from active sockets if any */
nix_tcp_Engine_collect_closed_sockets(self);
}
Assert(self->free_sockets);
nix_tcp_Socket *new_socket = self->free_sockets;
self->free_sockets = self->free_sockets->next;
if (self->free_sockets) {
self->free_sockets->prev = 0;
}
new_socket->prev = 0;
new_socket->next = self->active_sockets;
if (self->active_sockets) {
self->active_sockets->prev = new_socket;
}
self->active_sockets= new_socket;
// socket status
return new_socket;
}
internal void
nix_tcp_Engine_produce_listen_task(nix_tcp_Engine *self, s32 port, void *user_data, PlatformTCPCallback *callback, pt_TCP_Feedback *feedback)
{
// simply let it overflow
u64 index = pt_atomic_add_u64(&self->tasks.end, 1);
index &= nix_tcp_TASK_QUEUE_MASK;
//
// NOTE(llins): assumes we don't produce more tasks than the
// queue size in a single cycle.
//
Assert(index != self->tasks.sentinel);
nix_tcp_Task *task = self->tasks.queue + index;
Assert(task->ready == 0);
task->callback = callback;
task->feedback = feedback;
task->port = port;
task->type = nix_tcp_LISTEN_TASK;
task->user_data = user_data;
if (feedback) {
feedback->status = pt_TCP_SOCKET_ACTIVATING;
feedback->socket.handle = 0;
feedback->socket.type = 0;
feedback->socket.user_data = 0;
}
__sync_synchronize();
// make sure everything above is ready before we set ready to 1
task->ready = 1;
}
internal void
nix_tcp_Engine_produce_client_task(nix_tcp_Engine *self, s32 port, char *hostname, void *user_data, PlatformTCPCallback *callback, pt_TCP_Feedback *feedback)
{
// simply let it overflow
u64 index = pt_atomic_add_u64(&self->tasks.end, 1);
index &= nix_tcp_TASK_QUEUE_MASK;
//
// NOTE(llins): assumes we don't produce more tasks than the
// queue size in a single cycle.
//
Assert(index != self->tasks.sentinel);
nix_tcp_Task *task = self->tasks.queue + index;
Assert(task->ready == 0);
task->callback = callback;
task->client.hostname = hostname;
task->feedback = feedback;
task->port = port;
task->type = nix_tcp_CLIENT_TASK;
task->user_data = user_data;
if (feedback) {
feedback->status = pt_TCP_SOCKET_ACTIVATING;
feedback->socket.handle = 0;
feedback->socket.type = 0;
feedback->socket.user_data = 0;
}
__sync_synchronize();
// make sure everything above is ready before we set ready to 1
task->ready = 1;
}
internal void
nix_tcp_Engine_consume_listen_task(nix_tcp_Engine *self, nix_tcp_Task *task)
{
Assert(task->type == nix_tcp_LISTEN_TASK);
s32 next_status = pt_TCP_SOCKET_OK;
nix_tcp_Socket *listen_socket = 0;
/* create self server socket */
int listen_socket_fd = socket(PF_INET, SOCK_STREAM, 0);
if (listen_socket_fd < 0) {
printf("pt_Engine_ERROR_SOCKET\n");
goto error;
}
//Allow socket to be reused
int yes = 1;
if (setsockopt(listen_socket_fd,SOL_SOCKET,
SO_REUSEADDR,&yes,
sizeof(int)) == -1){
perror("setsockopt SO_REUSEADDR");
}
/* set as non-blocking */
nix_tcp_set_nonblocking_fd(listen_socket_fd);
struct sockaddr_in listen_socket_addr;
listen_socket_addr.sin_family = AF_INET;
listen_socket_addr.sin_port = htons(task->port);
inet_aton(nix_tcp_LOCAL_ADDR, &(listen_socket_addr.sin_addr));
int bind_error = bind(listen_socket_fd,
(struct sockaddr*) &listen_socket_addr,
sizeof(listen_socket_addr));
if (bind_error != 0) {
printf("pt_Engine_ERROR_BIND\n");
goto error;
}
/* listen */
int listen_error = listen(listen_socket_fd, nix_tcp_MAX_CONNECTIONS);
if (listen_error) {
printf("pt_Engine_ERROR_LISTEN\n");
goto error;
}
/* initialize listen socket report */
f64 start_time = nix_get_time();
listen_socket = nix_tcp_Engine_reserve_socket(self);
if (!listen_socket) {
printf("[nix_tcp_Engine_consume_tasks]: could not reserver socket\n");
Assert(listen_socket_fd);
}
nix_tcp_Socket_init_listen(listen_socket, listen_socket_fd, task->port, task->user_data, task->callback, start_time);
/* register into kqueue */
nix_tcp_Socket_kqueue_insert(listen_socket);
goto done;
error:
next_status = pt_TCP_SOCKET_ERROR;
done:
if (task->feedback) {
task->feedback->status = next_status;
if (listen_socket) {
task->feedback->socket.handle = listen_socket;
task->feedback->socket.type = pt_TCP_LISTEN_SOCKET;
task->feedback->socket.user_data = task->user_data;
}
}
task->ready = 0;
}
internal void
nix_tcp_Engine_consume_client_task(nix_tcp_Engine *self, nix_tcp_Task *task)
{
// TODO(llins): continue from here
Assert(task->type == nix_tcp_CLIENT_TASK);
s32 next_status = pt_TCP_SOCKET_OK;
// TODO(llins): which one is it? a hostname or an ip address?
// assume hostname
int client_socket_fd = -1;
f64 start_time = nix_get_time();
// http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#getaddrinfo
struct addrinfo hints = { 0 };
hints.ai_family = AF_UNSPEC; // don't care IPV4 or IPV6
hints.ai_socktype = SOCK_STREAM; // TCP stream socket
hints.ai_flags = AI_PASSIVE; // fill in my IP for me
char port_string[15];
snprintf(port_string,15,"%d",task->port);
struct addrinfo *servinfo;
nix_tcp_Socket *client_socket = 0;
int status = getaddrinfo(task->client.hostname, port_string, &hints, &servinfo);
if (status != 0) {
printf("[nix_tcp_Engine_consume_client_task] Error: getaddrinfo()\n");
printf(" %s\n", gai_strerror(status));
goto error;
}
s32 option = 0;
for (struct addrinfo *p=servinfo; p!=0; p=p->ai_next) {
++option;
client_socket_fd = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
if (client_socket_fd >= 0) {
int connect_status = connect(client_socket_fd, p->ai_addr, p->ai_addrlen);
if (connect_status != 0) {
printf("[nix_tcp_Engine_consume_client_task] Could not connect(...) using addrinfo %d: connect(...)\n", option);
close(client_socket_fd);
} else {
goto connect_ok;
}
} else {
printf("[nix_tcp_Engine_consume_client_task] Could not socket(...) using addrinfo %d: connect(...)\n", option);
}
}
goto error;
connect_ok:
/* set client to be nonblocking */
nix_tcp_set_nonblocking_fd(client_socket_fd);
/* register client socket fd into the kqueue */
client_socket = nix_tcp_Engine_reserve_socket(self);
if (!client_socket) {
printf("[nix_tcp_Engine_consume_client_task]: could not reserve socket\n");
goto error;
}
// TODO(llins): register hostname and port on the client socket?
nix_tcp_Socket_init_client(client_socket, client_socket_fd, task->user_data,
task->port, task->client.hostname, task->callback,
start_time);
/* register into kqueue */
nix_tcp_Socket_kqueue_insert(client_socket);
goto done;
error:
next_status = pt_TCP_SOCKET_ERROR;
done:
if (task->feedback) {
task->feedback->status = next_status;
if (client_socket) {
task->feedback->socket.handle = client_socket;
task->feedback->socket.type = pt_TCP_CLIENT_SOCKET;
task->feedback->socket.user_data = task->user_data;
}
}
task->ready = 0;
}
internal void
nix_tcp_Engine_consume_tasks(nix_tcp_Engine *self)
{
// how to safely check if task queue is full
u64 it = (self->tasks.sentinel + 1) & nix_tcp_TASK_QUEUE_MASK;
u64 end = self->tasks.end & nix_tcp_TASK_QUEUE_MASK;
while (it != end) {
nix_tcp_Task *task = self->tasks.queue + it;
if (task->ready) {
/* listen task */
if (task->type == nix_tcp_LISTEN_TASK) {
nix_tcp_Engine_consume_listen_task(self, task);
} else if (task->type == nix_tcp_CLIENT_TASK) {
nix_tcp_Engine_consume_client_task(self, task);
} else {
printf("[nix_tcp_Engine_consume_tasks] task type not supported\n");
Assert(0);
}
} else {
// if i-th task is not ready leave remaining
// tasks to next engine cycle
break;
}
it = (it + 1) & nix_tcp_TASK_QUEUE_MASK;
}
if (it == 0) {
self->tasks.sentinel = nix_tcp_TASK_QUEUE_SIZE - 1;
} else {
self->tasks.sentinel = it - 1;
}
}
internal void
nix_tcp_read_from_connection_and_dispatch(nix_tcp_Socket *socket)
{
char buf[nix_tcp_BUFFER_SIZE];
pt_TCP_Socket pt_socket = { .user_data = socket->user_data, .handle = socket };
b8 done = 0;
while (1) {
/* this could be running in a work thread */
int count = read(socket->file_descriptor, buf, sizeof(buf)-1);
if (count == -1) {
/* If errno == EAGAIN, that means we have read all
data. So go back to the main loop. */
if (errno != EAGAIN) {
done = 1;
}
break;
} else if (count == 0) {
/* End of file. The remote has closed the socket. */
done = 1;
break;
} else {
buf[count] = 0;
printf("[SERVER] Incoming data on %d:%d (%d bytes)\n",
socket->index,
socket->file_descriptor,
count);
#if 0
printf("====== Input data form fd %3d ======\n", socket->file_descriptor);
printf("%s\n====== end =========================\n", buf);
#endif
socket->callback(&pt_socket, buf, count);
}
}
if (done) {
f64 end_time = nix_get_time();
printf("[SERVER] Closing Socket %d:%d on (active time: %fs)\n", socket->index, socket->file_descriptor, end_time - socket->start_time);
// printf ("Closed socket on descriptor %d\n",events[i].data.fd);
/* Closing the descriptor will make kqueue remove it
from the set of descriptors which are monitored. */
close(socket->file_descriptor);
nix_tcp_Socket_close(socket);
} else {
/* NOTE(llins): from what I read, system call here is thread safe */
printf("[SERVER] Retriggering Socket %d:%d\n", socket->index, socket->file_descriptor);
nix_tcp_Socket_kqueue_retrigger(socket);
}
}
internal
PLATFORM_WORK_QUEUE_CALLBACK(nix_tcp_work_queue_callback)
{
nix_tcp_Socket *connection = (nix_tcp_Socket*) data;
nix_tcp_read_from_connection_and_dispatch(connection);
}
internal void
nix_tcp_Engine_process_events(nix_tcp_Engine *tcp, pt_WorkQueue *work_queue)
{
/* register listen and client sockets coming as registered tasks */
nix_tcp_Engine_consume_tasks(tcp);
/* wait for events on sockets beign tracked for at most nix_tcp_TIMEOUT milliseconds */
#if defined(OS_MAC)
// @note one second timeout
static const struct timespec timeout = { .tv_sec= nix_tcp_TIMEOUT_SECONDS, .tv_nsec = 1000 * nix_tcp_TIMEOUT_MILLISECONDS };
int num_fd = kevent(tcp->kqueue_fd, 0, 0, tcp->events, ArrayCount(tcp->events), &timeout);
struct kevent ev;
#elif defined(OS_LINUX)
int num_fd = epoll_wait(tcp->epoll_fd, tcp->events, ArrayCount(tcp->events), nix_tcp_TIMEOUT_MILLISECONDS + 1000 * nix_tcp_TIMEOUT_SECONDS);
#endif
/* for each socket with some event available process all what
* is available (edge triggered)
*
* for events on listen sockets:
* use the same thread to register new listen sockets to kqueue
*
* for events on client or server sockets:
* use the same thread to run the receive callbacks if work_queue is null
* dispatch callbacks to work queue
*/
for (int i=0; i<num_fd; ++i) {
#if defined(OS_MAC)
nix_tcp_Socket *socket = (nix_tcp_Socket*) tcp->events[i].udata;
#elif defined(OS_LINUX)
nix_tcp_Socket *socket = (nix_tcp_Socket*) tcp->events[i].data.ptr;
#endif
if (socket->type == pt_TCP_LISTEN_SOCKET) {
pf_BEGIN_BLOCK("accepting_connection");
// try accepetping one or more incoming connections
while (1) {
struct sockaddr_in new_socket_addr;
socklen_t new_socket_len = sizeof(struct sockaddr_in);
int new_socket_fd = accept(socket->file_descriptor, (struct sockaddr*) &new_socket_addr, &new_socket_len);
if (new_socket_fd == -1) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
break;
} else {
printf("[SERVER] Fatal Error: problem when accepting socket\n");
Assert(0 && "problem when accepting socket");
}
}
Assert(new_socket_fd >= 0);
nix_tcp_set_nonblocking_fd(new_socket_fd);
nix_tcp_Socket *new_socket = nix_tcp_Engine_reserve_socket(tcp);
f64 start_time = nix_get_time();
printf("[SERVER] New Socket %d:%d from %s:%d\n",
new_socket->index,
new_socket_fd,
inet_ntoa(new_socket_addr.sin_addr),
(int) new_socket_addr.sin_port);
nix_tcp_Socket_init_server(new_socket, socket, new_socket_fd, socket->user_data, socket->callback, start_time);
nix_tcp_Socket_kqueue_insert(new_socket);
}
pf_END_BLOCK();
} else {
if (work_queue) {
/* work threads */
nix_work_queue_add_entry(work_queue, nix_tcp_work_queue_callback, socket);
} else {
/* single threaded */
nix_tcp_read_from_connection_and_dispatch(socket);
}
}
}
}
internal
PLATFORM_TCP_PROCESS_EVENTS(nix_tcp_process_events)
{
nix_tcp_Engine_process_events((nix_tcp_Engine*) tcp.handle, work_queue);
}
internal
PLATFORM_TCP_WRITE(nix_tcp_write)
{
if (length == 0)
return;
nix_tcp_Socket *nix_socket = (nix_tcp_Socket*) socket->handle;
s64 offset = 0;
while (1) {
// https://stackoverflow.com/questions/108183/how-to-prevent-sigpipes-or-handle-them-properly
// s64 count = write(nix_socket->file_descriptor, buffer + offset, length - offset);
// MSG_NOSIGPIPE
#if defined(OS_MAC)
s64 count = send(nix_socket->file_descriptor, buffer + offset, length - offset, SO_NOSIGPIPE);
#elif defined(OS_LINUX)
s64 count = send(nix_socket->file_descriptor, buffer + offset, length - offset, MSG_NOSIGNAL );
#endif
if (count == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
// printf("[SERVER] received EAGAIN || EWOULDBLOCK with -1 result, will try again...\n");
// usleep(1);
continue;
} else {
printf("[SERVER] write count == -1 on socket %d:%d errorno %d is %s (exiting server respond)\n",
nix_socket->index, nix_socket->file_descriptor, errno,
strerror(errno));
return;
}
} else if (count == 0) {
printf("[SERVER] write count == 0 on socket %d:%d errorno %d is %s\n",
nix_socket->index, nix_socket->file_descriptor, errno,
strerror(errno));
// TODO(llins): revise these cases. not sure what is the right approach.
return;
} else if (count > 0) {
offset += count;
if (offset == length) {
printf("[SERVER] written %d bytes on socket (response done %d) %d:%d\n", (int) count, (int) length, nix_socket->index, nix_socket->file_descriptor);
break;
} else {
// printf("[SERVER] written %d bytes on socket %d:%d\n", (int) count, nix_socket->index, nix_socket->file_descriptor);
}
}
}
}
internal
PLATFORM_TCP_CREATE(nix_tcp_create)
{
pt_TCP result = { .handle = 0 };
if (nix_tcp_num_engines == ArrayCount(nix_tcp_engines)) {
return result;
}
/* osx server */
nix_tcp_Engine *nix_tcp_engine = nix_tcp_engines + nix_tcp_num_engines;
nix_tcp_Engine_init(nix_tcp_engine);
/* osx server */
++nix_tcp_num_engines;
result.handle = (void*) nix_tcp_engine;
return result;
}
internal
PLATFORM_TCP_DESTROY(nix_tcp_destroy)
{
if (!tcp.handle) {
return;
}
nix_tcp_Engine *tcp_engine = (nix_tcp_Engine*) tcp.handle;
nix_tcp_Engine_destroy(tcp_engine);
}
// #define PLATFORM_TCP_SERVE(name) void name(pt_TCP *tcp, s32 port, void *user_data, PlatformTCPCallback *callback, s32 *status)
internal
PLATFORM_TCP_SERVE(nix_tcp_serve)
{
nix_tcp_Engine *nix_tcp_engine = (nix_tcp_Engine*) tcp.handle;
/* schedule tcp engine to create a listen socket on next process events cycle */
nix_tcp_Engine_produce_listen_task(nix_tcp_engine, port, user_data, callback, feedback);
}
// #define PLATFORM_TCP_CLIENT(name) void name(pt_TCP *tcp, s32 port, char *hostname, void *user_data, PlatformTCPCallback *callback, s32 *status)
internal
PLATFORM_TCP_CLIENT(nix_tcp_client)
{
nix_tcp_Engine *nix_tcp_engine = (nix_tcp_Engine*) tcp.handle;
/* schedule tcp engine to create a client socket on next process events cycle */
/* client socket should connect to host referred on hostname */
// TODO(llins): should we copy hostname to a safe place? (client code might destroy it)
nix_tcp_Engine_produce_client_task(nix_tcp_engine, port, hostname, user_data, callback, feedback);
}
// initialize osx platform to PlatformAPI
internal void
nix_init_platform(PlatformAPI* p)
{
p->allocate_memory = nix_allocate_memory;
p->resize_memory = nix_resize_memory;
p->free_memory = nix_free_memory;
p->copy_memory = nix_copy_memory;
p->open_write_file = nix_open_write_file;
p->open_read_file = nix_open_read_file;
p->read_next_file_chunk = nix_read_next_file_chunk;
p->seek_file = nix_seek_file;
p->close_file = nix_close_file;
p->write_to_file = nix_write_to_file;
p->get_time = nix_get_time;
p->open_mmap_file = nix_open_mmap_file;
p->close_mmap_file = nix_close_mmap_file;
p->resize_file = nix_resize_file;
p->cycle_count_cpu = nix_cycle_count_cpu;
// mutex
p->create_mutex = nix_create_mutex;
p->release_mutex = nix_release_mutex;
p->lock_mutex = nix_lock_mutex;
p->unlock_mutex = nix_unlock_mutex;
p->executable_path = nix_executable_path;
p->work_queue_add_entry = nix_work_queue_add_entry;
p->work_queue_complete_work = nix_work_queue_complete_all_work;
p->work_queue_create = nix_work_queue_create;
p->work_queue_destroy = nix_work_queue_destroy;
p->work_queue_finished = nix_work_queue_finished;
p->get_thread_index = nix_get_thread_index;
p->thread_sleep = nix_thread_sleep;
/* tcp support is not implemented on OSX */
p->tcp_create = nix_tcp_create;
p->tcp_serve = nix_tcp_serve;
p->tcp_write = nix_tcp_write;
p->tcp_process_events = nix_tcp_process_events;
p->tcp_client = nix_tcp_client;
}
| {
"pile_set_name": "Github"
} |
/* wf - print word frequencies; uses structures */
/* based on the program of the same name from the lcc test suite */
let
type node = {
count : int, /* frequency count */
left : node, /* left subtree */
right : node, /* right subtree */
word : string /* word itself */
}
var root := nil
function err(s : string) = (
print("? "); print(s); print("\n");
exit(1)
)
/* add_word - add word to tree: install or increment count */
function add_word(word : string) =
let function insert(p : node) : node =
if p = nil then node { count = 1, left = nil, right = nil, word = word }
else if word = p.word then (p.count := p.count + 1; p)
else if word < p.word then (p.left := insert(p.left); p)
else (p.right := insert(p.right); p)
in root := insert(root)
end
/* not until we have division
function print_int(n : int) =
if n = 0 then print("0")
else if n < 0 then (print("-"); print_int(-n))
else
let function digit(n : int) = print(chr(ord("0") + n))
function mod10(n : int) : int = n - 10 * (n / 10)
function digits(n : int) =
(if n < 10 then digit(n) else (digits(n / 10); digit(mod10(n))))
in digits(n)
end
*/
/* tprint - print tree */
function tprint(tree : node) =
if tree <> nil then (
tprint(tree.left);
printi(tree.count); print("\t"); print(tree.word); print("\n");
tprint(tree.right)
)
/* isletter - return folded version of c if it is a letter, 0 otherwise */
function isletter(c : string) : int =
if c >= "A" and c <= "Z" then
ord(c) + ord("a") - ord("A")
else if c >= "a" and c <= "z" then
ord(c)
else
0
/* getword - get next input word into buf, return empty string on EOF */
function getword() : string =
let var s := ""
var c := ""
in
c := getchar();
while c <> "" and isletter(c) = 0 do
c := getchar();
while c <> "" and isletter(c) do (
s := concat(s, chr(isletter(c)));
c := getchar()
);
s
end
function main() =
let var word := ""
in
word := getword();
while size(word) > 0 do (
add_word(word);
word := getword()
);
tprint(root)
end
in main()
end
| {
"pile_set_name": "Github"
} |
---
deprecated: true
author:
name: Linode
email: [email protected]
description: 'Use Munin on Ubuntu 12.04 to Keep Track of Vital System Statistics and Troubleshoot Performance Problems'
keywords: ["munin", "monitoring", "ubuntu 12.04", "munin node", "munin master"]
tags: ["monitoring","statistics","ubuntu"]
license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
aliases: ['/uptime/monitoring/monitoring-server-with-munin-on-ubuntu-12-04-precise-pangolin/','/server-monitoring/munin/ubuntu-12-04-precise-pangolin/']
modified: 2012-10-09
modified_by:
name: Linode
published: 2012-10-09
expiryDate: 2014-10-09
title: 'Deploy Munin to Monitor Servers on Ubuntu 12.04'
external_resources:
- '[Munin Homepage](http://munin-monitoring.org/)'
- '[Munin Exchange](https://github.com/munin-monitoring/contrib//)'
- '[Installing Munin on Other Linux Distributions](http://munin-monitoring.org/wiki/MuninInstallationLinux)'
- '[Installing Munin on Mac OS X](http://munin-monitoring.org/wiki/MuninInstallationDarwin)'
- '[Installing Munin on Solaris](http://munin-monitoring.org/wiki/MuninInstallationSolaris)'
---
The Linode Manager provides some basic monitoring of system resource utilization, which includes information regarding Network, CPU, and Input/Output usage over the past 24 hours and 30 days. While this basic information is helpful for monitoring your system, there are cases where more fine-grained information is useful. For instance, if you need to monitor memory usage or resource consumption on a per-process level, a more precise monitoring tool like Munin might be helpful.
Munin is a system and network monitoring tool that uses RRDTool to generate useful visualizations of resource usage. The primary goal of the Munin project is to provide an easy-to-use tool that is simple to install and configure and provides information in an accessible web-based interface. Munin also makes it possible to monitor multiple "nodes" with a single installation.
Before installing Munin, we assume that you have followed our [getting started guide](/docs/getting-started/). If you're new to Linux server administration you may be interested in our [introduction to Linux concepts guide](/docs/tools-reference/introduction-to-linux-concepts), the [beginner's guide](/docs/beginners-guide/) and [administration basics guide](/docs/using-linux/administration-basics). Additionally, you'll need to install a web server, such as [Apache](/docs/web-servers/apache/installation/ubuntu-10-04-lucid), in order to use the web interface.
## Install Munin
Make sure your package repositories and installed programs are up to date by issuing the following commands:
apt-get update
apt-get upgrade --show-upgraded
The Munin system has two components: a master component often referred to as simply "munin," and a "node" component, or "munin-node," which collects the data and forwards it to the master node. In Lucid, you need to install both the `munin` and `munin-node` packages if you wish to monitor the Linode you plan to use as the primary Munin device. To install these packages, issue the following command:
apt-get install munin munin-node
On all of the additional machines you administer that you would like to monitor with Munin, issue the following command:
apt-get install munin-node
The machines that you wish to monitor with Munin do not need to run Ubuntu. The Munin project supports monitoring for a large number of operating systems. Consult the Munin project's [installation guide](http://munin-monitoring.org/wiki/MuninInstallationLinux) for more information installing nodes on additional operating systems.
## Configure Munin
### Munin Master Configuration
The master configuration file for Munin is `/etc/munin/munin.conf`. This file is used to set the global directives used by Munin, as well as the hosts monitored by Munin. This file is large, so we've opted to show the key parts of the file. For the most part, the default configuration will be suitable to your needs.
The first section of the file contains the paths to the directories used by Munin. Note that these directories are the default paths used by Munin and can be changed by uncommenting and updating the path. When configuring your web server with Munin, make sure to point the root folder to the path of `htmldir`.
{{< file "/etc/munin/munin.conf" >}}
# dbdir /var/lib/munin \# htmldir /var/cache/munin/www \# logdir /var/log/munin \# rundir /var/run/munin
{{< /file >}}
There are additional directives after the directory location block such as `tmpldir`, which shows Munin where to look for HTML templates, and others that allow you to configure mail to be sent when something on the server changes. These additional directives are explained more in depth on the [munin.conf page of the Munin website](http://munin-monitoring.org/wiki/munin.conf). You can also find quick explanations inside the file itself via hash (`#`) comments. Take note that these global directives must be defined prior to defining hosts monitored by Munin. Do not place global directives at the bottom of the `munin.conf` file.
The last section of the `munin.conf` file defines the hosts Munin retrieves information from. For a default configuration, adding a host can be done in the form shown below:
{{< file "/etc/munin/munin.conf" >}}
[example.org]
: address example.org
{{< /file >}}
For more complex configurations, including grouping domains, see the comment section in the file, reproduced below for your convenience:
{{< file "/etc/munin/munin.conf" >}}
# A more complex example of a host tree \# \#\# First our "normal" host. \# [fii.foo.com] \# address foo \# \#\# Then our other host... \# [fay.foo.com] \# address fay \# \#\# Then we want totals... \# [foo.com;Totals] \#Force it into the "foo.com"-domain... \# update no \# Turn off data-fetching for this "host". \# \# \# The graph "load1". We want to see the loads of both machines... \# \# "fii=fii.foo.com:load.load" means "label=machine:graph.field" \# load1.graph\_title Loads side by side \# load1.graph\_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load \# \# \# The graph "load2". Now we want them stacked on top of each other. \# load2.graph\_title Loads on top of each other \# load2.dummy\_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.l\$ \# load2.dummy\_field.draw AREA \# We want area instead the default LINE2. \# load2.dummy\_field.label dummy \# This is needed. Silly, really. \# \# \# The graph "load3". Now we want them summarized into one field \# load3.graph\_title Loads summarized \# load3.combined\_loads.sum fii.foo.com:load.load fay.foo.com:load.load \# load3.combined\_loads.label Combined loads \# Must be set, as this is \# \# not a dummy field! \# \#\# ...and on a side note, I want them listen in another order (default is \#\# alphabetically) \# \# \# Since [foo.com] would be interpreted as a host in the domain "com", we \# \# specify that this is a domain by adding a semicolon. \# [foo.com;] \# node\_order Totals fii.foo.com fay.foo.com \#
{{< /file >}}
### Munin Node Configuration
The default `/etc/munin/munin-node.conf` file contains several variables you'll want to adjust to your preference. For a basic configuration, you'll only need to add the IP address of the master Munin server as a regular expression. Simply follow the style of the existing `allow` line if you're unfamiliar with regular expressions.
{{< file "/etc/munin/munin-node.conf" >}}
# A list of addresses that are allowed to connect. This must be a \# regular expression, due to brain damage in Net::Server, which \# doesn't understand CIDR-style network notation. You may repeat \# the allow line as many times as you'd like
allow \^127.0.0.1\$
{{< /file >}}
# Replace this with the master munin server IP address allow \^123.45.67.89\$
The above line tells the munin-node that the master Munin server is located at IP address `123.45.67.89`. After updating this file, restart the `munin-node`. In Ubuntu, use the following command:
/etc/init.d/munin-node restart
### Web Interface Configuration
You can use Munin with the web server of your choice, simply point your web server to provide access to resources created by Munin. By default, these resources are located at `/var/cache/munin/www`.
If you are using the [Apache HTTP Server](/docs/web-servers/apache/) you can create a Virtual Host configuration to serve the reports from Munin. In this scenario, we've created a subdomain in the DNS Manager and are now creating the virtual host file:
{{< file "/etc/apache2/sites-available/stats.example.org" >}}
<VirtualHost 12.34.56.78:80>
ServerAdmin [email protected]
ServerName stats.example.org
DocumentRoot /var/cache/munin/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
LogLevel notice
CustomLog /var/log/apache2/access.log combined
ErrorLog /var/log/apache2/error.log
ServerSignature On
</VirtualHost>
{{< /file >}}
If you use this configuration you will want to issue the following commands to ensure that all required directories exist and that your site is enabled:
a2ensite stats.example.org
Now, restart the server so that the changes to your configuration file can take effect. Issue the following command:
/etc/init.d/apache2 restart
You should now be able to see your site's statistics by appending `/munin` to the end of your IP address (e.g. `12.34.56.78/munin`.) If you don't see any statistics at first, be sure to wait for Munin to update; Munin refreshes every 5 minutes.
In most cases you will probably want to prevent the data generated by Munin from becoming publicly accessible. You can either limit access using [rule-based access control](/docs/web-servers/apache/configuration/rule-based-access-control) so that only a specified list of IPs will be permitted access, or you can configure [HTTP Authentication](/docs/web-servers/apache/configuration/http-authentication) to require a password before permitting access. You may want to examine Munin's example Apache configuration file at `/etc/munin/apache.conf`. In addition to protecting the `stats.` virtual host, also ensure that the Munin controls are protected on the default virtual host (e.g. by visiting `http://12.34.56.78/munin/` where `12.34.56.78` is the IP address of your server.)
| {
"pile_set_name": "Github"
} |
//---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 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_DETAIL_VENDOR_HPP
#define BOOST_COMPUTE_DETAIL_VENDOR_HPP
#include <boost/compute/device.hpp>
#include <boost/compute/platform.hpp>
namespace boost {
namespace compute {
namespace detail {
// returns true if the device is an nvidia gpu
inline bool is_nvidia_device(const device &device)
{
std::string nvidia("NVIDIA");
return device.vendor().compare(0, nvidia.size(), nvidia) == 0;
}
// returns true if the device is an amd cpu or gpu
inline bool is_amd_device(const device &device)
{
return device.platform().vendor() == "Advanced Micro Devices, Inc.";
}
} // end detail namespace
} // end compute namespace
} // end boost namespace
#endif // BOOST_COMPUTE_DETAIL_VENDOR_HPP
| {
"pile_set_name": "Github"
} |
/*
*
* Copyright 2016 Netflix, 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.
*
*/
/**
* Various Spring aspects for Genie web.
*
* @author amajumdar
* @since 3.0.0
*/
package com.netflix.genie.web.aspects;
| {
"pile_set_name": "Github"
} |
---
http_client_port: 18012
http_public_port: 17012
udp_server_port: 16012
database: host=localhost port=5432 dbname=ubot_t12
node_number: 12
public_host: localhost
node_name: ubot_12
ip:
- 127.0.0.1
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.wicket.markup.html.link;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
import java.io.IOException;
import org.apache.wicket.Component;
import org.apache.wicket.model.IComponentAssignedModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.IWrapModel;
import org.apache.wicket.protocol.http.mock.MockServletContext;
import org.apache.wicket.util.tester.WicketTestCase;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Tests DownloadLink
*
* @author <a href="mailto:[email protected]">Jean-Baptiste Quenot</a>
*/
class DownloadLinkTest extends WicketTestCase
{
private static final String APPLICATION_X_CUSTOM = "application/x-custom";
private static final Logger log = LoggerFactory.getLogger(DownloadLinkTest.class);
/**
* Tests custom type download.
*/
@Test
void customTypeDownloadLink()
{
tester.startPage(DownloadPage.class);
((MockServletContext)tester.getApplication().getServletContext()).addMimeType("custom",
APPLICATION_X_CUSTOM);
tester.clickLink(DownloadPage.CUSTOM_DOWNLOAD_LINK);
log.debug("Content-Type: " + tester.getContentTypeFromResponseHeader());
assertTrue(tester.getContentTypeFromResponseHeader().startsWith(APPLICATION_X_CUSTOM));
}
/**
* Tests pdf download.
*/
@Test
void pdfDownloadLink()
{
tester.startPage(DownloadPage.class);
tester.clickLink(DownloadPage.PDF_DOWNLOAD_LINK);
assertTrue(tester.getContentTypeFromResponseHeader().startsWith("application/pdf"));
assertEquals(DownloadPage.HELLO_WORLD.length(), tester.getContentLengthFromResponseHeader());
}
/**
* Tests text download.
*/
@Test
void textDownloadLink()
{
tester.startPage(DownloadPage.class);
tester.clickLink(DownloadPage.TEXT_DOWNLOAD_LINK);
assertTrue(tester.getContentTypeFromResponseHeader().startsWith("text/plain"));
assertTrue(tester.getContentDispositionFromResponseHeader().startsWith(
"attachment; filename="));
assertEquals(0, tester.getContentLengthFromResponseHeader());
}
/**
* Tests file removal after download
*/
@Test
void deleteAfterLink()
{
DownloadPage page;
try
{
page = new DownloadPage();
}
catch (IOException e)
{
throw new RuntimeException(e);
}
tester.startPage(page);
File temporary = page.getTemporaryFile();
tester.clickLink(DownloadPage.DELETE_DOWNLOAD_LINK);
assertFalse(temporary.exists());
}
/**
* WICKET-4738 wrapOnAssigment and detach on fileName
*/
@Test
void fileNameModel()
{
FileNameModel fileNameModel = new FileNameModel();
DownloadLink link = new DownloadLink("test", new IModel<File>()
{
@Override
public File getObject()
{
return null;
}
}, fileNameModel);
assertTrue(fileNameModel.wrapOnAssignmentCalled);
link.detach();
assertTrue(fileNameModel.detachCalled);
}
private class FileNameModel implements IModel<String>,
IComponentAssignedModel<String>,
IWrapModel<String>
{
private static final long serialVersionUID = 1L;
boolean detachCalled = false;
boolean wrapOnAssignmentCalled;
@Override
public String getObject()
{
return null;
}
@Override
public IWrapModel<String> wrapOnAssignment(Component component)
{
wrapOnAssignmentCalled = true;
return this;
}
@Override
public void detach()
{
detachCalled = true;
}
@Override
public IModel<?> getWrappedModel()
{
return null;
}
}
}
| {
"pile_set_name": "Github"
} |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
*
* (C) 2001 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef MPITEST_H_INCLUDED
#define MPITEST_H_INCLUDED
#include "mpitestconf.h"
/*
* Init and finalize test
*/
void MTest_Init( int *, char *** );
void MTest_Init_thread( int *, char ***, int, int * );
void MTest_Finalize( int );
void MTestPrintError( int );
void MTestPrintErrorMsg( const char [], int );
void MTestPrintfMsg( int, const char [], ... );
void MTestError( const char [] );
int MTestReturnValue( int );
/*
* Utilities
*/
void MTestSleep( int );
/*
* This structure contains the information used to test datatypes
* buf is set to null when an MTestDatatype is created; the
* InitBuf routine will allocate (if necessary) and initialize
* the data. InitBuf may be called multiple times (this is particularly
* important for recv bufs), in which case the buffer will only
* be allocated if it has not already been created.
*/
typedef struct _MTestDatatype {
MPI_Datatype datatype;
void *buf; /* buffer to use in communication */
int count; /* count to use for this datatype */
int isBasic; /* true if the type is predefined */
int printErrors; /* true if errors should be printed
(used by the CheckBuf routines) */
/* The following is optional data that is used by some of
the derived datatypes */
int stride, nelm, blksize, *index;
/* stride, nelm, and blksize are in bytes */
int *displs, basesize;
/* displacements are in multiples of base type; basesize is the
size of that type*/
void *(*InitBuf)( struct _MTestDatatype * );
void *(*FreeBuf)( struct _MTestDatatype * );
int (*CheckBuf)( struct _MTestDatatype * );
} MTestDatatype;
int MTestCheckRecv( MPI_Status *, MTestDatatype * );
int MTestGetDatatypes( MTestDatatype *, MTestDatatype *, int );
void MTestResetDatatypes( void );
void MTestFreeDatatype( MTestDatatype * );
const char *MTestGetDatatypeName( MTestDatatype * );
int MTestGetDatatypeIndex( void );
int MTestGetIntracomm( MPI_Comm *, int );
int MTestGetIntracommGeneral( MPI_Comm *, int, int );
int MTestGetIntercomm( MPI_Comm *, int *, int );
int MTestGetComm( MPI_Comm *, int );
const char *MTestGetIntracommName( void );
const char *MTestGetIntercommName( void );
void MTestFreeComm( MPI_Comm * );
#ifdef HAVE_MPI_WIN_CREATE
int MTestGetWin( MPI_Win *, int );
const char *MTestGetWinName( void );
void MTestFreeWin( MPI_Win * );
#endif
/* These macros permit overrides via:
* make CPPFLAGS='-DMTEST_MPI_VERSION=X -DMTEST_MPI_SUBVERSION=Y'
* where X and Y are the major and minor versions of the MPI standard that is
* being tested. The override should work similarly if added to the CPPFLAGS at
* configure time. */
#ifndef MTEST_MPI_VERSION
#define MTEST_MPI_VERSION MPI_VERSION
#endif
#ifndef MTEST_MPI_SUBVERSION
#define MTEST_MPI_SUBVERSION MPI_SUBVERSION
#endif
/* Makes it easier to conditionally compile test code for a particular minimum
* version of the MPI Standard. Right now there is only a MIN flavor but it
* would be easy to add MAX or EXACT flavors if they become necessary at some
* point. Example usage:
------8<-------
#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
... test for some feature that is only available in MPI-2.2 or later ...
#endif
------8<-------
*/
#define MTEST_HAVE_MIN_MPI_VERSION(major_,minor_) \
((MTEST_MPI_VERSION == (major_) && MTEST_MPI_SUBVERSION >= (minor_)) || \
(MTEST_MPI_VERSION > (major_)))
#endif
| {
"pile_set_name": "Github"
} |
# Copyright (C) 2001-2012, Parrot Foundation.
=pod
=head1 NAME
docs/dev/pmc_obj_design_meeting_notes.pod
=head1 DESCRIPTION
This document sets out PMC/Object Design Meeting Notes which took place in
Chicago in 2006.
=head1 PARROT PMC/OBJECT DESIGN MEETING NOTES
During the Chicago Hackathon 2006, Jerry Gay, Matt Diephouse, chromatic,
Leo Toetch, Jonathan Worthington and Chip Salzenberg (arriving late) met to
discuss problems and proposed solutions for Parrot PMCs and objects. Previous
to the meeting, wiki pages were set up to gather a list of problems, they can
be found at L<http://rakudo.org/hackathon-chicago/index.cgi?object> and
L<http://rakudo.org/hackathon-chicago/index.cgi?pmc>. A log of the discussion
that took place can be found at
L<http://www.parrotcode.org/misc/parrotsketch-logs/irclog.parrotsketch-200611/irclog.parrotsketch.20061112>.
This summary has been compiled from these sources and from other
conversations which were not recorded.
=head2 List of problems and proposed solutions for PMCs:
=over 4
=item Not all PMCs properly serialize properties by calling the default
implementation
This is one of many troubles with properties. Also, properties were invented
at a time when it looked like Perl 6 needed them, however this suspected use
case has so far proven incorrect. A general property system means every PMC
might get properties at runtime, so all PMCs share the burden all the time of
an uncommonly-used "feature". Furthermore, a property as currently
implemented is one full-blown hash per object, typically to store a single
value. The same effect can easily be achieved by using one AddrRegistry Hash
to store values in it. Finally, if some class system needs properties, it can
implement it itself.
B<Recommendation>: Deprecate property support in PMCs. We may put them back
in later, but if we do, it will be for a good reason.
Allison: What is the proposed alternate strategy for altering the
attribute structure of an object at runtime? I'm still not in favor of
removing properties. The distinction isn't a high-level one, it's a
low-level implementation distinction. Would it help if we call them
"static attributes" and "dynamic attributes"?
=item Attributes use external data slot (pmc_ext)
When attributes are used on a PMC, they are stored in the single external
data segment associated with a PMC. This prevents the use of attributes and
storage of non-attribute data in the PMC external data segment, limiting
their usefulness to all but the most simple PMC types.
B<Recommendation>: Implement differently-sized PMCs. The proposed
pddXX_pmc.pod has been reviewed, and the implementation of a prototype
solution has been requested. Work on this prototype is targeted to begin
in trunk after the 0.4.7 release.
Allison: Agreed.
=item DYNSELF is the common case, but the common case should be SELF
The DYNSELF macro is closer to the true OO concept of 'self'; if anything is
worthy of the name SELF, it is DYNSELF. DYNSELF does dispatching, while SELF
statically calls the method in the current class.
B<Recommendation>: Throughout the source, rename SELF to STATIC_SELF, and
rename DYNSELF to SELF. Additionally, direct access to VTABLE functions should
be reviewed, and SELF should be used where possible to increase clarity and
maintainability (this is a good CAGE task.) Also, this should become a coding
standard for PMCs.
Allison: OK on the rename of DYNSELF to SELF, but we need a better name
than STATIC_SELF. Where is the non-dispatching version likely to be used
and why?
B<Att:> SELF is just a synonym for I<pmc> - the object - above is talking
about SELF.method() and alikes. See F<lib/Parrot/Pmc2c.pm>.
=item composition is almost non-existent (roles would be nice)
The current class composition uses interfaces, which seems inadequate. Roles
may make better composition units, but may not make supporting Perl 5 OO
easier. Leo, chromatic, Matt, and Jonathan traded ideas on the subject. It
seems more investigation and discussion is in order.
B<Recommendation>: Leo, chromatic, Matt, and Jonathan should exchange ideas
on the subject in a meeting within the next two weeks. Hopefully this
exchange of ideas will lead to clarity on a proposed solution to a class
composition model.
Allison: Definitely in favor of a composition model.
=item split VTABLE functions into related categories
Someone had mentioned the idea of splitting the PMC vtable functions into
groups of related functions that you could choose to implement or not
implement. All keyed vtable functions would go in one group, for example.
Leo pointed to a p2 thread on the topic:
L<http://groups.google.at/group/perl.perl6.internals/browse_thread/thread/9ea5d132cb6a328b/4b83e54a13116d7c?lnk=st&q=interface+vtable+Toetsch&rnum=2#4b83e54a13116d7c>
Others thought this idea sounded intriguing, and that it was worth pursuing.
B<Recommendation>: Elaboration on this idea is required in order to focus
thought on design considerations. No timeframe has been set.
Allison: Yes, needs a more complete proposal.
=back
=head2 List of problems and proposed solutions for objects:
=over 4
=item Class namespace is global
At present it is not possible for a HLL to define a classname that has
already been used by another HLL. (Example: PGE/Perl 6 cannot define a class
named 'Closure' because Parrot already has one.) Chip and chromatic
discussed this before the meeting, and Chip has a solution 'almost ready.'
Discussion moved into class/namespace relationships, and metaclasses as it
relates to method dispatch order, and the potential to incorporate roles
instead of metaclasses, which brought the tangent back to previous discussion
on class composition, before the discussion was tabled.)
B<Recommendation>: Chip, based on prior thought, as well as this discussion,
will detail his plan. We know it includes a registry of class names for each
HLL, but more will be revealed soon.
Allison: das ist gut.
=item PMC vtable entries don't work in subclasses (or subsubclasses)
Currently things are handled by deleg_pmc.pmc and default.pmc. Unfortunately,
it appears that calls to vtable entries in default.pmc take place before
delegation to a superclass. Patrick proposes that this be switched somehow;
e.g, inheritance should be preferred over default vtable entries.
See L<https://rt.perl.org/rt3//Ticket/Display.html?id=39329>.
B<Recommendation>: Inherit from default.pmc unless you have a parent. Always
check inheritance when dispatching, if necessary. Chip will look specifically
at Capture PMCs and attempt to provide a solution without architectural
changes, enabling Patrick's work to continue.
Allison: das ist gut. Also looks like a good point for potential
architectural changes in the updated objects PDD.
=item PMC methods aren't inherited by ParrotObject pmcs
A METHOD defined in a PMC won't work unless it's been specifically coded to
work in a PIR-based subclass. See L<http://xrl.us/s7ns>.
B<Recommendation>: All direct data access should go through accessors, except
for within the accessors themselves. This involves a code review of all core
and custom PMCs, which has been recommended above as well. This may require
further discussion, as Patrick did not seem confident that this statement was
sufficient to resolve the situation.
Patrick's after-meeting response: The unresolved issue I'm seeing is that
every PMC has to be aware of the possibility that SELF is a ParrotObject
instead of the PMC type. For example, src/pmc/capture.pmc currently
has its methods as
METHOD PMC* get_array() {
PMC* capt = SELF;
/* XXX: This workaround is for when we get here as
part of a subclass of Capture */
if (PObj_is_object_TEST(SELF))
capt = get_attrib_num(PMC_data(SELF), 0);
CAPTURE_array_CREATE(INTERP, capt);
return CAPTURE_array(capt);
}
It's the "if (PObj_is_object_TEST(SELF))" clause that bugs me --
does every PMC METHOD have to have something like this in order
for subclassing to work properly? That feels wrong. And I don't
see how the solution of "all direct data access goes through
accessors" applies to this particular situation... although I
could just be reading it wrong. --Pm
Allison: ParrotObjects and PMCs were intended to be completely
substitutable. Clearly they aren't yet, but the solution to the problem
is not to add more and more checks for whether a particular PMC is an
Object, but to give ParrotObjects and low-level PMCs the ability to be
subclassed through a single standard interface (even if each has
completely different code behind the interface making it work).
=item getattribute/setattribute efficiency
Dan used to often remark that sequences like the following were "very slow":
=begin PIR_FRAGMENT_INVALID
$P0 = getattribute obj, "foo"
$P1 = getattribute obj, "bar"
$P2 = getattribute obj, "baz"
=end PIR_FRAGMENT_INVALID
Instead, Dan suggested always using classoffset to obtain attributes:
=begin PIR_FRAGMENT_INVALID
$I0 = classoffset obj, "FooClass"
$P0 = getattribute obj, $I0 # which attr is this?
inc $I0
$P0 = getattribute obj, $I0 # and that?
inc $I0
$P0 = getattribute obj, $I0
=end PIR_FRAGMENT_INVALID
Unfortunately, this doesn't seem to be very practical in many respects. Can
we at least get a declaration from the designers about the appropriate style
to use for object attributes? I much prefer the former to the latter, and if
it's a question of efficiency we should make the former more efficient
somehow.
The latter takes 2 opcodes, which is per se suboptimal, The former is much
more readable, just one opcode and optimizable and never subject of any
caching effects of the offset (e.g. what happens, if the getattribute has
some nasty side-effects like adding new attributes?)
Oh well, and classoffset does of course not work for Hash-like or other
objects.
B<Recommendation>: Best practice is to use named attribute access.
Optimizations, if necessary, will be addressed closer to 1.0. Issues with
classoffset and hash-like objects will be addressed in the future as
necessary.
Allison: Agreed.
=back
=head1 AUTHOR
Jerry Gay L<mailto:[email protected]>
=cut
| {
"pile_set_name": "Github"
} |
class Solution:
def bitwiseComplement(self, N: int) -> int:
return N ^ ((1 << (len(bin(N)) - 2)) - 1) | {
"pile_set_name": "Github"
} |
<% provide(:title, 'Sign in') %>
<h1>Sign in</h1>
<div class="row">
<div class="span6 offset3">
<%= form_for(:session, url: sessions_path) do |f| %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :password %>
<%= f.password_field :password %>
<%= f.submit "Sign in", class: "btn btn-large btn-primary" %>
<% end %>
<p>New user? <%= link_to "Sign up now!", signup_path %></p>
</div>
</div> | {
"pile_set_name": "Github"
} |
{
"080": {
"name": "Lào Cai",
"type": "thanh-pho",
"slug": "lao-cai",
"name_with_type": "Thành phố Lào Cai",
"path": "Lào Cai, Lào Cai",
"path_with_type": "Thành phố Lào Cai, Tỉnh Lào Cai",
"code": "080",
"parent_code": "10"
},
"082": {
"name": "Bát Xát",
"type": "huyen",
"slug": "bat-xat",
"name_with_type": "Huyện Bát Xát",
"path": "Bát Xát, Lào Cai",
"path_with_type": "Huyện Bát Xát, Tỉnh Lào Cai",
"code": "082",
"parent_code": "10"
},
"083": {
"name": "Mường Khương",
"type": "huyen",
"slug": "muong-khuong",
"name_with_type": "Huyện Mường Khương",
"path": "Mường Khương, Lào Cai",
"path_with_type": "Huyện Mường Khương, Tỉnh Lào Cai",
"code": "083",
"parent_code": "10"
},
"084": {
"name": "Si Ma Cai",
"type": "huyen",
"slug": "si-ma-cai",
"name_with_type": "Huyện Si Ma Cai",
"path": "Si Ma Cai, Lào Cai",
"path_with_type": "Huyện Si Ma Cai, Tỉnh Lào Cai",
"code": "084",
"parent_code": "10"
},
"085": {
"name": "Bắc Hà",
"type": "huyen",
"slug": "bac-ha",
"name_with_type": "Huyện Bắc Hà",
"path": "Bắc Hà, Lào Cai",
"path_with_type": "Huyện Bắc Hà, Tỉnh Lào Cai",
"code": "085",
"parent_code": "10"
},
"086": {
"name": "Bảo Thắng",
"type": "huyen",
"slug": "bao-thang",
"name_with_type": "Huyện Bảo Thắng",
"path": "Bảo Thắng, Lào Cai",
"path_with_type": "Huyện Bảo Thắng, Tỉnh Lào Cai",
"code": "086",
"parent_code": "10"
},
"087": {
"name": "Bảo Yên",
"type": "huyen",
"slug": "bao-yen",
"name_with_type": "Huyện Bảo Yên",
"path": "Bảo Yên, Lào Cai",
"path_with_type": "Huyện Bảo Yên, Tỉnh Lào Cai",
"code": "087",
"parent_code": "10"
},
"088": {
"name": "Sa Pa",
"type": "thi-xa",
"slug": "sa-pa",
"name_with_type": "Thị xã Sa Pa",
"path": "Sa Pa, Lào Cai",
"path_with_type": "Thị xã Sa Pa, Tỉnh Lào Cai",
"code": "088",
"parent_code": "10"
},
"089": {
"name": "Văn Bàn",
"type": "huyen",
"slug": "van-ban",
"name_with_type": "Huyện Văn Bàn",
"path": "Văn Bàn, Lào Cai",
"path_with_type": "Huyện Văn Bàn, Tỉnh Lào Cai",
"code": "089",
"parent_code": "10"
}
} | {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Performance Test</title>
<link href="../unicodetiles/unicodetiles.css" rel="stylesheet" type="text/css" />
<link href="../docs/style.css" rel="stylesheet" type="text/css" />
<link href="../examples/style.css" rel="stylesheet" type="text/css" />
<script src="../unicodetiles/unicodetiles.js"></script>
<script src="../unicodetiles/ut.WebGLRenderer.js"></script>
<script src="../unicodetiles/ut.CanvasRenderer.js"></script>
<script src="../unicodetiles/ut.DOMRenderer.js"></script>
<script src="performance-core.js"></script>
<script>
randomTile = function(x, y) {
var r = Math.floor(Math.random() * 255);
var g = Math.floor(Math.random() * 255);
var b = Math.floor(Math.random() * 255);
var br = Math.floor(Math.random() * 255);
var bg = Math.floor(Math.random() * 255);
var bb = Math.floor(Math.random() * 255);
var c = Math.floor(Math.random() * chars.length);
return new ut.Tile(chars[c], r, g, b, br, bg, bb);
}
</script>
</head>
<body onload="init(101, 41); start();">
<p id="result" class="centerer">Test running...</p>
<div class="centerer">
<div id="game">Enable JavaScript and reload the page.</div>
</div>
<div class="centerer">
<p>Renderer: <span id="renderer"></span></p>
<a href="#" id="switch-renderer">Switch</a>
</div>
<a class="backlink" href="index.html"><-- Back</a>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
This style contains a control template to show the ListView as a ContentGrid.
For more information about creating control templates see
https://docs.microsoft.com/dotnet/api/system.windows.controls.controltemplate
-->
<Style x:Key="ContentGridListViewItemStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="BorderThickness" Value="1, 1, 1, 1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border
x:Name="itemBorder"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true">
<Setter Property="BorderBrush" TargetName="itemBorder" Value="{DynamicResource MahApps.Brushes.Accent3}" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ContentGridListViewStyle" TargetType="{x:Type ListView}">
<Setter Property="Background" Value="{DynamicResource MahApps.Brushes.ThemeBackground}" />
<Setter Property="BorderThickness" Value="0, 0, 0, 0" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource ContentGridListViewItemStyle}" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}" HorizontalScrollBarVisibility="Disabled">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="0" />
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
| {
"pile_set_name": "Github"
} |
[telegram_secrets]
api_id = 123456
api_hash = d49161cade9d408c804a5d58b6ec0aef
phone_number = +79123456789
session_name = username1
[session_params]
dialog_id = 123456789
vkopt_file =
words_file =
your_name = username1
target_name = username2
| {
"pile_set_name": "Github"
} |
<?php
use app\models\CompanyUser;
use app\models\Vacancy;
use yii\db\Migration;
/**
* Class m200704_042821_fill_user_id_in_vacancy_table
*/
class m200704_042821_fill_user_id_in_vacancy_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$vacancies = Vacancy::find()->where(['IS', 'user_id', null])->all();
foreach ($vacancies as $vacancy) {
if ($vacancy->company_id) {
$company = $vacancy->companyRelation;
$companyUser = CompanyUser::findOne(['company_id' => $company->id]);
$vacancy->user_id = $companyUser->user_id;
$vacancy->save();
}
}
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
echo "m200704_042821_fill_user_id_in_vacancy_table cannot be reverted.\n";
return false;
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m200704_042821_fill_user_id_in_vacancy_table cannot be reverted.\n";
return false;
}
*/
}
| {
"pile_set_name": "Github"
} |
(ns ^:no-doc kee-frame.spec
(:require [re-frame.interceptor :refer [->interceptor get-effect get-coeffect assoc-coeffect assoc-effect]]
[re-frame.core :refer [console]]
[clojure.spec.alpha :as s]
[re-chain.core :as chain]
[expound.alpha :as e]
[kee-frame.api :as api]))
(s/def ::params (s/or :path-vector vector? :fn fn?))
(s/def ::start (s/or :vector ::event-vector :fn fn?))
(s/def ::stop (s/or :vector ::event-vector :fn fn?))
(s/def ::controller (s/keys :req-un [::params ::start]
:opt-un [::stop]))
(s/def ::event-vector (s/cat :event-key keyword? :event-args (s/* any?)))
(s/def ::routes any?)
(s/def ::router #(satisfies? api/Router %))
(s/def ::hash-routing? (s/nilable boolean?))
(s/def ::root-component (s/nilable vector?))
(s/def ::initial-db (s/nilable map?))
(s/def ::app-db-spec (s/nilable keyword?))
(s/def ::blacklist (s/coll-of keyword? :kind set?))
(s/def ::debug? boolean?)
(s/def ::debug-config (s/nilable (s/keys :opt-un [::blacklist ::events? ::controllers? ::routes? ::overwrites?])))
(s/def ::chain-links ::chain/links)
(s/def ::breakpoints vector?)
(s/def ::debounce-ms number?)
(s/def ::scroll (s/nilable (s/or :boolean boolean?
:config (s/keys :opt-un [:scroll/timeout]))))
(s/def ::screen (s/nilable (s/or :boolean boolean?
:config (s/keys :req-un [::breakpoints ::debounce-ms]))))
(s/def ::start-options (s/keys :opt-un [::routes ::router ::hash-routing? ::root-component ::initial-db ::log
::app-db-spec ::debug? ::debug-config ::chain-links ::screen ::scroll]))
(defn log-spec-error [new-db spec]
(console :group "*** Spec error when updating DB, rolling back ***")
(e/expound spec new-db)
(console :groupEnd "*****************************"))
(defn rollback [context new-db db-spec]
(do
(log-spec-error new-db db-spec)
(assoc-effect context :db (get-coeffect context :db))))
(defn spec-interceptor [db-spec-atom]
(->interceptor
:id :spec
:after (fn [context]
(let [new-db (get-effect context :db)]
(if (and @db-spec-atom new-db (not (s/valid? @db-spec-atom new-db)))
(rollback context new-db @db-spec-atom)
context))))) | {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.