text
stringlengths 2
14k
| meta
dict |
|---|---|
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
// https://www.jsonrpc.org/specification
// It is intended to be compatible with other implementations at the wire level.
package jsonrpc2
import (
"context"
"encoding/json"
"fmt"
"sync"
"sync/atomic"
"time"
)
// Conn is a JSON RPC 2 client server connection.
// Conn is bidirectional; it does not have a designated server or client end.
type Conn struct {
handle Handler
cancel Canceler
log Logger
stream Stream
done chan struct{}
err error
seq int64 // must only be accessed using atomic operations
pendingMu sync.Mutex // protects the pending map
pending map[ID]chan *Response
handlingMu sync.Mutex // protects the handling map
handling map[ID]handling
}
// Handler is an option you can pass to NewConn to handle incoming requests.
// If the request returns false from IsNotify then the Handler must eventually
// call Reply on the Conn with the supplied request.
// Handlers are called synchronously, they should pass the work off to a go
// routine if they are going to take a long time.
type Handler func(context.Context, *Conn, *Request)
// Canceler is an option you can pass to NewConn which is invoked for
// cancelled outgoing requests.
// The request will have the ID filled in, which can be used to propagate the
// cancel to the other process if needed.
// It is okay to use the connection to send notifications, but the context will
// be in the cancelled state, so you must do it with the background context
// instead.
type Canceler func(context.Context, *Conn, *Request)
// NewErrorf builds a Error struct for the suppied message and code.
// If args is not empty, message and args will be passed to Sprintf.
func NewErrorf(code int64, format string, args ...interface{}) *Error {
return &Error{
Code: code,
Message: fmt.Sprintf(format, args...),
}
}
// NewConn creates a new connection object that reads and writes messages from
// the supplied stream and dispatches incoming messages to the supplied handler.
func NewConn(ctx context.Context, s Stream, options ...interface{}) *Conn {
conn := &Conn{
stream: s,
done: make(chan struct{}),
pending: make(map[ID]chan *Response),
handling: make(map[ID]handling),
}
for _, opt := range options {
switch opt := opt.(type) {
case Handler:
if conn.handle != nil {
panic("Duplicate Handler function in options list")
}
conn.handle = opt
case Canceler:
if conn.cancel != nil {
panic("Duplicate Canceler function in options list")
}
conn.cancel = opt
case Logger:
if conn.log != nil {
panic("Duplicate Logger function in options list")
}
conn.log = opt
default:
panic(fmt.Errorf("Unknown option type %T in options list", opt))
}
}
if conn.handle == nil {
// the default handler reports a method error
conn.handle = func(ctx context.Context, c *Conn, r *Request) {
if r.IsNotify() {
c.Reply(ctx, r, nil, NewErrorf(CodeMethodNotFound, "method %q not found", r.Method))
}
}
}
if conn.cancel == nil {
// the default canceller does nothing
conn.cancel = func(context.Context, *Conn, *Request) {}
}
if conn.log == nil {
// the default logger does nothing
conn.log = func(Direction, *ID, time.Duration, string, *json.RawMessage, *Error) {}
}
go func() {
conn.err = conn.run(ctx)
close(conn.done)
}()
return conn
}
// Wait blocks until the connection is terminated, and returns any error that
// cause the termination.
func (c *Conn) Wait(ctx context.Context) error {
select {
case <-c.done:
return c.err
case <-ctx.Done():
return ctx.Err()
}
}
// Cancel cancels a pending Call on the server side.
// The call is identified by its id.
// JSON RPC 2 does not specify a cancel message, so cancellation support is not
// directly wired in. This method allows a higher level protocol to choose how
// to propagate the cancel.
func (c *Conn) Cancel(id ID) {
c.handlingMu.Lock()
handling, found := c.handling[id]
c.handlingMu.Unlock()
if found {
handling.cancel()
}
}
// Notify is called to send a notification request over the connection.
// It will return as soon as the notification has been sent, as no response is
// possible.
func (c *Conn) Notify(ctx context.Context, method string, params interface{}) error {
jsonParams, err := marshalToRaw(params)
if err != nil {
return fmt.Errorf("marshalling notify parameters: %v", err)
}
request := &Request{
Method: method,
Params: jsonParams,
}
data, err := json.Marshal(request)
if err != nil {
return fmt.Errorf("marshalling notify request: %v", err)
}
c.log(Send, nil, -1, request.Method, request.Params, nil)
return c.stream.Write(ctx, data)
}
// Call sends a request over the connection and then waits for a response.
// If the response is not an error, it will be decoded into result.
// result must be of a type you an pass to json.Unmarshal.
func (c *Conn) Call(ctx context.Context, method string, params, result interface{}) error {
jsonParams, err := marshalToRaw(params)
if err != nil {
return fmt.Errorf("marshalling call parameters: %v", err)
}
// generate a new request identifier
id := ID{Number: atomic.AddInt64(&c.seq, 1)}
request := &Request{
ID: &id,
Method: method,
Params: jsonParams,
}
// marshal the request now it is complete
data, err := json.Marshal(request)
if err != nil {
return fmt.Errorf("marshalling call request: %v", err)
}
// we have to add ourselves to the pending map before we send, otherwise we
// are racing the response
rchan := make(chan *Response)
c.pendingMu.Lock()
c.pending[id] = rchan
c.pendingMu.Unlock()
defer func() {
// clean up the pending response handler on the way out
c.pendingMu.Lock()
delete(c.pending, id)
c.pendingMu.Unlock()
}()
// now we are ready to send
before := time.Now()
c.log(Send, request.ID, -1, request.Method, request.Params, nil)
if err := c.stream.Write(ctx, data); err != nil {
// sending failed, we will never get a response, so don't leave it pending
return err
}
// now wait for the response
select {
case response := <-rchan:
elapsed := time.Since(before)
c.log(Send, response.ID, elapsed, request.Method, response.Result, response.Error)
// is it an error response?
if response.Error != nil {
return response.Error
}
if result == nil || response.Result == nil {
return nil
}
if err := json.Unmarshal(*response.Result, result); err != nil {
return fmt.Errorf("unmarshalling result: %v", err)
}
return nil
case <-ctx.Done():
// allow the handler to propagate the cancel
c.cancel(ctx, c, request)
return ctx.
|
{
"pile_set_name": "Github"
}
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus - cached_interp.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Copyright (C) 2002 Hacktarux *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef M64P_R4300_CACHED_INTERP_H
#define M64P_R4300_CACHED_INTERP_H
#include <stddef.h>
#include <stdint.h>
#include "ops.h"
/* FIXME: use forward declaration for precomp_block */
#include "recomp.h"
extern char invalid_code[0x100000];
extern struct precomp_block *blocks[0x100000];
extern struct precomp_block *actual;
extern uint32_t jump_to_address;
extern const cpu_instruction_table cached_interpreter_table;
void init_blocks(void);
void free_blocks(void);
void jump_to_func(void);
void invalidate_cached_code_hacktarux(uint32_t address, size_t size);
/* Jumps to the given address. This is for the cached interpreter / dynarec. */
#define jump_to(a) { jump_to_address = a; jump_to_func(); }
#endif /* M64P_R4300_CACHED_INTERP_H */
|
{
"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.ratis.examples.filestore;
import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
import org.apache.ratis.util.*;
import java.io.IOException;
import java.nio.file.Path;
import java.util.concurrent.CompletableFuture;
public interface FileStoreCommon {
String STATEMACHINE_DIR_KEY = "example.filestore.statemachine.dir";
SizeInBytes MAX_CHUNK_SIZE = SizeInBytes.valueOf(64, TraditionalBinaryPrefix.MEGA);
static int getChunkSize(long suggestedSize) {
return Math.toIntExact(Math.min(suggestedSize, MAX_CHUNK_SIZE.getSize()));
}
static ByteString toByteString(Path p) {
return ProtoUtils.toByteString(p.toString());
}
static <T> CompletableFuture<T> completeExceptionally(
long index, String message) {
return completeExceptionally(index, message, null);
}
static <T> CompletableFuture<T> completeExceptionally(
long index, String message, Throwable cause) {
return completeExceptionally(message + ", index=" + index, cause);
}
static <T> CompletableFuture<T> completeExceptionally(
String message, Throwable cause) {
return JavaUtils.completeExceptionally(
new IOException(message).initCause(cause));
}
}
|
{
"pile_set_name": "Github"
}
|
class RemoveOneClickOptionFromStandup < ActiveRecord::Migration
def change
remove_column :standups, :one_click_post
end
end
|
{
"pile_set_name": "Github"
}
|
glabel func_808945B4
/* 00114 808945B4 27BDFF38 */ addiu $sp, $sp, 0xFF38 ## $sp = FFFFFF38
/* 00118 808945B8 F7BE0070 */ sdc1 $f30, 0x0070($sp)
/* 0011C 808945BC 3C014040 */ lui $at, 0x4040 ## $at = 40400000
/* 00120 808945C0 4481F000 */ mtc1 $at, $f30 ## $f30 = 3.00
/* 00124 808945C4 F7BC0068 */ sdc1 $f28, 0x0068($sp)
/* 00128 808945C8 3C0141C8 */ lui $at, 0x41C8 ## $at = 41C80000
/* 0012C 808945CC 4481E000 */ mtc1 $at, $f28 ## $f28 = 25.00
/* 00130 808945D0 F7BA0060 */ sdc1 $f26, 0x0060($sp)
/* 00134 808945D4 3C014248 */ lui $at, 0x4248 ## $at = 42480000
/* 00138 808945D8 4481D000 */ mtc1 $at, $f26 ## $f26 = 50.00
/* 0013C 808945DC F7B80058 */ sdc1 $f24, 0x0058($sp)
/* 00140 808945E0 3C014220 */ lui $at, 0x4220 ## $at = 42200000
/* 00144 808945E4 4481C000 */ mtc1 $at, $f24 ## $f24 = 40.00
/* 00148 808945E8 F7B60050 */ sdc1 $f22, 0x0050($sp)
/* 0014C 808945EC 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000
/* 00150 808945F0 4481B000 */ mtc1 $at, $f22 ## $f22 = 20.00
/* 00154 808945F4 AFBE0098 */ sw $s8, 0x0098($sp)
/* 00158 808945F8 F7B40048 */ sdc1 $f20, 0x0048($sp)
/* 0015C 808945FC 3C014120 */ lui $at, 0x4120 ## $at = 41200000
/* 00160 80894600 AFB70094 */ sw $s7, 0x0094($sp)
/* 00164 80894604 AFB60090 */ sw $s6, 0x0090($sp)
/* 00168 80894608 AFB5008C */ sw $s5, 0x008C($sp)
/* 0016C 8089460C AFB40088 */ sw $s4, 0x0088($sp)
/* 00170 80894610 3C1E0601 */ lui $s8, 0x0601 ## $s8 = 06010000
/* 00174 80894614 4481A000 */ mtc1 $at, $f20 ## $f20 = 10.00
/* 00178 80894618 0080A825 */ or $s5, $a0, $zero ## $s5 = 00000000
/* 0017C 8089461C AFBF009C */ sw $ra, 0x009C($sp)
/* 00180 80894620 AFB30084 */ sw $s3, 0x0084($sp)
/* 00184 80894624 AFB20080 */ sw $s2, 0x0080($sp)
/* 00188 80894628 AFB1007C */ sw $s1, 0x007C($sp)
/* 0018C 8089462C AFB00078 */ sw $s0, 0x0078($sp)
/* 00190 80894630 AFA500CC */ sw $a1, 0x00CC($sp)
/* 00194 80894634 27DEEDC0 */ addiu $s8, $s8, 0xEDC0 ## $s8 = 0600EDC0
/* 00198 80894638 0000A025 */ or $s4, $zero, $zero ## $s4 = 00000000
/* 0019C 8089463C 27B600BC */ addiu $s6, $sp, 0x00BC ## $s6 = FFFFFFF4
/* 001A0 80894640 27B700B0 */ addiu $s7, $sp, 0x00B0 ## $s7 = FFFFFFE8
/* 001A4 80894644 2412000C */ addiu $s2, $zero, 0x000C ## $s2 = 0000000C
.L80894648:
/* 001A8 80894648 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next() float
/* 001AC 8089464C 24130008 */ addiu $s3, $zero, 0x0008 ## $s3 = 00000008
/* 001B0 80894650 46140102 */ mul.s $f4, $f0, $f20
/* 001B4 80894654 C6A60024 */ lwc1 $f6, 0x0024($s5) ## 00000024
/* 001B8 80894658 46062200 */ add.s $f8, $f4, $f6
/* 001BC 8089465C 46144281 */ sub.s $f10, $f8, $f20
/* 001C0 80894660 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next() float
/* 001C4 80894664 E7AA00BC */ swc1 $f10, 0x00BC($sp)
/* 001C8 80894668 46180402 */ mul.s $f16, $f0, $f24
/* 001CC 8089466C C6B20028 */ lwc1 $f18, 0x0028($s5) ## 00000028
/* 001D0 80894670 46128100 */ add.s $f4, $f16, $f18
/* 001D4 80894674 46162181 */ sub.s $f6, $f4, $f22
/* 001D8 80894678 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next() float
/* 001DC 8089467C E7A600C0 */ swc1 $f6, 0x00C0($sp)
/* 001E0 80894680 461A0202 */ mul.s $f8, $f0, $f26
/* 001E4 80894684 C6AA002C */ lwc1 $f10, 0x002C($s5) ## 0000002C
/* 001E8 80894688 460A4400 */ add.s $f16, $f8, $f10
/* 001EC 8089468C 461C8481 */ sub.s $f18, $f16, $f28
/* 001F0 80894690 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next() float
/* 001F4 80894694 E7B200C4 */ swc1 $f18, 0x00C4($sp)
/* 001F8 80894698 461E0102 */ mul.s $f4, $f0, $f30
/* 001FC 8089469C 3C018089 */ lui $at, %hi(D_8089509C) ## $at = 80890000
/* 00200 808946A0 C426509C */ lwc1 $f6, %lo(D_8089509C)($at)
/* 00204 808946A4 46062201 */ sub.s $f8, $f4, $f6
/* 00208 808946A8 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next()
|
{
"pile_set_name": "Github"
}
|
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
);
|
{
"pile_set_name": "Github"
}
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build 386,linux
package unix
const (
SizeofPtr = 0x4
SizeofLong = 0x4
)
type (
_C_long int32
)
type Timespec struct {
Sec int32
Nsec int32
}
type Timeval struct {
Sec int32
Usec int32
}
type Timex struct {
Modes uint32
Offset int32
Freq int32
Maxerror int32
Esterror int32
Status int32
Constant int32
Precision int32
Tolerance int32
Time Timeval
Tick int32
Ppsfreq int32
Jitter int32
Shift int32
Stabil int32
Jitcnt int32
Calcnt int32
Errcnt int32
Stbcnt int32
Tai int32
_ [44]byte
}
type Time_t int32
type Tms struct {
Utime int32
Stime int32
Cutime int32
Cstime int32
}
type Utimbuf struct {
Actime int32
Modtime int32
}
type Rusage struct {
Utime Timeval
Stime Timeval
Maxrss int32
Ixrss int32
Idrss int32
Isrss int32
Minflt int32
Majflt int32
Nswap int32
Inblock int32
Oublock int32
Msgsnd int32
Msgrcv int32
Nsignals int32
Nvcsw int32
Nivcsw int32
}
type Stat_t struct {
Dev uint64
_ uint16
_ uint32
Mode uint32
Nlink uint32
Uid uint32
Gid uint32
Rdev uint64
_ uint16
Size int64
Blksize int32
Blocks int64
Atim Timespec
Mtim Timespec
Ctim Timespec
Ino uint64
}
type Dirent struct {
Ino uint64
Off int64
Reclen uint16
Type uint8
Name [256]int8
_ [1]byte
}
type Flock_t struct {
Type int16
Whence int16
Start int64
Len int64
Pid int32
}
const (
FADV_DONTNEED = 0x4
FADV_NOREUSE = 0x5
)
type RawSockaddr struct {
Family uint16
Data [14]int8
}
type RawSockaddrAny struct {
Addr RawSockaddr
Pad [96]int8
}
type Iovec struct {
Base *byte
Len uint32
}
type Msghdr struct {
Name *byte
Namelen uint32
Iov *Iovec
Iovlen uint32
Control *byte
Controllen uint32
Flags int32
}
type Cmsghdr struct {
Len uint32
Level int32
Type int32
}
const (
SizeofIovec = 0x8
SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc
)
const (
SizeofSockFprog = 0x8
)
type PtraceRegs struct {
Ebx int32
Ecx int32
Edx int32
Esi int32
Edi int32
Ebp int32
Eax int32
Xds int32
Xes int32
Xfs int32
Xgs int32
Orig_eax int32
Eip int32
Xcs int32
Eflags int32
Esp int32
Xss int32
}
type FdSet struct {
Bits [32]int32
}
type Sysinfo_t struct {
Uptime int32
Loads [3]uint32
Totalram uint32
Freeram uint32
Sharedram uint32
Bufferram uint32
Totalswap uint32
Freeswap uint32
Procs uint16
Pad uint16
Totalhigh uint32
Freehigh uint32
Unit uint32
_ [8]int8
}
type Ustat_t struct {
Tfree int32
Tinode uint32
Fname [6]int8
Fpack [6]int8
}
type EpollEvent struct {
Events uint32
Fd int32
Pad int32
}
const (
POLLRDHUP = 0x2000
)
type Sigset_t struct {
Val [32]uint32
}
const _C__NSIG = 0x41
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Line uint8
Cc [19]uint8
Ispeed uint32
Ospeed uint32
}
type Taskstats struct {
Version uint16
Ac_exitcode uint32
Ac_flag uint8
Ac_nice uint8
_ [4]byte
Cpu_count uint64
Cpu_delay_total uint64
Blkio_count uint64
Blkio_delay_total uint64
Swapin_count uint64
Swapin_delay_total uint64
Cpu_run_real_total uint64
Cpu_run_virtual_total uint64
Ac_comm [32]int8
Ac_sched uint8
Ac_pad [3]uint8
_ [4]byte
Ac_uid uint32
Ac_gid uint32
Ac_pid uint32
Ac_ppid uint32
Ac_btime uint32
_ [4]byte
Ac_etime uint64
Ac_utime uint64
Ac_stime uint64
Ac_minflt uint64
Ac_majflt uint64
Coremem uint64
Virtmem uint64
Hiwater_rss uint64
Hiwater_vm uint64
Read_char uint64
Write_char uint64
Read_syscalls uint64
Write_syscalls uint64
Read_bytes uint64
Write_bytes uint64
Cancelled_write_bytes uint64
Nvcsw uint64
Nivcsw uint64
Ac_utimescaled uint64
Ac_stimescaled uint64
Cpu_scaled_run_real_total uint64
Freepages_count uint64
Freepages_delay_total uint64
Thrashing_count uint64
Thrashing_delay_total uint64
Ac_btime64 uint64
}
type cpuMask uint32
const (
_NCPUBITS = 0x20
)
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
CBitFieldMaskBit2 = 0x4
CBitFieldMaskBit3 = 0x8
CBitFieldMaskBit4 = 0x10
CBitFieldMaskBit5 = 0x20
CBitFieldMaskBit6 = 0x40
CBitFieldMaskBit7 = 0x80
CBitFieldMaskBit8 = 0x100
CBitFieldMaskBit9 = 0x200
CBitFieldMaskBit10
|
{
"pile_set_name": "Github"
}
|
#include <Blynk.h>
#include <Blynk/BlynkDetectDevice.h>
/*
* Pins Quantity
*/
#if defined(NUM_DIGITAL_PINS)
#define BOARD_DIGITAL_MAX int(NUM_DIGITAL_PINS)
#elif defined(PINS_COUNT)
#define BOARD_DIGITAL_MAX int(PINS_COUNT)
#else
#warning "BOARD_DIGITAL_MAX not detected"
#define BOARD_DIGITAL_MAX 32
#endif
#if defined(NUM_ANALOG_INPUTS)
#define BOARD_ANALOG_IN_MAX int(NUM_ANALOG_INPUTS)
#else
#warning "BOARD_ANALOG_IN_MAX not detected"
#define BOARD_ANALOG_IN_MAX 0
#endif
#if defined(BLYNK_USE_128_VPINS)
#define BOARD_VIRTUAL_MAX 127
#else
#define BOARD_VIRTUAL_MAX 31
#endif
/*
* Pins Functions
*/
#ifndef digitalPinHasPWM
#warning "No digitalPinHasPWM"
#define digitalPinHasPWM(x) false
#endif
#if !defined(analogInputToDigitalPin)
#warning "No analogInputToDigitalPin"
#define analogInputToDigitalPin(x) -1
#endif
/*
* Pins Ranges
*/
#if !defined(BOARD_PWM_MAX)
#if defined(PWMRANGE)
#define BOARD_PWM_MAX PWMRANGE
#elif defined(PWM_RESOLUTION)
#define BOARD_PWM_MAX ((2^(PWM_RESOLUTION))-1)
#else
#warning "Cannot detect BOARD_PWM_MAX"
#define BOARD_PWM_MAX 255
#endif
#endif
#if !defined(BOARD_ANALOG_MAX)
#if defined(ADC_RESOLUTION)
#define BOARD_ANALOG_MAX ((2^(ADC_RESOLUTION))-1)
#else
#warning "Cannot detect BOARD_ANALOG_MAX"
#define BOARD_ANALOG_MAX 1023
#endif
#endif
#if defined(clockCyclesPerMicrosecond)
#define BOARD_INFO_MHZ clockCyclesPerMicrosecond()
#elif defined(F_CPU)
#define BOARD_INFO_MHZ ((F_CPU)/1000000UL)
#endif
struct Ser {
template<typename T, typename... Args>
void print(T last) {
Serial.print(last);
}
template<typename T, typename... Args>
void print(T head, Args... tail) {
Serial.print(head);
print(tail...);
}
} ser;
const char* JS[] = {
"\n"
"{\n"
" ",
"\"map\": {\n"
" \"digital\": {\n"
" \"pins\": {\n"
" ", "\n"
" },\n"
" \"ops\": [ \"dr\", \"dw\" ]\n"
" },\n"
" \"analog\": {\n"
" \"pins\": {\n"
" ", "\n"
" },\n"
" \"ops\": [ \"dr\", \"dw\", \"ar\" ],\n"
" \"arRange\": [ 0, ", " ]\n"
" },\n"
" \"pwm\": {\n"
" \"pins\": [\n"
" ", "\n"
" ],\n"
" \"ops\": [ \"aw\" ],\n"
" \"awRange\": [ 0, ", " ]\n"
" },\n"
" \"virtual\": {\n"
" \"pinsRange\": [ 0, ", " ],\n"
" \"ops\": [ \"vr\", \"vw\" ]\n"
" }\n"
" }\n"
"}\n"
};
void setup() {
Serial.begin(9600);
delay(10);
}
void loop() {
ser.print(JS[0]);
ser.print("\"name\": \"", BLYNK_INFO_DEVICE, "\",\n ");
#ifdef BLYNK_INFO_CPU
ser.print("\"cpu\": \"", BLYNK_INFO_CPU, "\",\n ");
#endif
#ifdef BOARD_INFO_MHZ
ser.print("\"mhz\": ", BOARD_INFO_MHZ, ",\n ");
#endif
ser.print(JS[1]);
for (int i = 0; i < BOARD_DIGITAL_MAX; i++) {
ser.print("\"D", i, "\": ", i);
if (i % 5 != 4) {
ser.print(", ");
} else {
ser.print(",\n ");
}
}
ser.print(JS[2]);
for (int i = 0; i < BOARD_ANALOG_IN_MAX; i++) {
int pin = analogInputToDigitalPin(i);
if (pin != -1) {
ser.print("\"A", i, "\": ", pin);
if (i % 5 != 4) {
ser.print(", ");
} else {
ser.print(",\n ");
}
}
}
ser.print(JS[3]);
ser.print(BOARD_ANALOG_MAX);
ser.print(JS[4]);
for (int i = 0; i < BOARD_DIGITAL_MAX; i++) {
bool hasPWM = digitalPinHasPWM(i);
//bool hasInt = digitalPinToInterrupt(i) != NOT_AN_INTERRUPT;
if (hasPWM) {
ser.print("\"D", i, "\", ");
}
}
ser.print(JS[5]);
ser.print(BOARD_PWM_MAX);
ser.print(JS[6]);
ser.print(BOARD_VIRTUAL_MAX);
ser.print(JS[7]);
delay(10000);
}
|
{
"pile_set_name": "Github"
}
|
;; Copyright (C) 2011-2016 Free Software Foundation, Inc
;; Author: Rocky Bernstein <rocky@gnu.org>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; Perl trepanning Debugger tracking a comint buffer.
(require 'load-relative)
(require-relative-list '(
"../../common/cmds"
"../../common/menu"
"../../common/track"
"../../common/track-mode"
)
"realgud-")
(require-relative-list '("core" "init") "realgud:trepanpl-")
(require-relative-list '("../../lang/perl") "realgud-lang-")
(realgud-track-mode-vars "realgud:trepanpl")
(declare-function realgud-goto-line-for-pt 'realgud-track-mode)
(declare-function realgud-track-mode 'realgud-track-mode)
(declare-function realgud-track-mode-setup 'realgud-track-mode)
(declare-function realgud:track-mode-hook 'realgud-track-mode)
(declare-function realgud:track-set-debugger 'realgud-track-mode)
(declare-function realgud-perl-populate-command-keys 'realgud-lang-perl)
(defun realgud:trepanpl-goto-syntax-error-line (pt)
"Display the location mentioned in a Syntax error line
described by PT."
(interactive "d")
(realgud-goto-line-for-pt pt "syntax-error"))
(define-key realgud:trepanpl-track-mode-map
(kbd "C-c !s") 'realgud:trepanpl-goto-syntax-error-line)
(realgud-perl-populate-command-keys realgud:trepanpl-track-mode-map)
(defun realgud:trepanpl-track-mode-hook()
(if realgud:trepanpl-track-mode
(progn
(use-local-map realgud:trepanpl-track-mode-map)
(message "using trepanpl mode map")
)
(message "trepan.pl track-mode-hook disable called"))
)
(define-minor-mode realgud:trepanpl-track-mode
"Minor mode for tracking trepan.pl source locations inside a
process shell via realgud. trepan.pl is a Perl debugger see URL
`https://metacpan.org/pod/Devel::Trepan'.
If called interactively with no prefix argument, the mode is
toggled. A prefix argument, captured as ARG, enables the mode if
the argument is positive, and disables it otherwise.
"
:init-value nil
;; :lighter " trepanpl" ;; mode-line indicator from realgud-track is sufficient.
;; The minor mode bindings.
:global nil
:group 'realgud:trepanpl
:keymap realgud:trepanpl-track-mode-map
(realgud:track-set-debugger "trepan.pl")
(if realgud:trepanpl-track-mode
(progn
(realgud-track-mode-setup 't)
(realgud:trepanpl-track-mode-hook))
(progn
(setq realgud-track-mode nil)
))
)
(define-key realgud:trepanpl-short-key-mode-map "T" 'realgud:cmd-backtrace)
(provide-me "realgud:trepanpl-")
|
{
"pile_set_name": "Github"
}
|
# August 13, 2020 Meeting
Attendees:
- Shane Carr - Google i18n (SFC), Co-Moderator
- Romulo Cintra - CaixaBank (RCA), MessageFormat Working Group Liaison
- Frank Yung-Fong Tang - Google i18n, V8 (FYT)
- Jeff Walden - SpiderMonkey/Mozilla (JSW)
- Richard Gibson - OpenJS Foundation (RGN)
- Eemeli Aro - OpenJSF (EAO)
- Felipe Balbontin - Google i18n (FBN)
- Ujjwal Sharma - Igalia (USA), Co-Moderator
- Leo Balter - Salesforce (LEO)
- Philip Chimento - Igalia (PFC)
- Zibi Braniecki - Mozilla (ZB)
- Younies Mahmoud - Google i18n (YMD)
Standing items:
- [Discussion Board](https://github.com/tc39/ecma402/projects/2)
- [Status Wiki](https://github.com/tc39/ecma402/wiki/Proposal-and-PR-Progress-Tracking) -- please update!
- [Abbreviations](https://github.com/tc39/notes/blob/master/delegates.txt)
- [MDN Tracking](https://github.com/tc39/ecma402-mdn)
- [Meeting Calendar](https://calendar.google.com/calendar/embed?src=unicode.org_nubvqveeeol570uuu7kri513vc%40group.calendar.google.com)
## Liaison Updates
### MessageFormat Working Group
RCA: We've started on some implementations: Mihai, Elango, Zibi, are creating some POC’s to implement a use case(selector & placeholders) We're creating smaller task forces on smaller issues to try to increase velocity.
SFC: What are some of the recent decisions?
RCA: We will start by implementing the placeholders. That will help us learn the constraints. Then we will follow up with bigger decisions.
## Discussion Topics
### Update on permissions on the repo
SFC: *discusses access control on the ECMA-402 repository*
FYT: What does the write access give intl to? I still have no merge button in the PR got approved.
SFC: The write access is for adding items in the wiki page, triage the issues, ... Merging PR requires admin access. I set intl to write access because of that was the status quo.
LEO: We could grant intl admin access too and trust the 19 people in the intl group to do the right thing.
SFC : Will create an issue, to follow up later if we should give admin access or not.
### Airtable as alternative to the status wiki
SFC: *show an alternate status listing on airtable.com*
SFC: The wiki page of showing the status are good to view but hard to change
FYT: The wiki is hard to edit, yes, but airtable looks much worse. There ought to be an alternative which improves things on both ends.
SFC: I’ll kick off an email thread for this.
### Normative: Define @@toStringTag for Intl namespace object #487
https://github.com/tc39/ecma402/pull/487
SFC: the same contributor added string tags to all Intl constructors that didn’t have it, and now they have proposed it for the Intl top-level object itself. Frank and Ujjwal approved, I think it’s a good idea too. Frank even made a V8 CL.
SFC: Any thoughts on this? Otherwise I will record consensus.
EAO: Good idea.
SFC: We didn’t get consensus on this PR during the last meeting IIRC.
LEO: We actually did; see ECMA262 issue #2057.
SFC: perfect. In that case, we did get consensus during the July meeting.
LEO: no pressure, but we can merge this in if we get consensus right now.
SFC: Ok, I'm gonna record consensus.
#### Conclusion
TC39-TG2 Consensus.
### Normative: handle awkward rounding behavior #471
https://github.com/tc39/ecma402/pull/471
USA: I think I've resolved all the comments. But I need people to give an approving review. I'd like everyone to go back and hit the review button if everything looks okay.
SFC : Sounds good to me, we should provide links to Issues(Jeff and Frank) and MDN
USA: I'll follow up with FYT and JSW.
### Intl.DateTimeFormat.prototype.formatRange toward Stage 4
https://github.com/tc39/proposal-intl-DateTimeFormat-formatRange
FBN: I think we're on track for Stage 4. What's the process for reviewers?
SFC: the process is that you ought to open a PR for the upstream ECMA-402 repo and we can merge this in once everything is ready.
RCA: this should come alongside updates to MDN.
SFC: do you specifically mean the compat table?
RCA: I precisely am referring to the compat table, the MDN text is already there for these PRs anyway. Should we track it on the ecma402-mdn github repository?
SFC: I think we should reopen the old issue.
FYT: Is it true that we need to make a version of the spec in Stage 4 with the ins and del tags? Or do we only need the PR?
RGN: Those tags are most useful for rendering spec changes. I use them and I see them in proposals. But the PR itself should just make the change.
FYT: question: there are some concerns from anba. What’s the nature of those concerns? I haven’t had the time to look into it so far. Do you think we’re ready for Stage 4?
FBN: Yeah, so I put that PR together and sent it for review. It's mostly an issue that ABL pointed out, that we're missing options for locale data. But we are saying that the implementations must have that data available, because these are new fields used only for range formatting. ABL proposed a change that I liked, which I proposed for the spec. But this shouldn't affect implementations.
FYT: So you're saying that ICU outputs the desired result, but the spec is missing that detail?
FYT: Yes.
### Intl Enumeration API
https://github.com/tc39/proposal-intl-enumeration
FYT: We got to Stage 1 in July. We added some options for the timezone and are working on figuring out some options for regions. Let's say you pass in Switzerland; it may return different values as opposed to passing in “United States”. There are some questions about the use cases. There are some open-source JavaScript libraries providing similar functionality. But I wonder what questions people have before I go to Stage 2.
ZB: I have deep reservations whether we should do this because of fingerprinting. I think this PR is fully overlapping with HTML for pickers, and I think HTML can handle privacy better. But I don't have deep privacy knowledge.
SFC: There is an issue on the repo, issue #3 regarding privacy issues. It would be good to get a follow-up on that issue.
https://github.com/tc39/proposal-intl-enumeration/issues/3
ZB: I think we should get feedback from a privacy team, maybe Chrome or Apple. I know Mozilla is having to deal with supported fonts having privacy issues. So I'm concerned, but I might be wrong.
FYT: Comparing this with fonts is very different. A user could download new fonts, so fonts could be unique to that user. On the other hand, the number of time zones is based on the OS or the browser supports, and users can't change the set of time zones. ZB, do you have references to whether anyone is working on this in the HTML side?
ZB: I think working with HTML would make sense assuming the dominant use case is for pickers. You're right that fonts are different, but it's still a way to enumerate info about the user. So my question is, if we land this in browsers, are we going to make work for people from other domains to clean up the privacy problems?
USA: For the specific use case of time zone pickers, something on the HTML side makes sense. But I think pickers aren't the only use case. This is an iterator so that someone dealing with time zones can programmatically access the list of time zones. Also, because the result of this depends on your browser version, I don't know how this could provide fingerprinting beyond that of user agents.
ZB: If you look at the list of APIs that's in the proposal, it's quite a few bits of info. It sets precedent for potentially adding similar functions in the
|
{
"pile_set_name": "Github"
}
|
// Package errwrap implements methods to formalize error wrapping in Go.
//
// All of the top-level functions that take an `error` are built to be able
// to take any error, not just wrapped errors. This allows you to use errwrap
// without having to type-check and type-cast everywhere.
package errwrap
import (
"errors"
"reflect"
"strings"
)
// WalkFunc is the callback called for Walk.
type WalkFunc func(error)
// Wrapper is an interface that can be implemented by custom types to
// have all the Contains, Get, etc. functions in errwrap work.
//
// When Walk reaches a Wrapper, it will call the callback for every
// wrapped error in addition to the wrapper itself. Since all the top-level
// functions in errwrap use Walk, this means that all those functions work
// with your custom type.
type Wrapper interface {
WrappedErrors() []error
}
// Wrap defines that outer wraps inner, returning an error type that
// can be cleanly used with the other methods in this package, such as
// Contains, GetAll, etc.
//
// This function won't modify the error message at all (the outer message
// will be used).
func Wrap(outer, inner error) error {
return &wrappedError{
Outer: outer,
Inner: inner,
}
}
// Wrapf wraps an error with a formatting message. This is similar to using
// `fmt.Errorf` to wrap an error. If you're using `fmt.Errorf` to wrap
// errors, you should replace it with this.
//
// format is the format of the error message. The string '{{err}}' will
// be replaced with the original error message.
func Wrapf(format string, err error) error {
outerMsg := "<nil>"
if err != nil {
outerMsg = err.Error()
}
outer := errors.New(strings.Replace(
format, "{{err}}", outerMsg, -1))
return Wrap(outer, err)
}
// Contains checks if the given error contains an error with the
// message msg. If err is not a wrapped error, this will always return
// false unless the error itself happens to match this msg.
func Contains(err error, msg string) bool {
return len(GetAll(err, msg)) > 0
}
// ContainsType checks if the given error contains an error with
// the same concrete type as v. If err is not a wrapped error, this will
// check the err itself.
func ContainsType(err error, v interface{}) bool {
return len(GetAllType(err, v)) > 0
}
// Get is the same as GetAll but returns the deepest matching error.
func Get(err error, msg string) error {
es := GetAll(err, msg)
if len(es) > 0 {
return es[len(es)-1]
}
return nil
}
// GetType is the same as GetAllType but returns the deepest matching error.
func GetType(err error, v interface{}) error {
es := GetAllType(err, v)
if len(es) > 0 {
return es[len(es)-1]
}
return nil
}
// GetAll gets all the errors that might be wrapped in err with the
// given message. The order of the errors is such that the outermost
// matching error (the most recent wrap) is index zero, and so on.
func GetAll(err error, msg string) []error {
var result []error
Walk(err, func(err error) {
if err.Error() == msg {
result = append(result, err)
}
})
return result
}
// GetAllType gets all the errors that are the same type as v.
//
// The order of the return value is the same as described in GetAll.
func GetAllType(err error, v interface{}) []error {
var result []error
var search string
if v != nil {
search = reflect.TypeOf(v).String()
}
Walk(err, func(err error) {
var needle string
if err != nil {
needle = reflect.TypeOf(err).String()
}
if needle == search {
result = append(result, err)
}
})
return result
}
// Walk walks all the wrapped errors in err and calls the callback. If
// err isn't a wrapped error, this will be called once for err. If err
// is a wrapped error, the callback will be called for both the wrapper
// that implements error as well as the wrapped error itself.
func Walk(err error, cb WalkFunc) {
if err == nil {
return
}
switch e := err.(type) {
case *wrappedError:
cb(e.Outer)
Walk(e.Inner, cb)
case Wrapper:
cb(err)
for _, err := range e.WrappedErrors() {
Walk(err, cb)
}
default:
cb(err)
}
}
// wrappedError is an implementation of error that has both the
// outer and inner errors.
type wrappedError struct {
Outer error
Inner error
}
func (w *wrappedError) Error() string {
return w.Outer.Error()
}
func (w *wrappedError) WrappedErrors() []error {
return []error{w.Outer, w.Inner}
}
|
{
"pile_set_name": "Github"
}
|
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
// Copyright 2016 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 idna
// This file implements the Punycode algorithm from RFC 3492.
import (
"math"
"strings"
"unicode/utf8"
)
// These parameter values are specified in section 5.
//
// All computation is done with int32s, so that overflow behavior is identical
// regardless of whether int is 32-bit or 64-bit.
const (
base int32 = 36
damp int32 = 700
initialBias int32 = 72
initialN int32 = 128
skew int32 = 38
tmax int32 = 26
tmin int32 = 1
)
func punyError(s string) error { return &labelError{s, "A3"} }
// decode decodes a string as specified in section 6.2.
func decode(encoded string) (string, error) {
if encoded == "" {
return "", nil
}
pos := 1 + strings.LastIndex(encoded, "-")
if pos == 1 {
return "", punyError(encoded)
}
if pos == len(encoded) {
return encoded[:len(encoded)-1], nil
}
output := make([]rune, 0, len(encoded))
if pos != 0 {
for _, r := range encoded[:pos-1] {
output = append(output, r)
}
}
i, n, bias := int32(0), initialN, initialBias
for pos < len(encoded) {
oldI, w := i, int32(1)
for k := base; ; k += base {
if pos == len(encoded) {
return "", punyError(encoded)
}
digit, ok := decodeDigit(encoded[pos])
if !ok {
return "", punyError(encoded)
}
pos++
i += digit * w
if i < 0 {
return "", punyError(encoded)
}
t := k - bias
if t < tmin {
t = tmin
} else if t > tmax {
t = tmax
}
if digit < t {
break
}
w *= base - t
if w >= math.MaxInt32/base {
return "", punyError(encoded)
}
}
x := int32(len(output) + 1)
bias = adapt(i-oldI, x, oldI == 0)
n += i / x
i %= x
if n > utf8.MaxRune || len(output) >= 1024 {
return "", punyError(encoded)
}
output = append(output, 0)
copy(output[i+1:], output[i:])
output[i] = n
i++
}
return string(output), nil
}
// encode encodes a string as specified in section 6.3 and prepends prefix to
// the result.
//
// The "while h < length(input)" line in the specification becomes "for
// remaining != 0" in the Go code, because len(s) in Go is in bytes, not runes.
func encode(prefix, s string) (string, error) {
output := make([]byte, len(prefix), len(prefix)+1+2*len(s))
copy(output, prefix)
delta, n, bias := int32(0), initialN, initialBias
b, remaining := int32(0), int32(0)
for _, r := range s {
if r < 0x80 {
b++
output = append(output, byte(r))
} else {
remaining++
}
}
h := b
if b > 0 {
output = append(output, '-')
}
for remaining != 0 {
m := int32(0x7fffffff)
for _, r := range s {
if m > r && r >= n {
m = r
}
}
delta += (m - n) * (h + 1)
if delta < 0 {
return "", punyError(s)
}
n = m
for _, r := range s {
if r < n {
delta++
if delta < 0 {
return "", punyError(s)
}
continue
}
if r > n {
continue
}
q := delta
for k := base; ; k += base {
t := k - bias
if t < tmin {
t = tmin
} else if t > tmax {
t = tmax
}
if q < t {
break
}
output = append(output, encodeDigit(t+(q-t)%(base-t)))
q = (q - t) / (base - t)
}
output = append(output, encodeDigit(q))
bias = adapt(delta, h+1, h == b)
delta = 0
h++
remaining--
}
delta++
n++
}
return string(output), nil
}
func decodeDigit(x byte) (digit int32, ok bool) {
switch {
case '0' <= x && x <= '9':
return int32(x - ('0' - 26)), true
case 'A' <= x && x <= 'Z':
return int32(x - 'A'), true
case 'a' <= x && x <= 'z':
return int32(x - 'a'), true
}
return 0, false
}
func encodeDigit(digit int32) byte {
switch {
case 0 <= digit && digit < 26:
return byte(digit + 'a')
case 26 <= digit && digit < 36:
return byte(digit + ('0' - 26))
}
panic("idna: internal error in punycode encoding")
}
// adapt is the bias adaptation function specified in section 6.1.
func adapt(delta, numPoints int32, firstTime bool) int32 {
if firstTime {
delta /= damp
} else {
delta /= 2
}
delta += delta / numPoints
k := int32(0)
for delta > ((base-tmin)*tmax)/2 {
delta /= base - tmin
k += base
}
return k + (base-tmin+1)*delta/(delta+skew)
}
|
{
"pile_set_name": "Github"
}
|
/*
* SonarQube
* Copyright (C) 2009-2020 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.server.platform.db.migration.version.v84.users.fk.groupsusers;
import org.sonar.db.Database;
import org.sonar.server.platform.db.migration.step.DropIndexChange;
public class DropIndexOnUserIdOfGroupsUsersTable extends DropIndexChange {
private static final String TABLE_NAME = "groups_users";
private static final String INDEX_NAME = "index_groups_users_on_user_id";
public DropIndexOnUserIdOfGroupsUsersTable(Database db) {
super(db, INDEX_NAME, TABLE_NAME);
}
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"icheheavo",
"ichamthi"
],
"DAY": [
"Jumapili",
"Jumatatu",
"Jumanne",
"Jumatano",
"Alhamisi",
"Ijumaa",
"Jumamosi"
],
"MONTH": [
"Januari",
"Februari",
"Machi",
"Aprili",
"Mei",
"Juni",
"Julai",
"Agosti",
"Septemba",
"Oktoba",
"Novemba",
"Desemba"
],
"SHORTDAY": [
"Jpi",
"Jtt",
"Jnn",
"Jtn",
"Alh",
"Ijm",
"Jmo"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mac",
"Apr",
"Mei",
"Jun",
"Jul",
"Ago",
"Sep",
"Okt",
"Nov",
"Dec"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "dd/MM/y h:mm a",
"shortDate": "dd/MM/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "TSh",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "asa-tz",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
{
"pile_set_name": "Github"
}
|
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// test:
// template <class charT, class traits, size_t N>
// basic_istream<charT, traits>&
// operator>>(basic_istream<charT, traits>& is, bitset<N>& x);
#include <bitset>
#include <sstream>
#include <cassert>
int main()
{
std::ostringstream os;
std::bitset<8> b(0x5A);
os << b;
assert(os.str() == "01011010");
}
|
{
"pile_set_name": "Github"
}
|
#! /bin/sh
. ../../testenv.sh
GHDL_STD_FLAGS=--std=08
for t in conv01; do
analyze $t.vhdl tb_$t.vhdl
elab_simulate tb_$t
clean
synth $t.vhdl -e $t > syn_$t.vhdl
analyze syn_$t.vhdl tb_$t.vhdl
elab_simulate tb_$t
clean
done
echo "Test successful"
|
{
"pile_set_name": "Github"
}
|
package org.coralibre.android.sdk.fakegms.tasks;
import androidx.annotation.NonNull;
/**
* Represents an asynchronous operation.
* <p>
* Minimal Task class providing interfaces currently required by the RKI app.
*/
public abstract class Task<T> {
/**
* Returns true if the Task is complete; false otherwise.
* A Task is complete if it is done running, regardless of whether it was successful or
* has been cancelled.
*/
public abstract boolean isComplete();
/**
* Returns true if the Task has completed successfully; false otherwise.
*/
public abstract boolean isSuccessful();
/**
* Adds a listener that is called if the Task completes successfully.
* <p>
* The listener will be called on the main application thread.
* If the Task has already completed successfully, a call to the listener will be immediately
* scheduled. If multiple listeners are added, they will be called in the order in which they
* were added.
*
* @return this Task
*/
@NonNull
public abstract Task<T> addOnSuccessListener(OnSuccessListener<? super T> listener);
/**
* Adds a listener that is called if the Task fails.
* <p>
* The listener will be called on main application thread. If the Task has already failed,
* a call to the listener will be immediately scheduled. If multiple listeners are added,
* they will be called in the order in which they were added.
* <p>
* A canceled Task is not a failure Task.
* This listener will not trigger if the Task is canceled.
*
* @return this Task
*/
@NonNull
public abstract Task<T> addOnFailureListener(OnFailureListener listener);
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'notification', 'tr', {
closed: 'Uyarılar kapatıldı.'
} );
|
{
"pile_set_name": "Github"
}
|
/**********************************************************************
*
* This file is part of Cardpeek, the smart card reader utility.
*
* Copyright 2009-2014 by Alain Pannetrat <L1L1@gmx.com>
*
* Cardpeek 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.
*
* Cardpeek 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 Cardpeek. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MISC_H
#define MISC_H
#include <glib.h>
#ifdef _WIN32
#include "win32/config.h"
#else
#include "config.h"
#endif
#ifndef HAVE_GSTATBUF
#include <unistd.h>
typedef struct stat GStatBuf;
#endif
/* Not needed for maverick anymore *
#ifdef __APPLE__
#define DIRENT_T struct dirent
#else*/
#define DIRENT_T const struct dirent
/* #endif
*/
#define is_hex(a) ((a>='0' && a<='9') || \
(a>='A' && a<='F') || \
(a>='a' && a<='f'))
#define is_blank(a) (a==' ' || a=='\t' || a=='\r' || a=='\n')
/*****************************************************
*
* filename parsing
*/
const char *filename_extension(const char *fname);
const char *filename_base(const char *fname);
/*****************************************************
*
* log functions
*/
typedef void (*logfunc_t)(int,const char*);
int log_printf(int level, const char *format, ...);
void log_set_function(logfunc_t logfunc);
void log_open_file(void);
void log_close_file(void);
enum {
LOG_DEBUG,
LOG_INFO,
LOG_WARNING,
LOG_ERROR
};
/*****************************************************
*
* String functions for hash maps
*/
guint cstring_hash(gconstpointer data);
gint cstring_equal(gconstpointer a, gconstpointer b);
/******************************************************
*
* version_to_bcd convert string version to BCD as
* MM.mm.rrrr
* | | |
* | | +- revision (0000-9999)
* | +------ minor (00-99)
* +--------- major (00-99)
*/
unsigned version_to_bcd(const char *version);
/******************************************************
*
* debug function
*/
#include <stdio.h>
#define HERE() { fprintf(stderr,"%s[%i]\n",__FILE__,__LINE__); fflush(stderr); }
#define UNUSED(x) (void)x
#endif /* _MISC_H_ */
|
{
"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 @@@
**********************************************************************/
#ifndef ODBCCOMMON_H_
#define ODBCCOMMON_H_
/*
* Translation unit: ODBCCOMMON
* Generated by CNPGEN(TANTAU CNPGEN TANTAU_AG_PC8 20001120.103031) on Mon Jan 31 11:14:07 2011
* C++ constructs used
* Header file for use with the CEE
* Client functionality included
* Server functionality included
*/
#include <stdarg.h>
#include <cee.h>
#if CEE_H_VERSION != 19991123
#error Version mismatch CEE_H_VERSION != 19991123
#endif
#include <idltype.h>
#if IDL_TYPE_H_VERSION != 19971225
#error Version mismatch IDL_TYPE_H_VERSION != 19971225
#endif
typedef IDL_string UUID_def;
#define UUID_def_cin_ ((char *) "d0+")
#define UUID_def_csz_ ((IDL_unsigned_long) 3)
typedef IDL_long DIALOGUE_ID_def;
#define DIALOGUE_ID_def_cin_ ((char *) "F")
#define DIALOGUE_ID_def_csz_ ((IDL_unsigned_long) 1)
typedef IDL_char SQL_IDENTIFIER_def[513];
#define SQL_IDENTIFIER_def_cin_ ((char *) "d512+")
#define SQL_IDENTIFIER_def_csz_ ((IDL_unsigned_long) 5)
typedef IDL_char STMT_NAME_def[513];
#define STMT_NAME_def_cin_ ((char *) "d512+")
#define STMT_NAME_def_csz_ ((IDL_unsigned_long) 5)
typedef IDL_long SQL_DATATYPE_def;
#define SQL_DATATYPE_def_cin_ ((char *) "F")
#define SQL_DATATYPE_def_csz_ ((IDL_unsigned_long) 1)
typedef IDL_char SQLSTATE_def[6];
#define SQLSTATE_def_cin_ ((char *) "d5+")
#define SQLSTATE_def_csz_ ((IDL_unsigned_long) 3)
typedef IDL_string ERROR_STR_def;
#define ERROR_STR_def_cin_ ((char *) "d0+")
#define ERROR_STR_def_csz_ ((IDL_unsigned_long) 3)
typedef struct SQL_DataValue_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
IDL_octet *_buffer;
IDL_PTR_PAD(_buffer, 1)
} SQL_DataValue_def;
#define SQL_DataValue_def_cin_ ((char *) "c0+H")
#define SQL_DataValue_def_csz_ ((IDL_unsigned_long) 4)
typedef IDL_short SQL_INDICATOR_def;
#define SQL_INDICATOR_def_cin_ ((char *) "I")
#define SQL_INDICATOR_def_csz_ ((IDL_unsigned_long) 1)
typedef IDL_long_long INTERVAL_NUM_def;
#define INTERVAL_NUM_def_cin_ ((char *) "G")
#define INTERVAL_NUM_def_csz_ ((IDL_unsigned_long) 1)
typedef IDL_char TIMESTAMP_STR_def[31];
#define TIMESTAMP_STR_def_cin_ ((char *) "d30+")
#define TIMESTAMP_STR_def_csz_ ((IDL_unsigned_long) 4)
typedef struct USER_SID_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
IDL_octet *_buffer;
IDL_PTR_PAD(_buffer, 1)
} USER_SID_def;
#define USER_SID_def_cin_ ((char *) "c0+H")
#define USER_SID_def_csz_ ((IDL_unsigned_long) 4)
typedef struct USER_PASSWORD_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
IDL_octet *_buffer;
IDL_PTR_PAD(_buffer, 1)
} USER_PASSWORD_def;
#define USER_PASSWORD_def_cin_ ((char *) "c0+H")
#define USER_PASSWORD_def_csz_ ((IDL_unsigned_long) 4)
typedef struct USER_NAME_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
IDL_octet *_buffer;
IDL_PTR_PAD(_buffer, 1)
} USER_NAME_def;
#define USER_NAME_def_cin_ ((char *) "c0+H")
#define USER_NAME_def_csz_ ((IDL_unsigned_long) 4)
typedef IDL_long TIME_def;
#define TIME_def_cin_ ((char *) "F")
#define TIME_def_csz_ ((IDL_unsigned_long) 1)
typedef IDL_short GEN_PARAM_TOKEN_def;
#define GEN_PARAM_TOKEN_def_cin_ ((char *) "I")
#define GEN_PARAM_TOKEN_def_csz_ ((IDL_unsigned_long) 1)
typedef IDL_short GEN_PARAM_OPERATION_def;
#define GEN_PARAM_OPERATION_def_cin_ ((char *) "I")
#define GEN_PARAM_OPERATION_def_csz_ ((IDL_unsigned_long) 1)
typedef struct GEN_PARAM_VALUE_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
IDL_octet *_buffer;
IDL_PTR_PAD(_buffer, 1)
} GEN_PARAM_VALUE_def;
#define GEN_PARAM_VALUE_def_cin_ ((char *) "c0+H")
#define GEN_PARAM_VALUE_def_csz_ ((IDL_unsigned_long) 4)
typedef IDL_char VPROC_def[33];
#define VPROC_def_cin_ ((char *) "d32+")
#define VPROC_def_csz_ ((IDL_unsigned_long) 4)
typedef IDL_char APLICATION_def[130];
#define APLICATION_def_cin_ ((char *) "d129+")
#define APLICATION_def_csz_ ((IDL_unsigned_long) 5)
typedef IDL_char COMPUTER_def[130];
#define COMPUTER_def_cin_ ((char *) "d129+")
#define COMPUTER_def_csz_ ((IDL_unsigned_long) 5)
typedef IDL_char NAME_def[130];
#define NAME_def_cin_ ((char *) "d129+")
#define NAME_def_csz_ ((IDL_unsigned_long) 5)
struct ERROR_DESC_t {
IDL_long rowId;
IDL_long errorDiagnosticId;
IDL_long sqlcode;
SQLSTATE_def sqlstate;
|
{
"pile_set_name": "Github"
}
|
[Angular 编程思想](http://weekly.manong.io/bounce?url=http%3A%2F%2Fflippinawesome.org%2F2013%2F09%2F03%2Fthe-angular-way%2F&aid=2&nid=1)
[[视频] AngularJS 基础视频教程](http://weekly.manong.io/bounce?url=http%3A%2F%2Fv.youku.com%2Fv_show%2Fid_XNjE2MzYyNTA4.html&aid=57&nid=4)
[海量 AngularJS 学习资源(Jeff Cunningham)](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgithub.com%2Fjmcunningham%2FAngularJS-Learning&aid=144&nid=8)
[AngularJS 1.2.0 正式版发布](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgithub.com%2Fangular%2Fangular.js%2Fblob%2Fmaster%2FCHANGELOG.md&aid=160&nid=9)
[[译] 构建自己的 AngularJS(@民工精髓V)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.ituring.com.cn%2Farticle%2F39865&aid=177&nid=10)
[写给 jQuery 开发者的 AngularJS 教程](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.ng-newsletter.com%2Fposts%2Fangular-for-the-jquery-developer.html&aid=214&nid=11)
[系列文章:25天学会 AngularJS](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.ng-newsletter.com%2Fadvent2013%2F%23%2F&aid=269&nid=13)
[AngularJS + Rails 4 入门教程(Jason Swett)](http://weekly.manong.io/bounce?url=https%3A%2F%2Fwww.honeybadger.io%2Fblog%2F2013%2F12%2F11%2Fbeginners-guide-to-angular-js-rails&aid=311&nid=14)
[2013年度最强 AngularJS 资源合集(@CSDN研发频道)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.csdn.net%2Farticle%2F2014-01-03%2F2818005-AngularJS-Google-resource&aid=357&nid=17)
[AngularJS 单元测试最佳实践(Andy Shora)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fandyshora.com%2Funit-testing-best-practices-angularjs.html&aid=400&nid=18)
[AngularJS 编码规范](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgoogle-styleguide.googlecode.com%2Fsvn%2Ftrunk%2Fangularjs-google-style.html&aid=516&nid=21)
[打造 AngularJS 版的 2048 游戏](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.ng-newsletter.com%2Fposts%2Fbuilding-2048-in-angularjs.html&aid=912&nid=27)
[AngularStrap - 一个将 Twitter Bootstrap 无缝集成进 AngularJS 应用的指令集](http://weekly.manong.io/bounce?url=http%3A%2F%2Fmgcrea.github.io%2Fangular-strap%2F&aid=926&nid=27)
[[PDF] Google 官方的 AngularJS 应用结构最佳实践](http://weekly.manong.io/bounce?url=http%3A%2F%2Fvdisk.weibo.com%2Fs%2FG-kauggDoqJL&aid=927&nid=27)
[30 分钟学会 AngularJS (Leon Revill)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.revillweb.com%2Ftutorials%2Fangularjs-in-30-minutes-angularjs-tutorial%2F&aid=949&nid=28)
[一步步教你构建 AngularJS 应用 (Raoni Boaventura)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.toptal.com%2Fangular-js%2Fa-step-by-step-guide-to-your-first-angularjs-app&aid=1061&nid=31)
[你如何做 AngularJS 项目的单元测试?(弘树)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fued.taobao.com%2Fblog%2F2014%2F08%2F%25E6%2587%2592%25E6%2587%2592%25E5%25B0%258F%25E6%258A%25A5-%25E5%25A4%2596%25E5%2588%258A%25E7%25AC%25AC4%25E6%259C%259F%25E4%25BD%25A0%25E5%25A6%2582%25E4%25BD%2595%25E5%2581%259Aangularjs%25E9%25A1%25B9%25E7%259B%25AE%25E7%259A%2584%25E5%258D%2595%25E5%2585%2583%25E6%25B5%258B%25E8%25AF%2595%25EF%25BC%259F%2F&aid=1335&nid=41)
[[PPT] AngularJS 进阶实践(天猪)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fatian25.github.io%2Ffiles%2FAngularJS%2520%25E8%25BF%259B%25E9%2598%25B6%25E5%25AE%259E%25E8%25B7%25B5.pptx&aid=1365&nid=42)
[一堆有用的 AngularJS 学习资源 (Tim Jacobi)](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgithub.com%2Ftimjacobi%2Fangular-education&aid=1463&nid=45)
[[PDF] Angular 2 核心 (Igor Minar & Tobias Bosch)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fvdisk.weibo.com%2Fs%2FG-kauggCL2Ix&aid=1574&nid=49)
[使用 AngularJS 的这两年 (Alexey Migutsky)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.fse.guru%2F2-years-with-angular&aid=1665&nid=52)
[[译] AngularJS 资源集合 (张红月)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.csdn.net%2
|
{
"pile_set_name": "Github"
}
|
form=词
tags=
三峡打头风,
吹回荆步。
坎止流行谩随遇。
须臾风静,
重踏西来旧武。
世间忧喜地,
分明觑。
喜事虽新,
忧端依旧,
徒为岷峨且欢舞。
阴云掩映,
天末扣阍无路。
一鞭归去也,
鸥为侣。
|
{
"pile_set_name": "Github"
}
|
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build go1.5
package ssa
// This file defines the lifting pass which tries to "lift" Alloc
// cells (new/local variables) into SSA registers, replacing loads
// with the dominating stored value, eliminating loads and stores, and
// inserting φ-nodes as needed.
// Cited papers and resources:
//
// Ron Cytron et al. 1991. Efficiently computing SSA form...
// http://doi.acm.org/10.1145/115372.115320
//
// Cooper, Harvey, Kennedy. 2001. A Simple, Fast Dominance Algorithm.
// Software Practice and Experience 2001, 4:1-10.
// http://www.hipersoft.rice.edu/grads/publications/dom14.pdf
//
// Daniel Berlin, llvmdev mailing list, 2012.
// http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-January/046638.html
// (Be sure to expand the whole thread.)
// TODO(adonovan): opt: there are many optimizations worth evaluating, and
// the conventional wisdom for SSA construction is that a simple
// algorithm well engineered often beats those of better asymptotic
// complexity on all but the most egregious inputs.
//
// Danny Berlin suggests that the Cooper et al. algorithm for
// computing the dominance frontier is superior to Cytron et al.
// Furthermore he recommends that rather than computing the DF for the
// whole function then renaming all alloc cells, it may be cheaper to
// compute the DF for each alloc cell separately and throw it away.
//
// Consider exploiting liveness information to avoid creating dead
// φ-nodes which we then immediately remove.
//
// Integrate lifting with scalar replacement of aggregates (SRA) since
// the two are synergistic.
//
// Also see many other "TODO: opt" suggestions in the code.
import (
"fmt"
"go/token"
"go/types"
"math/big"
"os"
)
// If true, perform sanity checking and show diagnostic information at
// each step of lifting. Very verbose.
const debugLifting = false
// domFrontier maps each block to the set of blocks in its dominance
// frontier. The outer slice is conceptually a map keyed by
// Block.Index. The inner slice is conceptually a set, possibly
// containing duplicates.
//
// TODO(adonovan): opt: measure impact of dups; consider a packed bit
// representation, e.g. big.Int, and bitwise parallel operations for
// the union step in the Children loop.
//
// domFrontier's methods mutate the slice's elements but not its
// length, so their receivers needn't be pointers.
//
type domFrontier [][]*BasicBlock
func (df domFrontier) add(u, v *BasicBlock) {
p := &df[u.Index]
*p = append(*p, v)
}
// build builds the dominance frontier df for the dominator (sub)tree
// rooted at u, using the Cytron et al. algorithm.
//
// TODO(adonovan): opt: consider Berlin approach, computing pruned SSA
// by pruning the entire IDF computation, rather than merely pruning
// the DF -> IDF step.
func (df domFrontier) build(u *BasicBlock) {
// Encounter each node u in postorder of dom tree.
for _, child := range u.dom.children {
df.build(child)
}
for _, vb := range u.Succs {
if v := vb.dom; v.idom != u {
df.add(u, vb)
}
}
for _, w := range u.dom.children {
for _, vb := range df[w.Index] {
// TODO(adonovan): opt: use word-parallel bitwise union.
if v := vb.dom; v.idom != u {
df.add(u, vb)
}
}
}
}
func buildDomFrontier(fn *Function) domFrontier {
df := make(domFrontier, len(fn.Blocks))
df.build(fn.Blocks[0])
if fn.Recover != nil {
df.build(fn.Recover)
}
return df
}
func RemoveInstr(refs []Instruction, instr Instruction) []Instruction {
return removeInstr(refs, instr)
}
func removeInstr(refs []Instruction, instr Instruction) []Instruction {
i := 0
for _, ref := range refs {
if ref == instr {
continue
}
refs[i] = ref
i++
}
for j := i; j != len(refs); j++ {
refs[j] = nil // aid GC
}
return refs[:i]
}
// lift attempts to replace local and new Allocs accessed only with
// load/store by SSA registers, inserting φ-nodes where necessary.
// The result is a program in classical pruned SSA form.
//
// Preconditions:
// - fn has no dead blocks (blockopt has run).
// - Def/use info (Operands and Referrers) is up-to-date.
// - The dominator tree is up-to-date.
//
func lift(fn *Function) {
// TODO(adonovan): opt: lots of little optimizations may be
// worthwhile here, especially if they cause us to avoid
// buildDomFrontier. For example:
//
// - Alloc never loaded? Eliminate.
// - Alloc never stored? Replace all loads with a zero constant.
// - Alloc stored once? Replace loads with dominating store;
// don't forget that an Alloc is itself an effective store
// of zero.
// - Alloc used only within a single block?
// Use degenerate algorithm avoiding φ-nodes.
// - Consider synergy with scalar replacement of aggregates (SRA).
// e.g. *(&x.f) where x is an Alloc.
// Perhaps we'd get better results if we generated this as x.f
// i.e. Field(x, .f) instead of Load(FieldIndex(x, .f)).
// Unclear.
//
// But we will start with the simplest correct code.
df := buildDomFrontier(fn)
if debugLifting {
title := false
for i, blocks := range df {
if blocks != nil {
if !title {
fmt.Fprintf(os.Stderr, "Dominance frontier of %s:\n", fn)
title = true
}
fmt.Fprintf(os.Stderr, "\t%s: %s\n", fn.Blocks[i], blocks)
}
}
}
newPhis := make(newPhiMap)
// During this pass we will replace some BasicBlock.Instrs
// (allocs, loads and stores) with nil, keeping a count in
// BasicBlock.gaps. At the end we will reset Instrs to the
// concatenation of all non-dead newPhis and non-nil Instrs
// for the block, reusing the original array if space permits.
// While we're here, we also eliminate 'rundefers'
// instructions in functions that contain no 'defer'
// instructions.
usesDefer := false
// Determine which allocs we can lift and number them densely.
// The renaming phase uses this numbering for compact maps.
numAllocs := 0
for _, b := range fn.Blocks {
b.gaps = 0
b.rundefers = 0
for _, instr := range b.Instrs {
switch instr := instr.(type) {
case *Alloc:
index := -1
if liftAlloc(df, instr, newPhis) {
index = numAllocs
numAllocs++
}
instr.index = index
case *Defer:
usesDefer = true
case *RunDefers:
b.rundefers++
}
}
}
// renaming maps an alloc (keyed by index) to its replacement
// value. Initially the renaming contains nil, signifying the
// zero constant of the appropriate type; we construct the
// Const la
|
{
"pile_set_name": "Github"
}
|
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package nilness inspects the control-flow graph of an SSA function
// and reports errors such as nil pointer dereferences and degenerate
// nil pointer comparisons.
package nilness
import (
"fmt"
"go/token"
"go/types"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/buildssa"
"golang.org/x/tools/go/ssa"
)
const Doc = `check for redundant or impossible nil comparisons
The nilness checker inspects the control-flow graph of each function in
a package and reports nil pointer dereferences and degenerate nil
pointers. A degenerate comparison is of the form x==nil or x!=nil where x
is statically known to be nil or non-nil. These are often a mistake,
especially in control flow related to errors.
This check reports conditions such as:
if f == nil { // impossible condition (f is a function)
}
and:
p := &v
...
if p != nil { // tautological condition
}
and:
if p == nil {
print(*p) // nil dereference
}
`
var Analyzer = &analysis.Analyzer{
Name: "nilness",
Doc: Doc,
Run: run,
Requires: []*analysis.Analyzer{buildssa.Analyzer},
}
func run(pass *analysis.Pass) (interface{}, error) {
ssainput := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA)
for _, fn := range ssainput.SrcFuncs {
runFunc(pass, fn)
}
return nil, nil
}
func runFunc(pass *analysis.Pass, fn *ssa.Function) {
reportf := func(category string, pos token.Pos, format string, args ...interface{}) {
pass.Report(analysis.Diagnostic{
Pos: pos,
Category: category,
Message: fmt.Sprintf(format, args...),
})
}
// notNil reports an error if v is provably nil.
notNil := func(stack []fact, instr ssa.Instruction, v ssa.Value, descr string) {
if nilnessOf(stack, v) == isnil {
reportf("nilderef", instr.Pos(), "nil dereference in "+descr)
}
}
// visit visits reachable blocks of the CFG in dominance order,
// maintaining a stack of dominating nilness facts.
//
// By traversing the dom tree, we can pop facts off the stack as
// soon as we've visited a subtree. Had we traversed the CFG,
// we would need to retain the set of facts for each block.
seen := make([]bool, len(fn.Blocks)) // seen[i] means visit should ignore block i
var visit func(b *ssa.BasicBlock, stack []fact)
visit = func(b *ssa.BasicBlock, stack []fact) {
if seen[b.Index] {
return
}
seen[b.Index] = true
// Report nil dereferences.
for _, instr := range b.Instrs {
switch instr := instr.(type) {
case ssa.CallInstruction:
notNil(stack, instr, instr.Common().Value,
instr.Common().Description())
case *ssa.FieldAddr:
notNil(stack, instr, instr.X, "field selection")
case *ssa.IndexAddr:
notNil(stack, instr, instr.X, "index operation")
case *ssa.MapUpdate:
notNil(stack, instr, instr.Map, "map update")
case *ssa.Slice:
// A nilcheck occurs in ptr[:] iff ptr is a pointer to an array.
if _, ok := instr.X.Type().Underlying().(*types.Pointer); ok {
notNil(stack, instr, instr.X, "slice operation")
}
case *ssa.Store:
notNil(stack, instr, instr.Addr, "store")
case *ssa.TypeAssert:
notNil(stack, instr, instr.X, "type assertion")
case *ssa.UnOp:
if instr.Op == token.MUL { // *X
notNil(stack, instr, instr.X, "load")
}
}
}
// For nil comparison blocks, report an error if the condition
// is degenerate, and push a nilness fact on the stack when
// visiting its true and false successor blocks.
if binop, tsucc, fsucc := eq(b); binop != nil {
xnil := nilnessOf(stack, binop.X)
ynil := nilnessOf(stack, binop.Y)
if ynil != unknown && xnil != unknown && (xnil == isnil || ynil == isnil) {
// Degenerate condition:
// the nilness of both operands is known,
// and at least one of them is nil.
var adj string
if (xnil == ynil) == (binop.Op == token.EQL) {
adj = "tautological"
} else {
adj = "impossible"
}
reportf("cond", binop.Pos(), "%s condition: %s %s %s", adj, xnil, binop.Op, ynil)
// If tsucc's or fsucc's sole incoming edge is impossible,
// it is unreachable. Prune traversal of it and
// all the blocks it dominates.
// (We could be more precise with full dataflow
// analysis of control-flow joins.)
var skip *ssa.BasicBlock
if xnil == ynil {
skip = fsucc
} else {
skip = tsucc
}
for _, d := range b.Dominees() {
if d == skip && len(d.Preds) == 1 {
continue
}
visit(d, stack)
}
return
}
// "if x == nil" or "if nil == y" condition; x, y are unknown.
if xnil == isnil || ynil == isnil {
var f fact
if xnil == isnil {
// x is nil, y is unknown:
// t successor learns y is nil.
f = fact{binop.Y, isnil}
} else {
// x is nil, y is unknown:
// t successor learns x is nil.
f = fact{binop.X, isnil}
}
for _, d := range b.Dominees() {
// Successor blocks learn a fact
// only at non-critical edges.
// (We could do be more precise with full dataflow
// analysis of control-flow joins.)
s := stack
if len(d.Preds) == 1 {
if d == tsucc {
s = append(s, f)
} else if d == fsucc {
s = append(s, f.negate())
}
}
visit(d, s)
}
return
}
}
for _, d := range b.Dominees() {
visit(d, stack)
}
}
// Visit the entry block. No need to visit fn.Recover.
if fn.Blocks != nil {
visit(fn.Blocks[0], make([]fact, 0, 20)) // 20 is plenty
}
}
// A fact records that a block is dominated
// by the condition v == nil or v != nil.
type fact struct {
value ssa.Value
nilness nilness
}
func (f fact) negate() fact { return fact{f.value, -f.nilness} }
type nilness int
const (
isnonnil = -1
unknown nilness = 0
isnil = 1
)
var nilnessStrings = []string{"non-nil", "unknown", "nil"}
func (n nilness) String() string { return nilnessStrings[n+1] }
// nilnessOf reports whether v is definitely nil, definitely not nil,
|
{
"pile_set_name": "Github"
}
|
// Copyright 2009,2010 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.
// OpenBSD system calls.
// This file is compiled as ordinary Go code,
// but it is also input to mksyscall,
// which parses the //sys lines and generates system call stubs.
// Note that sometimes we use a lowercase //sys name and wrap
// it in our own nicer implementation, either here or in
// syscall_bsd.go or syscall_unix.go.
package unix
import (
"sort"
"syscall"
"unsafe"
)
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
type SockaddrDatalink struct {
Len uint8
Family uint8
Index uint16
Type uint8
Nlen uint8
Alen uint8
Slen uint8
Data [24]int8
raw RawSockaddrDatalink
}
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func nametomib(name string) (mib []_C_int, err error) {
i := sort.Search(len(sysctlMib), func(i int) bool {
return sysctlMib[i].ctlname >= name
})
if i < len(sysctlMib) && sysctlMib[i].ctlname == name {
return sysctlMib[i].ctloid, nil
}
return nil, EINVAL
}
func direntIno(buf []byte) (uint64, bool) {
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
}
func direntReclen(buf []byte) (uint64, bool) {
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
}
func direntNamlen(buf []byte) (uint64, bool) {
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
}
func SysctlClockinfo(name string) (*Clockinfo, error) {
mib, err := sysctlmib(name)
if err != nil {
return nil, err
}
n := uintptr(SizeofClockinfo)
var ci Clockinfo
if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil {
return nil, err
}
if n != SizeofClockinfo {
return nil, EIO
}
return &ci, nil
}
func SysctlUvmexp(name string) (*Uvmexp, error) {
mib, err := sysctlmib(name)
if err != nil {
return nil, err
}
n := uintptr(SizeofUvmexp)
var u Uvmexp
if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil {
return nil, err
}
if n != SizeofUvmexp {
return nil, EIO
}
return &u, nil
}
//sysnb pipe(p *[2]_C_int) (err error)
func Pipe(p []int) (err error) {
if len(p) != 2 {
return EINVAL
}
var pp [2]_C_int
err = pipe(&pp)
p[0] = int(pp[0])
p[1] = int(pp[1])
return
}
//sys Getdents(fd int, buf []byte) (n int, err error)
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
n, err = Getdents(fd, buf)
if err != nil || basep == nil {
return
}
var off int64
off, err = Seek(fd, 0, 1 /* SEEK_CUR */)
if err != nil {
*basep = ^uintptr(0)
return
}
*basep = uintptr(off)
if unsafe.Sizeof(*basep) == 8 {
return
}
if off>>32 != 0 {
// We can't stuff the offset back into a uintptr, so any
// future calls would be suspect. Generate an error.
// EIO was allowed by getdirentries.
err = EIO
}
return
}
const ImplementsGetwd = true
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
func Getwd() (string, error) {
var buf [PathMax]byte
_, err := Getcwd(buf[0:])
if err != nil {
return "", err
}
n := clen(buf[:])
if n < 1 {
return "", EINVAL
}
return string(buf[:n]), nil
}
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
return sendfile(outfd, infd, offset, count)
}
// TODO
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
return -1, ENOSYS
}
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
var bufsize uintptr
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
func setattrlistTimes(path string, times []Timespec, flags int) error {
// used on Darwin for UtimesNano
return ENOSYS
}
//sys ioctl(fd int, req uint, arg uintptr) (err error)
//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
if len(fds) == 0 {
return ppoll(nil, 0, timeout, sigmask)
}
return ppoll(&fds[0], len(fds), timeout, sigmask)
}
func Uname(uname *Utsname) error {
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
n := unsafe.Sizeof(uname.Sysname)
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
return err
}
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
n = unsafe.Sizeof(uname.Nodename)
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
return err
}
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
n = unsafe.Sizeof(uname.Release)
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
return err
}
mib = []_C
|
{
"pile_set_name": "Github"
}
|
##HY-SRF05 Ultrasonic Position Sensor
Ultrasonic sensors overcome many of the weaknesses of IR sensors - they provide distance measurement regardless of color and lighting of obstacles. They also provide lower minimum distances and wider angles of detection to gaurantee that obstacles are not missed by a narrow sensor beam.
The SRF05 has been designed to increase flexibility, increase range, and to reduce costs still further. As such, the SRF05 is fully compatible with the SRF04. Range is increased from 3 meters to 4 meters. A new operating mode (tying the mode pin to ground) allows the SRF05 to use a single pin for both trigger and echo, thereby saving valuable pins on your controller. When the mode pin is left unconnected, the SRF05 operates with separate trigger and echo pins, like the SRF04. The SRF05 includes a small delay before the echo pulse to give slower controllers such as the Basic Stamp and Picaxe time to execute their pulse in commands.
###Specifications
5-Pin, One each for VCC, Trigger, Echo, Out and Ground.
1. Voltage : DC5V
2. Static current : less than 2mA
3. Detection distance: 2cm-450cm
4. High precision: up to 0.3c
The module performance is stable, measure the distance accurately:
Main technical parameters:
1) Voltage : DC5V
2) Static current : less than 2mA
3) level output: high-5V
4) level output: the end of 0V
5) Sensor angle: not more than 15 degrees
6) Detection distance: 2cm-450cm
7) High precision: up to 0.3cm
|
{
"pile_set_name": "Github"
}
|
@import url("https://fonts.googleapis.com/css?family=Open+Sans");
#kss-node .kss-section {
margin-bottom: 2rem; }
#kss-node .kss-section:first-child, #kss-node .kss-section:last-child {
border-bottom: 0;
margin-bottom: 0;
padding-bottom: 1rem; }
#kss-node .kss-depth-2 {
margin: 0;
background: url("../assets/hr.png") repeat-x 0 0;
border: 0;
float: left;
clear: both;
width: 100%; }
#kss-node .kss-modifier {
border-top: 0; }
#kss-node .kss-wrapper {
margin-left: 0;
position: relative;
max-width: 1440px;
padding: 0; }
#kss-node .kss-content {
padding-right: 0.5rem;
padding-left: 0.5rem;
margin: 2rem;
clear: both; }
@media (min-width: 40em) {
#kss-node .kss-content {
padding-right: 0.5rem;
padding-left: 0.5rem;
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
margin: 0 3rem 0 325px;
clear: none; } }
#kss-node .kss-sidebar-collapsed + .kss-content {
margin: 0 3rem; }
@media (min-width: 40em) {
#kss-node .kss-sidebar-collapsed + .kss-content {
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
margin: 0 3rem 0 6rem; } }
#kss-node .kss-modifier-original .kss-modifier-example {
padding: 1rem 0; }
#kss-node .kss-overview code,
#kss-node .kss-description code,
#kss-node .kss-description pre {
padding: 2px 6px;
background: #f4f4f4;
border-radius: 4px;
font-size: 14px; }
#kss-node .kss-description blockquote {
margin-bottom: 2rem; }
#kss-node .kss-description h3 {
font-weight: normal;
font-style: normal;
margin: 20px 0 0;
font-size: 16px; }
@media (min-width: 55em) {
#kss-node .kss-description h3 {
font-size: 20px; } }
#kss-node .kss-markup pre {
border-radius: 0 4px 4px 0;
border: 2px solid #f4f4f4;
border-left: 5px solid #e00000; }
#kss-node .kss-sidebar.kss-fixed,
#kss-node .kss-sidebar {
background: #f4f4f4;
padding: 0 2rem;
width: 100%;
margin: 0 auto;
position: relative;
-webkit-box-sizing: border-box;
box-sizing: border-box;
z-index: 999;
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
float: left;
height: 100%; }
#kss-node .kss-sidebar.kss-fixed .kss-sidebar-inner,
#kss-node .kss-sidebar .kss-sidebar-inner {
text-decoration: none;
padding-top: 0;
margin-top: -1rem; }
@media (min-width: 40em) {
#kss-node .kss-sidebar.kss-fixed,
#kss-node .kss-sidebar {
height: 100% !important;
width: 275px;
position: fixed;
padding: 2.5rem 2rem;
overflow-y: auto !important; }
#kss-node .kss-sidebar.kss-fixed .kss-nav,
#kss-node .kss-sidebar .kss-nav {
padding: 0.5rem 0;
margin: 0.5rem 0;
max-height: 100%;
overflow-y: auto !important;
clear: both;
width: 100%; } }
#kss-node .kss-menu > .kss-menu-item {
padding: 0.5rem;
border-bottom: 1px solid #bbbbbb; }
#kss-node .kss-menu > .kss-menu-item:last-child {
border-bottom: 0; }
#kss-node .kss-menu,
#kss-node .kss-menu-child,
#kss-node .kss-menu > .kss-menu-item > a {
border-bottom: 0; }
#kss-node .kss-menu li,
#kss-node .kss-menu-child li,
#kss-node .kss-menu > .kss-menu-item > a li {
list-style: none; }
#kss-node .kss-menu > .kss-menu-item > a > .kss-name,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-name,
#kss-node .kss-menu > .kss-menu-item > a > .kss-menu-item > a > .kss-name {
text-align: left;
color: #464646;
font-weight: 100; }
#kss-node .kss-menu > .kss-menu-item > a > .kss-name:hover, #kss-node .kss-menu > .kss-menu-item > a > .kss-name:focus, #kss-node .kss-menu > .kss-menu-item > a > .kss-name:active,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-name:hover,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-name:focus,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-name:active,
#kss-node .kss-menu > .kss-menu-item > a > .kss-menu-item > a > .kss-name:hover,
#kss-node .kss-menu > .kss-menu-item > a > .kss-menu-item > a > .kss-name:focus,
#kss-node .kss-menu > .kss-menu-item > a > .kss-menu-item > a > .kss-name:active {
color: #464646;
text-decoration: underline; }
#kss-node .kss-menu-child {
padding: 0; }
#kss-node h1 > a,
#kss-node h2 > a,
#kss-node h3 > a,
#kss-node .kss-menu > .kss-menu-item > a > .kss-ref,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-ref,
#kss-node .kss-overview a,
#kss-node .kss-description a {
text-align: left;
color: #e00000;
text-decoration: none;
|
{
"pile_set_name": "Github"
}
|
// ***************************************************************************
// *
// * Copyright (C) 2013 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: org.unicode.cldr.icu.NewLdml2IcuConverter
// * Source File: <path>/common/main/as.xml
// *
// ***************************************************************************
/**
* ICU <specials> source: <path>/common/main/as.xml
*/
as{
AuxExemplarCharacters{"[\u200C\u200D ৲]"}
ExemplarCharacters{
"[অ আ ই ঈ উ ঊ ঋ এ ঐ ও ঔ ং \u0981 ঃ ক খ গ ঘ ঙ চ ছ জ ঝ ঞ ট ঠ ড {ড\u09BC}ড় ঢ {ঢ"
"\u09BC}ঢ় ণ ত থ দ ধ ন প ফ ব ভ ম য {য\u09BC} ৰ ল ৱ শ ষ স হ {ক\u09CDষ} া ি ী "
"\u09C1 \u09C2 \u09C3 ে ৈ ো ৌ \u09CD]"
}
LocaleScript{
"Beng",
}
NumberElements{
default{"beng"}
latn{
patterns{
currencyFormat{"¤ #,##,##0.00"}
decimalFormat{"#,##,##0.###"}
percentFormat{"#,##,##0%"}
}
}
native{"beng"}
}
Version{"2.0.92.87"}
calendar{
gregorian{
AmPmMarkers{
"পূৰ্বাহ্ণ",
"অপৰাহ্ণ",
}
dayNames{
format{
abbreviated{
"ৰবি",
"সোম",
"মঙ্গল",
"বুধ",
"বৃহষ্পতি",
"শুক্ৰ",
"শনি",
}
wide{
"দেওবাৰ",
"সোমবাৰ",
"মঙ্গলবাৰ",
"বুধবাৰ",
"বৃহষ্পতিবাৰ",
"শুক্ৰবাৰ",
"শনিবাৰ",
}
}
}
monthNames{
format{
abbreviated{
"জানু",
"ফেব্ৰু",
"মাৰ্চ",
"এপ্ৰিল",
"মে",
"জুন",
"জুলাই",
"আগ",
"সেপ্ট",
"অক্টো",
"নভে",
"ডিসে",
}
wide{
"জানুৱাৰী",
"ফেব্ৰুৱাৰী",
"মাৰ্চ",
"এপ্ৰিল",
"মে",
"জুন",
"জুলাই",
"আগষ্ট",
"ছেপ্তেম্বৰ",
"অক্টোবৰ",
"নৱেম্বৰ",
"ডিচেম্বৰ",
}
}
}
quarters{
format{
wide{
"প্ৰথম প্ৰহৰ",
"দ্বিতীয় প্ৰহৰ",
"তৃতীয় প্ৰহৰ",
"চতুৰ্থ প্ৰহৰ",
}
}
}
}
}
fields{
day{
dn{"দিন"}
relative{
"-1"{"কালি"}
"1"{"কাইলৈ"}
"2"{"পৰহিলৈ"}
}
}
era{
dn{"যুগ"}
}
hour{
dn{"ঘণ্টা"}
}
minute{
dn{"মিনিট"}
}
month{
dn{"মাহ"}
}
second{
dn{"ছেকেণ্ড"}
}
week{
dn{"সপ্তাহ"}
}
year{
dn{"বছৰ"}
}
zone{
dn{"ক্ষেত্ৰ"}
}
}
measurementSystemNames{
US{"ইউ.এছ."}
metric{"মেট্ৰিক"}
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Validates a number as defined by the CSS spec.
*/
class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef
{
/**
* Indicates whether or not only positive values are allowed.
* @type bool
*/
protected $non_negative = false;
/**
* @param bool $non_negative indicates whether negatives are forbidden
*/
public function __construct($non_negative = false)
{
$this->non_negative = $non_negative;
}
/**
* @param string $number
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return string|bool
* @warning Some contexts do not pass $config, $context. These
* variables should not be used without checking HTMLPurifier_Length
*/
public function validate($number, $config, $context)
{
$number = $this->parseCDATA($number);
if ($number === '') {
return false;
}
if ($number === '0') {
return '0';
}
$sign = '';
switch ($number[0]) {
case '-':
if ($this->non_negative) {
return false;
}
$sign = '-';
case '+':
$number = substr($number, 1);
}
if (ctype_digit($number)) {
$number = ltrim($number, '0');
return $number ? $sign . $number : '0';
}
// Period is the only non-numeric character allowed
if (strpos($number, '.') === false) {
return false;
}
list($left, $right) = explode('.', $number, 2);
if ($left === '' && $right === '') {
return false;
}
if ($left !== '' && !ctype_digit($left)) {
return false;
}
$left = ltrim($left, '0');
$right = rtrim($right, '0');
if ($right === '') {
return $left ? $sign . $left : '0';
} elseif (!ctype_digit($right)) {
return false;
}
return $sign . $left . '.' . $right;
}
}
// vim: et sw=4 sts=4
|
{
"pile_set_name": "Github"
}
|
namespace KellermanSoftware.CompareNetObjectsTests.TestClasses
{
public interface ILabTestSpecimenStability
{
string TemperatureDescription
{
get;
set;
}
int TemperatureDescriptionTypeId
{
get;
set;
}
int DurationAtTemperature
{
get;
set;
}
string DurationTypeDescription
{
get;
set;
}
int DurationTypeId
{
get;
set;
}
bool IsPreferred
{
get;
set;
}
}
}
|
{
"pile_set_name": "Github"
}
|
seq1 Stellar eps-matches 203842 204051 95.3051 + . seq2;seq2Range=797542,797749;eValue=9.01857e-84;cigar=41M1D48M1D39M1I49M1D5M1I17M1D1M1D3M1I2M;mutations=27A,129A,148T,184C,206A
seq1 Stellar eps-matches 376267 376474 95.238 + . seq2;seq2Range=839295,839499;eValue=3.20309e-82;cigar=3M1D16M1D127M1D48M1I3M2D1M1I5M;mutations=111A,157A,195C,200T,204C
seq1 Stellar eps-matches 825759 825964 95.283 + . seq2;seq2Range=249212,249421;eValue=2.96448e-83;cigar=3M1I45M1I35M1D5M1D47M1I19M1I9M1I36M1I5M;mutations=4C,6C,50T,138A,158A,168T,199A,205C
seq1 Stellar eps-matches 35180 35383 95.1456 + . seq2;seq2Range=370909,371107;eValue=3.73947e-80;cigar=4M1I2M1D29M1D25M1I2M1D79M1D20M1D6M1D23M1D7M;mutations=5A,62G,195A
seq1 Stellar eps-matches 803348 803551 95.1219 + . seq2;seq2Range=319086,319285;eValue=1.2292e-79;cigar=20M1D56M1D6M1D53M1D37M1I27M1D;mutations=10T,101T,131T,173A,198A
seq1 Stellar eps-matches 788133 788335 95.1219 + . seq2;seq2Range=878118,878318;eValue=1.2292e-79;cigar=4M1D18M1D2M1I48M1D20M1D29M1I78M;mutations=3G,25G,35C,77G,123A,188G
seq1 Stellar eps-matches 271109 271310 95.1456 + . seq2;seq2Range=892735,892938;eValue=3.73947e-80;cigar=35M2I45M1D23M1I32M1I64M1D1M;mutations=27G,36G,37A,106G,139C,157T,188C,202G
seq1 Stellar eps-matches 417128 417328 95.169 + . seq2;seq2Range=395971,396175;eValue=1.13763e-80;cigar=61M1I46M1I31M1I42M1I1M1I13M1I5M2D;mutations=32A,62C,63G,109C,141A,184A,186G,200T
seq1 Stellar eps-matches 690816 691016 95.1456 + . seq2;seq2Range=187699,187902;eValue=3.73947e-80;cigar=45M1I27M1I48M1D9M1I19M1D44M1I1M1I6M;mutations=46G,74A,110T,132G,141G,196A,198T,201A
seq1 Stellar eps-matches 981047 981247 95.1456 + . seq2;seq2Range=643512,643715;eValue=3.73947e-80;cigar=74M1I24M1D34M1I15M1I8M1D11M1I31M1I2M;mutations=5C,75A,115A,134C,150C,170T,202C,203C
seq1 Stellar eps-matches 14903 15102 95.0495 + . seq2;seq2Range=614619,614815;eValue=4.36568e-78;cigar=64M1D26M1D15M1D31M1D2M1I4M1I30M1D23M;mutations=2A,5C,139T,144C,189A
seq1 Stellar eps-matches 151834 152033 95.098 + . seq2;seq2Range=513755,513956;eValue=4.04047e-79;cigar=45M1I23M1D9M1I36M1D3M1I64M1I18M;mutations=35C,46C,79A,119A,160C,184G,199C,201G
seq1 Stellar eps-matches 298523 298722 95.0738 + . seq2;seq2Range=139496,139691;eValue=1.32813e-78;cigar=11M1D29M1D14M1D44M1D2M1I13M1D28M1D44M1I1M1I2M1D5M;mutations=101C,187G,189C
seq1 Stellar eps-matches 704641 704840 95.0495 + . seq2;seq2Range=945073,945270;eValue=4.36568e-78;cigar=67M1D34M1D25M1D48M1I17M1D4M1I1M;mutations=2A,5T,89C,167A,175C,197T
seq1 Stellar eps-matches 823546 823745 95.098 + . seq2;seq2Range=116227,116424;eValue=4.04047e-79;cigar=4M1I41M1I20M1D2M1D28M1D9M1I27M1I21M1D41M2D1M;mutations=5T,47C,107G,135T
seq1 Stellar eps-matches 859412 859611 95.098 + . seq2;seq2Range=678027,678229;eValue=4.04047e-79;cigar=9M1I126M1I3M1I3M1I9M1D49M;mutations=3C,10G,13T,128A,137A,141A,145T,183T,185G
seq1 Stellar eps-matches 181072 181270 95.0738 + . seq2;seq2Range=626082,626282;eValue=1.32813e-78;cigar=16M1I48M1D89M1D6M1I5M1I5M1I28M;mutations=17T,88G,96G,161C,167G,173G,198C,199C
seq1 Stellar eps-matches 330607 330805 95.098 + . seq2;seq2Range=627125,627325;eValue=4.04047e-79;cigar=19M1I50M1D31M1D10M1I69M1D1M1I14M2I2M;mutations=20G,47G,112T,134C,183A,198A,199A
seq1 Stellar eps-matches 438336 438534 95.098 + . seq2;seq2Range=270288,270488;eValue=4.04047e-79;cigar=17M1I19M2I12M1D15M1I22M1D31M1I79M1D1M;mutations=4T,18G,38C,39T,67A,68A,121C
seq1 Stellar eps-matches 651384
|
{
"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.camel.component.file.remote;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class FromFtpRecursiveNoopTest extends FtpServerTestSupport {
protected String getFtpUrl() {
return "ftp://admin@localhost:" + getPort() + "/noop?password=admin&binary=false&initialDelay=3000"
+ "&recursive=true&noop=true";
}
@Override
@BeforeEach
public void setUp() throws Exception {
super.setUp();
template.sendBodyAndHeader(getFtpUrl(), "a", Exchange.FILE_NAME, "a.txt");
template.sendBodyAndHeader(getFtpUrl(), "b", Exchange.FILE_NAME, "b.txt");
template.sendBodyAndHeader(getFtpUrl(), "a2", Exchange.FILE_NAME, "foo/a.txt");
template.sendBodyAndHeader(getFtpUrl(), "c", Exchange.FILE_NAME, "bar/c.txt");
template.sendBodyAndHeader(getFtpUrl(), "b2", Exchange.FILE_NAME, "bar/b.txt");
}
@Test
public void testRecursiveNoop() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceivedInAnyOrder("a", "b", "a2", "c", "b2");
assertMockEndpointsSatisfied();
// reset mock and send in a new file to be picked up only
mock.reset();
mock.expectedBodiesReceived("c2");
template.sendBodyAndHeader(getFtpUrl(), "c2", Exchange.FILE_NAME, "c.txt");
assertMockEndpointsSatisfied();
}
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from(getFtpUrl()).convertBodyTo(String.class).to("log:ftp").to("mock:result");
}
};
}
}
|
{
"pile_set_name": "Github"
}
|
# -----------------------------------------------------------------------------
# yacc_badargs.py
#
# Rules with wrong # args
# -----------------------------------------------------------------------------
import sys
sys.tracebacklimit = 0
sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# Parsing rules
precedence = (
('left','PLUS','MINUS'),
('left','TIMES','DIVIDE'),
('right','UMINUS'),
)
# dictionary of names
names = { }
def p_statement_assign(t,s):
'statement : NAME EQUALS expression'
names[t[1]] = t[3]
def p_statement_expr():
'statement : expression'
print(t[1])
def p_expression_binop(t):
'''expression : expression PLUS expression
| expression MINUS expression
| expression TIMES expression
| expression DIVIDE expression'''
if t[2] == '+' : t[0] = t[1] + t[3]
elif t[2] == '-': t[0] = t[1] - t[3]
elif t[2] == '*': t[0] = t[1] * t[3]
elif t[2] == '/': t[0] = t[1] / t[3]
def p_expression_uminus(t):
'expression : MINUS expression %prec UMINUS'
t[0] = -t[2]
def p_expression_group(t):
'expression : LPAREN expression RPAREN'
t[0] = t[2]
def p_expression_number(t):
'expression : NUMBER'
t[0] = t[1]
def p_expression_name(t):
'expression : NAME'
try:
t[0] = names[t[1]]
except LookupError:
print("Undefined name '%s'" % t[1])
t[0] = 0
def p_error(t):
print("Syntax error at '%s'" % t.value)
yacc.yacc()
|
{
"pile_set_name": "Github"
}
|
{
"name": "odinlib",
"version": "0.2.0",
"description": "A nodejs package for gathering information in odin jobs",
"license": "MIT",
"repository": "github.com/theycallmemac/odin",
"main": "odin/odin.js",
"scripts": {
"test": "mocha"
},
"keywords": [
"odin",
"odinlib"
],
"dependencies": {
"yamljs": "^0.3.0"
},
"devDependencies": {
"eslint": "^7.4.0",
"eslint-config-google": "^0.14.0",
"mocha": "^7.2.0",
"mongodb": "^3.5.8"
}
}
|
{
"pile_set_name": "Github"
}
|
package mesosphere.marathon
package core.task.state
import com.typesafe.scalalogging.StrictLogging
import mesosphere.marathon.state._
import scala.jdk.CollectionConverters._
import org.apache.mesos
import scala.annotation.tailrec
/**
* Metadata about a task's networking information.
*
* @param hostPorts The hostPorts as taken originally from the accepted offer
* @param hostName the agent's hostName
* @param ipAddresses all associated IP addresses, computed from mesosStatus
*/
case class NetworkInfo(hostName: String, hostPorts: Seq[Int], ipAddresses: Seq[mesos.Protos.NetworkInfo.IPAddress]) {
import NetworkInfo._
/**
* compute the effective IP address based on whether the runSpec declares container-mode networking; if so
* then choose the first address from the list provided by Mesos. Otherwise, in host- and bridge-mode
* networking just use the agent hostname as the effective IP.
*
* we assume that container-mode networking is exclusive of bridge-mode networking.
*/
def effectiveIpAddress(runSpec: RunSpec): Option[String] = {
if (runSpec.networks.hasContainerNetworking) {
pickFirstIpAddressFrom(ipAddresses)
} else {
Some(hostName)
}
}
/**
* generate a list of possible port assignments, perhaps even including assignments for which no effective
* address or port is available. A returned `PortAssignment` for which there is no `effectiveAddress` will have
* have an `effectivePort` of `NoPort`.
*
* @param app the app run specification
* @param includeUnresolved when `true` include assignments without effective address and port
*/
def portAssignments(app: AppDefinition, includeUnresolved: Boolean): Seq[PortAssignment] = {
computePortAssignments(app, hostName, hostPorts, effectiveIpAddress(app), includeUnresolved)
}
/**
* Update the network info with the given mesos TaskStatus. This will eventually update ipAddresses and the
* effectiveIpAddress.
*
* Note: Only makes sense to call this the task just became running as the reported ip addresses are not
* expected to change during a tasks lifetime.
*/
def update(mesosStatus: mesos.Protos.TaskStatus): NetworkInfo = {
val newIpAddresses = resolveIpAddresses(mesosStatus)
if (ipAddresses != newIpAddresses) {
copy(ipAddresses = newIpAddresses)
} else {
// nothing has changed
this
}
}
}
object NetworkInfo extends StrictLogging {
/**
* Pick the IP address based on an ip address configuration as given in teh AppDefinition
*
* Only applicable if the app definition defines an IP address. PortDefinitions cannot be configured in addition,
* and we currently expect that there is at most one IP address assigned.
*/
private[state] def pickFirstIpAddressFrom(ipAddresses: Seq[mesos.Protos.NetworkInfo.IPAddress]): Option[String] = {
// Explicitly take the ipAddress from the first given object, if available. We do not expect to receive
// IPAddresses that do not define an ipAddress.
ipAddresses.headOption.map { ipAddress =>
require(ipAddress.hasIpAddress, s"$ipAddress does not define an ipAddress")
ipAddress.getIpAddress
}
}
def resolveIpAddresses(mesosStatus: mesos.Protos.TaskStatus): Seq[mesos.Protos.NetworkInfo.IPAddress] = {
if (mesosStatus.hasContainerStatus && mesosStatus.getContainerStatus.getNetworkInfosCount > 0) {
mesosStatus.getContainerStatus.getNetworkInfosList.asScala.iterator.flatMap(_.getIpAddressesList.asScala).toSeq
} else {
Nil
}
}
private def computePortAssignments(
app: AppDefinition,
hostName: String,
hostPorts: Seq[Int],
effectiveIpAddress: Option[String],
includeUnresolved: Boolean
): Seq[PortAssignment] = {
def fromPortMappings(container: Container): Seq[PortAssignment] = {
import Container.PortMapping
@tailrec
def gen(ports: List[Int], mappings: List[PortMapping], assignments: List[PortAssignment]): List[PortAssignment] = {
(ports, mappings) match {
case (hostPort :: xs, PortMapping(containerPort, Some(_), _, _, portName, _, _) :: rs) =>
// agent port was requested, and we strongly prefer agentIP:hostPort (legacy reasons?)
val assignment = PortAssignment(
portName = portName,
effectiveIpAddress = Option(hostName),
effectivePort = hostPort,
hostPort = Option(hostPort),
// See [[TaskBuilder.computeContainerInfo.boundPortMappings]] for more info.
containerPort = if (containerPort == 0) Option(hostPort) else Option(containerPort)
)
gen(xs, rs, assignment :: assignments)
case (_, mapping :: rs) if mapping.hostPort.isEmpty =>
// no port was requested on the agent (really, this is only possible for container networking)
val assignment = PortAssignment(
portName = mapping.name,
// if there's no assigned IP and we have no host port, then this container isn't reachable
effectiveIpAddress = effectiveIpAddress,
// just pick containerPort; we don't have an agent port to fall back on regardless,
// of effectiveIp or hasAssignedIpAddress
effectivePort = effectiveIpAddress.fold(PortAssignment.NoPort)(_ => mapping.containerPort),
hostPort = None,
containerPort = Some(mapping.containerPort)
)
gen(ports, rs, assignment :: assignments)
case (Nil, Nil) =>
assignments
case _ =>
throw new IllegalStateException(
s"failed to align remaining allocated host ports $ports with remaining declared port mappings $mappings in app ${app.id}"
)
}
}
gen(hostPorts.to(List), container.portMappings.to(List), Nil).reverse
}
def fromPortDefinitions: Seq[PortAssignment] =
app.portDefinitions.zip(hostPorts).map {
case (portDefinition, hostPort) =>
PortAssignment(
portName = portDefinition.name,
effectiveIpAddress = effectiveIpAddress,
effectivePort = hostPort,
hostPort = Some(hostPort)
)
}
app.container.collect {
case c: Container if app.networks.hasNonHostNetworking =>
// don't return assignments that haven't yet been allocated a port
val mappings = fromPortMappings(c)
if (includeUnresolved) mappings else mappings.filter(_.isResolved)
}.getOrElse(fromPortDefinitions)
}
}
|
{
"pile_set_name": "Github"
}
|
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful'
# end
|
{
"pile_set_name": "Github"
}
|
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <unistd.h>
#include "macro.h"
#include "string.h"
static inline size_t sc_arg_max(void) {
long l = sysconf(_SC_ARG_MAX);
assert(l > 0);
return (size_t) l;
}
bool env_name_is_valid(const char *e);
bool env_value_is_valid(const char *e);
bool env_assignment_is_valid(const char *e);
enum {
REPLACE_ENV_USE_ENVIRONMENT = 1 << 0,
REPLACE_ENV_ALLOW_BRACELESS = 1 << 1,
REPLACE_ENV_ALLOW_EXTENDED = 1 << 2,
};
#if 0 /// UNNEEDED by elogind
char *replace_env_n(const char *format, size_t n, char **env, unsigned flags);
char **replace_env_argv(char **argv, char **env);
static inline char *replace_env(const char *format, char **env, unsigned flags) {
return replace_env_n(format, strlen(format), env, flags);
}
bool strv_env_is_valid(char **e);
#define strv_env_clean(l) strv_env_clean_with_callback(l, NULL, NULL)
char **strv_env_clean_with_callback(char **l, void (*invalid_callback)(const char *p, void *userdata), void *userdata);
bool strv_env_name_is_valid(char **l);
bool strv_env_name_or_assignment_is_valid(char **l);
char **strv_env_merge(size_t n_lists, ...);
char **strv_env_delete(char **x, size_t n_lists, ...); /* New copy */
char **strv_env_set(char **x, const char *p); /* New copy ... */
#endif // 0
char **strv_env_unset(char **l, const char *p); /* In place ... */
#if 0 /// UNNEEDED by elogind
char **strv_env_unset_many(char **l, ...) _sentinel_;
#endif // 0
int strv_env_replace(char ***l, char *p); /* In place ... */
#if 0 /// UNNEEDED by elogind
char *strv_env_get_n(char **l, const char *name, size_t k, unsigned flags) _pure_;
char *strv_env_get(char **x, const char *n) _pure_;
#endif // 0
int getenv_bool(const char *p);
int getenv_bool_secure(const char *p);
|
{
"pile_set_name": "Github"
}
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sw=4 et tw=99:
*
* 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 jsdbgapi_h___
#define jsdbgapi_h___
/*
* JS debugger API.
*/
#include "jsapi.h"
#include "jsprvtd.h"
namespace JS {
struct FrameDescription
{
JSScript *script;
unsigned lineno;
JSFunction *fun;
};
struct StackDescription
{
unsigned nframes;
FrameDescription *frames;
};
extern JS_PUBLIC_API(StackDescription *)
DescribeStack(JSContext *cx, unsigned maxFrames);
extern JS_PUBLIC_API(void)
FreeStackDescription(JSContext *cx, StackDescription *desc);
extern JS_PUBLIC_API(char *)
FormatStackDump(JSContext *cx, char *buf,
JSBool showArgs, JSBool showLocals,
JSBool showThisProps);
}
# ifdef DEBUG
JS_FRIEND_API(void) js_DumpValue(const js::Value &val);
JS_FRIEND_API(void) js_DumpId(jsid id);
JS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);
# endif
JS_FRIEND_API(void)
js_DumpBacktrace(JSContext *cx);
extern JS_PUBLIC_API(JSCompartment *)
JS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);
extern JS_PUBLIC_API(JSString *)
JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);
/*
* Currently, we only support runtime-wide debugging. In the future, we should
* be able to support compartment-wide debugging.
*/
extern JS_PUBLIC_API(void)
JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);
/*
* Debug mode is a compartment-wide mode that enables a debugger to attach
* to and interact with running methodjit-ed frames. In particular, it causes
* every function to be compiled as if an eval was present (so eval-in-frame)
* can work, and it ensures that functions can be re-JITed for other debug
* features. In general, it is not safe to interact with frames that were live
* before debug mode was enabled. For this reason, it is also not safe to
* enable debug mode while frames are live.
*/
/* Get current state of debugging mode. */
extern JS_PUBLIC_API(JSBool)
JS_GetDebugMode(JSContext *cx);
/*
* Turn on/off debugging mode for all compartments. This returns false if any code
* from any of the runtime's compartments is running or on the stack.
*/
JS_FRIEND_API(JSBool)
JS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);
/*
* Turn on/off debugging mode for a single compartment. This should only be
* used when no code from this compartment is running or on the stack in any
* thread.
*/
JS_FRIEND_API(JSBool)
JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);
/*
* Turn on/off debugging mode for a context's compartment.
*/
JS_FRIEND_API(JSBool)
JS_SetDebugMode(JSContext *cx, JSBool debug);
/* Turn on single step mode. */
extern JS_PUBLIC_API(JSBool)
JS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);
/* The closure argument will be marked. */
extern JS_PUBLIC_API(JSBool)
JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
JSTrapHandler handler, jsval closure);
extern JS_PUBLIC_API(void)
JS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
JSTrapHandler *handlerp, jsval *closurep);
extern JS_PUBLIC_API(void)
JS_ClearScriptTraps(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(void)
JS_ClearAllTrapsForCompartment(JSContext *cx);
extern JS_PUBLIC_API(JSBool)
JS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);
extern JS_PUBLIC_API(JSBool)
JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);
/************************************************************************/
extern JS_PUBLIC_API(JSBool)
JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,
JSWatchPointHandler handler, JSObject *closure);
extern JS_PUBLIC_API(JSBool)
JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,
JSWatchPointHandler *handlerp, JSObject **closurep);
extern JS_PUBLIC_API(JSBool)
JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);
extern JS_PUBLIC_API(JSBool)
JS_ClearAllWatchPoints(JSContext *cx);
/************************************************************************/
// RawScript because this needs to be callable from a signal handler
extern JS_PUBLIC_API(unsigned)
JS_PCToLineNumber(JSContext *cx, js::RawScript script, jsbytecode *pc);
extern JS_PUBLIC_API(jsbytecode *)
JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);
extern JS_PUBLIC_API(jsbytecode *)
JS_EndPC(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(JSBool)
JS_GetLinePCs(JSContext *cx, JSScript *script,
unsigned startLine, unsigned maxLines,
unsigned* count, unsigned** lines, jsbytecode*** pcs);
extern JS_PUBLIC_API(unsigned)
JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);
extern JS_PUBLIC_API(JSBool)
JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);
/*
* N.B. The mark is in the context temp pool and thus the caller must take care
* to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other
* call that may use the temp pool.
*/
extern JS_PUBLIC_API(uintptr_t *)
JS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);
extern JS_PUBLIC_API(JSAtom *)
JS_LocalNameToAtom(uintptr_t w);
extern JS_PUBLIC_API(JSString *)
JS_AtomKey(JSAtom *atom);
extern JS_PUBLIC_API(void)
JS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);
extern JS_PUBLIC_API(JSScript *)
JS_GetFunctionScript(JSContext *cx, JSFunction *fun);
extern JS_PUBLIC_API(JSNative)
JS_GetFunctionNative(JSContext *cx, JSFunction *fun);
extern JS_PUBLIC_API(JSPrincipals *)
JS_GetScriptPrincipals(JSScript *script);
extern JS_PUBLIC_API(JSPrincipals *)
JS_GetScriptOriginPrincipals(JSScript *script);
JS_PUBLIC_API(JSFunction *)
JS_GetScriptFunction(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(JSObject *)
JS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);
/************************************************************************/
/*
* This is almost JS_GetClass(obj)->name except that certain debug-only
* proxies are made transparent. In particular, this function turns the class
|
{
"pile_set_name": "Github"
}
|
.. index:: balancing; operations
.. index:: balancing; configure
===============================
Manage Sharded Cluster Balancer
===============================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
.. versionchanged:: 3.4
The balancer process has moved from the :binary:`~bin.mongos` instances
to the primary member of the config server replica set.
This page describes common administrative procedures related
to balancing. For an introduction to balancing, see
:ref:`sharding-balancing`. For lower level information on balancing, see
:ref:`sharding-balancing-internals`.
.. important::
Use the version of the :binary:`~bin.mongo` shell that corresponds to
the version of the sharded cluster. For example, do not use a 3.2 or
earlier version of :binary:`~bin.mongo` shell against the 3.4 sharded
cluster.
Check the Balancer State
------------------------
:method:`sh.getBalancerState()` checks if the balancer is enabled (i.e. that the
balancer is permitted to run). :method:`sh.getBalancerState()` does not check if the balancer
is actively balancing chunks.
To see if the balancer is enabled in your :term:`sharded cluster`,
issue the following command, which returns a boolean:
.. code-block:: javascript
sh.getBalancerState()
You can also see if the balancer is enabled using :method:`sh.status()`.
The :data:`~sh.status.balancer.currently-enabled` field indicates
whether the balancer is enabled, while the
:data:`~sh.status.balancer.currently-running` field indicates if the
balancer is currently running.
.. _sharding-balancing-is-running:
Check if Balancer is Running
----------------------------
To see if the balancer process is active in your :term:`cluster
<sharded cluster>`:
.. important::
Use the version of the :binary:`~bin.mongo` shell that corresponds to
the version of the sharded cluster. For example, do not use a 3.2 or
earlier version of :binary:`~bin.mongo` shell against the 3.4 sharded
cluster.
#. Connect to any :binary:`~bin.mongos` in the cluster using the
:binary:`~bin.mongo` shell.
#. Use the following operation to determine if the balancer is running:
.. code-block:: javascript
sh.isBalancerRunning()
.. _sharded-cluster-config-default-chunk-size:
Configure Default Chunk Size
----------------------------
The default chunk size for a sharded cluster is 64 megabytes. In most
situations, the default size is appropriate for splitting and migrating
chunks. For information on how chunk size affects deployments, see
details, see :ref:`sharding-chunk-size`.
Changing the default chunk size affects chunks that are processes during
migrations and auto-splits but does not retroactively affect all chunks.
To configure default chunk size, see
:doc:`modify-chunk-size-in-sharded-cluster`.
.. _sharding-schedule-balancing-window:
.. _sharded-cluster-config-balancing-window:
Schedule the Balancing Window
-----------------------------
In some situations, particularly when your data set grows slowly and a
migration can impact performance, it is useful to ensure
that the balancer is active only at certain times. The following
procedure specifies the ``activeWindow``,
which is the timeframe during which the :term:`balancer` will
be able to migrate chunks:
.. include:: /includes/steps/schedule-balancer-window.rst
.. _sharding-balancing-remove-window:
Remove a Balancing Window Schedule
----------------------------------
If you have :ref:`set the balancing window
<sharding-schedule-balancing-window>` and wish to remove the schedule
so that the balancer is always running, use :update:`$unset` to clear
the ``activeWindow``, as in the following:
.. code-block:: javascript
use config
db.settings.update({ _id : "balancer" }, { $unset : { activeWindow : true } })
.. _sharding-balancing-disable-temporally:
.. _sharding-balancing-disable-temporarily:
Disable the Balancer
--------------------
By default, the balancer may run at any time and only moves chunks as
needed. To disable the balancer for a short period of time and prevent
all migration, use the following procedure:
#. Connect to any :binary:`~bin.mongos` in the cluster using the
:binary:`~bin.mongo` shell.
#. Issue the following operation to disable the balancer:
.. code-block:: javascript
sh.stopBalancer()
If a migration is in progress, the system will complete the
in-progress migration before stopping.
.. include:: /includes/extracts/4.2-changes-stop-balancer-autosplit.rst
#. To verify that the balancer will not start, issue the following command,
which returns ``false`` if the balancer is disabled:
.. code-block:: javascript
sh.getBalancerState()
Optionally, to verify no migrations are in progress after disabling,
issue the following operation in the :binary:`~bin.mongo` shell:
.. code-block:: javascript
use config
while( sh.isBalancerRunning() ) {
print("waiting...");
sleep(1000);
}
.. note::
To disable the balancer from a driver,
use the :command:`balancerStop` command against the ``admin`` database,
as in the following:
.. code-block:: javascript
db.adminCommand( { balancerStop: 1 } )
.. _sharding-balancing-re-enable:
.. _sharding-balancing-enable:
Enable the Balancer
-------------------
Use this procedure if you have disabled the balancer and are ready to
re-enable it:
#. Connect to any :binary:`~bin.mongos` in the cluster using the
:binary:`~bin.mongo` shell.
#. Issue one of the following operations to enable the balancer:
From the :binary:`~bin.mongo` shell, issue:
.. code-block:: javascript
sh.startBalancer()
.. note::
To enable the balancer from a driver, use the :command:`balancerStart`
command against the ``admin`` database, as in the following:
.. code-block:: javascript
db.adminCommand( { balancerStart: 1 } )
.. include:: /includes/extracts/4.2-changes-start-balancer-autosplit.rst
Disable Balancing During Backups
--------------------------------
If MongoDB migrates a :term:`chunk` during a :doc:`backup
</core/backups>`, you can end with an inconsistent snapshot
of your :term:`sharded cluster`. Never run a backup while the balancer is
active. To ensure that the balancer is inactive during your backup
operation:
- Set the :ref:`balancing window <sharding-schedule-balancing-window>`
so that the balancer is inactive during the backup. Ensure that the
backup can complete while you have the balancer disabled.
- :ref:`manually disable the balancer <sharding-balancing-disable-temporarily>`
for the duration of the backup procedure.
If you turn the balancer off while it is in the middle of a balancing round,
the shut down is not instantaneous. The balancer completes the chunk
move in-progress and then ceases all further balancing rounds.
Before starting a backup operation, confirm that the balancer is not
active. You can use the following command to determine if the balancer
is active:
.. code-block:: javascript
!sh.getBalancerState() && !sh.isBalancerRunning()
When the backup procedure is complete you can reactivate
the balancer process.
Disable Balancing on a Collection
---------------------------------
You can disable balancing for a specific collection with the
:method:`sh.disableBalancing()` method. You may want to disable the
balancer for a specific collection to support maintenance operations or
atypical workloads, for example, during data ingestions or data exports.
When you disable balancing on a collection, MongoDB will not interrupt in
progress migrations.
To disable balancing on a collection, connect to a :binary:`~bin.mongos`
with the :binary:`~bin.mongo
|
{
"pile_set_name": "Github"
}
|
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { Link } from '@reach/router';
import { Utils } from '../../../utils/utils.js';
import { siteRoot } from '../../../utils/constants';
const GroupItemPropTypes = {
group: PropTypes.object.isRequired,
showSetGroupQuotaDialog: PropTypes.func.isRequired,
showDeleteDepartDialog: PropTypes.func.isRequired,
};
class GroupItem extends React.Component {
constructor(props) {
super(props);
this.state = {
highlight: false,
};
}
onMouseEnter = () => {
this.setState({ highlight: true });
}
onMouseLeave = () => {
this.setState({ highlight: false });
}
render() {
const group = this.props.group;
const highlight = this.state.highlight;
const newHref = siteRoot+ 'sys/departments/' + group.id + '/';
return (
<tr className={highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
<td><Link to={newHref}>{group.name}</Link></td>
<td>{moment(group.created_at).fromNow()}</td>
<td onClick={this.props.showSetGroupQuotaDialog.bind(this, group.id)}>
{Utils.bytesToSize(group.quota)}{' '}
<span title="Edit Quota" className={`fa fa-pencil-alt attr-action-icon ${highlight ? '' : 'vh'}`}></span>
</td>
<td className="cursor-pointer text-center" onClick={this.props.showDeleteDepartDialog.bind(this, group)}>
<span className={`sf2-icon-delete action-icon ${highlight ? '' : 'vh'}`} title="Delete"></span>
</td>
</tr>
);
}
}
GroupItem.propTypes = GroupItemPropTypes;
export default GroupItem;
|
{
"pile_set_name": "Github"
}
|
// re2c $INPUT -o $OUTPUT -i --input custom
// overlapping trailing contexts of variable length:
// we need multiple tags and we cannot deduplicate them
/*!re2c
"ab" / "c"{2,} { 0 }
"a" / "b"* { 1 }
* { d }
*/
|
{
"pile_set_name": "Github"
}
|
---
exp_name: qm8_gat
exp_dir: exp/qm8_gat
runner: QM8Runner
use_gpu: true
gpus: [0]
seed: 1234
dataset:
loader_name: QM8Data
name: chemistry
data_path: data/QM8/preprocess
meta_data_path: data/QM8/QM8_meta.p
num_atom: 70
num_bond_type: 6
model:
name: GAT
input_dim: 64
hidden_dim: [16, 16, 16, 16, 16, 16, 16]
num_layer: 7
num_heads: [8, 8, 8, 8, 8, 8, 8]
output_dim: 16
dropout: 0.0
loss: MSE
train:
optimizer: Adam
lr_decay: 0.1
lr_decay_steps: [10000]
num_workers: 4
max_epoch: 200
batch_size: 64
display_iter: 100
snapshot_epoch: 10000
valid_epoch: 1
lr: 1.0e-4
wd: 0.0e-4
momentum: 0.9
shuffle: true
is_resume: false
resume_model: None
test:
batch_size: 64
num_workers: 0
test_model:
|
{
"pile_set_name": "Github"
}
|
// This data is machine generated from the WDS database
// Contains STT objects to magnitude 8.5
// Do NOT edit this data manually. Rather, fix the import formulas.
#define Cat_STT_Title "Slct STT**"
#define Cat_STT_Prefix "STT"
#define NUM_STT 114
const char *Cat_STT_Names=
"F8V;"
"F2;"
"B8V+B9V;"
"B4V+K3III;"
"A0V;"
"A9IV;"
"F8;"
"A0V;"
"B8V+A0V;"
"A2IV;"
"B9Vp;"
"F8;"
"A2V;"
"G0;"
"A3+G5;"
"A2V+A5V;"
"K3I-II;"
"F8V;"
"A1pSi;"
"K0IV;"
"G0;"
"A1V;"
"A5m;"
"B5I;"
"Am;"
"B9;"
"G0;"
"B9Vn;"
"A5;"
"K2III+A5V;"
"B7III;"
"A2V;"
"G8III+F8V;"
"A2;"
"G0IV-V;"
"F0;"
"K0III;"
"A2;"
"F7V;"
"A4V;"
"A1.5V;"
"F8;"
"A2V;"
"A9IV;"
"A5IV;"
"F6V;"
"F8V;"
"F7V;"
"F6V;"
"F5;"
"A6III;"
"F9V;"
"K2V;"
"K2V+K0;"
"F7V;"
"G8IIIab;"
"G8-IIIab;"
"F9IV;"
"A2Vs;"
"G8III;"
"G0V;"
"A4III;"
"G5;"
"B7V+B9V;"
"F8V;"
"G0V;"
"G9III-IV;"
"F0IV;"
"A2;"
"A9IV;"
"F7V;"
"B8V;"
"A3V+G0III;"
"B5III;"
"B9.5V;"
"B5V;"
"F6V;"
"B9.5V;"
"A3V;"
"F2III;"
"B9IV-V;"
"B8IIIpMn;"
"B5Ve;"
"A0;"
"G0;"
"F8V;"
"K0;"
"G4V;"
"K0III;"
"B2.5Ve;"
"A0V;"
"B1V;"
"B1V;"
"A;"
"B9III;"
"A1V+G:;"
"A8III;"
"A3;"
"G0IV;"
"B2V;"
"B8V;"
"A0p;"
"A0p;"
"A3Iae;"
"A6V;"
"B7Ve;"
"A5V;"
"A2V;"
"F6V+F6V;"
"G2V+G4V;"
"A0pSi;"
"G5V;"
"K0;"
"G1V;"
;
const char *Cat_STT_SubId=
"AB;"
"AB;"
"AC;"
"BC;"
"AB;"
"AC;"
"AB;"
"AB;"
"AB;"
"AC;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB,C;"
"AB;"
"AB;"
"AB,C;"
"AB;"
"AB,G;"
"Aa,Ab;"
"AC;"
"AB;"
"AB;"
"AB,C;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AE;"
"AB;"
"AD;"
"AE;"
"DE;"
"EF;"
"A,BC;"
"AB;"
"AB;"
"AB;"
"AC;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AB;"
"AC;"
"AC;"
;
CAT_TYPES Cat_STT_Type=CAT_DBL_STAR_COMP;
const dbl_star_comp_t Cat_STT[NUM_STT] = {
{ 1, 0, 24, 1, 2, 4, 157, 102, 93, 610, 9826 },
{ 1, 0, 24, 0, 11, 1966, 317, 102, 101, 1396, 11700 },
{ 1, 16, 10, 0, 12, 2, 210, 81, 78, 1446, 19850 },
{ 1, 16, 24, 0, 15, 3, 319, 106, 100, 1630, 17848 },
{ 1, 66, 90, 1, 20, 7, 177, 97, 86, 2484, 6986 },
{ 1, 0, 24, 0, 21, 13, 175, 106, 93, 2868, 17249 },
{ 1, 66, 24, 1, 30, 567, 106, 106, 106, 3894, 11487 },
{ 1, 18, 24, 0, 34, 5, 285, 106, 101, 5001, 29449 },
{ 1, 0, 2, 1, 38, 2, 96, 90, 78, 5639, 15411 },
{ 1, 62, 24, 1, 42, 1, 301, 105, 96, 6978, 19045 },
{ 1, 62, 24, 1, 44, 872, 290, 108, 110, 7383, 15546 },
{ 1, 16, 24, 1, 50, 10, 146, 110, 109, 8768, 26052 },
{ 1, 13, 24, 1, 52, 5, 56, 99, 96, 8990, 23905 },
{ 1, 62, 24, 1, 53, 6, 233, 110, 102, 8999, 14068 },
{ 1, 77, 24, 1, 57, 687, 33, 102, 97, 9712, 8508 },
{ 1, 77, 24, 0, 65, 4, 202, 90, 82, 10482, 9313 },
{ 1, 13, 24, 0, 67, 17, 49, 106, 78, 10792, 22248 },
{ 1, 62, 24, 1, 77, 5, 298, 107, 105, 11648, 11539 },
{ 1, 62, 24, 0, 80, 3, 152, 109, 89, 11997, 15447 },
{ 1, 77, 24, 0, 84, 95, 255, 106, 97, 12337, 2473 },
{ 1, 13, 24, 0, 88, 8, 307, 108, 97, 13529, 22483 },
{ 1, 13, 24, 0, 89, 4, 301, 98, 90, 13865, 26966 },
{ 1, 77, 24, 0, 95, 10, 296, 101, 95, 13905, 7211 },
{ 1, 77, 24, 0, 97, 4, 149, 109, 95, 13909, 8396 },
{ 1, 59, 38, 0, 98, 10, 286, 92, 83, 14012, 3094 },
{ 1, 7, 24, 0, 112, 9, 47, 107, 104, 15469, 13820 },
{ 1, 77, 24, 1, 115,
|
{
"pile_set_name": "Github"
}
|
{% trans_default_domain 'cocorico_booking' %}
{% embed "@CocoricoCore/Dashboard/layout_show_bill.html.twig" %}
{% trans_default_domain 'cocorico_booking' %}
{% set booking = booking_payin_refund.booking %}
{#Currency values#}
{% set amount_dec = booking_payin_refund.amountDecimal %}
{% set amount_fees_dec = booking.amountFeeAsAskerDecimal %}
{% set amount_excl_vat_dec = amount_fees_dec / (1 + vatRate) %}
{% set amount_vat_dec = amount_fees_dec - amount_excl_vat_dec %}
{#Currency formated#}
{% set amount = amount_dec | format_price(app.request.locale, 2) %}
{% set amount_fees = amount_fees_dec | format_price(app.request.locale, 2) %}
{% set amount_vat = amount_vat_dec | format_price(app.request.locale, 2) %}
{% set amount_excl_vat = amount_excl_vat_dec | format_price(app.request.locale, 2) %}
{#Vars#}
{% set listing = booking.listing %}
{% set listing_translation = listing.translations[app.request.locale] %}
{% set user = booking.user %}
{% set user_timezone = booking.timeZoneAsker %}
{% set user_address = booking.user.getAddresses %}
{% set user_address = (user_address is empty) ? null : user_address[0] %}
{% set bill_date_title = 'booking.bill.date.title'|trans %}
{% set bill_date = booking_payin_refund.getPayedAt ? booking_payin_refund.getPayedAt|localizeddate('short', 'none', 'fr', user_timezone) : '' %}
{% set isRefund = true %}
{% endembed %}
|
{
"pile_set_name": "Github"
}
|
/*=============================================================================
Copyright (c) 2011 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED)
#define BOOST_FUSION_ITERATOR_RANGE_IS_SEGMENTED_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct iterator_range_tag;
template <typename Context>
struct segmented_iterator;
namespace extension
{
template <typename Tag>
struct is_segmented_impl;
// An iterator_range of segmented_iterators is segmented
template <>
struct is_segmented_impl<iterator_range_tag>
{
private:
template <typename Iterator>
struct is_segmented_iterator
: mpl::false_
{};
template <typename Iterator>
struct is_segmented_iterator<Iterator &>
: is_segmented_iterator<Iterator>
{};
template <typename Iterator>
struct is_segmented_iterator<Iterator const>
: is_segmented_iterator<Iterator>
{};
template <typename Context>
struct is_segmented_iterator<segmented_iterator<Context> >
: mpl::true_
{};
public:
template <typename Sequence>
struct apply
: is_segmented_iterator<typename Sequence::begin_type>
{
BOOST_MPL_ASSERT_RELATION(
is_segmented_iterator<typename Sequence::begin_type>::value
, ==
, is_segmented_iterator<typename Sequence::end_type>::value);
};
};
}
}}
#endif
|
{
"pile_set_name": "Github"
}
|
/**
*
*/
package com.javaaid.hackerrank.solutions.languages.java.datastructures;
import java.util.Scanner;
/**
* @author Kanahaiya Gupta
*
*/
public class Java2DArray {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int arr[][] = new int[6][6];
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
arr[i][j] = in.nextInt();
}
}
int maxSum = Integer.MIN_VALUE, sum = 0;
;
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
if ((i + 2 < 6) && (j + 2) < 6) {
sum = arr[i][j] + arr[i][j + 1] + arr[i][j + 2] + arr[i + 1][j + 1] + arr[i + 2][j]
+ arr[i + 2][j + 1] + arr[i + 2][j + 2];
if (sum > maxSum)
maxSum = sum;
}
}
}
System.out.println(maxSum);
in.close();
}
}
|
{
"pile_set_name": "Github"
}
|
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1000012634256044}
m_IsPrefabParent: 1
--- !u!1 &1000012634256044
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 4000011272021182}
m_Layer: 0
m_Name: Weird Table
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000012934959352
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 4000012105117130}
- 33: {fileID: 33000011438450836}
- 23: {fileID: 23000010191256184}
- 64: {fileID: 64000010941696098}
m_Layer: 0
m_Name: Table (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000013687127692
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 4000010213783964}
- 33: {fileID: 33000013398391394}
- 23: {fileID: 23000010364422500}
- 64: {fileID: 64000013517629686}
m_Layer: 0
m_Name: Table (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000010213783964
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013687127692}
m_LocalRotation: {x: -0.7071068, y: 0.00011705608, z: -0.00011731009, w: 0.70710677}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 21.321606, y: 62.18895, z: 100.00003}
m_LocalEulerAnglesHint: {x: -89.981, y: 0, z: -0.018000001}
m_Children: []
m_Father: {fileID: 4000011272021182}
m_RootOrder: 0
--- !u!4 &4000011272021182
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012634256044}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.190001, y: 0, z: -3.169}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 4000010213783964}
- {fileID: 4000012105117130}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!4 &4000012105117130
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012934959352}
m_LocalRotation: {x: -0.50008297, y: -0.49991712, z: -0.5000828, w: 0.49991724}
m_LocalPosition: {x: 0, y: -0.001, z: 0}
m_LocalScale: {x: 39.279137, y: 30.309559, z: 100.00009}
m_LocalEulerAnglesHint: {x: -89.981, y: 0, z: -90.018005}
m_Children: []
m_Father: {fileID: 4000011272021182}
m_RootOrder: 1
--- !u!23 &23000010191256184
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012934959352}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: d07127d506ba1204e94715378a104735, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &23000010364422500
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013687127692}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: d07127d506ba1204e94715378a104735, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &33000011438450836
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_Game
|
{
"pile_set_name": "Github"
}
|
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
package com.twilio.rest.preview.understand.assistant.task;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.twilio.Twilio;
import com.twilio.converter.DateConverter;
import com.twilio.converter.Promoter;
import com.twilio.exception.TwilioException;
import com.twilio.http.HttpMethod;
import com.twilio.http.Request;
import com.twilio.http.Response;
import com.twilio.http.TwilioRestClient;
import com.twilio.rest.Domains;
import mockit.Mocked;
import mockit.NonStrictExpectations;
import org.junit.Before;
import org.junit.Test;
import java.net.URI;
import static com.twilio.TwilioTest.serialize;
import static org.junit.Assert.*;
public class FieldTest {
@Mocked
private TwilioRestClient twilioRestClient;
@Before
public void setUp() throws Exception {
Twilio.init("AC123", "AUTH TOKEN");
}
@Test
public void testFetchRequest() {
new NonStrictExpectations() {{
Request request = new Request(HttpMethod.GET,
Domains.PREVIEW.toString(),
"/understand/Assistants/UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Tasks/UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Fields/UEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
twilioRestClient.request(request);
times = 1;
result = new Response("", 500);
twilioRestClient.getAccountSid();
result = "AC123";
}};
try {
Field.fetcher("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch();
fail("Expected TwilioException to be thrown for 500");
} catch (TwilioException e) {}
}
@Test
public void testFetchResponse() {
new NonStrictExpectations() {{
twilioRestClient.request((Request) any);
result = new Response("{\"url\": \"https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"unique_name\": \"unique_name\",\"date_updated\": \"2015-07-30T20:00:00Z\",\"assistant_sid\": \"UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"task_sid\": \"UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"date_created\": \"2015-07-30T20:00:00Z\",\"sid\": \"UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"field_type\": \"field_type\"}", TwilioRestClient.HTTP_STATUS_CODE_OK);
twilioRestClient.getObjectMapper();
result = new ObjectMapper();
}};
assertNotNull(Field.fetcher("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch());
}
@Test
public void testReadRequest() {
new NonStrictExpectations() {{
Request request = new Request(HttpMethod.GET,
Domains.PREVIEW.toString(),
"/understand/Assistants/UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Tasks/UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Fields");
twilioRestClient.request(request);
times = 1;
result = new Response("", 500);
twilioRestClient.getAccountSid();
result = "AC123";
}};
try {
Field.reader("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").read();
fail("Expected TwilioException to be thrown for 500");
} catch (TwilioException e) {}
}
@Test
public void testReadEmptyResponse() {
new NonStrictExpectations() {{
twilioRestClient.request((Request) any);
result = new Response("{\"fields\": [],\"meta\": {\"page\": 0,\"first_page_url\": \"https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0\",\"url\": \"https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0\",\"key\": \"fields\",\"next_page_url\": null,\"previous_page_url\": null,\"page_size\": 50}}", TwilioRestClient.HTTP_STATUS_CODE_OK);
twilioRestClient.getObjectMapper();
result = new ObjectMapper();
}};
assertNotNull(Field.reader("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").read());
}
@Test
public void testReadFullResponse() {
new NonStrictExpectations() {{
twilioRestClient.request((Request) any);
result = new Response("{\"fields\": [{\"url\": \"https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"unique_name\": \"unique_name\",\"date_updated\": \"2015-07-30T20:00:00Z\",\"assistant_sid\": \"UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"task_sid\": \"UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"date_created\": \"2015-07-30T20:00:00Z\",\"sid\": \"UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"field_type\": \"field_type\"}],\"meta\": {\"page\": 0,\"first_page_url\": \"https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0\",\"url\": \"https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0\",\"key\": \"fields\",\"next_page_url\": null,\"previous_page_url\": null,\"page_size\": 50}}", TwilioRestClient.HTTP_STATUS_CODE_OK);
twilioRestClient.getObjectMapper();
result = new ObjectMapper();
}};
assertNotNull(Field.reader("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").read());
}
@Test
public void testCreateRequest() {
new NonStrictExpectations() {{
Request request = new Request(HttpMethod.POST,
Domains.PREVIEW.toString(),
"/understand/Assistants/UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Tasks/UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Fields");
request.addPostParam("FieldType", serialize("field_type"));
request.addPostParam("UniqueName", serialize("unique_name"));
twilioRestClient.request(request);
times = 1;
result = new Response("", 500);
twilioRestClient.getAccountSid();
result = "AC123";
}};
try {
Field.creator("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "field_type", "unique_name").create();
fail("Expected TwilioException to be thrown for 500");
} catch (TwilioException e) {}
}
@Test
public void testCreateResponse() {
new NonStrictExpectations() {{
twilioRestClient.request((Request) any);
result = new Response("{\"url\": \"https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"unique_name\": \"unique_name\",\"date_updated\": \"2015-07-30T20:00:00Z\",\"assistant_sid\": \"UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"task_sid\": \"UDaaaaaaaaaaaaaaaa
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotthingsgraph/model/DescribeNamespaceRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTThingsGraph::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeNamespaceRequest::DescribeNamespaceRequest() :
m_namespaceNameHasBeenSet(false)
{
}
Aws::String DescribeNamespaceRequest::SerializePayload() const
{
JsonValue payload;
if(m_namespaceNameHasBeenSet)
{
payload.WithString("namespaceName", m_namespaceName);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DescribeNamespaceRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "IotThingsGraphFrontEndService.DescribeNamespace"));
return headers;
}
|
{
"pile_set_name": "Github"
}
|
{
"action": {
"error": {
"notes": "Inadequate sanitization of FOIA released information",
"variety": [
"Misdelivery"
],
"vector": [
"Inadequate processes"
]
}
},
"actor": {
"internal": {
"job_change": [
"Let go"
],
"motive": [
"NA"
],
"variety": [
"Manager"
]
}
},
"asset": {
"assets": [
{
"amount": 1,
"variety": "S - Web application"
}
],
"cloud": [
"Other"
],
"country": [
"US"
],
"total_amount": 1
},
"attribute": {
"confidentiality": {
"data": [
{
"variety": "Personal"
},
{
"variety": "Internal"
}
],
"data_disclosure": "Yes",
"data_victim": [
"Employee",
"Student"
],
"state": [
"Stored unencrypted"
]
}
},
"confidence": "High",
"discovery_method": {
"external": {
"variety": [
"Customer"
]
}
},
"impact": {
"overall_rating": "Insignificant"
},
"incident_id": "019a5060-ef60-11e9-8b51-736a93581b2e",
"plus": {
"analysis_status": "Validated",
"analyst": "gbassett",
"asset_os": [
"Unknown"
],
"attribute": {
"confidentiality": {
"data_abuse": "No"
}
},
"created": "2019-10-15T20:37:42.582Z",
"dbir_year": 2020,
"event_chain": [
{
"action": "err",
"actor": "int",
"asset": "srv",
"attribute": "cp"
}
],
"github": "12798",
"master_id": "a2724294-4845-48f4-abc1-353c7112d575",
"modified": "2019-10-15T20:37:42.582Z"
},
"reference": "https://news.wttw.com/2018/12/28/cps-ousted-ogden-principal-exposed-private-student-info-new-data-breach",
"schema_version": "1.3.4",
"security_incident": "Confirmed",
"source_id": "vcdb",
"summary": "A principal sent a google drive link to a drive containing sensitive information by email. The principal was then FOIA'd and sent the email as part of the response, including the link with all the sensitive information.",
"targeted": "NA",
"timeline": {
"compromise": {
"unit": "Months"
},
"containment": {
"unit": "Unknown"
},
"discovery": {
"unit": "Weeks"
},
"exfiltration": {
"unit": "Minutes"
},
"incident": {
"year": 2018
}
},
"victim": {
"country": [
"US"
],
"employee_count": "50001 to 100000",
"industry": "611110",
"locations_affected": 1,
"region": [
"019021"
],
"state": "US-IL",
"victim_id": "Chicago Public School System"
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* pci_host.c
*
* Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
* VA Linux Systems Japan K.K.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "hw/pci/pci.h"
#include "hw/pci/pci_host.h"
#include "trace.h"
/* debug PCI */
//#define DEBUG_PCI
#ifdef DEBUG_PCI
#define PCI_DPRINTF(fmt, ...) \
do { printf("pci_host_data: " fmt , ## __VA_ARGS__); } while (0)
#else
#define PCI_DPRINTF(fmt, ...)
#endif
/*
* PCI address
* bit 16 - 24: bus number
* bit 8 - 15: devfun number
* bit 0 - 7: offset in configuration space of a given pci device
*/
/* the helper function to get a PCIDevice* for a given pci address */
static inline PCIDevice *pci_dev_find_by_addr(PCIBus *bus, uint32_t addr)
{
uint8_t bus_num = addr >> 16;
uint8_t devfn = addr >> 8;
return pci_find_device(bus, bus_num, devfn);
}
void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,
uint32_t limit, uint32_t val, uint32_t len)
{
assert(len <= 4);
trace_pci_cfg_write(pci_dev->name, PCI_SLOT(pci_dev->devfn),
PCI_FUNC(pci_dev->devfn), addr, val);
pci_dev->config_write(pci_dev, addr, val, MIN(len, limit - addr));
}
uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,
uint32_t limit, uint32_t len)
{
uint32_t ret;
assert(len <= 4);
ret = pci_dev->config_read(pci_dev, addr, MIN(len, limit - addr));
trace_pci_cfg_read(pci_dev->name, PCI_SLOT(pci_dev->devfn),
PCI_FUNC(pci_dev->devfn), addr, ret);
return ret;
}
void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len)
{
PCIDevice *pci_dev = pci_dev_find_by_addr(s, addr);
uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1);
if (!pci_dev) {
return;
}
PCI_DPRINTF("%s: %s: addr=%02" PRIx32 " val=%08" PRIx32 " len=%d\n",
__func__, pci_dev->name, config_addr, val, len);
pci_host_config_write_common(pci_dev, config_addr, PCI_CONFIG_SPACE_SIZE,
val, len);
}
uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len)
{
PCIDevice *pci_dev = pci_dev_find_by_addr(s, addr);
uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1);
uint32_t val;
if (!pci_dev) {
return ~0x0;
}
val = pci_host_config_read_common(pci_dev, config_addr,
PCI_CONFIG_SPACE_SIZE, len);
PCI_DPRINTF("%s: %s: addr=%02"PRIx32" val=%08"PRIx32" len=%d\n",
__func__, pci_dev->name, config_addr, val, len);
return val;
}
static void pci_host_config_write(void *opaque, hwaddr addr,
uint64_t val, unsigned len)
{
PCIHostState *s = opaque;
PCI_DPRINTF("%s addr " TARGET_FMT_plx " len %d val %"PRIx64"\n",
__func__, addr, len, val);
if (addr != 0 || len != 4) {
return;
}
s->config_reg = val;
}
static uint64_t pci_host_config_read(void *opaque, hwaddr addr,
unsigned len)
{
PCIHostState *s = opaque;
uint32_t val = s->config_reg;
PCI_DPRINTF("%s addr " TARGET_FMT_plx " len %d val %"PRIx32"\n",
__func__, addr, len, val);
return val;
}
static void pci_host_data_write(void *opaque, hwaddr addr,
uint64_t val, unsigned len)
{
PCIHostState *s = opaque;
PCI_DPRINTF("write addr " TARGET_FMT_plx " len %d val %x\n",
addr, len, (unsigned)val);
if (s->config_reg & (1u << 31))
pci_data_write(s->bus, s->config_reg | (addr & 3), val, len);
}
static uint64_t pci_host_data_read(void *opaque,
hwaddr addr, unsigned len)
{
PCIHostState *s = opaque;
uint32_t val;
if (!(s->config_reg & (1U << 31))) {
return 0xffffffff;
}
val = pci_data_read(s->bus, s->config_reg | (addr & 3), len);
PCI_DPRINTF("read addr " TARGET_FMT_plx " len %d val %x\n",
addr, len, val);
return val;
}
const MemoryRegionOps pci_host_conf_le_ops = {
.read = pci_host_config_read,
.write = pci_host_config_write,
.endianness = DEVICE_LITTLE_ENDIAN,
};
const MemoryRegionOps pci_host_conf_be_ops = {
.read = pci_host_config_read,
.write = pci_host_config_write,
.endianness = DEVICE_BIG_ENDIAN,
};
const MemoryRegionOps pci_host_data_le_ops = {
.read = pci_host_data_read,
.write = pci_host_data_write,
.endianness = DEVICE_LITTLE_ENDIAN,
};
const MemoryRegionOps pci_host_data_be_ops = {
.read = pci_host_data_read,
.write = pci_host_data_write,
.endianness = DEVICE_BIG_ENDIAN,
};
static const TypeInfo pci_host_type_info = {
.name = TYPE_PCI_HOST_BRIDGE,
.parent = TYPE_SYS_BUS_DEVICE,
.abstract = true,
.class_size = sizeof(PCIHostBridgeClass),
.instance_size = sizeof(PCIHostState),
};
static void pci_host_register_types(void)
{
type_register_static(&pci_host_type_info);
}
type_init(pci_host_register_types)
|
{
"pile_set_name": "Github"
}
|
menu "Android"
config ANDROID
bool "Android Drivers"
default N
---help---
Enable support for various drivers needed on the Android platform
if ANDROID
config ANDROID_BINDER_IPC
bool "Android Binder IPC Driver"
default n
config ASHMEM
bool "Enable the Anonymous Shared Memory Subsystem"
default n
depends on SHMEM || TINY_SHMEM
help
The ashmem subsystem is a new shared memory allocator, similar to
POSIX SHM but with different behavior and sporting a simpler
file-based API.
config ANDROID_LOGGER
tristate "Android log driver"
default n
config LOGCAT_SIZE
int "Adjust android log buffer sizes"
default 256
depends on ANDROID_LOGGER
help
Set logger buffer size. Enter a number greater than zero.
Any value less than 256 is recommended. Reduce value to save kernel static memory size.
config ANDROID_PERSISTENT_RAM
bool
depends on HAVE_MEMBLOCK
select REED_SOLOMON
select REED_SOLOMON_ENC8
select REED_SOLOMON_DEC8
config ANDROID_RAM_CONSOLE
bool "Android RAM buffer console"
depends on !S390 && !UML && HAVE_MEMBLOCK
select ANDROID_PERSISTENT_RAM
default n
config ANDROID_PERSISTENT_RAM_EXT_BUF
bool "Allow printing to old persistent ram"
default n
depends on ANDROID_RAM_CONSOLE && ANDROID_PERSISTENT_RAM
help
Adding function which can print to old persistent ram. It accepts
similar parameters as printk.
Content printed will be visible in last_kmsg.
If unsure, say N.
config PERSISTENT_TRACER
bool "Persistent function tracer"
depends on HAVE_FUNCTION_TRACER
select FUNCTION_TRACER
select ANDROID_PERSISTENT_RAM
help
persistent_trace traces function calls into a persistent ram
buffer that can be decoded and dumped after reboot through
/sys/kernel/debug/persistent_trace. It can be used to
determine what function was last called before a reset or
panic.
If unsure, say N.
config ANDROID_TIMED_OUTPUT
bool "Timed output class driver"
default y
config ANDROID_TIMED_GPIO
tristate "Android timed gpio driver"
depends on GENERIC_GPIO && ANDROID_TIMED_OUTPUT
default n
config ANDROID_LOW_MEMORY_KILLER
bool "Android Low Memory Killer"
default N
---help---
Register processes to be killed when memory is low
config ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES
bool "Android Low Memory Killer: detect oom_adj values"
depends on ANDROID_LOW_MEMORY_KILLER
default y
---help---
Detect oom_adj values written to
/sys/module/lowmemorykiller/parameters/adj and convert them
to oom_score_adj values.
source "drivers/staging/android/switch/Kconfig"
config ANDROID_INTF_ALARM_DEV
bool "Android alarm driver"
depends on RTC_CLASS
default n
help
Provides non-wakeup and rtc backed wakeup alarms based on rtc or
elapsed realtime, and a non-wakeup alarm on the monotonic clock.
Also exports the alarm interface to user-space.
config ANDROID_DEBUG_FD_LEAK
bool "Android file descriptor leak debugger"
default n
---help---
This Motorola Android extension helps debugging file descriptor
leak bugs by dumping the backtrace of the culprit thread which
is either creating a big file descriptor or injecting
a big file descriptor into another process. A file descriptor
is big when it is no less than CONFIG_ANDROID_BIG_FD.
In Motorola Android platform, this feature is enabled in eng
and userdebug build, and disabled in user build, same as the
helsmond feature which is controlled by the HELSMON_INCL build
variable.
config ANDROID_BIG_FD
int "Minimum value of a big file descriptor"
depends on ANDROID_DEBUG_FD_LEAK
default 512
---help---
Set this value to one that is unlikely reached by well-behaved
processes which have no file descriptor leak bugs, but likely
reached by the processes which do leak file descriptors.
If this value is undefined but CONFIG_ANDROID_DEBUG_FD_LEAK is
enabled, the value (__FD_SETSIZE / 2) will be assumed.
config ANDROID_LMK_ADJ_RBTREE
bool "Use RBTREE for Android Low Memory Killer"
depends on ANDROID_LOW_MEMORY_KILLER
default N
---help---
Use oom_score_adj rbtree to select the best proecss to kill
when system in low memory status.
config ANDROID_BG_SCAN_MEM
bool "SCAN free memory more frequently"
depends on ANDROID_LOW_MEMORY_KILLER && ANDROID_LMK_ADJ_RBTREE && CGROUP_SCHED
default N
---help---
Add more free-memory check point. Such as, when a task is moved to
background task groups, we can trigger low memory killer to scan
memory and decide whether it needs to reclaim memory by killing tasks.
endif # if ANDROID
endmenu
|
{
"pile_set_name": "Github"
}
|
/***************************************************************************/
/* */
/* afscript.h */
/* */
/* Auto-fitter scripts (specification only). */
/* */
/* Copyright 2013, 2014 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. */
/* */
/***************************************************************************/
/* The following part can be included multiple times. */
/* Define `SCRIPT' as needed. */
/* Add new scripts here. The first and second arguments are the */
/* script name in lowercase and uppercase, respectively, followed */
/* by a description string. Then comes the corresponding HarfBuzz */
/* script name tag, followed by a string of standard characters (to */
/* derive the standard width and height of stems). */
SCRIPT( cyrl, CYRL,
"Cyrillic",
HB_SCRIPT_CYRILLIC,
0x43E, 0x41E, 0x0 ) /* оО */
SCRIPT( deva, DEVA,
"Devanagari",
HB_SCRIPT_DEVANAGARI,
0x920, 0x935, 0x91F ) /* ठ व ट */
SCRIPT( grek, GREK,
"Greek",
HB_SCRIPT_GREEK,
0x3BF, 0x39F, 0x0 ) /* οΟ */
SCRIPT( hebr, HEBR,
"Hebrew",
HB_SCRIPT_HEBREW,
0x5DD, 0x0, 0x0 ) /* ם */
SCRIPT( latn, LATN,
"Latin",
HB_SCRIPT_LATIN,
'o', 'O', '0' )
SCRIPT( none, NONE,
"no script",
HB_SCRIPT_INVALID,
0x0, 0x0, 0x0 )
/* there are no simple forms for letters; we thus use two digit shapes */
SCRIPT( telu, TELU,
"Telugu",
HB_SCRIPT_TELUGU,
0xC66, 0xC67, 0x0 ) /* ౦ ౧ */
#ifdef AF_CONFIG_OPTION_INDIC
SCRIPT( beng, BENG,
"Bengali",
HB_SCRIPT_BENGALI,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( gujr, GUJR,
"Gujarati",
HB_SCRIPT_GUJARATI,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( guru, GURU,
"Gurmukhi",
HB_SCRIPT_GURMUKHI,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( knda, KNDA,
"Kannada",
HB_SCRIPT_KANNADA,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( limb, LIMB,
"Limbu",
HB_SCRIPT_LIMBU,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( mlym, MLYM,
"Malayalam",
HB_SCRIPT_MALAYALAM,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( orya, ORYA,
"Oriya",
HB_SCRIPT_ORIYA,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( sinh, SINH,
"Sinhala",
HB_SCRIPT_SINHALA,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( sund, SUND,
"Sundanese",
HB_SCRIPT_SUNDANESE,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( sylo, SYLO,
"Syloti Nagri",
HB_SCRIPT_SYLOTI_NAGRI,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( taml, TAML,
"Tamil",
HB_SCRIPT_TAMIL,
'o', 0x0, 0x0 ) /* XXX */
SCRIPT( tibt, TIBT,
"Tibetan",
HB_SCRIPT_TIBETAN,
'o', 0x0, 0x0 ) /* XXX */
#endif /* AF_CONFIG_OPTION_INDIC */
#ifdef AF_CONFIG_OPTION_CJK
SCRIPT( hani, HANI,
"CJKV ideographs",
HB_SCRIPT_HAN,
0x7530, 0x56D7, 0x0 ) /* 田囗 */
#endif /* AF_CONFIG_OPTION_CJK */
/* END */
|
{
"pile_set_name": "Github"
}
|
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT license.
Module Name:
Dmf_HidPortableDeviceButtons.c
Abstract:
Support for buttons (Power, Volume+ and Volume-) via Vhf.
Environment:
Kernel-mode Driver Framework
User-mode Driver Framework
--*/
// DMF and this Module's Library specific definitions.
//
#include "DmfModule.h"
#include "DmfModules.Library.h"
#include "DmfModules.Library.Trace.h"
#if defined(DMF_INCLUDE_TMH)
#include "Dmf_HidPortableDeviceButtons.tmh"
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Module Private Enumerations and Structures
///////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Display backlight brightness up and down codes defined by usb hid review request #41.
// https://www.usb.org/sites/default/files/hutrr41_0.pdf
//
#define DISPLAY_BACKLIGHT_BRIGHTNESS_INCREMENT 0x6F
#define DISPLAY_BACKLIGHT_BRIGHTNESS_DECREMENT 0x70
// The Input Report structure used for the child HID device
// NOTE: The actual size of this structure must match exactly with the
// corresponding descriptor below.
//
#include <pshpack1.h>
typedef struct _BUTTONS_INPUT_REPORT
{
UCHAR ReportId;
union
{
unsigned char Data;
struct
{
unsigned char Windows : 1;
unsigned char Power : 1;
unsigned char VolumeUp : 1;
unsigned char VolumeDown : 1;
unsigned char RotationLock : 1;
} Buttons;
} u;
} BUTTONS_INPUT_REPORT;
// Used in conjunction with Consumer usage page to send hotkeys to the OS.
//
typedef struct
{
UCHAR ReportId;
unsigned short HotKey;
} BUTTONS_HOTKEY_INPUT_REPORT;
#include <poppack.h>
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Module Private Context
///////////////////////////////////////////////////////////////////////////////////////////////////////
//
typedef struct _DMF_CONTEXT_HidPortableDeviceButtons
{
// Thread for processing requests for HID.
//
DMFMODULE DmfModuleVirtualHidDeviceVhf;
// It is the current state of all the buttons.
//
HID_XFER_PACKET VhfHidReport;
// Current state of button presses. Note that this variable
// stores state of multiple buttons so that combinations of buttons
// can be pressed at the same time.
//
BUTTONS_INPUT_REPORT InputReportButtonState;
// Enabled/disabled state of buttons. Buttons can be enabled/disabled
// by higher layers. This variable maintains the enabled/disabled
// state of each button.
//
BUTTONS_INPUT_REPORT InputReportEnabledState;
} DMF_CONTEXT_HidPortableDeviceButtons;
// This macro declares the following function:
// DMF_CONTEXT_GET()
//
DMF_MODULE_DECLARE_CONTEXT(HidPortableDeviceButtons)
// This macro declares the following function:
// DMF_CONFIG_GET()
//
DMF_MODULE_DECLARE_CONFIG(HidPortableDeviceButtons)
// MemoryTag.
//
#define MemoryTag 'BDPH'
///////////////////////////////////////////////////////////////////////////////////////////////////////
// DMF Module Support Code
///////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Number of BranchTrack button presses for each button.
//
#define HidPortableDeviceButtons_ButtonPresses 10
//
// This HID Report Descriptor describes a 1-byte input report for the 5
// buttons supported on Windows 10 for desktop editions (Home, Pro, and Enterprise). Following are the buttons and
// their bit positions in the input report:
// Bit 0 - Windows/Home Button (Unused)
// Bit 1 - Power Button
// Bit 2 - Volume Up Button
// Bit 3 - Volume Down Button
// Bit 4 - Rotation Lock Slider switch (Unused)
// Bit 5 - Unused
// Bit 6 - Unused
// Bit 7 - Unused
//
// The Report Descriptor also defines a 1-byte Control Enable/Disable
// feature report of the same size and bit positions as the Input Report.
// For a Get Feature Report, each bit in the report conveys whether the
// corresponding Control (i.e. button) is currently Enabled (1) or
// Disabled (0). For a Set Feature Report, each bit in the report conveys
// whether the corresponding Control (i.e. button) should be Enabled (1)
// or Disabled (0).
//
// NOTE: This descriptor is derived from the version published in MSDN. The published
// version was incorrect however. The modifications from that are to correct
// the issues with the published version.
//
#define REPORTID_BUTTONS 0x01
#define REPORTID_HOTKEYS 0x02
// Report Size includes the Report Id and one byte for data.
//
#define REPORT_SIZE 2
static
const
UCHAR
g_HidPortableDeviceButtons_HidReportDescriptor[] =
{
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x0D, // USAGE (Portable Device Control)
0xA1, 0x01, // COLLECTION (Application)
0x85, REPORTID_BUTTONS, // REPORT_ID (REPORTID_BUTTONS) (For Input Report & Feature Report)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x0D, // USAGE (Portable Device Control)
0xA1, 0x02, // COLLECTION (Logical)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x09, 0xE3, // USAGE (Keyboard LGUI) // Windows/Home Button
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0xCB, // USAGE (Control Enable)
0x95, 0x01, // REPORT_COUNT (1)
0xB1, 0x02, // FEATURE (Data,Var,Abs)
0xC0, // END_COLLECTION
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x0D, // USAGE (Portable Device Control)
0xA1, 0x02, // COLLECTION (Logical)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x81, // USAGE (System Power Down) // Power Button
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0xCB, // USAGE (Control Enable)
0x95, 0x01, // REPORT_COUNT (1)
0xB1, 0x02, // FEATURE (Data,Var,Abs)
0xC0, // END_COLLECTION
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x0D, // USAGE (Portable Device Control)
0xA1, 0x02, // COLLECTION (Logical)
0x05, 0x0C, // USAGE_PAGE (Consumer
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Effects Demos</title>
<link rel="stylesheet" href="../demos.css">
</head>
<body>
<div class="demos-nav">
<h4>Examples</h4>
<ul>
<li class="demo-config-on"><a href="default.html">Default functionality</a></li>
</ul>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
#ifndef BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
#define BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// assume_abstract_class.hpp:
// (C) Copyright 2008 Robert Ramey
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// this is useful for compilers which don't support the pdalboost::is_abstract
#include <boost/type_traits/is_abstract.hpp>
#ifndef BOOST_NO_IS_ABSTRACT
// if there is an intrinsic is_abstract defined, we don't have to do anything
#define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T)
// but forward to the "official" is_abstract
namespace pdalboost {
namespace serialization {
template<class T>
struct is_abstract : pdalboost::is_abstract< T > {} ;
} // namespace serialization
} // namespace pdalboost
#else
// we have to "make" one
namespace pdalboost {
namespace serialization {
template<class T>
struct is_abstract : pdalboost::false_type {};
} // namespace serialization
} // namespace pdalboost
// define a macro to make explicit designation of this more transparent
#define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T) \
namespace pdalboost { \
namespace serialization { \
template<> \
struct is_abstract< T > : pdalboost::true_type {}; \
template<> \
struct is_abstract< const T > : pdalboost::true_type {}; \
}} \
/**/
#endif // BOOST_NO_IS_ABSTRACT
#endif //BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file in the root of the source tree. An additional
* intellectual property rights grant can be found in the file PATENTS.
* All contributing project authors may be found in the AUTHORS file in
* the root of the source tree.
*/
#include "vp9/encoder/vp9_encoder.h"
#include "vp9/encoder/vp9_alt_ref_aq.h"
struct ALT_REF_AQ {
int dummy;
};
struct ALT_REF_AQ *vp9_alt_ref_aq_create(void) {
return (struct ALT_REF_AQ *)vpx_malloc(sizeof(struct ALT_REF_AQ));
}
void vp9_alt_ref_aq_destroy(struct ALT_REF_AQ *const self) { vpx_free(self); }
void vp9_alt_ref_aq_upload_map(struct ALT_REF_AQ *const self,
const struct MATX_8U *segmentation_map) {
(void)self;
(void)segmentation_map;
}
void vp9_alt_ref_aq_set_nsegments(struct ALT_REF_AQ *const self,
int nsegments) {
(void)self;
(void)nsegments;
}
void vp9_alt_ref_aq_setup_mode(struct ALT_REF_AQ *const self,
struct VP9_COMP *const cpi) {
(void)cpi;
(void)self;
}
// set basic segmentation to the altref's one
void vp9_alt_ref_aq_setup_map(struct ALT_REF_AQ *const self,
struct VP9_COMP *const cpi) {
(void)cpi;
(void)self;
}
// restore cpi->aq_mode
void vp9_alt_ref_aq_unset_all(struct ALT_REF_AQ *const self,
struct VP9_COMP *const cpi) {
(void)cpi;
(void)self;
}
int vp9_alt_ref_aq_disable_if(const struct ALT_REF_AQ *self,
int segmentation_overhead, int bandwidth) {
(void)bandwidth;
(void)self;
(void)segmentation_overhead;
return 0;
}
|
{
"pile_set_name": "Github"
}
|
#Fri Feb 19 20:28:11 CET 2010
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) 2010-2020 SAP and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* SAP - initial API and implementation
*/
package org.eclipse.dirigible.bpm.flowable.dto;
import java.util.Date;
import org.flowable.engine.common.impl.db.SuspensionState;
public class ExecutionData {
protected String id;
protected int revision;
protected boolean isInserted;
protected boolean isUpdated;
protected boolean isDeleted;
protected String tenantId = "";
protected String name;
protected String description;
protected String localizedName;
protected String localizedDescription;
protected Date lockTime;
protected boolean isActive = true;
protected boolean isScope = true;
protected boolean isConcurrent;
protected boolean isEnded;
protected boolean isEventScope;
protected boolean isMultiInstanceRoot;
protected boolean isCountEnabled;
protected String eventName;
protected String deleteReason;
protected int suspensionState = SuspensionState.ACTIVE.getStateCode();
protected String startActivityId;
protected String startUserId;
protected Date startTime;
protected int eventSubscriptionCount;
protected int taskCount;
protected int jobCount;
protected int timerJobCount;
protected int suspendedJobCount;
protected int deadLetterJobCount;
protected int variableCount;
protected int identityLinkCount;
protected String processDefinitionId;
protected String processDefinitionKey;
protected String processDefinitionName;
protected Integer processDefinitionVersion;
protected String deploymentId;
protected String activityId;
protected String activityName;
protected String processInstanceId;
protected String businessKey;
protected String parentId;
protected String superExecutionId;
protected String rootProcessInstanceId;
protected boolean forcedUpdate;
protected String callbackId;
protected String callbackType;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getRevision() {
return revision;
}
public void setRevision(int revision) {
this.revision = revision;
}
public boolean isInserted() {
return isInserted;
}
public void setInserted(boolean isInserted) {
this.isInserted = isInserted;
}
public boolean isUpdated() {
return isUpdated;
}
public void setUpdated(boolean isUpdated) {
this.isUpdated = isUpdated;
}
public boolean isDeleted() {
return isDeleted;
}
public void setDeleted(boolean isDeleted) {
this.isDeleted = isDeleted;
}
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLocalizedName() {
return localizedName;
}
public void setLocalizedName(String localizedName) {
this.localizedName = localizedName;
}
public String getLocalizedDescription() {
return localizedDescription;
}
public void setLocalizedDescription(String localizedDescription) {
this.localizedDescription = localizedDescription;
}
public Date getLockTime() {
return lockTime;
}
public void setLockTime(Date lockTime) {
this.lockTime = lockTime;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public boolean isScope() {
return isScope;
}
public void setScope(boolean isScope) {
this.isScope = isScope;
}
public boolean isConcurrent() {
return isConcurrent;
}
public void setConcurrent(boolean isConcurrent) {
this.isConcurrent = isConcurrent;
}
public boolean isEnded() {
return isEnded;
}
public void setEnded(boolean isEnded) {
this.isEnded = isEnded;
}
public boolean isEventScope() {
return isEventScope;
}
public void setEventScope(boolean isEventScope) {
this.isEventScope = isEventScope;
}
public boolean isMultiInstanceRoot() {
return isMultiInstanceRoot;
}
public void setMultiInstanceRoot(boolean isMultiInstanceRoot) {
this.isMultiInstanceRoot = isMultiInstanceRoot;
}
public boolean isCountEnabled() {
return isCountEnabled;
}
public void setCountEnabled(boolean isCountEnabled) {
this.isCountEnabled = isCountEnabled;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getDeleteReason() {
return deleteReason;
}
public void setDeleteReason(String deleteReason) {
this.deleteReason = deleteReason;
}
public int getSuspensionState() {
return suspensionState;
}
public void setSuspensionState(int suspensionState) {
this.suspensionState = suspensionState;
}
public String getStartActivityId() {
return startActivityId;
}
public void setStartActivityId(String startActivityId) {
this.startActivityId = startActivityId;
}
public String getStartUserId() {
return startUserId;
}
public void setStartUserId(String startUserId) {
this.startUserId = startUserId;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public int getEventSubscriptionCount() {
return eventSubscriptionCount;
}
public void setEventSubscriptionCount(int eventSubscriptionCount) {
this.eventSubscriptionCount = eventSubscriptionCount;
}
public int getTaskCount() {
return taskCount;
}
public void setTaskCount(int taskCount) {
this.taskCount = taskCount;
}
public int getJobCount() {
return jobCount;
}
public void setJobCount(int jobCount) {
this.jobCount = jobCount;
}
public int getTimerJobCount() {
return timerJobCount;
}
public void setTimerJobCount(int timerJobCount) {
this.timerJobCount = timerJobCount;
}
public int getSuspendedJobCount() {
return suspendedJobCount;
}
public void setSuspendedJobCount(int suspendedJobCount) {
this.suspendedJobCount = suspendedJobCount;
}
public int getDeadLetterJobCount() {
return deadLetterJobCount;
}
public void setDeadLetterJobCount(int deadLetterJobCount) {
this.deadLetterJobCount = deadLetterJobCount;
}
public int getVariableCount() {
return variableCount;
}
public void setVariableCount(int variableCount) {
this.variableCount = variableCount;
}
public int getIdentityLinkCount() {
return identityLinkCount;
}
public void setIdentityLinkCount(int identityLinkCount) {
this.identityLinkCount = identityLinkCount;
}
public String getProcessDefinitionId() {
return processDefinitionId;
}
public void setProcessDefinitionId(String processDefinitionId) {
this.processDefinitionId = processDefinitionId;
|
{
"pile_set_name": "Github"
}
|
// Configuration for your app
require("./build-index");
const path = require("path");
const fs = require("fs");
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const WebpackDeepScopeAnalysisPlugin = require('webpack-deep-scope-plugin').default;
const minimist = require('minimist');
module.exports = function (ctx) {
return {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
boot: [
"i18n",
"axios",
"apiPath",
"buildPath",
"imagePath",
"avatarPath",
"formatDate",
"successNotify",
"errorNotify",
"request",
"api",
"shared",
"throttle",
"vueDevTools",
"getBreadcrumbs",
"icons",
"customJsBoot"
],
css: ["app.scss"],
extras: [
"line-awesome",
"fontawesome-v5"
//'roboto-font',
//'material-icons', // optional, you are not bound to it
//'ionicons-v4',
//'mdi-v3',
//'eva-icons'
],
framework: {
all: "auto",
// Quasar plugins
plugins: ["Notify", "Meta", "Dialog", "LocalStorage"],
animations: ["bounceInDown", "bounceOutUp"],
iconSet: "line-awesome",
lang: "ru" // Quasar language
},
preFetch: false,
supportIE: false,
build: {
scopeHoisting: true,
vueRouterMode: "history",
// vueCompiler: true,
// gzip: true,
// analyze: true,
// extractCSS: false,
extendWebpack(cfg) {
cfg.resolve.alias.storeInd = path.resolve("./src/store/index/index.js");
cfg.resolve.alias.router = path.resolve("./src/router/index.js");
cfg.resolve.alias.App = path.resolve("./src/App.vue");
cfg.resolve.modules.push(path.resolve("./src"));
cfg.resolve.modules.push(path.resolve("./src/index"));
const htmlWebpackPlugin = cfg.plugins.find(
x => x.constructor.name === "HtmlWebpackPlugin"
);
htmlWebpackPlugin.options.configUId = Math.floor(
Math.random() * 1000000
).toString();
cfg.plugins.push(
new webpack.ProvidePlugin({
Vue: ['vue', 'default'],
sunImport: ['src/utils/sunImport', 'default'],
request: ['src/utils/request', 'default'],
Api: ['src/api/Api', 'default'],
AdminApi: ['src/api/AdminApi', 'default'],
Page: ['src/mixins/Page', 'default']
}));
if (ctx.dev) {
let configPath = "src/config.js";
let args = minimist(process.argv.slice(2));
if (args.config) {
let cpath = path.resolve(args.config)
if (fs.existsSync(cpath))
configPath = args.config;
} else if (fs.existsSync(path.resolve('./src/l.config.js')))
configPath = "src/l.config.js";
console.log("Using config: " + configPath);
cfg.plugins.push(
new CopyWebpackPlugin([
{from: "src/site/statics", to: "site/statics"},
{from: configPath, to: "config.js"},
{from: "src/custom.css", to: "custom.css"},
{from: "src/custom.js", to: "custom.js"}
])
);
} else {
cfg.plugins.push(
new CopyWebpackPlugin([{from: "src/site/statics", to: "site/statics"}])
);
}
cfg.plugins.push(new WebpackDeepScopeAnalysisPlugin());
cfg.optimization.splitChunks.cacheGroups.sun = {
test: /[\\/]src[\\/]/,
minChunks: 1,
priority: -13,
chunks: "all",
reuseExistingChunk: true,
name: function (module) {
const match = module.context.match(/[\\/]src[\\/](.*?)([\\/]|$)/);
if (match && match.length >= 1) {
if (match[1] === "modules") {
const match = module.context.match(/[\\/]src[\\/]modules[\\/](.*?)([\\/]|$)/);
return `sun-${match[1]}`;
}
return `sun-${match[1]}`;
} else
return "sun-main";
}
};
cfg.optimization.splitChunks.cacheGroups.admin = {
test: /[\\/]src[\\/]admin[\\/]/,
minChunks: 1,
priority: -12,
chunks: "all",
reuseExistingChunk: true,
name: function (module) {
const match = module.context.match(/[\\/]src[\\/]admin[\\/](.*?)([\\/]|$)/);
if (match && match.length >= 1)
return `admin-${match[1]}`;
else
return "admin-main";
}
};
delete cfg.optimization.splitChunks.cacheGroups.app;
delete cfg.optimization.splitChunks.cacheGroups.common;
},
env: {
PACKAGE_JSON: JSON.stringify(require("./package"))
}
},
devServer: {
// https: true,
host: "localhost",
port: 5005,
open: true // opens browser window automatically
},
// animations: 'all' --- includes all animations
animations: [],
ssr: {
pwa: false
},
pwa: {
// workboxPluginMode: 'InjectManifest',
// workboxOptions: {},
manifest: {
// name: 'Quasar App',
// short_name: 'Quasar-PWA',
// description: 'Best PWA App in town!',
display: "standalone",
orientation: "portrait",
background_color: "#ffffff",
theme_color: "#027be3",
icons: [
{
src: "statics/icons/icon-128x128.png",
sizes: "128x128",
type: "image/png"
},
{
src: "statics/icons/icon-192x192.png",
sizes: "192x192",
type: "image/png"
},
{
src: "statics/icons/icon-256x256.png",
sizes: "256x256",
type: "image/png"
},
{
src: "statics/icons/icon-384x384.png",
sizes: "384x384",
type: "image/png"
},
{
src: "statics/icons/icon-512x512.png",
sizes: "512x512",
type: "image/png"
}
]
}
},
cordova: {
// id: 'org.cordova.quasar.app'
},
electron: {
// bundler: 'builder', // or 'packager'
extendWebpack(cfg) {
// do something with Electron process Webpack cfg
},
packager: {
// https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
// OS X / Mac App Store
// appBundleId: '',
// appCategoryType: '',
// osxSign
|
{
"pile_set_name": "Github"
}
|
// CivOne
//
// To the extent possible under law, the person who associated CC0 with
// CivOne has waived all copyright and related or neighboring rights
// to CivOne.
//
// You should have received a copy of the CC0 legalcode along with this
// work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
using CivOne.Enums;
using CivOne.Graphics;
using CivOne.IO;
namespace CivOne.Screens
{
internal class GameOver : BaseScreen
{
private readonly Picture _background;
private readonly string[] _textLines;
private int _currentLine = 0;
private int _lineTick = 0;
protected override bool HasUpdate(uint gameTick)
{
if (gameTick % 10 != 0) return false;
_lineTick++;
if (_lineTick % 6 != 0) return false;
if (_textLines.Length <= _currentLine)
{
Runtime.Quit();
return true;
}
this.AddLayer(_background)
.DrawText(_textLines[_currentLine], 5, 15, 159, 7, TextAlign.Center)
.DrawText(_textLines[_currentLine], 5, 13, 159, 9, TextAlign.Center)
.DrawText(_textLines[_currentLine], 5, 14, 159, 8, TextAlign.Center);
_currentLine++;
return true;
}
public GameOver()
{
_background = Resources["ARCH"];
Palette = _background.Palette;
this.AddLayer(_background);
PlaySound("lose2");
// Load text and replace strings
_textLines = TextFile.Instance.GetGameText("KING/ARCH");
for (int i = 0; i < _textLines.Length; i++)
_textLines[i] = _textLines[i].Replace("$RPLC1", Human.LatestAdvance).Replace("$US", Human.LeaderName.ToUpper()).Replace("^", "");
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**********
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
**********/
// "liveMedia"
// Copyright (c) 1996-2014 Live Networks, Inc. All rights reserved.
// A parser for an Ogg file.
// Implementation
#include "OggFileParser.hh"
#include "OggDemuxedTrack.hh"
#include <GroupsockHelper.hh> // for "gettimeofday()
PacketSizeTable::PacketSizeTable(unsigned number_page_segments)
: numCompletedPackets(0), totSizes(0), nextPacketNumToDeliver(0),
lastPacketIsIncomplete(False) {
size = new unsigned[number_page_segments];
for (unsigned i = 0; i < number_page_segments; ++i) size[i] = 0;
}
PacketSizeTable::~PacketSizeTable() {
delete[] size;
}
OggFileParser::OggFileParser(OggFile& ourFile, FramedSource* inputSource,
FramedSource::onCloseFunc* onEndFunc, void* onEndClientData,
OggDemux* ourDemux)
: StreamParser(inputSource, onEndFunc, onEndClientData, continueParsing, this),
fOurFile(ourFile), fInputSource(inputSource),
fOnEndFunc(onEndFunc), fOnEndClientData(onEndClientData),
fOurDemux(ourDemux), fNumUnfulfilledTracks(0),
fPacketSizeTable(NULL), fCurrentTrackNumber(0), fSavedPacket(NULL) {
if (ourDemux == NULL) {
// Initialization
fCurrentParseState = PARSING_START_OF_FILE;
continueParsing();
} else {
fCurrentParseState = PARSING_AND_DELIVERING_PAGES;
// In this case, parsing (of page data) doesn't start until a client starts reading from a track.
}
}
OggFileParser::~OggFileParser() {
delete[] fSavedPacket;
delete fPacketSizeTable;
Medium::close(fInputSource);
}
void OggFileParser::continueParsing(void* clientData, unsigned char* ptr, unsigned size, struct timeval presentationTime) {
((OggFileParser*)clientData)->continueParsing();
}
void OggFileParser::continueParsing() {
if (fInputSource != NULL) {
if (fInputSource->isCurrentlyAwaitingData()) return;
// Our input source is currently being read. Wait until that read completes
if (!parse()) {
// We didn't complete the parsing, because we had to read more data from the source,
// or because we're waiting for another read from downstream.
// Once that happens, we'll get called again.
return;
}
}
// We successfully parsed the file. Call our 'done' function now:
if (fOnEndFunc != NULL) (*fOnEndFunc)(fOnEndClientData);
}
Boolean OggFileParser::parse() {
try {
while (1) {
switch (fCurrentParseState) {
case PARSING_START_OF_FILE: {
if (parseStartOfFile()) return True;
}
case PARSING_AND_DELIVERING_PAGES: {
parseAndDeliverPages();
}
case DELIVERING_PACKET_WITHIN_PAGE: {
if (deliverPacketWithinPage()) return False;
}
}
}
} catch (int /*e*/) {
#ifdef DEBUG
fprintf(stderr, "OggFileParser::parse() EXCEPTION (This is normal behavior - *not* an error)\n");
#endif
return False; // the parsing got interrupted
}
}
Boolean OggFileParser::parseStartOfFile() {
#ifdef DEBUG
fprintf(stderr, "parsing start of file\n");
#endif
// Read and parse each 'page', until we see the first non-BOS page, or until we have
// collected all required headers for Vorbis, Theora, or Opus track(s) (if any).
u_int8_t header_type_flag;
do {
header_type_flag = parseInitialPage();
} while ((header_type_flag&0x02) != 0 || needHeaders());
#ifdef DEBUG
fprintf(stderr, "Finished parsing start of file\n");
#endif
return True;
}
static u_int32_t byteSwap(u_int32_t x) {
return (x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24);
}
u_int8_t OggFileParser::parseInitialPage() {
u_int8_t header_type_flag;
u_int32_t bitstream_serial_number;
parseStartOfPage(header_type_flag, bitstream_serial_number);
// If this is a BOS page, examine the first 8 bytes of the first 'packet', to see whether
// the track data type is one that we know how to stream:
OggTrack* track;
if ((header_type_flag&0x02) != 0) { // BOS
char const* mimeType = NULL; // if unknown
if (fPacketSizeTable != NULL && fPacketSizeTable->size[0] >= 8) { // sanity check
char buf[8];
testBytes((u_int8_t*)buf, 8);
if (strncmp(&buf[1], "vorbis", 6) == 0) {
mimeType = "audio/VORBIS";
++fNumUnfulfilledTracks;
} else if (strncmp(buf, "OpusHead", 8) == 0) {
mimeType = "audio/OPUS";
++fNumUnfulfilledTracks;
} else if (strncmp(&buf[1], "theora", 6) == 0) {
mimeType = "video/THEORA";
++fNumUnfulfilledTracks;
}
}
// Add a new track descriptor for this track:
track = new OggTrack;
track->trackNumber = bitstream_serial_number;
track->mimeType = mimeType;
fOurFile.addTrack(track);
} else { // not a BOS page
// Because this is not a BOS page, the specified track should already have been seen:
track = fOurFile.lookup(bitstream_serial_number);
}
if (track != NULL) { // sanity check
#ifdef DEBUG
fprintf(stderr, "This track's MIME type: %s\n",
track->mimeType == NULL ? "(unknown)" : track->mimeType);
#endif
if (track->mimeType != NULL &&
(strcmp(track->mimeType, "audio/VORBIS") == 0 ||
strcmp(track->mimeType, "video/THEORA") == 0 ||
strcmp(track->mimeType, "audio/OPUS") == 0)) {
// Special-case handling of Vorbis, Theora, or Opus tracks:
// Make a copy of each packet, until we get the three special headers that we need:
Boolean isVorbis = strcmp(track->mimeType, "audio/VORBIS") == 0;
Boolean isTheora = strcmp(track->mimeType, "video/THEORA") == 0;
for (unsigned j = 0; j < fPacketSizeTable->numCompletedPackets && track->weNeedHeaders(); ++j) {
unsigned const packetSize = fPacketSizeTable->size[j];
if (packet
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>LCD Library: /Users/fmalpartida/development/ardWorkspace/LiquidCrystal_I2C/LiquiCrystal_I2C/LiquidCrystal_SR3W.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logoGoogle.jpg"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">LCD Library <span id="projectnumber">1.2.1</span></div>
<div id="projectbrief">LCD Library - LCD control class hierarchy library. Drop in replacement for the LiquidCrystal Library.</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">/Users/fmalpartida/development/ardWorkspace/LiquidCrystal_I2C/LiquiCrystal_I2C/LiquidCrystal_SR3W.cpp</div> </div>
</div>
<div class="contents">
<a href="_liquid_crystal___s_r3_w_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// ---------------------------------------------------------------------------</span>
<a name="l00002"></a>00002 <span class="comment">// Created by Francisco Malpartida on 7.3.2012.</span>
<a name="l00003"></a>00003 <span class="comment">// Copyright 2011 - Under creative commons license 3.0:</span>
<a name="l00004"></a>00004 <span class="comment">// Attribution-ShareAlike CC BY-SA</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This software is furnished "as is", without technical support, and with no </span>
<a name="l00007"></a>00007 <span class="comment">// warranty, express or implied, as to its usefulness for any purpose.</span>
<a name="l00008"></a>00008 <span class="comment">//</span>
<a name="l00009"></a>00009 <span class="comment">// Thread Safe: No</span>
<a name="l00010"></a>00010 <span class="comment">// Extendable: Yes</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012 <span class="comment">// @file LiquidCrystal_SRG.h</span>
<a name="l00013"></a>00013 <span class="comment">// This file implements a basic liquid crystal library that comes as standard</span>
<a name="l00014"></a>00014 <span class="comment">// in the Arduino SDK but using a generic SHIFT REGISTER extension board.</span>
<a name="l00015"></a>00015 <span class="comment">// </span>
<a name="l00016"></a>00016 <span class="comment">// @brief </span>
<a name="l00017"></a>00017 <span class="comment">// This is a basic implementation of the LiquidCrystal library of the</span>
<a name="l00018"></a>00018 <span class="comment">// Arduino SDK. The original library has been reworked in such a way that </span>
<a name="l00019"></a>00019 <span class="comment">// this class implements the all methods to command an LCD based</span>
<a name="l00020"></a>00020 <span class="comment">// on the Hitachi HD44780 and compatible chipsets using a 3 wire latching</span>
<a name="l00021"></a>00021 <span class="comment">// shift register. While it has been tested with a 74HC595N shift register</span>
<a name="l00022"></a>00022 <span class="comment">// it should also work with other latching shift registers such as the MC14094</span>
<a name="l00023"></a>00023 <span class="comment">// and the HEF4094</span>
<a name="l00024"></a>00024 <span class="comment">//</span>
<a name="l00025"></a>00025 <span class="comment">// This particular driver has been created as generic as possible to enable</span>
<a name="l00026"></a>00026 <span class="comment">// users to configure and connect their LCDs using just 3 digital IOs from the</span>
<a name="l00027"></a>00027 <span class="comment">// AVR or Arduino, and connect the LCD to the outputs of the shiftregister</span>
<a name="l00028"></a>00028 <span class="comment">// in any configuration. The library is configured by passing the IO pins</span>
<a name="l00029"></a>00029 <span class="comment">// that control the strobe, data and clock of the shift register and a map</span>
<a name="l00030"></a>00030 <span class="comment">// of how the shiftregister is connected to the LCD.</span>
<a name="l00031"></a>00031 <span class="comment">// </span>
<a name="l00032"></a>00032 <span class="comment">//</span>
<a name
|
{
"pile_set_name": "Github"
}
|
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (2.9 0 0);
boundaryField
{
top
{
type fixedValue;
value uniform (2.61933 -0.50632 0);
}
inlet
{
type fixedValue;
value uniform (2.9 0 0);
}
outlet
{
type zeroGradient;
}
bottom
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
|
{
"pile_set_name": "Github"
}
|
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.servicemanager.config;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.configuration2.MapConfiguration;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Bash does not allow environment variables that contain dots in their name.
* This Configuration loads environment variables that contains two underlines
* and replaces "__P__" -> "." and "__D__" -> "-"
* E.g.: dspace__P__dir will be read as dspace.dir.
* E.g.: my__D__dspace__P__prop will be read as my-dspace.prop.
*
* Most of this file was copied from org.apache.commons.configuration2.EnvironmentConfiguration.
*
* @author Pascal-Nicolas Becker -- dspace at pascal dash becker dot de
*/
public class DSpaceEnvironmentConfiguration extends MapConfiguration {
private static Logger log = LoggerFactory.getLogger(DSpaceEnvironmentConfiguration.class);
/**
* Create a Configuration based on the environment variables.
*
* @see System#getenv()
*/
public DSpaceEnvironmentConfiguration() {
super(getModifiedEnvMap());
}
public static Map<String, Object> getModifiedEnvMap() {
HashMap<String, Object> env = new HashMap<>(System.getenv().size());
for (String key : System.getenv().keySet()) {
// ignore all properties that do not contain __ as those will be loaded
// by apache commons config environment lookup.
if (!StringUtils.contains(key, "__")) {
continue;
}
// replace "__P__" with a single dot.
// replace "__D__" with a single dash.
String lookup = StringUtils.replace(key, "__P__", ".");
lookup = StringUtils.replace(lookup, "__D__", "-");
if (System.getenv(key) != null) {
// store the new key with the old value in our new properties map.
env.put(lookup, System.getenv(key));
log.debug("Found env " + lookup + " = " + System.getenv(key) + ".");
} else {
log.debug("Didn't found env " + lookup + ".");
}
}
return env;
}
/**
* Adds a property to this configuration. Because this configuration is
* read-only, this operation is not allowed and will cause an exception.
*
* @param key the key of the property to be added
* @param value the property value
*/
@Override
protected void addPropertyDirect(String key, Object value) {
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only!");
}
/**
* Removes a property from this configuration. Because this configuration is
* read-only, this operation is not allowed and will cause an exception.
*
* @param key the key of the property to be removed
*/
@Override
protected void clearPropertyDirect(String key) {
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only!");
}
/**
* Removes all properties from this configuration. Because this
* configuration is read-only, this operation is not allowed and will cause
* an exception.
*/
@Override
protected void clearInternal() {
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only!");
}
}
|
{
"pile_set_name": "Github"
}
|
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2018 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package proto
import "errors"
// Deprecated: do not use.
type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
// Deprecated: do not use.
func GetStats() Stats { return Stats{} }
// Deprecated: do not use.
func MarshalMessageSet(interface{}) ([]byte, error) {
return nil, errors.New("proto: not implemented")
}
// Deprecated: do not use.
func UnmarshalMessageSet([]byte, interface{}) error {
return errors.New("proto: not implemented")
}
// Deprecated: do not use.
func MarshalMessageSetJSON(interface{}) ([]byte, error) {
return nil, errors.New("proto: not implemented")
}
// Deprecated: do not use.
func UnmarshalMessageSetJSON([]byte, interface{}) error {
return errors.New("proto: not implemented")
}
// Deprecated: do not use.
func RegisterMessageSetType(Message, int32, string) {}
|
{
"pile_set_name": "Github"
}
|
#pragma once
#include <iostream>
#include "Common.h"
namespace magpie
{
class Memory;
// Interface for a class that provides the root objects reachable by the
// garbage collector. When a collection needs to occur, Memory starts by
// calling this to find the known root objects. An implementor should
// override reachRoots() and call memory.reach() on it for each root object.
class RootSource
{
public:
virtual ~RootSource() {}
virtual void reachRoots() = 0;
};
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.adwords.jaxws.v201809.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* Returns the ad parameters that match the criteria specified in the
* selector.
*
* @param serviceSelector Specifies which ad parameters to return.
* @return A list of ad parameters.
*
*
* <p>Java class for get element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="get">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="serviceSelector" type="{https://adwords.google.com/api/adwords/cm/v201809}Selector" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"serviceSelector"
})
@XmlRootElement(name = "get")
public class AdParamServiceInterfaceget {
protected Selector serviceSelector;
/**
* Gets the value of the serviceSelector property.
*
* @return
* possible object is
* {@link Selector }
*
*/
public Selector getServiceSelector() {
return serviceSelector;
}
/**
* Sets the value of the serviceSelector property.
*
* @param value
* allowed object is
* {@link Selector }
*
*/
public void setServiceSelector(Selector value) {
this.serviceSelector = value;
}
}
|
{
"pile_set_name": "Github"
}
|
#include <windows.h>
#include "iasiodrv.h"
#include "asiolist.h"
#define ASIODRV_DESC "description"
#define INPROC_SERVER "InprocServer32"
#define ASIO_PATH "software\\asio"
#define COM_CLSID "clsid"
// ******************************************************************
// Local Functions
// ******************************************************************
static LONG findDrvPath (char *clsidstr,char *dllpath,int dllpathsize)
{
HKEY hkEnum,hksub,hkpath;
char databuf[512];
LONG cr,rc = -1;
DWORD datatype,datasize;
DWORD index;
OFSTRUCT ofs;
HFILE hfile;
BOOL found = FALSE;
CharLowerBuff(clsidstr,strlen(clsidstr));
if ((cr = RegOpenKey(HKEY_CLASSES_ROOT,COM_CLSID,&hkEnum)) == ERROR_SUCCESS) {
index = 0;
while (cr == ERROR_SUCCESS && !found) {
cr = RegEnumKey(hkEnum,index++,(LPTSTR)databuf,512);
if (cr == ERROR_SUCCESS) {
CharLowerBuff(databuf,strlen(databuf));
if (!(strcmp(databuf,clsidstr))) {
if ((cr = RegOpenKeyEx(hkEnum,(LPCTSTR)databuf,0,KEY_READ,&hksub)) == ERROR_SUCCESS) {
if ((cr = RegOpenKeyEx(hksub,(LPCTSTR)INPROC_SERVER,0,KEY_READ,&hkpath)) == ERROR_SUCCESS) {
datatype = REG_SZ; datasize = (DWORD)dllpathsize;
cr = RegQueryValueEx(hkpath,0,0,&datatype,(LPBYTE)dllpath,&datasize);
if (cr == ERROR_SUCCESS) {
memset(&ofs,0,sizeof(OFSTRUCT));
ofs.cBytes = sizeof(OFSTRUCT);
hfile = OpenFile(dllpath,&ofs,OF_EXIST);
if (hfile) rc = 0;
}
RegCloseKey(hkpath);
}
RegCloseKey(hksub);
}
found = TRUE; // break out
}
}
}
RegCloseKey(hkEnum);
}
return rc;
}
static LPASIODRVSTRUCT newDrvStruct (HKEY hkey,char *keyname,int drvID,LPASIODRVSTRUCT lpdrv)
{
HKEY hksub;
char databuf[256];
char dllpath[MAXPATHLEN];
WORD wData[100];
CLSID clsid;
DWORD datatype,datasize;
LONG cr,rc;
if (!lpdrv) {
if ((cr = RegOpenKeyEx(hkey,(LPCTSTR)keyname,0,KEY_READ,&hksub)) == ERROR_SUCCESS) {
datatype = REG_SZ; datasize = 256;
cr = RegQueryValueEx(hksub,COM_CLSID,0,&datatype,(LPBYTE)databuf,&datasize);
if (cr == ERROR_SUCCESS) {
rc = findDrvPath (databuf,dllpath,MAXPATHLEN);
if (rc == 0) {
lpdrv = new ASIODRVSTRUCT[1];
if (lpdrv) {
memset(lpdrv,0,sizeof(ASIODRVSTRUCT));
lpdrv->drvID = drvID;
MultiByteToWideChar(CP_ACP,0,(LPCSTR)databuf,-1,(LPWSTR)wData,100);
if ((cr = CLSIDFromString((LPOLESTR)wData,(LPCLSID)&clsid)) == S_OK) {
memcpy(&lpdrv->clsid,&clsid,sizeof(CLSID));
}
datatype = REG_SZ; datasize = 256;
cr = RegQueryValueEx(hksub,ASIODRV_DESC,0,&datatype,(LPBYTE)databuf,&datasize);
if (cr == ERROR_SUCCESS) {
strcpy(lpdrv->drvname,databuf);
}
else strcpy(lpdrv->drvname,keyname);
}
}
}
RegCloseKey(hksub);
}
}
else lpdrv->next = newDrvStruct(hkey,keyname,drvID+1,lpdrv->next);
return lpdrv;
}
static void deleteDrvStruct (LPASIODRVSTRUCT lpdrv)
{
IASIO *iasio;
if (lpdrv != 0) {
deleteDrvStruct(lpdrv->next);
if (lpdrv->asiodrv) {
iasio = (IASIO *)lpdrv->asiodrv;
iasio->Release();
}
delete lpdrv;
}
}
static LPASIODRVSTRUCT getDrvStruct (int drvID,LPASIODRVSTRUCT lpdrv)
{
while (lpdrv) {
if (lpdrv->drvID == drvID) return lpdrv;
lpdrv = lpdrv->next;
}
return 0;
}
// ******************************************************************
// ******************************************************************
// AsioDriverList
// ******************************************************************
AsioDriverList::AsioDriverList ()
{
HKEY hkEnum = 0;
char keyname[MAXDRVNAMELEN];
LPASIODRVSTRUCT pdl;
LONG cr;
DWORD index = 0;
BOOL fin = FALSE;
numdrv = 0;
lpdrvlist = 0;
cr = RegOpenKey(HKEY_LOCAL_MACHINE,ASIO_PATH,&hkEnum);
while (cr == ERROR_SUCCESS) {
if ((cr = RegEnumKey(hkEnum,index++,(LPTSTR)keyname,MAXDRVNAMELEN))== ERROR_SUCCESS) {
lpdrvlist = newDrvStruct (hkEnum,keyname,0,lpdrvlist);
}
else fin = TRUE;
}
if (hkEnum) RegCloseKey(hkEnum);
pdl = lpdrvlist;
while (pdl) {
numdrv++;
pdl = pdl->next;
}
if (numdrv) CoInitialize(0); // initialize COM
}
AsioDriverList::~AsioDriverList ()
{
if (numdrv) {
deleteDrvStruct(lpdrvlist);
CoUninitialize();
}
}
LONG AsioDriverList::asioGetNumDev (VOID)
{
return (LONG)numdrv;
}
LONG AsioDriverList::asioOpenDriver (int drvID,LPVOID *asiodrv)
{
LPASIODRVSTRUCT lpdrv = 0;
long rc;
if (!asiodrv) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (!lpdrv->asiodrv) {
rc = CoCreateInstance(lpdrv->clsid,0,CLSCTX_INPROC_SERVER,lpdrv->clsid,asiodrv);
if (rc == S_OK) {
lpdrv->asiodrv = *asiodrv;
return 0;
}
// else if (rc == REGDB_E_CLASSNOTREG)
// strcpy (info->messageText, "Driver not registered in the Registration Database!");
}
else rc = DRVERR_DEVICE_ALREADY_OPEN;
}
else rc = DRVERR_DEVICE_NOT_FOUND;
return rc;
}
LONG AsioDriverList::asioCloseDriver (int drvID)
{
LPASIODRVSTRUCT lpdrv = 0;
IASIO *iasio;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (lpdrv->asiodrv) {
iasio = (IASIO *)lpdrv->asiodrv;
|
{
"pile_set_name": "Github"
}
|
#include "U8glib.h"
void setup(void)
{
}
void loop(void)
{
u8g_t u8g;
u8g_Init(&u8g, &u8g_dev_ht1632_24x16);
u8g_FirstPage(&u8g);
u8g_SetColorIndex(&u8g, 1);
do {
u8g_SetFont(&u8g, u8g_font_7x13);
u8g_DrawStr(&u8g, 0, 14, "ABCgdef");
}while( u8g_NextPage(&u8g) );
delay(1000);
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Certify.Models.Config;
namespace Certify.UI.Windows
{
/// <summary>
/// Selects template based on the type of the data item.
/// </summary>
public class ControlTemplateSelector : DataTemplateSelector
{
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
var context = container as FrameworkElement;
DataTemplate template = null;
if (null == container)
{
throw new NullReferenceException("container");
}
else if (null == context)
{
throw new Exception("container must be Framework Element");
}
else if (null == item)
{
return null;
}
var providerParameter = item as ProviderParameter;
if (providerParameter == null)
{
template = context.FindResource("ProviderStringParameter") as DataTemplate;
}
else if (providerParameter.IsHidden)
{
template = context.FindResource("ProviderHiddenParameter") as DataTemplate;
}
else if (providerParameter.IsPassword)
{
template = context.FindResource("ProviderPasswordParameter") as DataTemplate;
}
else if (providerParameter.Options.Count() != 0)
{
template = context.FindResource("ProviderDropDownParameter") as DataTemplate;
}
else if (providerParameter.IsMultiLine)
{
template = context.FindResource("ProviderMultiLineStringParameter") as DataTemplate;
}
else if (providerParameter.Type== OptionType.Boolean)
{
template = context.FindResource("ProviderBooleanParameter") as DataTemplate;
}
else
{
template = context.FindResource("ProviderStringParameter") as DataTemplate;
}
return template ?? base.SelectTemplate(item, container);
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?php namespace App\maguttiCms\Admin\Importer;
use App\Author;
use App\Category;
use App;
/**
* Importa i dati dal fileone
*
* Class GlobalListImport
* @package App\maguttiCms\Admin\Importer
*/
class GlobalListImport extends ImportHelper
{
/**
* @var
*/
protected $model;
protected $lang = 'it';
function __construct()
{
$this->setStorage('import');
}
function import()
{
$i = 0;
$this->getStorage();
foreach ($this->storage->files() as $file) {
if ($this->getFileExtension($file) == 'csv') {
$i++;
echo "<h1>" . $file . "</h1>";
$this->parseResource($file);
};
}
if ($i == 0) echo "No files found";
}
function addData($data)
{
App::setLocale('it');
/*
array:19 [▼
0 => "N° FILE"
1 => "SITO DI COLLEGAMENTO (NOME DELLA CARTELLA)"
2 => "NOME DEL FILE CHE COMPARE SULL'APP"
3 => "NOME DEL FILE WORD"
4 => "FOTO DI RIFERIMENTO"
5 => "CARATTERI DELL'OPERA IN LINGUA LOCALE (per 7 lingue)"
6 => "NAZIONE"
7 => "STATO"
8 => "CONTEA/REGIONE"
9 => "CITTA' (LOCALITA')"
10 => "VIA"
11 => "CIVICO"
12 => "AMBIENTE/SALA (se in museo)"
13 => "LATITUDINE GPS"
14 => "LONGITUDINE GPS"
15 => "TIPOLOGIA OPERA"
16 => "ARTISTA (AUTORE DELL'OPERA)"
17 => "STILE ARTISTICO"
18 => "AUTORE DEL TESTO"
]
*/
$sito = $data[1];
if($sito) {
echo "<br>****************************************<br>";
$position = $data[0]*10;
echo $titolo = $this->sanitize($data[2]);
echo "<br>";
$file = $this->sanitize($data[3]);
$chunk = split_nth($file,'_',5);
$code = $chunk[0] ;
$style = $this->sanitize($data[17]);
$podcast = "audio/".$file.'.mp3';
$podcastData = ['podcast' => $podcast];
$podcastObj = App\Podcast::firstOrNew( $podcastData);
if(!$podcastObj->id){
$podcastObj->title = $titolo ;
$podcastObj->code = $code ;
$podcastObj->podcast = $podcast ;
$podcastObj->podcast_original_filename = $file ;
$podcastObj->podcast_size = "4852668";
$podcastObj->podcast_last_modified = date('Y-m-d h:i:s a', time()); ;
$podcastObj->podcast_length = '5.23' ;
$categoria = $this->sanitize($data[15]);
$autore = $this->sanitize($data[16]);
$podcastObj->category_id = $this->getCategoria($categoria);
$podcastObj->author_id = $this->getArtista($autore);
$podcastObj->location_id = $this->getSito($data,$podcastObj->category_id);
$podcastObj->image = "";
// cabled
$podcastObj->writer_id = 1;
$podcastObj->sort = $position;
$podcastObj->locale = 'it';
$podcastObj->save();
//*** associazione con style
}
if($style && $style!='==='){
$styleArray = $this->getStyles( $style);
if(count($styleArray ) >0 ) $podcastObj->saveStyles($styleArray);
}
}
return false;
}
function getArtista($autore)
{
if($autore=='==='){
return null;
}
elseif($autore!='') {
echo "Autore:".$autore."<br>";
$matchThese = array('title'=>$autore);
$autoreObj = Author::updateOrCreate($matchThese,['title'=>$autore]);
return $autoreObj->id;
}
}
/**
* @param $categoria
*/
function getCategoria($categoria){
if($categoria!='') {
$categoriaObj = Category::whereTranslation('title', $categoria)->first();
if($categoriaObj) {
echo "Categoria: " . $categoria . " - ".$categoriaObj->id." - <br>";
return $categoriaObj->id;
}
else {
dd($categoria);
}
}
}
function getSito($data,$category_id){
$sito = $this->sanitize($data[1]);
echo "Sito:".$sito."<br>";
$locationData = ['name' => $sito];
$location = App\Location::firstOrNew($locationData);
if($location->id> 0) return $location->id;
else {
$location->route = ucwords(strtolower($this->sanitize($data[10])));
$location->street_number = ( $this->sanitize($data[11]) !='===' )?:'';
$location->locality = ucwords(strtolower($this->sanitize($data[9])));
$location->administrative_area_level_1 = ucwords(strtolower($this->sanitize($data[8])));
$location->country = ucwords(strtolower($this->sanitize($data[7])));
$location->name = $sito;
$location->category_id = $category_id;
$location->formatted_address = $location->route .' '.$location->street_number.' '.$location->locality;
$location->is_active = 1;
$location->city_id = 2;
$location->save() ;
return $location->id;
}
}
function getStyles($style){
$styles = explode('/',$style);
$arrayStili = [];
echo "Style:".$style."<br>";
var_dump( $styles);
foreach ( $styles as $_style){
$styleObj = App\Style::whereTranslation('title', $_style)->first();
if( $styleObj && $styleObj->id ) array_push($arrayStili,$styleObj->id);
else dd($_style);
}
return $arrayStili;
}
}
|
{
"pile_set_name": "Github"
}
|
Route110_Text_16E6C0:: @ 816E6C0
.string "TEAM {EVIL_TEAM}'s activities must be kept\n"
.string "secret for now.$"
Route110_Text_16E6F2:: @ 816E6F2
.string "I want to get going to SLATEPORT and\n"
.string "kick up a ruckus!$"
Route110_Text_16E729:: @ 816E729
.string "This is my first job after joining\n"
.string "TEAM {EVIL_TEAM}. I've got the shakes!$"
Route110_Text_16E76A:: @ 816E76A
.string "TEAM {EVIL_TEAM}'s actions will put a smile\n"
.string "on everyone's face!$"
Route110_Text_16E7A1:: @ 816E7A1
.string "MAY: Hi, {PLAYER}{KUN}, long time no see!\p"
.string "While I was searching for other\n"
.string "POKéMON, my POKéMON grew stronger.\p"
.string "So...\n"
.string "How about a little battle?$"
Route110_Text_16E826:: @ 816E826
.string "Yikes!\n"
.string "You're better than I expected!$"
Route110_Text_16E84C:: @ 816E84C
.string "MAY: {PLAYER}{KUN}, you've been busy\n"
.string "training, too, haven't you?\p"
.string "I think you deserve a reward!\n"
.string "This is from me!$"
Route110_Text_16E8B3:: @ 816E8B3
.string "MAY: That's an ITEMFINDER.\p"
.string "Try it out. If there is an item that's\n"
.string "not visible, it emits a sound.\p"
.string "Okay, {PLAYER}{KUN}, let's meet again!\p"
.string "I know it's a little silly coming from\n"
.string "me, but I think you should train a lot\l"
.string "harder for the next time.$"
Route110_Text_16E99A:: @ 816E99A
.string "BRENDAN: Hey, {PLAYER}.\n"
.string "So this is where you were.\l"
.string "How's it going?\p"
.string "Have you been raising your POKéMON?\n"
.string "I'll check for you.$"
Route110_Text_16EA0F:: @ 816EA0F
.string "Hmm...\n"
.string "You're pretty good.$"
Route110_Text_16EA2A:: @ 816EA2A
.string "BRENDAN: {PLAYER}, you've trained\n"
.string "without me noticing...\p"
.string "Good enough!\n"
.string "Here, take this.$"
Route110_Text_16EA7B:: @ 816EA7B
.string "BRENDAN: That's an ITEMFINDER.\p"
.string "Use it to root around for items that\n"
.string "aren't visible.\p"
.string "If it senses something, it emits a\n"
.string "sound.\p"
.string "Anyway, I'm off to look for new\n"
.string "POKéMON.$"
Route110_Text_16EB22:: @ 816EB22
.string "Wouldn't it be great to ride a BIKE\n"
.string "at full speed on CYCLING ROAD?$"
Route110_Text_16EB65:: @ 816EB65
.string "How do you like the way my raven-\n"
.string "colored hair streams behind me?\p"
.string "I grew my hair out just for that.$"
Route110_Text_16EBC9:: @ 816EBC9
.string "Oh, hey, you got that BIKE from RYDEL!\p"
.string "Oh, it's glaringly obvious.\n"
.string "It says right on your bike...\p"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\n"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\p"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\n"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\p"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\n"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\p"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\n"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL,\p"
.string "RYDEL, RYDEL, RYDEL, RYDEL, RYDEL...\n"
.string "That name's everywhere.\p"
.string "You should ride it around all over\n"
.string "the place - it's good advertising!$"
Route110_Text_16EDC5:: @ 816EDC5
.string "The two roads, one above, one below...\p"
.string "A road each for people and POKéMON.\n"
.string "Perhaps that is right and fair.$"
Route110_Text_16EE30:: @ 816EE30
.string "I don't have a BIKE, so I'll take a\n"
.string "leisurely walk on the low road.$"
Route110_Text_16EE74:: @ 816EE74
.string "Learning techniques will make BIKE\n"
.string "riding even more fun.\p"
.string "There are some places that you can\n"
.string "reach only by using a BIKE technique.$"
Route110_Text_16EEF6:: @ 816EEF6
.string "Which should I choose?\p"
.string "Make a beeline for MAUVILLE on\n"
.string "CYCLING ROAD, or take the low road\l"
.string "and look for POKéMON?$"
Route110_Text_16EF65:: @ 816EF65
.string "Number of collisions:\n"
.string "... ... {STR_VAR_1}!\p"
.string "Total time:\n"
.string "... ... {STR_VAR_2}!$"
Route110_Text_16EF9F:: @ 816EF9F
.string "Bravo! Splendid showing!\p"
.string "Your love of cycling comes from deep\n"
.string "within your heart.\l"
.string "You've shaken me to my very soul!$"
Route110_Text_16F012:: @ 816F012
.string "Your technique is remarkable.\p"
.string "I suggest you slow down just enough\n"
.string "to avoid collisions.$"
Route110_Text_16F069:: @ 816F069
.string "I would consider you a work in\n"
.string "progress.\p"
.string "Still, I hope you don't forget the\n"
.string "sheer pleasure of cycling.$"
Route110_Text_16F0D0:: @ 816F0D0
.string "My word... Your cycling skills border\n"
.string "on terrifying.\p"
.string "Most certainly, you need much more\n"
.string "practice riding.$"
Route110_Text_16F139:: @ 816F139
.string "...I am aghast...\p"
.string "You're perhaps not cut out for this\n"
.string "unfortunate cycling business.\p"
.string "You ought to give serious thought to\n"
.string "returning that BIKE to RYDEL.$
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>t157_apple_sign_in_test</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
|
{
"pile_set_name": "Github"
}
|
{
"description": "ClientIPConfig represents the configurations of Client IP based session affinity.",
"properties": {
"timeoutSeconds": {
"description": "timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours).",
"type": "integer",
"format": "int32"
}
},
"$schema": "http://json-schema.org/schema#",
"type": "object"
}
|
{
"pile_set_name": "Github"
}
|
namespace Aurora_Updater
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.update_progress = new System.Windows.Forms.ProgressBar();
this.richtextUpdateLog = new System.Windows.Forms.RichTextBox();
this.labelApplicationTitle = new System.Windows.Forms.Label();
this.pictureBoxApplicationLogo = new System.Windows.Forms.PictureBox();
this.labelUpdateLog = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxApplicationLogo)).BeginInit();
this.SuspendLayout();
//
// update_progress
//
this.update_progress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.update_progress.Location = new System.Drawing.Point(12, 352);
this.update_progress.Name = "update_progress";
this.update_progress.Size = new System.Drawing.Size(560, 22);
this.update_progress.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.update_progress.TabIndex = 0;
//
// richtextUpdateLog
//
this.richtextUpdateLog.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richtextUpdateLog.Location = new System.Drawing.Point(12, 82);
this.richtextUpdateLog.Name = "richtextUpdateLog";
this.richtextUpdateLog.ReadOnly = true;
this.richtextUpdateLog.Size = new System.Drawing.Size(560, 264);
this.richtextUpdateLog.TabIndex = 1;
this.richtextUpdateLog.Text = "";
//
// labelApplicationTitle
//
this.labelApplicationTitle.AutoSize = true;
this.labelApplicationTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelApplicationTitle.Location = new System.Drawing.Point(66, 12);
this.labelApplicationTitle.Name = "labelApplicationTitle";
this.labelApplicationTitle.Size = new System.Drawing.Size(156, 20);
this.labelApplicationTitle.TabIndex = 9;
this.labelApplicationTitle.Text = "Updating Aurora...";
//
// pictureBoxApplicationLogo
//
this.pictureBoxApplicationLogo.Image = global::Aurora_Updater.Properties.Resources.Aurora_updater_logo;
this.pictureBoxApplicationLogo.Location = new System.Drawing.Point(12, 12);
this.pictureBoxApplicationLogo.Name = "pictureBoxApplicationLogo";
this.pictureBoxApplicationLogo.Size = new System.Drawing.Size(48, 48);
this.pictureBoxApplicationLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBoxApplicationLogo.TabIndex = 8;
this.pictureBoxApplicationLogo.TabStop = false;
//
// labelUpdateLog
//
this.labelUpdateLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.labelUpdateLog.AutoSize = true;
this.labelUpdateLog.Location = new System.Drawing.Point(9, 66);
this.labelUpdateLog.Name = "labelUpdateLog";
this.labelUpdateLog.Size = new System.Drawing.Size(75, 13);
this.labelUpdateLog.TabIndex = 10;
this.labelUpdateLog.Text = "Update details";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(584, 381);
this.Controls.Add(this.richtextUpdateLog);
this.Controls.Add(this.labelUpdateLog);
this.Controls.Add(this.labelApplicationTitle);
this.Controls.Add(this.pictureBoxApplicationLogo);
this.Controls.Add(this.update_progress);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(600, 450);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(600, 350);
this.Name = "MainForm";
this.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Aurora Updater";
this.Shown += new System.EventHandler(this.Form1_Shown);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxApplicationLogo)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ProgressBar update_progress;
private System.Windows.Forms.RichTextBox richtextUpdateLog;
private System.Windows.Forms.Label labelApplicationTitle;
private System.Windows.Forms.PictureBox pictureBoxApplicationLogo;
private System.Windows.Forms.Label labelUpdateLog;
}
}
|
{
"pile_set_name": "Github"
}
|
.miniChart {
position: relative;
width: 100%;
.chartContent {
position: absolute;
bottom: -28px;
width: 100%;
> div {
margin: 0 -5px;
overflow: hidden;
}
}
.chartLoading {
position: absolute;
top: 16px;
left: 50%;
margin-left: -7px;
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<ImageView
android:id="@+id/label_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/label_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="20sp"
fontPath="DINNextLTPro-Light.otf"
tools:ignore="MissingPrefix" />
</merge>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2013 salesforce.com, inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.auraframework.impl.root;
import com.google.common.collect.Maps;
import org.auraframework.Aura;
import org.auraframework.def.AttributeDef;
import org.auraframework.def.AttributeDefRef;
import org.auraframework.def.DefDescriptor;
import org.auraframework.def.EventHandlerDef;
import org.auraframework.def.RegisterEventDef;
import org.auraframework.def.RootDefinition;
import org.auraframework.def.TypeDef;
import org.auraframework.expression.Expression;
import org.auraframework.expression.PropertyReference;
import org.auraframework.impl.expression.PropertyReferenceImpl;
import org.auraframework.impl.root.event.EventHandlerImpl;
import org.auraframework.impl.type.ComponentArrayTypeDef;
import org.auraframework.impl.type.ComponentTypeDef;
import org.auraframework.impl.util.AuraUtil;
import org.auraframework.instance.Attribute;
import org.auraframework.instance.AttributeSet;
import org.auraframework.instance.BaseComponent;
import org.auraframework.instance.EventHandler;
import org.auraframework.instance.Instance;
import org.auraframework.instance.InstanceStack;
import org.auraframework.instance.ValueProvider;
import org.auraframework.instance.Wrapper;
import org.auraframework.service.DefinitionService;
import org.auraframework.system.Location;
import org.auraframework.throwable.AuraRuntimeException;
import org.auraframework.throwable.AuraUnhandledException;
import org.auraframework.throwable.NoAccessException;
import org.auraframework.throwable.quickfix.AttributeNotFoundException;
import org.auraframework.throwable.quickfix.InvalidDefinitionException;
import org.auraframework.throwable.quickfix.InvalidExpressionException;
import org.auraframework.throwable.quickfix.MissingRequiredAttributeException;
import org.auraframework.throwable.quickfix.QuickFixException;
import org.auraframework.util.json.Json;
import org.auraframework.util.json.Serialization;
import org.auraframework.util.json.Serialization.ReferenceType;
import java.io.IOException;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
/**
*/
@Serialization(referenceType = ReferenceType.IDENTITY)
public class AttributeSetImpl implements AttributeSet {
private static final Location SUPER_PASSTHROUGH = AuraUtil.getExternalLocation("super component attribute passthrough");
// Immutable? I think not.
private DefDescriptor<? extends RootDefinition> rootDefDescriptor;
private boolean trackDirty = false;
private final Map<DefDescriptor<AttributeDef>, Attribute> attributes = Maps.newHashMap();
private final Map<DefDescriptor<EventHandlerDef>, EventHandler> events = Maps.newHashMap();
private final BaseComponent<?, ?> valueProvider;
private final Instance<?> parent;
private final boolean useUnlinkedDefinition;
public AttributeSetImpl(DefDescriptor<? extends RootDefinition> componentDefDescriptor,
BaseComponent<?, ?> valueProvider, Instance<?> parent) throws QuickFixException {
this(componentDefDescriptor, valueProvider, parent, false);
}
public AttributeSetImpl(DefDescriptor<? extends RootDefinition> componentDefDescriptor,
BaseComponent<?, ?> valueProvider, Instance<?> parent, boolean useUnlinkedDefinition)
throws QuickFixException {
this.rootDefDescriptor = componentDefDescriptor;
this.valueProvider = valueProvider;
this.parent = parent;
this.useUnlinkedDefinition = useUnlinkedDefinition;
setDefaults();
}
@Override
public void setRootDefDescriptor(DefDescriptor<? extends RootDefinition> descriptor) throws QuickFixException {
rootDefDescriptor = descriptor;
setDefaults();
}
@Override
public DefDescriptor<? extends RootDefinition> getRootDefDescriptor() throws QuickFixException {
return rootDefDescriptor;
}
private void setDefaults() throws QuickFixException {
Map<DefDescriptor<AttributeDef>, AttributeDef> attrs = getRootDefinition().getAttributeDefs();
for (Map.Entry<DefDescriptor<AttributeDef>, AttributeDef> attr : attrs.entrySet()) {
AttributeDefRef ref = attr.getValue().getDefaultValue();
if (ref != null && !attributes.containsKey(attr.getKey())) {
set(ref);
}
}
}
private void set(EventHandler eventHandler) {
events.put(eventHandler.getDescriptor(), eventHandler);
}
private void set(Attribute attribute) {
if (trackDirty) {
attribute.markDirty();
}
attributes.put(attribute.getDescriptor(), attribute);
}
private void set(AttributeDefRef attributeDefRef) throws QuickFixException {
RootDefinition def = getRootDefinition();
Map<DefDescriptor<AttributeDef>, AttributeDef> attributeDefs = def.getAttributeDefs();
AttributeDef attributeDef = attributeDefs.get(attributeDefRef.getDescriptor());
// setAndValidateAttribute should be merged with creating the
// AttributeImpl here
AttributeImpl attribute;
if (attributeDef == null) {
Map<String, RegisterEventDef> events = def.getRegisterEventDefs();
if (events.containsKey(attributeDefRef.getDescriptor().getName())) {
EventHandlerImpl eh = new EventHandlerImpl(attributeDefRef.getDescriptor().getName());
Object o = attributeDefRef.getValue();
if (!(o instanceof PropertyReference)) {
// FIXME: where are we?
throw new InvalidDefinitionException(String.format("%s no can haz %s", eh.getName(), o),
SUPER_PASSTHROUGH);
}
eh.setActionExpression((PropertyReference) o);
set(eh);
return;
} else {
// FIXME: where are we?
throw new AttributeNotFoundException(rootDefDescriptor, attributeDefRef.getName(), SUPER_PASSTHROUGH);
}
} else {
attribute = new AttributeImpl(attributeDef.getDescriptor());
}
try {
attributeDefRef.parseValue(attributeDef.getTypeDef());
} catch(InvalidExpressionException exception) {
// Kris:
// This is going to fail a good handfull of things at the moment, I need to
// Uncomment and test against the app before trying to check this in.
// Mode mode = contextService.getCurrentContext().getMode();
// if(mode.isDevMode() || mode.isTestMode()) {
// throw new InvalidValueSetTypeException(
// String.format("Error setting the attribute '%s' of type %s to a value of type %s.", attributeDef.getName(), attributeDef.getTypeDef().getName(), attributeDefRef.getValue().getClass().getName()),
// exception.getLocation());
// }
}
Object value = attributeDefRef.getValue();
InstanceStack iStack = Aura.getContextService().getCurrentContext().getInstanceStack();
iStack.markParent(parent);
iStack.setAttributeName(attributeDef.getDescriptor().toString());
if (valueProvider != null) {
iStack.pushAccess(valueProvider);
}
value = attributeDef.getTypeDef().initialize(value, valueProvider);
if (valueProvider != null) {
iStack.popAccess(valueProvider);
}
iStack.clearAttributeName(attributeDef.getDescriptor().toString());
iStack.clearParent(parent);
attribute.setValue(value);
set(attribute);
}
@Override
public void set(Collection<AttributeDefRef> attributeDefRefs) throws QuickFixException {
for (AttributeDefRef attributeDefRef : attributeDefRefs) {
set(attributeDefRef);
}
|
{
"pile_set_name": "Github"
}
|
{include file="orderforms/standard_cart/common.tpl"}
<script>
var _localLang = {
'addToCart': '{$LANG.orderForm.addToCart|escape}',
'addedToCartRemove': '{$LANG.orderForm.addedToCartRemove|escape}'
}
</script>
<div id="order-standard_cart">
<div class="row">
<div class="pull-md-right col-md-9">
<div class="header-lined">
<h1>{$LANG.cartdomainsconfig}</h1>
</div>
</div>
<div class="col-md-3 pull-md-left sidebar hidden-xs hidden-sm">
{include file="orderforms/standard_cart/sidebar-categories.tpl"}
</div>
<div class="col-md-9 pull-md-right">
{include file="orderforms/standard_cart/sidebar-categories-collapsed.tpl"}
<form method="post" action="{$smarty.server.PHP_SELF}?a=confdomains" id="frmConfigureDomains">
<input type="hidden" name="update" value="true" />
<p>{$LANG.orderForm.reviewDomainAndAddons}</p>
{if $errormessage}
<div class="alert alert-danger" role="alert">
<p>{$LANG.orderForm.correctErrors}:</p>
<ul>
{$errormessage}
</ul>
</div>
{/if}
{foreach $domains as $num => $domain}
<div class="sub-heading">
<span>{$domain.domain}</span>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label>{$LANG.orderregperiod}</label>
<br />
{$domain.regperiod} {$LANG.orderyears}
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>{$LANG.hosting}</label>
<br />
{if $domain.hosting}<span style="color:#009900;">[{$LANG.cartdomainshashosting}]</span>{else}<a href="cart.php" style="color:#cc0000;">[{$LANG.cartdomainsnohosting}]</a>{/if}
</div>
</div>
{if $domain.eppenabled}
<div class="col-sm-12">
<div class="form-group prepend-icon">
<input type="text" name="epp[{$num}]" id="inputEppcode{$num}" value="{$domain.eppvalue}" class="field" placeholder="{$LANG.domaineppcode}" />
<label for="inputEppcode{$num}" class="field-icon">
<i class="fa fa-lock"></i>
</label>
<span class="field-help-text">
{$LANG.domaineppcodedesc}
</span>
</div>
</div>
{/if}
</div>
{if $domain.dnsmanagement || $domain.emailforwarding || $domain.idprotection}
<div class="row addon-products">
{if $domain.dnsmanagement}
<div class="col-sm-{math equation="12 / numAddons" numAddons=$domain.addonsCount}">
<div class="panel panel-default panel-addon{if $domain.dnsmanagementselected} panel-addon-selected{/if}">
<div class="panel-body">
<label>
<input type="checkbox" name="dnsmanagement[{$num}]"{if $domain.dnsmanagementselected} checked{/if} />
{$LANG.domaindnsmanagement}
</label><br />
{$LANG.domainaddonsdnsmanagementinfo}
</div>
<div class="panel-price">
{$domain.dnsmanagementprice} / {$domain.regperiod} {$LANG.orderyears}
</div>
<div class="panel-add">
<i class="fa fa-plus"></i>
{$LANG.orderForm.addToCart}
</div>
</div>
</div>
{/if}
{if $domain.idprotection}
<div class="col-sm-{math equation="12 / numAddons" numAddons=$domain.addonsCount}">
<div class="panel panel-default panel-addon{if $domain.idprotectionselected} panel-addon-selected{/if}">
<div class="panel-body">
<label>
<input type="checkbox" name="idprotection[{$num}]"{if $domain.idprotectionselected} checked{/if} />
{$LANG.domainidprotection}
</label><br />
{$LANG.domainaddonsidprotectioninfo}
</div>
<div class="panel-price">
{$domain.idprotectionprice} / {$domain.regperiod} {$LANG.orderyears}
</div>
<div class="panel-add">
<i class="fa fa-plus"></i>
{$LANG.orderForm.addToCart}
</div>
</div>
</div>
{/if}
{if $domain.emailforwarding}
<div class="col-sm-{math equation="12 / numAddons" numAddons=$domain.addonsCount}">
<div class="panel panel-default panel-addon{if $domain.emailforwardingselected} panel-addon-selected{/if}">
<div class="panel-body">
<label>
<input type="checkbox" name="emailforwarding[{$num}]"{if $domain.emailforwardingselected} checked{/if} />
{$LANG.domainemailforwarding}
</label><br />
{$LANG.domainaddonsemailforwardinginfo}
</div>
<div class="panel-price">
{$domain.emailforwardingprice} / {$domain.regperiod} {$LANG.orderyears}
</div>
<div class="panel-add">
<i class="fa fa-plus"></i>
{$LANG.orderForm.addToCart}
</div>
</div>
</div>
{/if}
</div>
{/if}
{foreach from=$domain.fields key=domainfieldname item=domainfield}
<div class="row">
<div class="col-sm-4">{$domainfieldname}:</div>
<div class="col-sm-8">{$domainfield}</div>
</div>
{/foreach}
{/foreach}
{if $atleastonenohosting}
<div class="sub-heading">
<span>{$LANG.domainnameservers}</span>
</div>
<p>{$LANG.cartnameserversdesc}</p>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<label for="inputNs1">{$LANG.domainnameserver1}</label>
<input type="text" class="form-control" id="inputNs1" name="domainns1" value="{$domainns1}" />
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="inputNs2">{$LANG.domainnameserver2}</label>
<input type="text" class="form-control" id="inputNs2" name="domainns2" value="{$domainns2}" />
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="inputNs3">{$LANG.domainnameserver3}</label>
<input type="text"
|
{
"pile_set_name": "Github"
}
|
StartChar: uni1F9A
Encoding: 8090 8090 1943
Width: 1005
VWidth: 0
Flags: HM
LayerCount: 2
Fore
Refer: 1668 -1 N 1 0 0 1 -34 -10 2
Refer: 1666 -1 N 1 0 0 1 88 -3 2
Refer: 871 919 N 1 0 0 1 195 0 2
Validated: 32769
MultipleSubs2: "CCMP_Precomp subtable" Eta uni0345.cap uni0313.grk gravecomb.grkstack
EndChar
|
{
"pile_set_name": "Github"
}
|
package Paws::ElasticBeanstalk::ListTagsForResource;
use Moose;
has ResourceArn => (is => 'ro', isa => 'Str', required => 1);
use MooseX::ClassAttribute;
class_has _api_call => (isa => 'Str', is => 'ro', default => 'ListTagsForResource');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::ElasticBeanstalk::ResourceTagsDescriptionMessage');
class_has _result_key => (isa => 'Str', is => 'ro', default => 'ListTagsForResourceResult');
1;
### main pod documentation begin ###
=head1 NAME
Paws::ElasticBeanstalk::ListTagsForResource - Arguments for method ListTagsForResource on L<Paws::ElasticBeanstalk>
=head1 DESCRIPTION
This class represents the parameters used for calling the method ListTagsForResource on the
L<AWS Elastic Beanstalk|Paws::ElasticBeanstalk> service. Use the attributes of this class
as arguments to method ListTagsForResource.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to ListTagsForResource.
=head1 SYNOPSIS
my $elasticbeanstalk = Paws->service('ElasticBeanstalk');
my $ResourceTagsDescriptionMessage = $elasticbeanstalk->ListTagsForResource(
ResourceArn => 'MyResourceArn',
);
# Results:
my $ResourceArn = $ResourceTagsDescriptionMessage->ResourceArn;
my $ResourceTags = $ResourceTagsDescriptionMessage->ResourceTags;
# Returns a L<Paws::ElasticBeanstalk::ResourceTagsDescriptionMessage> object.
Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk/ListTagsForResource>
=head1 ATTRIBUTES
=head2 B<REQUIRED> ResourceArn => Str
The Amazon Resource Name (ARN) of the resouce for which a tag list is
requested.
Must be the ARN of an Elastic Beanstalk environment.
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method ListTagsForResource in L<Paws::ElasticBeanstalk>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
|
{
"pile_set_name": "Github"
}
|
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ServiceManager", "ServiceManager.vbproj", "{FC9A8347-24B8-496F-A7FB-E71106F5E3AA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FC9A8347-24B8-496F-A7FB-E71106F5E3AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC9A8347-24B8-496F-A7FB-E71106F5E3AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC9A8347-24B8-496F-A7FB-E71106F5E3AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC9A8347-24B8-496F-A7FB-E71106F5E3AA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
|
{
"pile_set_name": "Github"
}
|
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "Tools_00065.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "Tools_00065@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "Tools_00065@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MNNKit: MNNFaceDetection/android/src/main/java/com/alibaba Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="mnn.jpg"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">MNNKit
 <span id="projectnumber">1.0</span>
</div>
<div id="projectbrief">MNNKit is a collection of AI solutions on mobile phone, powered by MNN engine.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_ff51bd0b7841751e6292791fdaa2b577.html">MNNFaceDetection</a></li><li class="navelem"><a class="el" href="dir_63791b95483cf3c993780521edc19890.html">android</a></li><li class="navelem"><a class="el" href="dir_7f92bc3fdbda6107b6f10f88212fd556.html">src</a></li><li class="navelem"><a class="el" href="dir_d56f97a77027a31056fee7685895f0c4.html">main</a></li><li class="navelem"><a class="el" href="dir_47d122ed7c37c9322d5530106463b8f2.html">java</a></li><li class="navelem"><a class="el" href="dir_98cb6771020ddafee339445588c01181.html">com</a></li><li class="navelem"><a class="el" href="dir_09d68240d7e1d43e5755b29e8c25f971.html">alibaba</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">alibaba Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
Directories</h2></td></tr>
<tr class="memitem:dir_4b583c7e5532556e734d11ce03a6cbac"><td class="memItemLeft" align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_4b583c7e5532556e734d11ce03a6cbac.html">android</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::AveragingMethod
Description
Base class for lagrangian averaging methods.
SourceFiles
AveragingMethod.C
AveragingMethodI.H
\*---------------------------------------------------------------------------*/
#ifndef AveragingMethod_H
#define AveragingMethod_H
#include "barycentric.H"
#include "tetIndices.H"
#include "FieldField.H"
#include "fvMesh.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class AveragingMethod Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class AveragingMethod
:
public regIOobject,
public FieldField<Field, Type>
{
protected:
//- Protected typedefs
//- Gradient type
typedef typename outerProduct<vector, Type>::type TypeGrad;
//- Protected data
//- Dictionary
const dictionary& dict_;
//- The mesh on which the averaging is to be done
const fvMesh& mesh_;
//- Protected member functions
//- Update the gradient calculation
virtual void updateGrad();
public:
//- Runtime type information
TypeName("averagingMethod");
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
AveragingMethod,
dictionary,
(
const IOobject& io,
const dictionary& dict,
const fvMesh& mesh
),
(io, dict, mesh)
);
//- Constructors
//- Construct from components
AveragingMethod
(
const IOobject& io,
const dictionary& dict,
const fvMesh& mesh,
const labelList& size
);
//- Construct a copy
AveragingMethod(const AveragingMethod<Type>& am);
//- Construct and return a clone
virtual autoPtr<AveragingMethod<Type>> clone() const = 0;
//- Selector
static autoPtr<AveragingMethod<Type>> New
(
const IOobject& io,
const dictionary& dict,
const fvMesh& mesh
);
//- Destructor
virtual ~AveragingMethod();
//- Member Functions
//- Add point value to interpolation
virtual void add
(
const barycentric& coordinates,
const tetIndices& tetIs,
const Type& value
) = 0;
//- Interpolate
virtual Type interpolate
(
const barycentric& coordinates,
const tetIndices& tetIs
) const = 0;
//- Interpolate gradient
virtual TypeGrad interpolateGrad
(
const barycentric& coordinates,
const tetIndices& tetIs
) const = 0;
//- Calculate the average
virtual void average();
virtual void average(const AveragingMethod<scalar>& weight);
//- Dummy write
virtual bool writeData(Ostream&) const;
//- Write using setting from DB
virtual bool write(const bool write = true) const;
//- Return an internal field of the average
virtual tmp<Field<Type>> primitiveField() const = 0;
//- Assign to another average
inline void operator=(const AveragingMethod<Type>& x);
//- Assign to value
inline void operator=(const Type& x);
//- Assign to tmp
inline void operator=(tmp<FieldField<Field, Type>> x);
//- Add-equal tmp
inline void operator+=(tmp<FieldField<Field, Type>> x);
//- Multiply-equal tmp
inline void operator*=(tmp<FieldField<Field, Type>> x);
//- Divide-equal tmp
inline void operator/=(tmp<FieldField<Field, scalar>> x);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "AveragingMethodI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "AveragingMethod.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
|
{
"pile_set_name": "Github"
}
|
<sect2>
<title>Installation of Less</title>
<para>Install Less by running the following commands:</para>
<para><screen><userinput>./configure --prefix=/usr --bindir=/bin &&
make &&
make install</userinput></screen></para>
</sect2>
|
{
"pile_set_name": "Github"
}
|
module Authority
# Should be included into all models in a Rails app. Provides the model
# with both class and instance methods like `updatable_by?(user)`
# Exactly which methods get defined is determined from `config.abilities`;
# the module is evaluated after any user-supplied config block is run
# in order to make that possible.
# All delegate to the methods of the same name on the model's authorizer.
module Abilities
extend ActiveSupport::Concern
included do |base|
class_attribute :authorizer_name
# Set the default authorizer for this model.
# - Look for an authorizer named like the model inside the model's namespace.
# - If there is none, use 'ApplicationAuthorizer'
self.authorizer_name = begin
"#{base.name}Authorizer".constantize.name
rescue NameError
"ApplicationAuthorizer"
end
end
def authorizer
self.class.authorizer.new(self) # instantiate on every check, in case model has changed
end
module Definitions
# Send all calls like `editable_by?` to an authorizer instance
# Not using Forwardable because it makes it harder for users to track an ArgumentError
# back to their authorizer
Authority.adjectives.each do |adjective|
define_method("#{adjective}_by?") { |*args| authorizer.send("#{adjective}_by?", *args) }
end
end
include Definitions
module ClassMethods
include Definitions
def authorizer=(authorizer_class)
@authorizer = authorizer_class
self.authorizer_name = @authorizer.name
end
# @return [Class] of the designated authorizer
def authorizer
@authorizer ||= authorizer_name.constantize # Get an actual reference to the authorizer class
rescue NameError
raise Authority::NoAuthorizerError.new(
"#{authorizer_name} is set as the authorizer for #{self}, but the constant is missing"
)
end
end
end
NoAuthorizerError = Class.new(RuntimeError)
end
|
{
"pile_set_name": "Github"
}
|
/***************************************************************************
*
* Project: OpenCPN
*
***************************************************************************
* Copyright (C) 2013 by David S. Register *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************
*/
#ifndef __WINDOWDESTROYLISTENER_H__
#define __WINDOWDESTROYLISTENER_H__
class WindowDestroyListener
{
public:
virtual void DestroyWindow() = 0;
};
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright(c) 2006 to 2019 ADLINK Technology Limited and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
* v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
#include <assert.h>
#include "dds/ddsrt/heap.h"
#include "dds/ddsrt/string.h"
#include "dds/ddsrt/types.h"
#include "dds/ddsrt/environ.h"
#include "dds/security/dds_security_api.h"
#include "dds/security/core/dds_security_serialize.h"
#include "dds/security/core/dds_security_utils.h"
#include "dds/security/core/shared_secret.h"
#include "dds/security/openssl_support.h"
#include "CUnit/CUnit.h"
#include "CUnit/Test.h"
#include "common/src/loader.h"
#include "common/src/crypto_helper.h"
#include "crypto_objects.h"
#if OPENSLL_VERSION_NUMBER >= 0x10002000L
#define AUTH_INCLUDE_EC
#endif
#define TEST_SHARED_SECRET_SIZE 32
static struct plugins_hdl *plugins = NULL;
static DDS_Security_SharedSecretHandle shared_secret_handle = DDS_SECURITY_HANDLE_NIL;
static dds_security_cryptography *crypto = NULL;
static DDS_Security_ParticipantCryptoHandle local_participant_crypto_handle = DDS_SECURITY_HANDLE_NIL;
static DDS_Security_ParticipantCryptoHandle remote_participant_crypto_handle = DDS_SECURITY_HANDLE_NIL;
static void prepare_participant_security_attributes(DDS_Security_ParticipantSecurityAttributes *attributes)
{
memset(attributes, 0, sizeof(DDS_Security_ParticipantSecurityAttributes));
attributes->allow_unauthenticated_participants = false;
attributes->is_access_protected = false;
attributes->is_discovery_protected = false;
attributes->is_liveliness_protected = false;
attributes->is_rtps_protected = true;
attributes->plugin_participant_attributes = DDS_SECURITY_PARTICIPANT_ATTRIBUTES_FLAG_IS_VALID;
attributes->plugin_participant_attributes |= DDS_SECURITY_PLUGIN_PARTICIPANT_ATTRIBUTES_FLAG_IS_RTPS_ENCRYPTED;
}
static void reset_exception(DDS_Security_SecurityException *ex)
{
ex->code = 0;
ex->minor_code = 0;
ddsrt_free(ex->message);
ex->message = NULL;
}
static void suite_register_local_datareader_init(void)
{
DDS_Security_IdentityHandle participant_identity = 5; //valid dummy value
DDS_Security_SecurityException exception = {NULL, 0, 0};
DDS_Security_PropertySeq participant_properties;
DDS_Security_PermissionsHandle remote_participant_permissions = 5; //valid dummy value
DDS_Security_SharedSecretHandleImpl *shared_secret_handle_impl;
DDS_Security_PermissionsHandle participant_permissions = 3; //valid dummy value
DDS_Security_ParticipantSecurityAttributes participant_security_attributes;
/* Only need the crypto plugin. */
CU_ASSERT_FATAL((plugins = load_plugins(
NULL /* Access Control */,
NULL /* Authentication */,
&crypto /* Cryptograpy */)) != NULL);
/* prepare test shared secret handle */
shared_secret_handle_impl = ddsrt_malloc(sizeof(DDS_Security_SharedSecretHandleImpl));
shared_secret_handle_impl->shared_secret = ddsrt_malloc(TEST_SHARED_SECRET_SIZE * sizeof(DDS_Security_octet));
shared_secret_handle_impl->shared_secret_size = TEST_SHARED_SECRET_SIZE;
for (int i = 0; i < shared_secret_handle_impl->shared_secret_size; i++)
{
shared_secret_handle_impl->shared_secret[i] = (unsigned char)(i % 20);
}
for (int i = 0; i < 32; i++)
{
shared_secret_handle_impl->challenge1[i] = (unsigned char)(i % 15);
shared_secret_handle_impl->challenge2[i] = (unsigned char)(i % 12);
}
shared_secret_handle = (DDS_Security_SharedSecretHandle)shared_secret_handle_impl;
/* Check if we actually have the validate_local_identity() function. */
CU_ASSERT_FATAL(crypto != NULL && crypto->crypto_key_factory != NULL && crypto->crypto_key_factory->register_local_participant != NULL);
memset(&exception, 0, sizeof(DDS_Security_SecurityException));
memset(&participant_properties, 0, sizeof(participant_properties));
prepare_participant_security_attributes(&participant_security_attributes);
CU_ASSERT_FATAL((local_participant_crypto_handle = crypto->crypto_key_factory->register_local_participant(
crypto->crypto_key_factory,
participant_identity,
participant_permissions,
&participant_properties,
&participant_security_attributes,
&exception)) != DDS_SECURITY_HANDLE_NIL)
/* Now call the function. */
remote_participant_crypto_handle = crypto->crypto_key_factory->register_matched_remote_participant(
crypto->crypto_key_factory,
local_participant_crypto_handle,
participant_identity,
remote_participant_permissions,
shared_secret_handle,
&exception);
}
static void suite_register_local_datareader_fini(void)
{
DDS_Security_SharedSecretHandleImpl *shared_secret_handle_impl = (DDS_Security_SharedSecretHandleImpl *)shared_secret_handle;
DDS_Security_SecurityException exception = {NULL, 0, 0};
crypto->crypto_key_factory->unregister_participant(crypto->crypto_key_factory, remote_participant_crypto_handle, &exception);
reset_exception(&exception);
crypto->crypto_key_factory->unregister_participant(crypto->crypto_key_factory, local_participant_crypto_handle, &exception);
reset_exception(&exception);
unload_plugins(plugins);
ddsrt_free(shared_secret_handle_impl->shared_secret);
ddsrt_free(shared_secret_handle_impl);
shared_secret_handle = DDS_SECURITY_HANDLE_NIL;
crypto = NULL;
local_participant_crypto_handle = DDS_SECURITY_HANDLE_NIL;
remote_participant_crypto_handle = DDS_SECURITY_HANDLE_NIL;
}
static void prepare_endpoint_security_attributes(DDS_Security_EndpointSecurityAttributes *attributes)
{
memset(attributes, 0, sizeof(DDS_Security_EndpointSecurityAttributes));
attributes->is_discovery_protected = true;
attributes->is_submessage_protected = true;
attributes->plugin_endpoint_attributes |= DDS_SECURITY_PLUGIN_ENDPOINT_ATTRIBUTES_FLAG_IS_SUBMESSAGE_ENCRYPTED;
}
CU_Test(ddssec_builtin_register_local_datareader, happy_day, .init = suite_register_local_datareader_init, .fini = suite_register_local_datareader_fini)
{
DDS_Security_DatareaderCryptoHandle result;
/* Dummy (even un-initialized) data for now. */
DDS_Security_SecurityException exception = {NULL, 0, 0};
DDS_Security_PropertySeq datare
|
{
"pile_set_name": "Github"
}
|
package jwt
// Implements the none signing method. This is required by the spec
// but you probably should never use it.
var SigningMethodNone *signingMethodNone
const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed"
var NoneSignatureTypeDisallowedError error
type signingMethodNone struct{}
type unsafeNoneMagicConstant string
func init() {
SigningMethodNone = &signingMethodNone{}
NoneSignatureTypeDisallowedError = NewValidationError("'none' signature type is not allowed", ValidationErrorSignatureInvalid)
RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod {
return SigningMethodNone
})
}
func (m *signingMethodNone) Alg() string {
return "none"
}
// Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key
func (m *signingMethodNone) Verify(signingString, signature string, key interface{}) (err error) {
// Key must be UnsafeAllowNoneSignatureType to prevent accidentally
// accepting 'none' signing method
if _, ok := key.(unsafeNoneMagicConstant); !ok {
return NoneSignatureTypeDisallowedError
}
// If signing method is none, signature must be an empty string
if signature != "" {
return NewValidationError(
"'none' signing method with non-empty signature",
ValidationErrorSignatureInvalid,
)
}
// Accept 'none' signing method.
return nil
}
// Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key
func (m *signingMethodNone) Sign(signingString string, key interface{}) (string, error) {
if _, ok := key.(unsafeNoneMagicConstant); ok {
return "", nil
}
return "", NoneSignatureTypeDisallowedError
}
|
{
"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.stanbol.entityhub.web.writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import javax.ws.rs.core.MediaType;
import org.apache.stanbol.entityhub.servicesapi.model.Representation;
import org.apache.stanbol.entityhub.web.ModelWriter;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ModelWriterTracker extends ServiceTracker {
private final Logger log = LoggerFactory.getLogger(getClass());
/**
* Holds the config
*/
private final Map<String, Map<MediaType,List<ServiceReference>>> writers = new HashMap<String,Map<MediaType,List<ServiceReference>>>();
/**
* Caches requests for MediaTypes and types
*/
private final Map<CacheKey, Collection<ServiceReference>> cache = new HashMap<CacheKey,Collection<ServiceReference>>();
/**
* lock for {@link #writers} and {@link #cache}
*/
private final ReadWriteLock lock = new ReentrantReadWriteLock();
@Override
public Object addingService(ServiceReference reference) {
Object service = super.addingService(reference);
Set<MediaType> mediaTypes = parseMediaTypes(((ModelWriter)service).supportedMediaTypes());
Class<? extends Representation> nativeType = ((ModelWriter)service).getNativeType();
if(!mediaTypes.isEmpty()){
lock.writeLock().lock();
try {
for(MediaType mediaType : mediaTypes){
addModelWriter(nativeType, mediaType, reference);
}
} finally {
lock.writeLock().unlock();
}
return service;
} else { //else no MediaTypes registered
return null; //ignore this service
}
}
@Override
public void removedService(ServiceReference reference, Object service) {
if(service != null){
Set<MediaType> mediaTypes = parseMediaTypes(((ModelWriter)service).supportedMediaTypes());
Class<? extends Representation> nativeType = ((ModelWriter)service).getNativeType();
if(!mediaTypes.isEmpty()){
lock.writeLock().lock();
try {
for(MediaType mediaType : mediaTypes){
removeModelWriter(nativeType, mediaType, reference);
}
} finally {
lock.writeLock().unlock();
}
}
}
super.removedService(reference, service);
}
@Override
public final void modifiedService(ServiceReference reference, Object service) {
super.modifiedService(reference, service);
if(service != null){
Set<MediaType> mediaTypes = parseMediaTypes(((ModelWriter)service).supportedMediaTypes());
Class<? extends Representation> nativeType = ((ModelWriter)service).getNativeType();
if(!mediaTypes.isEmpty()){
lock.writeLock().lock();
try {
for(MediaType mediaType : mediaTypes){
updateModelWriter(nativeType, mediaType, reference);
}
} finally {
lock.writeLock().unlock();
}
}
}
}
/**
* @param reference
* @param key
*/
private void addModelWriter(Class<? extends Representation> nativeType,
MediaType mediaType, ServiceReference reference) {
//we want to have all ModelWriters under the null key
log.debug(" > add ModelWriter format: {}, bundle: {}, nativeType: {}",
new Object[]{mediaType, reference.getBundle(),
nativeType != null ? nativeType.getName() : "none"});
Map<MediaType,List<ServiceReference>> typeWriters = writers.get(null);
addTypeWriter(typeWriters, mediaType, reference);
if(nativeType != null){ //register also as native type writers
typeWriters = writers.get(nativeType.getName());
if(typeWriters == null){
typeWriters = new HashMap<MediaType,List<ServiceReference>>();
writers.put(nativeType.getName(), typeWriters);
}
addTypeWriter(typeWriters, mediaType, reference);
}
cache.clear(); //clear the cache after a change
}
/**
* @param typeWriters
* @param mediaType
* @param reference
*/
private void addTypeWriter(Map<MediaType,List<ServiceReference>> typeWriters,
MediaType mediaType,
ServiceReference reference) {
List<ServiceReference> l;
l = typeWriters.get(mediaType);
if(l == null){
l = new ArrayList<ServiceReference>();
typeWriters.put(mediaType, l);
}
l.add(reference);
Collections.sort(l); //service ranking based sorting
}
/**
* @param key
* @param reference
*/
private void removeModelWriter(Class<? extends Representation> nativeType,
MediaType mediaType, ServiceReference reference) {
log.debug(" > remove ModelWriter format: {}, service: {}, nativeType: {}",
new Object[]{mediaType, reference,
nativeType != null ? nativeType.getClass().getName() : "none"});
Map<MediaType,List<ServiceReference>> typeWriters = writers.get(null);
removeTypeWriter(typeWriters, mediaType, reference);
if(nativeType != null){
typeWriters = writers.get(nativeType.getName());
if(typeWriters != null){
removeTypeWriter(typeWriters, mediaType, reference);
if(typeWriters.isEmpty()){
writers.remove(nativeType.getName());
}
}
}
cache.clear(); //clear the cache after a change
}
/**
* @param typeWriters
* @param mediaType
* @param reference
*/
private void removeTypeWriter(Map<MediaType,List<ServiceReference>> typeWriters,
MediaType mediaType,
ServiceReference reference) {
List<ServiceReference> l = typeWriters.get(mediaType);
if(l != null && l.remove(reference) && l.isEmpty()){
writers.remove(mediaType); //remove empty mediaTypes
}
}
/**
* @param key
* @param reference
*/
private void updateModelWriter(Class<? extends Representation> nativeType,
MediaType mediaType, ServiceReference reference) {
log.debug(" > update ModelWriter format: {}, service: {}, nativeType: {}",
new Object[]{mediaType, reference,
nativeType != null ? nativeType.getClass().getName() : "none"});
Map<MediaType,List<ServiceReference>> typeWriters = writers.get(null);
updateTypeWriter(typeWriters, mediaType, reference);
if(nativeType != null){
typeWriters = writers.get(nativeType.getName());
if(typeWriters != null){
updateTypeWriter(typeWriters, mediaType, reference);
}
}
cache.clear(); //clear the cache after a change
}
|
{
"pile_set_name": "Github"
}
|
<!--
Description: xhtml:body type
Expect: bozo and entries[0]['content'][0]['type'] == u'application/xhtml+xml'
-->
<rss version="2.0">
<channel>
<item>
<body xmlns="http://www.w3.org/1999/xhtml">
<p>Example content</p>
</body>
</item>
</channel>
</rss
|
{
"pile_set_name": "Github"
}
|
#ifndef UTIL_LINUX_STATFS_MAGIC_H
#define UTIL_LINUX_STATFS_MAGIC_H
#include <sys/statfs.h>
/*
* If possible then don't depend on internal libc __SWORD_TYPE type.
*/
#ifdef __GNUC__
#define F_TYPE_EQUAL(a, b) (a == (__typeof__(a)) b)
#else
#define F_TYPE_EQUAL(a, b) (a == (__SWORD_TYPE) b)
#endif
/*
* Unfortunately, Linux kernel header file <linux/magic.h> is incomplete
* mess and kernel returns by statfs f_type many numbers that are nowhere
* specified (in API).
*
* This is collection of the magic numbers.
*/
#define STATFS_ADFS_MAGIC 0xadf5
#define STATFS_AFFS_MAGIC 0xadff
#define STATFS_AFS_MAGIC 0x5346414F
#define STATFS_AUTOFS_MAGIC 0x0187
#define STATFS_BDEVFS_MAGIC 0x62646576
#define STATFS_BEFS_MAGIC 0x42465331
#define STATFS_BFS_MAGIC 0x1BADFACE
#define STATFS_BINFMTFS_MAGIC 0x42494e4d
#define STATFS_BTRFS_MAGIC 0x9123683E
#define STATFS_CEPH_MAGIC 0x00c36400
#define STATFS_CGROUP_MAGIC 0x27e0eb
#define STATFS_CGROUP2_MAGIC 0x63677270
#define STATFS_CIFS_MAGIC 0xff534d42
#define STATFS_CODA_MAGIC 0x73757245
#define STATFS_CONFIGFS_MAGIC 0x62656570
#define STATFS_CRAMFS_MAGIC 0x28cd3d45
#define STATFS_DEBUGFS_MAGIC 0x64626720
#define STATFS_DEVPTS_MAGIC 0x1cd1
#define STATFS_ECRYPTFS_MAGIC 0xf15f
#define STATFS_EFIVARFS_MAGIC 0xde5e81e4
#define STATFS_EFS_MAGIC 0x414A53
#define STATFS_EXOFS_MAGIC 0x5DF5
#define STATFS_EXT2_MAGIC 0xEF53
#define STATFS_EXT3_MAGIC 0xEF53
#define STATFS_EXT4_MAGIC 0xEF53
#define STATFS_F2FS_MAGIC 0xF2F52010
#define STATFS_FUSE_MAGIC 0x65735546
#define STATFS_FUTEXFS_MAGIC 0xBAD1DEA
#define STATFS_GFS2_MAGIC 0x01161970
#define STATFS_HFSPLUS_MAGIC 0x482b
#define STATFS_HOSTFS_MAGIC 0x00c0ffee
#define STATFS_HPFS_MAGIC 0xf995e849
#define STATFS_HPPFS_MAGIC 0xb00000ee
#define STATFS_HUGETLBFS_MAGIC 0x958458f6
#define STATFS_ISOFS_MAGIC 0x9660
#define STATFS_JFFS2_MAGIC 0x72b6
#define STATFS_JFS_MAGIC 0x3153464a
#define STATFS_LOGFS_MAGIC 0xc97e8168
#define STATFS_MINIX2_MAGIC 0x2468
#define STATFS_MINIX2_MAGIC2 0x2478
#define STATFS_MINIX3_MAGIC 0x4d5a
#define STATFS_MINIX_MAGIC 0x137F
#define STATFS_MINIX_MAGIC2 0x138F
#define STATFS_MQUEUE_MAGIC 0x19800202
#define STATFS_MSDOS_MAGIC 0x4d44
#define STATFS_NCP_MAGIC 0x564c
#define STATFS_NFS_MAGIC 0x6969
#define STATFS_NILFS_MAGIC 0x3434
#define STATFS_NTFS_MAGIC 0x5346544e
#define STATFS_OCFS2_MAGIC 0x7461636f
#define STATFS_OMFS_MAGIC 0xC2993D87
#define STATFS_OPENPROMFS_MAGIC 0x9fa1
#define STATFS_PIPEFS_MAGIC 0x50495045
#define STATFS_PROC_MAGIC 0x9fa0
#define STATFS_PSTOREFS_MAGIC 0x6165676C
#define STATFS_QNX4_MAGIC 0x002f
#define STATFS_QNX6_MAGIC 0x68191122
#define STATFS_RAMFS_MAGIC 0x858458f6
#define STATFS_REISERFS_MAGIC 0x52654973
#define STATFS_ROMFS_MAGIC 0x7275
#define STATFS_SECURITYFS_MAGIC 0x73636673
#define STATFS_SELINUXFS_MAGIC 0xf97cff8c
#define STATFS_SMACKFS_MAGIC 0x43415d53
#define STATFS_SMB_MAGIC 0x517B
#define STATFS_SOCKFS_MAGIC 0x534F434B
#define STATFS_SQUASHFS_MAGIC 0x73717368
#define STATFS_SYSFS_MAGIC 0x62656572
#define STATFS_TMPFS_MAGIC 0x01021994
#define STATFS_UBIFS_MAGIC 0x24051905
#define STATFS_UDF_MAGIC 0x15013346
#define STATFS_UFS2_MAGIC 0x19540119
#define STATFS_UFS_MAGIC 0x00011954
#define STATFS_V9FS_MAGIC 0x01021997
#define STATFS_VXFS_MAGIC 0xa501FCF5
#define STATFS_XENFS_MAGIC 0xabba1974
#define STATFS_XFS_MAGIC 0x58465342
#endif /* UTIL_LINUX_STATFS_MAGIC_H */
|
{
"pile_set_name": "Github"
}
|
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value (empirically, with Gradle 6.0.1):
# -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m
# We allow more space (no MaxMetaspaceSize; bigger -Xmx),
# and don't litter heap dumps if that still proves insufficient.
org.gradle.jvmargs=-Xms256m -Xmx1024m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.33.1
|
{
"pile_set_name": "Github"
}
|
cheats = 4
cheat0_desc = "[Pt1]Infinite Energy"
cheat0_code = "M 8 36220 0 0\nM 8 36516 0 0\nZ 8 39371 200 0"
cheat0_enable = false
cheat1_desc = "[Pt2]Infinite Energy"
cheat1_code = "M 8 36192 0 0\nZ 8 39232 200 0"
cheat1_enable = false
cheat2_desc = "[Pt1][2P]1 Hit to Kill"
cheat2_code = "Z 8 36798 1 0"
cheat2_enable = false
cheat3_desc = "[Pt2][1P]1 Hit to Kill"
cheat3_code = "Z 8 36605 1 0"
cheat3_enable = false
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* osCommerce Online Merchant
*
* @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
namespace osCommerce\OM\Core\Site\Admin\Application\PaymentModules\Model;
use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Cache;
class save {
public static function execute($data) {
if ( OSCOM::callDB('Admin\PaymentModules\Save', $data) ) {
Cache::clear('configuration');
return true;
}
return false;
}
}
?>
|
{
"pile_set_name": "Github"
}
|
<shapes name="mxgraph.aws2.security_and_identity">
<shape aspect="variable" h="54.8" name="ACM" strokewidth="inherit" w="68">
<connections/>
<foreground>
<fillcolor color="#759C3E"/>
<path>
<move x="68" y="32.2"/>
<line x="34" y="35.6"/>
<line x="34" y="19.2"/>
<line x="68" y="22.6"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4B612C"/>
<path>
<move x="0" y="32.2"/>
<line x="34" y="35.6"/>
<line x="34" y="19.2"/>
<line x="0" y="22.6"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#648339"/>
<rect h="11" w="54.5" x="6.8" y="0"/>
<fillstroke/>
<fillcolor color="#3C4929"/>
<path>
<move x="54.5" y="13.8"/>
<line x="13.6" y="13.8"/>
<line x="6.8" y="11"/>
<line x="61.3" y="11"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#648339"/>
<rect h="11" w="54.5" x="6.8" y="43.8"/>
<fillstroke/>
<fillcolor color="#B7CA9D"/>
<path>
<move x="54.5" y="41"/>
<line x="13.6" y="41"/>
<line x="6.8" y="43.8"/>
<line x="61.3" y="43.8"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="55.9" name="ACM Certificate Manager" strokewidth="inherit" w="65.1">
<connections/>
<foreground>
<fillcolor color="#4C622C"/>
<path>
<move x="62" y="55.9"/>
<line x="3" y="55.9"/>
<curve x1="1.4" x2="0" x3="0" y1="55.9" y2="54.6" y3="52.9"/>
<line x="0" y="7"/>
<curve x1="0" x2="1.3" x3="3" y1="5.4" y2="4" y3="4"/>
<line x="62.1" y="4"/>
<curve x1="63.7" x2="65.1" x3="65.1" y1="4" y2="5.3" y3="7"/>
<line x="65.1" y="53"/>
<curve x1="65" x2="63.7" x3="62" y1="54.6" y2="55.9" y3="55.9"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#759C3F"/>
<path>
<move x="62" y="51.9"/>
<line x="3" y="51.9"/>
<curve x1="1.4" x2="0" x3="0" y1="51.9" y2="50.6" y3="48.9"/>
<line x="0" y="3"/>
<curve x1="0" x2="1.3" x3="3" y1="1.4" y2="0" y3="0"/>
<line x="62.1" y="0"/>
<curve x1="63.7" x2="65.1" x3="65.1" y1="0" y2="1.3" y3="3"/>
<line x="65.1" y="49"/>
<curve x1="65" x2="63.7" x3="62" y1="50.6" y2="51.9" y3="51.9"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#FFFFFF"/>
<rect h="4.4" w="48.7" x="12.8" y="4.1"/>
<fillstroke/>
<ellipse h="7" w="7" x="2.8" y="2.8"/>
<fillstroke/>
<rect h="35.1" w="58" x="3.5" y="12.8"/>
<fillstroke/>
<fillcolor color="#759C3F"/>
<path>
<move x="38" y="34.1"/>
<line x="37.8" y="34.7"/>
<line x="37.3" y="36.1"/>
<line x="36" y="35.5"/>
<line x="35.4" y="35.2"/>
<line x="35.1" y="35.7"/>
<line x="34.2" y="36.9"/>
<line x="33.1" y="36"/>
<line x="32.6" y="35.6"/>
<line x="32.2" y="36"/>
<line x="31" y="36.9"/>
<line x="30.2" y="35.7"/>
<line x="29.9" y="35.2"/>
<line x="29.3" y="35.5"/>
<line x="28" y="36.1"/>
<line x="27.5" y="34.7"/>
<line x="27.3" y="34.1"/>
<line x="26.3" y="34.3"/>
<line x="25.5" y="34.3"/>
<line x="25.5" y="45.3"/>
<line x="32.5" y="39.4"/>
<line x="39.5" y="45.3"/>
<line x="39.5" y="34.3"/>
<line x="38.8" y="34.3"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="41.6" y="24.8"/>
<line x="42.8" y="23.5"/>
<line x="41.3" y="22.5"/>
<line x="42.1" y="20.9"/>
<line x="40.4" y="20.3"/>
<line x="40.8" y="18.6"/>
<line x="39" y="18.4"/>
<line x="38.9" y="16.7"/>
<line x="37.1" y="17"/>
<line x="36.6" y="15.4"/>
<line x="35" y="16.1"/>
<line x="34" y="14.7"/>
<line x="32.6" y="15.8"/>
<line x="31.3" y="14.7"/>
<line x="30.3" y="16.1"/>
<line x="28.7" y="15.4"/>
<line x="28.1" y="17"/>
<line x="26.4" y="16.7"/>
<line x="26.3" y="18.4"/>
<line x="24.5" y="18.6"/>
<line x="24.8" y="20.3"/>
<line x="23.2" y="20.9"/>
<line x="23.9" y="22.5"/>
<line x="22.5" y="23.5"/>
<line x="23.6" y="24.8"/>
<line x="22.5" y="26.1"/>
<line x="23.9" y="27.1"/>
<line x="23.2" y="28.7"/>
<line x="24.
|
{
"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.
!-->
## <a id="ComparisonFunctions">Comparison Functions</a> ##
### greatest ###
* Syntax:
greatest(numeric_value1, numeric_value2, ...)
* Computes the greatest value among arguments.
* Arguments:
* `numeric_value1`: a `tinyint`/`smallint`/`integer`/`bigint`/`float`/`double` value,
* `numeric_value2`: a `tinyint`/`smallint`/`integer`/`bigint`/`float`/`double` value,
* ....
* Return Value:
* the greatest values among arguments.
The returning type is decided by the item type with the highest
order in the numeric type promotion order (`tinyint`-> `smallint`->`integer`->`bigint`->`float`->`double`)
among items.
* `null` if any argument is a `missing` value or `null` value,
* any other non-numeric input value will cause a type error.
* Example:
{ "v1": greatest(1, 2, 3), "v2": greatest(float("0.5"), double("-0.5"), 5000) };
* The expected result is:
{ "v1": 3, "v2": 5000.0 }
### least ###
* Syntax:
least(numeric_value1, numeric_value2, ...)
* Computes the least value among arguments.
* Arguments:
* `numeric_value1`: a `tinyint`/`smallint`/`integer`/`bigint`/`float`/`double` value,
* `numeric_value2`: a `tinyint`/`smallint`/`integer`/`bigint`/`float`/`double` value,
* ....
* Return Value:
* the least values among arguments.
The returning type is decided by the item type with the highest
order in the numeric type promotion order (`tinyint`-> `smallint`->`integer`->`bigint`->`float`->`double`)
among items.
* `null` if any argument is a `missing` value or `null` value,
* any other non-numeric input value will cause a type error.
* Example:
{ "v1": least(1, 2, 3), "v2": least(float("0.5"), double("-0.5"), 5000) };
* The expected result is:
{ "v1": 1, "v2": -0.5 }
|
{
"pile_set_name": "Github"
}
|
package au.edu.wehi.idsv.visualisation;
import au.edu.wehi.idsv.visualisation.TrackedBuffer.NamedTrackedBuffer;
import htsjdk.samtools.util.CloserUtil;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Tracks intermediate buffer sizes for memory tracking purposes.
* @author Daniel Cameron
*
*/
public class BufferTracker {
private final List<WeakReference<TrackedBuffer>> bufferObjects = Collections.synchronizedList(new ArrayList<WeakReference<TrackedBuffer>>());
private final File output;
private final float writeIntervalInSeconds;
private volatile Worker worker = null;
/**
* Tracking
* @param owner owning object. If the owning object is garbage collected, tracking stops
* @param output output file
* @param writeIntervalInSeconds interval between
*/
public BufferTracker(File output, float writeIntervalInSeconds) {
this.output = output;
this.writeIntervalInSeconds = writeIntervalInSeconds;
}
public void start() {
worker = new Worker();
worker.setName("BufferTracker");
worker.setDaemon(true);
worker.start();
}
public void stop() {
if (worker == null) return;
Worker currentWorker = worker;
worker = null;
currentWorker.interrupt();
}
public synchronized void register(String context, TrackedBuffer obj) {
obj.setTrackedBufferContext(context);
bufferObjects.add(new WeakReference<TrackedBuffer>(obj));
}
private synchronized String getCsvRows() {
StringBuilder sb = new StringBuilder();
String timestamp = LocalDateTime.now().toString();
for (WeakReference<TrackedBuffer> wr : bufferObjects) {
TrackedBuffer buffer = wr.get();
if (buffer != null) {
for (NamedTrackedBuffer bufferSize : buffer.currentTrackedBufferSizes()) {
sb.append(timestamp);
sb.append(',');
sb.append(bufferSize.name);
sb.append(',');
sb.append(Long.toString(bufferSize.size));
sb.append('\n');
}
}
}
return sb.toString();
}
private void append() {
FileOutputStream os = null;
String str = getCsvRows();
if (!str.isEmpty()) {
try {
os = new FileOutputStream(output, true);
os.write(str.getBytes(StandardCharsets.UTF_8));
os.flush();
os.close();
os = null;
} catch (IOException e) {
} finally {
CloserUtil.close(os);
}
}
}
private class Worker extends Thread {
@Override
public void run() {
while (true) {
try {
Thread.sleep((long)(writeIntervalInSeconds * 1000));
append();
} catch (InterruptedException e) {
} finally {
if (worker != this) {
return;
}
}
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.