text
stringlengths 2
99.9k
| 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.Err()
}
}
// Reply sends a reply to the given request.
// It is an error to call this if request was not a call.
// You must call this exactly once for any given request.
// If err is set then result will be ignored.
func (c *Conn) Reply(ctx context.Context, req *Request, result interface{}, err error) error {
if req.IsNotify() {
return fmt.Errorf("reply not invoked with a valid call")
}
c.handlingMu.Lock()
handling, found := c.handling[*req.ID]
if found {
delete(c.handling, *req.ID)
}
c.handlingMu.Unlock()
if !found {
return fmt.Errorf("not a call in progress: %v", req.ID)
}
elapsed := time.Since(handling.start)
var raw *json.RawMessage
if err == nil {
raw, err = marshalToRaw(result)
}
response := &Response{
Result: raw,
ID: req.ID,
}
if err != nil {
if callErr, ok := err.(*Error); ok {
response.Error = callErr
} else {
response.Error = NewErrorf(0, "%s", err)
}
}
data, err := json.Marshal(response)
if err != nil {
return err
}
c.log(Send, response.ID, elapsed, req.Method, response.Result, response.Error)
if err = c.stream.Write(ctx, data); err != nil {
// TODO(iancottrell): if a stream write fails, we really need to shut down
// the whole stream
return err
}
return nil
}
type handling struct {
request *Request
cancel context.CancelFunc
start time.Time
}
// combined has all the fields of both Request and Response.
// We can decode this and then work out which it is.
type combined struct {
VersionTag VersionTag `json:"jsonrpc"`
ID *ID `json:"id,omitempty"`
Method string `json:"method"`
Params *json.RawMessage `json:"params,omitempty"`
Result *json.RawMessage `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
// Run starts a read loop on the supplied reader.
// It must be called exactly once for each Conn.
// It returns only when the reader is closed or there is an error in the stream.
func (c *Conn) run(ctx context.Context) error {
for {
// get the data for a message
data, err := c.stream.Read(ctx)
if err != nil {
// the stream failed, we cannot continue
return err
}
// read a combined message
msg := &combined{}
if err := json.Unmarshal(data, msg); err != nil {
// a badly formed message arrived, log it and continue
// we trust the stream to have isolated the error to just this message
c.log(Receive, nil, -1, "", nil, NewErrorf(0, "unmarshal failed: %v", err))
continue
}
// work out which kind of message we have
switch {
case msg.Method != "":
// if method is set it must be a request
request := &Request{
Method: msg.Method,
Params: msg.Params,
ID: msg.ID,
}
if request.IsNotify() {
c.log(Receive, request.ID, -1, request.Method, request.Params, nil)
// we have a Notify, forward to the handler in a go routine
c.handle(ctx, c, request)
} else {
// we have a Call, forward to the handler in another go routine
reqCtx, cancelReq := context.WithCancel(ctx)
c.handlingMu.Lock()
c.handling[*request.ID] = handling{
request: request,
cancel: cancelReq,
start: time.Now(),
}
c.handlingMu.Unlock()
c.log(Receive, request.ID, -1, request.Method, request.Params, nil)
c.handle(reqCtx, c, request)
}
case msg.ID != nil:
// we have a response, get the pending entry from the map
c.pendingMu.Lock()
rchan := c.pending[*msg.ID]
if rchan != nil {
delete(c.pending, *msg.ID)
}
c.pendingMu.Unlock()
// and send the reply to the channel
response := &Response{
Result: msg.Result,
Error: msg.Error,
ID: msg.ID,
}
rchan <- response
close(rchan)
default:
c.log(Receive, nil, -1, "", nil, NewErrorf(0, "message not a call, notify or response, ignoring"))
}
}
}
func marshalToRaw(obj interface{}) (*json.RawMessage, error) {
data, err := json.Marshal(obj)
if err != nil {
return nil, err
}
raw := json.RawMessage(data)
return &raw, nil
}
| {
"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() float
/* 0020C 808946AC E7A800B0 */ swc1 $f8, 0x00B0($sp)
/* 00210 808946B0 3C014190 */ lui $at, 0x4190 ## $at = 41900000
/* 00214 808946B4 44815000 */ mtc1 $at, $f10 ## $f10 = 18.00
/* 00218 808946B8 00000000 */ nop
/* 0021C 808946BC 460A0402 */ mul.s $f16, $f0, $f10
/* 00220 808946C0 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next() float
/* 00224 808946C4 E7B000B4 */ swc1 $f16, 0x00B4($sp)
/* 00228 808946C8 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000
/* 0022C 808946CC 44819000 */ mtc1 $at, $f18 ## $f18 = 0.50
/* 00230 808946D0 3C014170 */ lui $at, 0x4170 ## $at = 41700000
/* 00234 808946D4 44813000 */ mtc1 $at, $f6 ## $f6 = 15.00
/* 00238 808946D8 46120101 */ sub.s $f4, $f0, $f18
/* 0023C 808946DC 46062202 */ mul.s $f8, $f4, $f6
/* 00240 808946E0 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next() float
/* 00244 808946E4 E7A800B8 */ swc1 $f8, 0x00B8($sp)
/* 00248 808946E8 46160282 */ mul.s $f10, $f0, $f22
/* 0024C 808946EC 24100001 */ addiu $s0, $zero, 0x0001 ## $s0 = 00000001
/* 00250 808946F0 4600540D */ trunc.w.s $f16, $f10
/* 00254 808946F4 44028000 */ mfc1 $v0, $f16
/* 00258 808946F8 00000000 */ nop
/* 0025C 808946FC 24420001 */ addiu $v0, $v0, 0x0001 ## $v0 = 00000001
/* 00260 80894700 00027C00 */ sll $t7, $v0, 16
/* 00264 80894704 000FC403 */ sra $t8, $t7, 16
/* 00268 80894708 00028C00 */ sll $s1, $v0, 16
/* 0026C 8089470C 2B01000B */ slti $at, $t8, 0x000B
/* 00270 80894710 14200003 */ bne $at, $zero, .L80894720
/* 00274 80894714 00118C03 */ sra $s1, $s1, 16
/* 00278 80894718 10000001 */ beq $zero, $zero, .L80894720
/* 0027C 8089471C 24100005 */ addiu $s0, $zero, 0x0005 ## $s0 = 00000005
.L80894720:
/* 00280 80894720 0C03F66B */ jal Math_Rand_ZeroOne
## Rand.Next() float
/* 00284 80894724 00000000 */ nop
/* 00288 80894728 3C018089 */ lui $at, %hi(D_808950A0) ## $at = 80890000
/* 0028C 8089472C C43250A0 */ lwc1 $f18, %lo(D_808950A0)($at)
/* 00290 80894730 8FA400CC */ lw $a0, 0x00CC($sp)
/* 00294 80894734 02C02825 */ or $a1, $s6, $zero ## $a1 = FFFFFFF4
/* 00298 80894738 4612003C */ c.lt.s $f0, $f18
/* 0029C 8089473C 02E03025 */ or $a2, $s7, $zero ## $a2 = FFFFFFE8
/* 002A0 80894740 02C03825 */ or $a3, $s6, $zero ## $a3 = FFFFFFF4
/* 002A4 80894744 2419FED4 */ addiu $t9, $zero, 0xFED4 ## $t9 = FFFFFED4
/* 002A8 80894748 45000005 */ bc1f .L80894760
/* 002AC 8089474C 24080001 */ addiu $t0, $zero, 0x0001 ## $t0 = 00000001
/* 002B0 80894750 36100040 */ ori $s0, $s0, 0x0040 ## $s0 = 00000045
/* 002B4 80894754 00108400 */ sll $s0, $s0, 16
/* 002B8 80894758 10000008 */ beq $zero, $zero, .L8089477C
/* 002BC 8089475C 00108403 */ sra $s0, $s0, 16
.L80894760:
/* 002C0 80894760 36100020 */ ori $s0, $s0, 0x0020 ## $s0 = 00000065
/* 002C4 80894764 00108400 */ sll $s0, $s0, 16
/* 002C8 80894768 2A210008 */ slti $at, $s1, 0x0008
/* 002CC 8089476C 10200003 */ beq $at, $zero, .L8089477C
/* 002D0 80894770 00108403 */ sra $s0, $s0, 16
/* 002D4 80894774 24120046 */ addiu $s2, $zero, 0x0046 ## $s2 = 00000046
/* 002D8 80894778 24130028 */ addiu $s3, $zero, 0x0028 ## $s3 = 00000028
.L8089477C:
/* 002DC 8089477C 2409000F */ addiu $t1, $zero, 0x000F ## $t1 = 0000000F
/* 002E0 80894780 240A0050 */ addiu $t2, $zero, 0x0050 ## $t2 = 00000050
/* 002E4 80894784 240BFFFF */ addiu $t3, $zero, 0xFFFF ## $t3 = FFFFFFFF
/* 002E8 80894788 240C00F1 */ addiu $t4, $zero, 0x00F1 ## $t4 = 000000F1
/* 002EC 8089478C AFAC0038 */ sw $t4, 0x0038($sp)
/* 002F0 80894790 AFAB0034 */ sw $t3, 0x0034($sp)
/* 002F4 80894794 AFAA0030 */ sw $t2, 0x0030($sp)
/* 002F8 80894798 AFA9002C */ sw $t1, 0x002C($sp)
/* 002FC 8089479C AFB90010 */ sw $t9, 0x0010($sp)
/* 00300 808947A0 AFB00014 */ sw $s0, 0x0014($sp)
/* 00304 808947A4 AFB20018 */ sw $s2, 0x0018($sp)
/* 00308 808947A8 AFB3001C */ sw $s3, 0x001C($sp)
/* 0030C 808947AC AFA00020 */ sw $zero, 0x0020($sp)
/* 00310 808947B0 AFB10024 */ sw $s1, 0x0024($sp)
/* 00314 808947B4 AFA80028 */ sw $t0, 0x0028($sp)
/* 00318 808947B8 0C00A7A3 */ jal Effect_SpawnFragment
/* 0031C 808947BC AFBE003C */ sw $s8, 0x003C($sp)
/* 00320 808947C0 26940001 */ addiu $s4, $s4, 0x0001 ## $s4 = 00000001
/* 00324 808947C4 24010014 */ addiu $at, $zero, 0x0014 ## $at = 00000014
/* 00328 808947C8 5681FF9F */ bnel $s4, $at, .L80894648
/* 0032C 808947CC 2412000C */ addiu $s2, $zero, 0x000C ## $s2 = 0000000C
/* 00330 808947D0 240D0064 */ addiu $t5, $zero, 0x0064 ## $t5 = 00000064
/* 00334 808947D4 240E00A0 */ addiu $t6, $zero, 0x00A0 ## $t6 = 000000A0
/* 00338 808947D8 AFAE0014 */ sw $t6, 0x0014($sp)
/* 0033C 808947DC AFAD0010 */ sw $t5, 0x0010($sp)
/* 00340 808947E0 8FA400CC */ lw $a0, 0x00CC($sp)
/* 00344 808947E4 26A50024 */ addiu $a1, $s5, 0x0024 ## $a1 = 00000024
/* 00348 808947E8 3C0642C8 */ lui $a2, 0x42C8 ## $a2 = 42C80000
/* 0034C 808947EC 24070008 */ addiu $a3, $zero, 0x0008 ## $a3 = 00000008
/* 00350 808947F0 0C00CD20 */ jal func_80033480
/* 00354 808947F4 AFA00018 */ sw $zero, 0x0018($sp)
/* 00358 808947F8 8FBF009C */ lw $ra, 0x009C($sp)
/* 0035C 808947FC D7B40048 */ ldc1 $f20, 0x0048($sp)
/* 00360 80894800 D7B60050 */ ldc1 $f22, 0x0050($sp)
/* 00364 80894804 D7B80058 */ ldc1 $f24, 0x0058($sp)
/* 00368 80894808 D7BA0060 */ ldc1 $f26, 0x0060($sp)
/* 0036C 8089480C D7BC0068 */ ldc1 $f28, 0x0068($sp)
/* 00370 80894810 D7BE0070 */ ldc1 $f30, 0x0070($sp)
/* 00374 80894814 8FB00078 */ lw $s0, 0x0078($sp)
/* 00378 80894818 8FB1007C */ lw $s1, 0x007C($sp)
/* 0037C 8089481C 8FB20080 */ lw $s2, 0x0080($sp)
/* 00380 80894820 8FB30084 */ lw $s3, 0x0084($sp)
/* 00384 80894824 8FB40088 */ lw $s4, 0x0088($sp)
/* 00388 80894828 8FB5008C */ lw $s5, 0x008C($sp)
/* 0038C 8089482C 8FB60090 */ lw $s6, 0x0090($sp)
/* 00390 80894830 8FB70094 */ lw $s7, 0x0094($sp)
/* 00394 80894834 8FBE0098 */ lw $s8, 0x0098($sp)
/* 00398 80894838 03E00008 */ jr $ra
/* 0039C 8089483C 27BD00C8 */ addiu $sp, $sp, 0x00C8 ## $sp = 00000000
| {
"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 = 0x400
CBitFieldMaskBit11 = 0x800
CBitFieldMaskBit12 = 0x1000
CBitFieldMaskBit13 = 0x2000
CBitFieldMaskBit14 = 0x4000
CBitFieldMaskBit15 = 0x8000
CBitFieldMaskBit16 = 0x10000
CBitFieldMaskBit17 = 0x20000
CBitFieldMaskBit18 = 0x40000
CBitFieldMaskBit19 = 0x80000
CBitFieldMaskBit20 = 0x100000
CBitFieldMaskBit21 = 0x200000
CBitFieldMaskBit22 = 0x400000
CBitFieldMaskBit23 = 0x800000
CBitFieldMaskBit24 = 0x1000000
CBitFieldMaskBit25 = 0x2000000
CBitFieldMaskBit26 = 0x4000000
CBitFieldMaskBit27 = 0x8000000
CBitFieldMaskBit28 = 0x10000000
CBitFieldMaskBit29 = 0x20000000
CBitFieldMaskBit30 = 0x40000000
CBitFieldMaskBit31 = 0x80000000
CBitFieldMaskBit32 = 0x100000000
CBitFieldMaskBit33 = 0x200000000
CBitFieldMaskBit34 = 0x400000000
CBitFieldMaskBit35 = 0x800000000
CBitFieldMaskBit36 = 0x1000000000
CBitFieldMaskBit37 = 0x2000000000
CBitFieldMaskBit38 = 0x4000000000
CBitFieldMaskBit39 = 0x8000000000
CBitFieldMaskBit40 = 0x10000000000
CBitFieldMaskBit41 = 0x20000000000
CBitFieldMaskBit42 = 0x40000000000
CBitFieldMaskBit43 = 0x80000000000
CBitFieldMaskBit44 = 0x100000000000
CBitFieldMaskBit45 = 0x200000000000
CBitFieldMaskBit46 = 0x400000000000
CBitFieldMaskBit47 = 0x800000000000
CBitFieldMaskBit48 = 0x1000000000000
CBitFieldMaskBit49 = 0x2000000000000
CBitFieldMaskBit50 = 0x4000000000000
CBitFieldMaskBit51 = 0x8000000000000
CBitFieldMaskBit52 = 0x10000000000000
CBitFieldMaskBit53 = 0x20000000000000
CBitFieldMaskBit54 = 0x40000000000000
CBitFieldMaskBit55 = 0x80000000000000
CBitFieldMaskBit56 = 0x100000000000000
CBitFieldMaskBit57 = 0x200000000000000
CBitFieldMaskBit58 = 0x400000000000000
CBitFieldMaskBit59 = 0x800000000000000
CBitFieldMaskBit60 = 0x1000000000000000
CBitFieldMaskBit61 = 0x2000000000000000
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
type SockaddrStorage struct {
Family uint16
_ [122]int8
_ uint32
}
type HDGeometry struct {
Heads uint8
Sectors uint8
Cylinders uint16
Start uint32
}
type Statfs_t struct {
Type int32
Bsize int32
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int32
Frsize int32
Flags int32
Spare [4]int32
}
type TpacketHdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
}
const (
SizeofTpacketHdr = 0x18
)
type RTCPLLInfo struct {
Ctrl int32
Value int32
Max int32
Min int32
Posmult int32
Negmult int32
Clock int32
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
}
const (
BLKPG = 0x1269
)
type XDPUmemReg struct {
Addr uint64
Len uint64
Size uint32
Headroom uint32
Flags uint32
}
type CryptoUserAlg struct {
Name [64]int8
Driver_name [64]int8
Module_name [64]int8
Type uint32
Mask uint32
Refcnt uint32
Flags uint32
}
type CryptoStatAEAD struct {
Type [64]int8
Encrypt_cnt uint64
Encrypt_tlen uint64
Decrypt_cnt uint64
Decrypt_tlen uint64
Err_cnt uint64
}
type CryptoStatAKCipher struct {
Type [64]int8
Encrypt_cnt uint64
Encrypt_tlen uint64
Decrypt_cnt uint64
Decrypt_tlen uint64
Verify_cnt uint64
Sign_cnt uint64
Err_cnt uint64
}
type CryptoStatCipher struct {
Type [64]int8
Encrypt_cnt uint64
Encrypt_tlen uint64
Decrypt_cnt uint64
Decrypt_tlen uint64
Err_cnt uint64
}
type CryptoStatCompress struct {
Type [64]int8
Compress_cnt uint64
Compress_tlen uint64
Decompress_cnt uint64
Decompress_tlen uint64
Err_cnt uint64
}
type CryptoStatHash struct {
Type [64]int8
Hash_cnt uint64
Hash_tlen uint64
Err_cnt uint64
}
type CryptoStatKPP struct {
Type [64]int8
Setsecret_cnt uint64
Generate_public_key_cnt uint64
Compute_shared_secret_cnt uint64
Err_cnt uint64
}
type CryptoStatRNG struct {
Type [64]int8
Generate_cnt uint64
Generate_tlen uint64
Seed_cnt uint64
Err_cnt uint64
}
type CryptoStatLarval struct {
Type [64]int8
}
type CryptoReportLarval struct {
Type [64]int8
}
type CryptoReportHash struct {
Type [64]int8
Blocksize uint32
Digestsize uint32
}
type CryptoReportCipher struct {
Type [64]int8
Blocksize uint32
Min_keysize uint32
Max_keysize uint32
}
type CryptoReportBlkCipher struct {
Type [64]int8
Geniv [64]int8
Blocksize uint32
Min_keysize uint32
Max_keysize uint32
Ivsize uint32
}
type CryptoReportAEAD struct {
Type [64]int8
Geniv [64]int8
Blocksize uint32
Maxauthsize uint32
Ivsize uint32
}
type CryptoReportComp struct {
Type [64]int8
}
type CryptoReportRNG struct {
Type [64]int8
Seedsize uint32
}
type CryptoReportAKCipher struct {
Type [64]int8
}
type CryptoReportKPP struct {
Type [64]int8
}
type CryptoReportAcomp struct {
Type [64]int8
}
type LoopInfo struct {
Number int32
Device uint16
Inode uint32
Rdevice uint16
Offset int32
Encrypt_type int32
Encrypt_key_size int32
Flags int32
Name [64]int8
Encrypt_key [32]uint8
Init [2]uint32
Reserved [4]int8
}
type TIPCSubscr struct {
Seq TIPCServiceRange
Timeout uint32
Filter uint32
Handle [8]int8
}
type TIPCSIOCLNReq struct {
Peer uint32
Id uint32
Linkname [68]int8
}
type TIPCSIOCNodeIDReq struct {
Peer uint32
Id [16]int8
}
| {
"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 <[email protected]>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 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 future. So the question is whether we can design this API in a way to protect privacy, so that V2 doesn't need to be incompatible.
SFC: The high bit is that we need to get a privacy expert involved.
EAO: Another question is whether these endpoints would vary between browsers. We clearly don't have an understanding of it at this time.
SFC: as mentioned in the issue, the source of all of this is the CLDR data. In Safari, that is linked to the OS version, for Chrome and FF, it is linked to the browser version.
ZB: Yes, but we're also talking about making our constructors asynchronous, which could cause additional data to be loaded. For example, maybe you visit controversial websites written in a different language and have data loaded from those websites.
USA: That's a good point.
RCA: If we're exposing with these APIs specific data from CLDR that is always the same, what is the point of getSupported? Because we're conditionally loading these lists.
FYT: When we say “the same”, we mean within that version. If you upgrade your browser, you may get a different list.
### Intl Locale Info API
https://github.com/FrankYFTang/proposal-intl-locale-info/
FYT: This is based on issues #6 and #205 on the ECMA-402 issue tracker. For Locale, there are certain things associated with the locale that may be useful for the user to get. I put those together.
One is the weekday data. Zibi already has mozIntl.getCalendarInfo. And there are some not-internationalized JavaScript APIs that give you the first day of the week. But the fact that those libraries exist speaks to the use cases. The week data provides basic information: what is the first day of the week? Where does the weekend start and end? How many days need to be in the week to be considered the first week of the year? There are questions on Stack Overflow. We also have ICU4C/ICU4J for this.
Another is language direction. Given a language, is it RTL or LTR? It should really be "is it bi-di", since no language, not even Arabic, is strictly right-to-left. There are third-party libraries that do a similar thing.
Then, there’s something called a “measurement system”. Currently, I don’t think ICU exposes everything we need for this, there’s a different set of functions in both Java and C, but data is in CLDR. I don’t know how exactly we need to expose that information. One solution is that we can just add getters to Intl.Locale and we keep adding more getters as we go. The second approach is to add a function to Intl, and you can pass the info you need in a string, this is closer to how Mozilla does it currently. This is still up for discussion. I want to discuss if this is meaningful to move to Stage 1.
JSW: This is perfectly reasonable information.
ZB: I am also in favor of this and this looks like a pretty solid API. This is important info that I can give numerous use-cases for. Lots of applications would require this kind of information eventually.
SFC: I like this idea, but I’m not sure what the final API should look like. I would point you to issue #409 where DE proposed getters like “preferredCalendar” and more. For locale, we’d check the extension key and if none exist, we’d have to fall back to the base locale. Therefore, we need to see how this works alongside the user preferences use-case. Eventually we’d reach a point where locales would have user preferred values and we need to make sure these two work well together.
FYT: but the locale already has the user preferences, whether it is in object or string format. This is different from the question of user preferences, which might have its own set of privacy concerns.
SFC: Locale identifier keywords is a mechanism within the vision for user preferences. The point is that if you get a locale identifier that has a keyword like hourCycle, you should return that keyword, or else fall back to locale data.
FYT: there’s multiple ways of dealing with this. That said, we can discuss that at more length at Stage 1, this is definitely not a concern that needs to be addressed right now.
SFC: I agree, we should answer these questions at Stage 1, before Stage 2.
FYT: would you like to co-champion this?
ZB: I can help with specific requests but I cannot commit to co-championing this currently, apologies.
SFC: Do we have consensus for Stage 1?
JSW: +1
EAO: +1
USA: +1
#### Conclusion
Consensus for Stage 1.
### Intl.DisplayNames V2
https://github.com/FrankYFTang/intl-displaynames-v2/
FYT: Intl.DisplayNames has got to Stage 3, and we’re looking at Stage 4. This is a set of enhancements to that proposal. We’re mainly considering two enhancements.
The first one is: weekday names and month names. Originally we had weekday names and month names, but due to challenges with calendars with leap months and Temporal, we took it out of V1. But for V2, I think we should find a way to put it back.
Next is that NumberFormat is shipped with units, and there are times when users have a UI with a column with labels like "meter", which requires a unit display name. It was originally tracked in Intl.DisplayNames issue 34. I think we need to work on the use case in a little more detail.
Next is time zone names. People can hack around with the DateFormat API, but it might not be correct. For example, daylight savings time is confusing, because it varies from northern to southern hemisphere.
The other two are numbering system and calendar names. For example, the Islamic Calendar (there are 3-4 types), etc. Maybe we decide it's not that important, but it's an option.
Finally, we would consider Supporting Dialect. SRL suggested this one. It's talking about when we ask for a language… I'd like to discuss use cases.
JSW: What is the use case for time zone names?
FYT: Pickers.
JSW: If they build a picker, would they have America/Los_Angeles instead?
SFC: There are metazones as well as specific time zones like “Pacific Daylight Time”. This makes much more sense in different languages, for example “India Standard Time” translated in Hindi would make so much more sense.
USA: A lot of people don't know about America/Calcutta, which is generally what they should be using.
JSW: People living in Arizona don't have local variants from the norm.
PFC: In my opinion the most effective time zone pickers are map-based.
SFC: It is still useful to have localized strings.
PFC: no pickers are quite ideal because timezones aren’t ideal.
JSW: I'm looking at the GNOME picker. It has a drop-down.
SFC: do we want to discuss which of these we want to promote or should we promote the whole proposal and discuss the rest later?
FYT: If people have opinions on what should or shouldn't be here, now is a good time to express it. Priorities are also good to know.
ZB: My experience is that weekday and month names are the most commonly requested from frontend engineers.
SFC: I made a comment that we can deal with at least month names (the problem being with leap months). I think we can use Temporal.YearMonth. reasonably by casting Temporal YearMonth into DisplayNames. For weekdays, maybe we can qualify them to be called “modern weekdays” because of historic calendars. Temporal has progressed to a point where we can discuss this in more detail.
FYT: Can you talk about the YearMonth thing in more detail?
SFC: [Temporal.YearMonth](https://github.com/tc39/proposal-temporal/blob/main/docs/yearmonth.md) can be a year and a month in an arbitrary calendar system. By using this, we don’t have to figure out a weird way of dealing with leap months. In the Hebrew calendar, things get messy but this allows us to unambiguously deal with this problem.
JSW: We're missing month, weekday, quarter, day period, and datetime field. I think day period is especially important.
SFC: The first two are covered but the last three aren’t.
FYT: I can put those back.
ZB: The problem with day period is that it doesn't span across all cultures. We could figure out some way to deal with them, but it would potentially get pretty messy.
FYT: day period is indeed very tricky. CLDR has two definitions of day period, one which you mentioned and the other is AM/PM. We need to be careful when discussing this.
SFC: It’s not perfect but it’s not horrible to use Intl.DateTimeFormat with a single field. It doesn’t give us a few things that DisplayNames does, but it does handle a lot of these things much better.
FYT: The problem is you have to construct a Date first. You have to figure out the date and time zone. You're forcing the engineer to do steps beyond what they need to do.
SFC: Hopefully this would become much easier with Temporal, but I get your point.
FYT: Can I have someone to help me with use cases to express how important this is?
YMD: I could help.
FYT: Which one could you help with?
YMD: You talked about the islamic calendar. I could help with those cases.
RCA: I can help with week and month names.
SFC: Peter Edberg wanted unit names for Apple. I can look those up.
JSW: Would you include data for compound units? Like kilometer-per-hour?
SFC: Good question. I think we'd only want to expose the data explicitly in CLDR. kilometer-per-hour is supported, but not kilojoule-per-furlong, but right now ECMA-402 doesn't distinguish between those two.
FYT: Can we move to Stage 1 in the next TC39 meeting?
SFC: I have Stage 2 concerns for the weekday/month/dayperiod, but I think we’re good to go for Stage 1. It would be useful to write example code for how you can do this today in DateTimeFormat, and then what the code would look like in Temporal and in Intl.DisplayNames V2.
FYT: sounds like a decent approach. Do we have another meeting for the deadline for the next meeting?
SFC: Yes.
FYT: perfect. We can discuss this in more detail next time once I’ve put in some more work.
#### Conclusion
Consensus for Stage 1
### Update "Conformance" section for new options/constructors
https://github.com/tc39/ecma402/issues/467
SFC: *reads CP’s response*
SFC: this predates Caridy’s time as editor, we should ask NL.
LEO: You can ask RW about it too.
SFC: I see three options:
1. Continue adding items to Section 2 that could throw RangeErrors.
2. Keep Section 2 stable without adding new options to it.
3. Remove items from Section 2 to make conformance requirements stricter.
LEO: I like Option 3 and removing the third paragraph of Section 2. However, Option 2 is the safest and most convenient.
FYT: I don't have a strong opinion. I think that Option 2 is the status quo and isn't too bad.
### Require options to be an object #480
https://github.com/tc39/ecma402/issues/480
PFC: In Temporal, we plan to use options bags similar to 402. There isn’t any precedent for such options bags in 262. For that reason, we’d like to move the abstract op to 262 and 402 pick it up from there. At the very least, we’d want the two to be the same. The current GetOption in 402 is a bit weird. It boxes primitives and tries to read them then, which makes little sense. This behavior never really shows up in 402. This includes two commits: one is editorial which doesn’t change behavior in 402. That said, there’s a normative commit after that which does change the behavior, because the current behavior seemed strange and we wanted to change that if possible in a web compatible way.
SFC: right now when you call an Intl constructor with an options arg which isn’t an object, we call ToObject on it. The reason it’s not an editorial PR, we’d throw a typeerror instead of calling GetObject.
JSW: the only case we can be worried about would be accidental cases in which case this was done but somehow worked because the caller was expecting the default behaviour.
FYT: so do you mean
SFC: I want to separate the semantic issue and the spec issue. The important question here is, are we okay with the normative change here.
FYT: I agree but I don’t think it’s as simple as an editorial issue.
SFC: Let me start with this question. Does anyone think the original behavior is better than the proposed version? In this case, Temporal would like to adopt this. The question now is, do we need to match it in 402 or do we keep doing what we do?
SFC: we can stick to the new behavior in Temporal, rename the GetOptions to something like LegacyGetOptions and use GetOptions moving forwards.
???
SFC: we call GetOptions multiple times sometimes. Is type checking observable?
JSW: that depends on the implementation.
RGN: to answer SFC’s question, no.
FYT: Is there a Type abstract op?
RGN: It’s just a notation.
SFC: We can explicitly move those 4 lines to something like “NormalizeOptions”
RGN: That seems to be an improvement in itself.
FYT: that would be observable. The current PR is an improvement over that.
SFC: I propose we only call it once, at the top.
FYT: I would suggest we discuss this on the issue tracker.
| {
"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 <[email protected]>
*
* 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;
char pad_to_offset_24_[6];
ERROR_STR_def errorText;
IDL_PTR_PAD(errorText, 1)
IDL_long operationAbortId;
IDL_long errorCodeType;
IDL_string Param1;
IDL_PTR_PAD(Param1, 1)
IDL_string Param2;
IDL_PTR_PAD(Param2, 1)
IDL_string Param3;
IDL_PTR_PAD(Param3, 1)
IDL_string Param4;
IDL_PTR_PAD(Param4, 1)
IDL_string Param5;
IDL_PTR_PAD(Param5, 1)
IDL_string Param6;
IDL_PTR_PAD(Param6, 1)
IDL_string Param7;
IDL_PTR_PAD(Param7, 1)
};
typedef ERROR_DESC_t ERROR_DESC_def;
#define ERROR_DESC_def_cin_ ((char *) \
"b14+FFFd5+d0+FFd0+d0+d0+d0+d0+d0+d0+")
#define ERROR_DESC_def_csz_ ((IDL_unsigned_long) 36)
typedef struct ERROR_DESC_LIST_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
ERROR_DESC_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} ERROR_DESC_LIST_def;
#define ERROR_DESC_LIST_def_cin_ ((char *) \
"c0+b14+FFFd5+d0+FFd0+d0+d0+d0+d0+d0+d0+")
#define ERROR_DESC_LIST_def_csz_ ((IDL_unsigned_long) 39)
struct SQLItemDesc_t {
IDL_long version;
SQL_DATATYPE_def dataType;
IDL_long datetimeCode;
IDL_long maxLen;
IDL_short precision;
IDL_short scale;
IDL_boolean nullInfo;
IDL_char colHeadingNm[514];
IDL_boolean signType;
IDL_long ODBCDataType;
IDL_short ODBCPrecision;
char pad_to_offset_544_[2];
IDL_long SQLCharset;
IDL_long ODBCCharset;
IDL_char TableName[514];
IDL_char CatalogName[514];
IDL_char SchemaName[514];
IDL_char Heading[514];
IDL_long intLeadPrec;
IDL_long paramMode;
};
typedef SQLItemDesc_t SQLItemDesc_def;
#define SQLItemDesc_def_cin_ ((char *) \
"b19+FFFFIIBd513+BFIFFd513+d513+d513+d513+FF")
#define SQLItemDesc_def_csz_ ((IDL_unsigned_long) 43)
typedef struct SQLItemDescList_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
SQLItemDesc_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} SQLItemDescList_def;
#define SQLItemDescList_def_cin_ ((char *) \
"c0+b19+FFFFIIBd513+BFIFFd513+d513+d513+d513+FF")
#define SQLItemDescList_def_csz_ ((IDL_unsigned_long) 46)
struct SQLValue_t {
SQL_DATATYPE_def dataType;
SQL_INDICATOR_def dataInd;
char pad_to_offset_8_[2];
SQL_DataValue_def dataValue;
IDL_long dataCharset;
char pad_to_size_32_[4];
};
typedef SQLValue_t SQLValue_def;
#define SQLValue_def_cin_ ((char *) "b4+FIc0+HF")
#define SQLValue_def_csz_ ((IDL_unsigned_long) 10)
typedef struct SQLValueList_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
SQLValue_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} SQLValueList_def;
#define SQLValueList_def_cin_ ((char *) "c0+b4+FIc0+HF")
#define SQLValueList_def_csz_ ((IDL_unsigned_long) 13)
typedef IDL_enum USER_DESC_TYPE_t;
#define SID_TYPE ((IDL_enum) 0)
#define AUTHENTICATED_USER_TYPE ((IDL_enum) 1)
#define UNAUTHENTICATED_USER_TYPE ((IDL_enum) 2)
#define PASSWORD_ENCRYPTED_USER_TYPE ((IDL_enum) 3)
#define SID_ENCRYPTED_USER_TYPE ((IDL_enum) 4)
#define WIN95_USER_TYPE ((IDL_enum) 5)
typedef USER_DESC_TYPE_t USER_DESC_TYPE_def;
#define USER_DESC_TYPE_def_cin_ ((char *) "h5+")
#define USER_DESC_TYPE_def_csz_ ((IDL_unsigned_long) 3)
struct USER_DESC_t {
USER_DESC_TYPE_def userDescType;
char pad_to_offset_8_[4];
USER_SID_def userSid;
IDL_string domainName;
IDL_PTR_PAD(domainName, 1)
IDL_string userName;
IDL_PTR_PAD(userName, 1)
USER_PASSWORD_def password;
};
typedef USER_DESC_t USER_DESC_def;
#define USER_DESC_def_cin_ ((char *) "b5+h5+c0+Hd0+d0+c0+H")
#define USER_DESC_def_csz_ ((IDL_unsigned_long) 20)
struct VERSION_t {
IDL_short componentId;
IDL_short majorVersion;
IDL_short minorVersion;
char pad_to_offset_8_[2];
IDL_unsigned_long buildId;
};
typedef VERSION_t VERSION_def;
#define VERSION_def_cin_ ((char *) "b4+IIIK")
#define VERSION_def_csz_ ((IDL_unsigned_long) 7)
typedef struct VERSION_LIST_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
VERSION_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} VERSION_LIST_def;
#define VERSION_LIST_def_cin_ ((char *) "c0+b4+IIIK")
#define VERSION_LIST_def_csz_ ((IDL_unsigned_long) 10)
struct CONNECTION_CONTEXT_t {
SQL_IDENTIFIER_def datasource;
SQL_IDENTIFIER_def catalog;
SQL_IDENTIFIER_def schema;
SQL_IDENTIFIER_def location;
SQL_IDENTIFIER_def userRole;
char pad_to_offset_2566_[1];
IDL_short accessMode;
IDL_short autoCommit;
char pad_to_offset_2572_[2];
IDL_unsigned_long queryTimeoutSec;
IDL_unsigned_long idleTimeoutSec;
IDL_unsigned_long loginTimeoutSec;
IDL_short txnIsolationLevel;
IDL_short rowSetSize;
IDL_long diagnosticFlag;
IDL_unsigned_long processId;
IDL_char computerName[61];
char pad_to_offset_2664_[7];
IDL_string windowText;
IDL_PTR_PAD(windowText, 1)
IDL_unsigned_long ctxACP;
IDL_unsigned_long ctxDataLang;
IDL_unsigned_long ctxErrorLang;
IDL_short ctxCtrlInferNCHAR;
IDL_short cpuToUse;
IDL_short cpuToUseEnd;
IDL_char clientVproc[101];
char pad_to_offset_2744_[3];
IDL_string connectOptions;
IDL_PTR_PAD(connectOptions, 1)
VERSION_LIST_def clientVersionList;
IDL_unsigned_long inContextOptions1;
IDL_unsigned_long inContextOptions2;
IDL_char sessionName[101];
char pad_to_offset_2880_[3];
IDL_string clientUserName;
IDL_PTR_PAD(clientUserName, 1)
};
typedef CONNECTION_CONTEXT_t CONNECTION_CONTEXT_def;
#define CONNECTION_CONTEXT_def_cin_ ((char *) \
"b29+d512+d512+d512+d512+d512+IIKKKIIFKa1+61+Cd0+KKKIIIa1+51+"\
"Cd0+c0+b4+IIIKKKa1+101+Cd0+")
#define CONNECTION_CONTEXT_def_csz_ ((IDL_unsigned_long) 87)
struct OUT_CONNECTION_CONTEXT_t {
VERSION_LIST_def versionList;
IDL_short nodeId;
char pad_to_offset_20_[2];
IDL_unsigned_long processId;
IDL_char computerName[61];
SQL_IDENTIFIER_def catalog;
SQL_IDENTIFIER_def schema;
char pad_to_offset_1112_[1];
IDL_unsigned_long outContextOptions1;
IDL_unsigned_long outContextOptions2;
IDL_unsigned_long outContextOptionStringLen;
char pad_to_offset_1128_[4];
IDL_string outContextOptionString;
IDL_PTR_PAD(outContextOptionString, 1)
};
typedef OUT_CONNECTION_CONTEXT_t OUT_CONNECTION_CONTEXT_def;
#define OUT_CONNECTION_CONTEXT_def_cin_ ((char *) \
"b10+c0+b4+IIIKIKa1+61+Cd512+d512+KKKd0+")
#define OUT_CONNECTION_CONTEXT_def_csz_ ((IDL_unsigned_long) 39)
typedef IDL_char IDL_OBJECT_def[128];
#define IDL_OBJECT_def_cin_ ((char *) "a1+128+C")
#define IDL_OBJECT_def_csz_ ((IDL_unsigned_long) 8)
struct GEN_Param_t {
GEN_PARAM_TOKEN_def paramToken;
GEN_PARAM_OPERATION_def paramOperation;
char pad_to_offset_8_[4];
GEN_PARAM_VALUE_def paramValue;
};
typedef GEN_Param_t GEN_Param_def;
#define GEN_Param_def_cin_ ((char *) "b3+IIc0+H")
#define GEN_Param_def_csz_ ((IDL_unsigned_long) 9)
typedef struct GEN_ParamList_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
GEN_Param_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} GEN_ParamList_def;
#define GEN_ParamList_def_cin_ ((char *) "c0+b3+IIc0+H")
#define GEN_ParamList_def_csz_ ((IDL_unsigned_long) 12)
struct RES_DESC_t {
SQL_IDENTIFIER_def AttrNm;
char pad_to_offset_520_[7];
IDL_long_long Limit;
IDL_string Action;
IDL_PTR_PAD(Action, 1)
IDL_long Settable;
char pad_to_size_544_[4];
};
typedef RES_DESC_t RES_DESC_def;
#define RES_DESC_def_cin_ ((char *) "b4+d512+Gd0+F")
#define RES_DESC_def_csz_ ((IDL_unsigned_long) 13)
typedef struct RES_DESC_LIST_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
RES_DESC_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} RES_DESC_LIST_def;
#define RES_DESC_LIST_def_cin_ ((char *) "c0+b4+d512+Gd0+F")
#define RES_DESC_LIST_def_csz_ ((IDL_unsigned_long) 16)
struct ENV_DESC_t {
IDL_long VarSeq;
IDL_long VarType;
IDL_string VarVal;
IDL_PTR_PAD(VarVal, 1)
};
typedef ENV_DESC_t ENV_DESC_def;
#define ENV_DESC_def_cin_ ((char *) "b3+FFd0+")
#define ENV_DESC_def_csz_ ((IDL_unsigned_long) 8)
typedef struct ENV_DESC_LIST_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
ENV_DESC_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} ENV_DESC_LIST_def;
#define ENV_DESC_LIST_def_cin_ ((char *) "c0+b3+FFd0+")
#define ENV_DESC_LIST_def_csz_ ((IDL_unsigned_long) 11)
struct SRVR_CONTEXT_t {
INTERVAL_NUM_def srvrIdleTimeout;
INTERVAL_NUM_def connIdleTimeout;
RES_DESC_LIST_def resDescList;
ENV_DESC_LIST_def envDescList;
};
typedef SRVR_CONTEXT_t SRVR_CONTEXT_def;
#define SRVR_CONTEXT_def_cin_ ((char *) \
"b4+GGc0+b4+d512+Gd0+Fc0+b3+FFd0+")
#define SRVR_CONTEXT_def_csz_ ((IDL_unsigned_long) 32)
#ifdef USE_NEW_PHANDLE
typedef SB_Phandle_Type PROCESS_HANDLE_def;
#else
typedef IDL_short PROCESS_HANDLE_def[10];
#endif
#define PROCESS_HANDLE_def_cin_ ((char *) "a1+10+I")
#define PROCESS_HANDLE_def_csz_ ((IDL_unsigned_long) 7)
typedef struct PROCESS_HANDLE_List_def_seq_ {
IDL_unsigned_long _length;
char pad_to_offset_8_[4];
PROCESS_HANDLE_def *_buffer;
IDL_PTR_PAD(_buffer, 1)
} PROCESS_HANDLE_List_def;
#define PROCESS_HANDLE_List_def_cin_ ((char *) "c0+a1+10+I")
#define PROCESS_HANDLE_List_def_csz_ ((IDL_unsigned_long) 10)
/*
* End translation unit: ODBCCOMMON
*/
#endif /* ODBCCOMMON_H_ */
| {
"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%2Farticle%2F2014-12-10%2F2823058-AngularJS&aid=1722&nid=54)
[[译] Angular 2:基于 TypeScript (@寸志)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fzhuanlan.zhihu.com%2FFrontendMagazine%2F19970324&aid=1954&nid=62)
[Angular 2 学习资源整理 (Tim Jacobi)](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgithub.com%2Ftimjacobi%2Fangular2-education&aid=2105&nid=66)
[Google 将 Android 字体 Roboto 完全开源 (feng)](http://weekly.manong.io/bounce?url=http%3A%2F%2F36kr.com%2Fp%2F533285.html&aid=2461&nid=73)
[[译] Angular2 简介 (MrSunny)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fzhuanlan.zhihu.com%2FFrontendMagazine%2F20058966&aid=2502&nid=74)
[[译] 推荐 15 个 Angular.js 应用扩展指令 (@开源中国)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.oschina.net%2Ftranslate%2F15-directives-to-extend-your-angular-js-apps&aid=2629&nid=76)
[AngularJS 接收 PHP 变量数据 (lxjwlt)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fblog.lxjwlt.com%2Fothers%2F2015%2F06%2F23%2Fangularjs-with-php.html&aid=2736&nid=77)
[Angular 路由深入浅出 (Lovesueee)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fdiv.io%2Ftopic%2F1096&aid=2864&nid=79)
[Angular2 使用体验 (TAT.simplehuang)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.alloyteam.com%2F2015%2F07%2Fangular2-shi-yong-ti-yan%2F&aid=3129&nid=82)
[[译] Angular 1 和 Angular 2 集成:无缝升级的方法 (海涛 等)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.oschina.net%2Ftranslate%2Fangular-1-and-angular-2-coexistence&aid=3569&nid=87)
[Angular Input 格式化 (破狼)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fgreengerong.com%2Fblog%2F2015%2F09%2F03%2Fangular-inputge-shi-hua%2F&aid=3572&nid=87)
[Angular 实现递归指令:Tree View (破狼)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fgreengerong.com%2Fblog%2F2015%2F09%2F02%2Fangularshi-xian-di-gui-zhi-ling-tree-view%2F&aid=3583&nid=87)
[自定义 Angular 插件:网站用户引导](http://weekly.manong.io/bounce?url=http%3A%2F%2Fgreengerong.com%2Fblog%2F2015%2F10%2F18%2Fangular-wang-zhan-yong-hu-yin-dao-cha-jian%2F&aid=3918&nid=91)
[Angular2 快速入门学习资料](http://weekly.manong.io/bounce?url=http%3A%2F%2Fwww.cnblogs.com%2Fflyingzl%2Farticles%2F4878119.html&aid=3947&nid=91)
[从 jQuery 到 Angular 的一次改版](http://weekly.manong.io/bounce?url=http%3A%2F%2Fyalishizhude.github.io%2F2015%2F11%2F13%2Fjquery2angular%2F&aid=4288&nid=95)
[Angular 移除不必要的 $watch 之性能优化](http://weekly.manong.io/bounce?url=http%3A%2F%2Fgreengerong.com%2Fblog%2F2015%2F11%2F11%2Fangular-remove-unnecessary-watch-to-improve-performance%2F&aid=4305&nid=95)
[如何评价 Angular 2 发布 Beta 版本?](http://weekly.manong.io/bounce?url=https%3A%2F%2Fwww.zhihu.com%2Fquestion%2F38571416%2Fanswer%2F77067217&aid=4781&nid=100)
[[译] Angular2 开发指南](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgithub.com%2Fgf-rd%2Fblog%2Fissues%2F21&aid=5021&nid=103)
[基于 Angular 实现等待长操作时锁定页面](http://weekly.manong.io/bounce?url=http%3A%2F%2Fsegmentfault.com%2Fa%2F1190000004343531&aid=5153&nid=104)
[ng2websocket:Angular2 Websocket 组件](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgithub.com%2Fvanishs%2Fng2websocket&aid=5180&nid=104)
[编写你的第一个 Angular2 Web 应用](http://weekly.manong.io/bounce?url=https%3A%2F%2Fgithub.com%2Fkittencup%2Fangular2-ama-cn%2Fissues%2F24&aid=5400&nid=107)
[Angular 说:这个锅我不背](http://weekly.manong.io/bounce?url=http%3A%2F%2Fyalishizhude.github.io%2F2016%2F05%2F30%2F4angular%2F&aid=6408&nid=120)
[Angular 官方中文版](http://weekly.manong.io/bounce?url=https%3A%2F%2Fangular.cn%2Ftranslate%2Fcn%2Fhome.html&aid=6846&nid=126)
[尝试通过 AngularJS 模块按需加载搭建大型应用(上)](http://weekly.manong.io/bounce?url=http%3A%2F%2Fyalishizhude.github.io%2F2016%2F07%2F07%2Fangular-large-1%2F&aid=6851&nid=126)
[全面剖析 Angular 2 新特性](http://weekly.manong.io/bounce?url=https%3A%2F%2Ftoutiao.io%2Fj%2Fh2q6g2&aid=7683&nid=138)
[掌握 Angular2 的 NgModule(模块系统)](http://weekly.manong.io/bounce?url=https%3A%2F%2Ftoutiao.io%2Fk%2Fnlc65m&aid=7788&nid=140)
[你会用 AngularJS,但你会写 AngularJS 文档么?](http://weekly.manong.io/bounce?url=https%3A%2F%2Ftoutiao.io%2Fk%2F2j2k48&aid=8211&nid=147)
| {
"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 lazily at most once on each path through the domtree.
// TODO(adonovan): opt: cache per-function not per subtree.
renaming := make([]Value, numAllocs)
// Renaming.
rename(fn.Blocks[0], renaming, newPhis)
// Eliminate dead new phis, then prepend the live ones to each block.
for _, b := range fn.Blocks {
// Compress the newPhis slice to eliminate unused phis.
// TODO(adonovan): opt: compute liveness to avoid
// placing phis in blocks for which the alloc cell is
// not live.
nps := newPhis[b]
j := 0
for _, np := range nps {
if !phiIsLive(np.phi) {
// discard it, first removing it from referrers
for _, newval := range np.phi.Edges {
if refs := newval.Referrers(); refs != nil {
*refs = removeInstr(*refs, np.phi)
}
}
continue
}
nps[j] = np
j++
}
nps = nps[:j]
rundefersToKill := b.rundefers
if usesDefer {
rundefersToKill = 0
}
if j+b.gaps+rundefersToKill == 0 {
continue // fast path: no new phis or gaps
}
// Compact nps + non-nil Instrs into a new slice.
// TODO(adonovan): opt: compact in situ if there is
// sufficient space or slack in the slice.
dst := make([]Instruction, len(b.Instrs)+j-b.gaps-rundefersToKill)
for i, np := range nps {
dst[i] = np.phi
}
for _, instr := range b.Instrs {
if instr == nil {
continue
}
if !usesDefer {
if _, ok := instr.(*RunDefers); ok {
continue
}
}
dst[j] = instr
j++
}
for i, np := range nps {
dst[i] = np.phi
}
b.Instrs = dst
}
// Remove any fn.Locals that were lifted.
j := 0
for _, l := range fn.Locals {
if l.index < 0 {
fn.Locals[j] = l
j++
}
}
// Nil out fn.Locals[j:] to aid GC.
for i := j; i < len(fn.Locals); i++ {
fn.Locals[i] = nil
}
fn.Locals = fn.Locals[:j]
}
func phiIsLive(phi *Phi) bool {
for _, instr := range *phi.Referrers() {
if instr == phi {
continue // self-refs don't count
}
if _, ok := instr.(*DebugRef); ok {
continue // debug refs don't count
}
return true
}
return false
}
type blockSet struct{ big.Int } // (inherit methods from Int)
// add adds b to the set and returns true if the set changed.
func (s *blockSet) add(b *BasicBlock) bool {
i := b.Index
if s.Bit(i) != 0 {
return false
}
s.SetBit(&s.Int, i, 1)
return true
}
// take removes an arbitrary element from a set s and
// returns its index, or returns -1 if empty.
func (s *blockSet) take() int {
l := s.BitLen()
for i := 0; i < l; i++ {
if s.Bit(i) == 1 {
s.SetBit(&s.Int, i, 0)
return i
}
}
return -1
}
// newPhi is a pair of a newly introduced φ-node and the lifted Alloc
// it replaces.
type newPhi struct {
phi *Phi
alloc *Alloc
}
// newPhiMap records for each basic block, the set of newPhis that
// must be prepended to the block.
type newPhiMap map[*BasicBlock][]newPhi
// liftAlloc determines whether alloc can be lifted into registers,
// and if so, it populates newPhis with all the φ-nodes it may require
// and returns true.
//
func liftAlloc(df domFrontier, alloc *Alloc, newPhis newPhiMap) bool {
// Don't lift aggregates into registers, because we don't have
// a way to express their zero-constants.
switch deref(alloc.Type()).Underlying().(type) {
case *types.Array, *types.Struct:
return false
}
// Don't lift named return values in functions that defer
// calls that may recover from panic.
if fn := alloc.Parent(); fn.Recover != nil {
for _, nr := range fn.namedResults {
if nr == alloc {
return false
}
}
}
// Compute defblocks, the set of blocks containing a
// definition of the alloc cell.
var defblocks blockSet
for _, instr := range *alloc.Referrers() {
// Bail out if we discover the alloc is not liftable;
// the only operations permitted to use the alloc are
// loads/stores into the cell, and DebugRef.
switch instr := instr.(type) {
case *Store:
if instr.Val == alloc {
return false // address used as value
}
if instr.Addr != alloc {
panic("Alloc.Referrers is inconsistent")
}
defblocks.add(instr.Block())
case *UnOp:
if instr.Op != token.MUL {
return false // not a load
}
if instr.X != alloc {
panic("Alloc.Referrers is inconsistent")
}
case *DebugRef:
// ok
default:
return false // some other instruction
}
}
// The Alloc itself counts as a (zero) definition of the cell.
defblocks.add(alloc.Block())
if debugLifting {
fmt.Fprintln(os.Stderr, "\tlifting ", alloc, alloc.Name())
}
fn := alloc.Parent()
// Φ-insertion.
//
// What follows is the body of the main loop of the insert-φ
// function described by Cytron et al, but instead of using
// counter tricks, we just reset the 'hasAlready' and 'work'
// sets each iteration. These are bitmaps so it's pretty cheap.
//
// TODO(adonovan): opt: recycle slice storage for W,
// hasAlready, defBlocks across liftAlloc calls.
var hasAlready blockSet
// Initialize W and work to defblocks.
var work blockSet = defblocks // blocks seen
var W blockSet // blocks to do
W.Set(&defblocks.Int)
// Traverse iterated dominance frontier, inserting φ-nodes.
for i := W.take(); i != -1; i = W.take() {
u := fn.Blocks[i]
for _, v := range df[u.Index] {
if hasAlready.add(v) {
// Create φ-node.
// It will be prepended to v.Instrs later, if needed.
phi := &Phi{
Edges: make([]Value, len(v.Preds)),
Comment: alloc.Comment,
}
phi.pos = alloc.Pos()
phi.setType(deref(alloc.Type()))
phi.block = v
if debugLifting {
fmt.Fprintf(os.Stderr, "\tplace %s = %s at block %s\n", phi.Name(), phi, v)
}
newPhis[v] = append(newPhis[v], newPhi{phi, alloc})
if work.add(v) {
W.add(v)
}
}
}
}
return true
}
func ReplaceAll(x, y Value) {
replaceAll(x, y)
}
// replaceAll replaces all intraprocedural uses of x with y,
// updating x.Referrers and y.Referrers.
// Precondition: x.Referrers() != nil, i.e. x must be local to some function.
//
func replaceAll(x, y Value) {
var rands []*Value
pxrefs := x.Referrers()
pyrefs := y.Referrers()
for _, instr := range *pxrefs {
rands = instr.Operands(rands[:0]) // recycle storage
for _, rand := range rands {
if *rand != nil {
if *rand == x {
*rand = y
}
}
}
if pyrefs != nil {
*pyrefs = append(*pyrefs, instr) // dups ok
}
}
*pxrefs = nil // x is now unreferenced
}
// renamed returns the value to which alloc is being renamed,
// constructing it lazily if it's the implicit zero initialization.
//
func renamed(renaming []Value, alloc *Alloc) Value {
v := renaming[alloc.index]
if v == nil {
v = zeroConst(deref(alloc.Type()))
renaming[alloc.index] = v
}
return v
}
// rename implements the (Cytron et al) SSA renaming algorithm, a
// preorder traversal of the dominator tree replacing all loads of
// Alloc cells with the value stored to that cell by the dominating
// store instruction. For lifting, we need only consider loads,
// stores and φ-nodes.
//
// renaming is a map from *Alloc (keyed by index number) to its
// dominating stored value; newPhis[x] is the set of new φ-nodes to be
// prepended to block x.
//
func rename(u *BasicBlock, renaming []Value, newPhis newPhiMap) {
// Each φ-node becomes the new name for its associated Alloc.
for _, np := range newPhis[u] {
phi := np.phi
alloc := np.alloc
renaming[alloc.index] = phi
}
// Rename loads and stores of allocs.
for i, instr := range u.Instrs {
switch instr := instr.(type) {
case *Alloc:
if instr.index >= 0 { // store of zero to Alloc cell
// Replace dominated loads by the zero value.
renaming[instr.index] = nil
if debugLifting {
fmt.Fprintf(os.Stderr, "\tkill alloc %s\n", instr)
}
// Delete the Alloc.
u.Instrs[i] = nil
u.gaps++
}
case *Store:
if alloc, ok := instr.Addr.(*Alloc); ok && alloc.index >= 0 { // store to Alloc cell
// Replace dominated loads by the stored value.
renaming[alloc.index] = instr.Val
if debugLifting {
fmt.Fprintf(os.Stderr, "\tkill store %s; new value: %s\n",
instr, instr.Val.Name())
}
// Remove the store from the referrer list of the stored value.
if refs := instr.Val.Referrers(); refs != nil {
*refs = removeInstr(*refs, instr)
}
// Delete the Store.
u.Instrs[i] = nil
u.gaps++
}
case *UnOp:
if instr.Op == token.MUL {
if alloc, ok := instr.X.(*Alloc); ok && alloc.index >= 0 { // load of Alloc cell
newval := renamed(renaming, alloc)
if debugLifting {
fmt.Fprintf(os.Stderr, "\tupdate load %s = %s with %s\n",
instr.Name(), instr, newval.Name())
}
// Replace all references to
// the loaded value by the
// dominating stored value.
replaceAll(instr, newval)
// Delete the Load.
u.Instrs[i] = nil
u.gaps++
}
}
case *DebugRef:
if alloc, ok := instr.X.(*Alloc); ok && alloc.index >= 0 { // ref of Alloc cell
if instr.IsAddr {
instr.X = renamed(renaming, alloc)
instr.IsAddr = false
// Add DebugRef to instr.X's referrers.
if refs := instr.X.Referrers(); refs != nil {
*refs = append(*refs, instr)
}
} else {
// A source expression denotes the address
// of an Alloc that was optimized away.
instr.X = nil
// Delete the DebugRef.
u.Instrs[i] = nil
u.gaps++
}
}
}
}
// For each φ-node in a CFG successor, rename the edge.
for _, v := range u.Succs {
phis := newPhis[v]
if len(phis) == 0 {
continue
}
i := v.predIndex(u)
for _, np := range phis {
phi := np.phi
alloc := np.alloc
newval := renamed(renaming, alloc)
if debugLifting {
fmt.Fprintf(os.Stderr, "\tsetphi %s edge %s -> %s (#%d) (alloc=%s) := %s\n",
phi.Name(), u, v, i, alloc.Name(), newval.Name())
}
phi.Edges[i] = newval
if prefs := newval.Referrers(); prefs != nil {
*prefs = append(*prefs, phi)
}
}
}
// Continue depth-first recursion over domtree, pushing a
// fresh copy of the renaming map for each subtree.
for _, v := range u.dom.children {
// TODO(adonovan): opt: avoid copy on final iteration; use destructive update.
r := make([]Value, len(renaming))
copy(r, renaming)
rename(v, r, newPhis)
}
}
| {
"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,
// or unknown given the dominating stack of facts.
func nilnessOf(stack []fact, v ssa.Value) nilness {
// Is value intrinsically nil or non-nil?
switch v := v.(type) {
case *ssa.Alloc,
*ssa.FieldAddr,
*ssa.FreeVar,
*ssa.Function,
*ssa.Global,
*ssa.IndexAddr,
*ssa.MakeChan,
*ssa.MakeClosure,
*ssa.MakeInterface,
*ssa.MakeMap,
*ssa.MakeSlice:
return isnonnil
case *ssa.Const:
if v.IsNil() {
return isnil
} else {
return isnonnil
}
}
// Search dominating control-flow facts.
for _, f := range stack {
if f.value == v {
return f.nilness
}
}
return unknown
}
// If b ends with an equality comparison, eq returns the operation and
// its true (equal) and false (not equal) successors.
func eq(b *ssa.BasicBlock) (op *ssa.BinOp, tsucc, fsucc *ssa.BasicBlock) {
if If, ok := b.Instrs[len(b.Instrs)-1].(*ssa.If); ok {
if binop, ok := If.Cond.(*ssa.BinOp); ok {
switch binop.Op {
case token.EQL:
return binop, b.Succs[0], b.Succs[1]
case token.NEQ:
return binop, b.Succs[1], b.Succs[0]
}
}
}
return nil, nil, 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_int{CTL_KERN, KERN_VERSION}
n = unsafe.Sizeof(uname.Version)
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
return err
}
// The version might have newlines or tabs in it, convert them to
// spaces.
for i, b := range uname.Version {
if b == '\n' || b == '\t' {
if i == len(uname.Version)-1 {
uname.Version[i] = 0
} else {
uname.Version[i] = ' '
}
}
}
mib = []_C_int{CTL_HW, HW_MACHINE}
n = unsafe.Sizeof(uname.Machine)
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
return err
}
return nil
}
/*
* Exposed directly
*/
//sys Access(path string, mode uint32) (err error)
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
//sys Chdir(path string) (err error)
//sys Chflags(path string, flags int) (err error)
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)
//sys Exit(code int)
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
//sys Fchdir(fd int) (err error)
//sys Fchflags(fd int, flags int) (err error)
//sys Fchmod(fd int, mode uint32) (err error)
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
//sys Fchown(fd int, uid int, gid int) (err error)
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
//sys Flock(fd int, how int) (err error)
//sys Fpathconf(fd int, name int) (val int, err error)
//sys Fstat(fd int, stat *Stat_t) (err error)
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
//sys Fsync(fd int) (err error)
//sys Ftruncate(fd int, length int64) (err error)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (uid int)
//sysnb Getgid() (gid int)
//sysnb Getpgid(pid int) (pgid int, err error)
//sysnb Getpgrp() (pgrp int)
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
//sys Getpriority(which int, who int) (prio int, err error)
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
//sysnb Getrtable() (rtable int, err error)
//sysnb Getrusage(who int, rusage *Rusage) (err error)
//sysnb Getsid(pid int) (sid int, err error)
//sysnb Gettimeofday(tv *Timeval) (err error)
//sysnb Getuid() (uid int)
//sys Issetugid() (tainted bool)
//sys Kill(pid int, signum syscall.Signal) (err error)
//sys Kqueue() (fd int, err error)
//sys Lchown(path string, uid int, gid int) (err error)
//sys Link(path string, link string) (err error)
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
//sys Listen(s int, backlog int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Mkdir(path string, mode uint32) (err error)
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//sys Mkfifo(path string, mode uint32) (err error)
//sys Mkfifoat(dirfd int, path string, mode uint32) (err error)
//sys Mknod(path string, mode uint32, dev int) (err error)
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
//sys Open(path string, mode int, perm uint32) (fd int, err error)
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
//sys Pathconf(path string, name int) (val int, err error)
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
//sys Rename(from string, to string) (err error)
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
//sys Revoke(path string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sysnb Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
//sys Setlogin(name string) (err error)
//sysnb Setpgid(pid int, pgid int) (err error)
//sys Setpriority(which int, who int, prio int) (err error)
//sysnb Setregid(rgid int, egid int) (err error)
//sysnb Setreuid(ruid int, euid int) (err error)
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
//sysnb Setrtable(rtable int) (err error)
//sysnb Setsid() (pid int, err error)
//sysnb Settimeofday(tp *Timeval) (err error)
//sysnb Setuid(uid int) (err error)
//sys Stat(path string, stat *Stat_t) (err error)
//sys Statfs(path string, stat *Statfs_t) (err error)
//sys Symlink(path string, link string) (err error)
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
//sys Sync() (err error)
//sys Truncate(path string, length int64) (err error)
//sys Umask(newmask int) (oldmask int)
//sys Unlink(path string) (err error)
//sys Unlinkat(dirfd int, path string, flags int) (err error)
//sys Unmount(path string, flags int) (err error)
//sys write(fd int, p []byte) (n int, err error)
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
//sys munmap(addr uintptr, length uintptr) (err error)
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
/*
* Unimplemented
*/
// __getcwd
// __semctl
// __syscall
// __sysctl
// adjfreq
// break
// clock_getres
// clock_gettime
// clock_settime
// closefrom
// execve
// fcntl
// fhopen
// fhstat
// fhstatfs
// fork
// futimens
// getfh
// getgid
// getitimer
// getlogin
// getresgid
// getresuid
// getthrid
// ktrace
// lfs_bmapv
// lfs_markv
// lfs_segclean
// lfs_segwait
// mincore
// minherit
// mount
// mquery
// msgctl
// msgget
// msgrcv
// msgsnd
// nfssvc
// nnpfspioctl
// preadv
// profil
// pwritev
// quotactl
// readv
// reboot
// renameat
// rfork
// sched_yield
// semget
// semop
// setgroups
// setitimer
// setsockopt
// shmat
// shmctl
// shmdt
// shmget
// sigaction
// sigaltstack
// sigpending
// sigprocmask
// sigreturn
// sigsuspend
// sysarch
// syscall
// threxit
// thrsigdivert
// thrsleep
// thrwakeup
// vfork
// writev
| {
"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;
font-weight: bold; }
#kss-node h1 > a:hover, #kss-node h1 > a:focus, #kss-node h1 > a:active,
#kss-node h2 > a:hover,
#kss-node h2 > a:focus,
#kss-node h2 > a:active,
#kss-node h3 > a:hover,
#kss-node h3 > a:focus,
#kss-node h3 > a:active,
#kss-node .kss-menu > .kss-menu-item > a > .kss-ref:hover,
#kss-node .kss-menu > .kss-menu-item > a > .kss-ref:focus,
#kss-node .kss-menu > .kss-menu-item > a > .kss-ref:active,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-ref:hover,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-ref:focus,
#kss-node .kss-menu-child > .kss-menu-item > a > .kss-ref:active,
#kss-node .kss-overview a:hover,
#kss-node .kss-overview a:focus,
#kss-node .kss-overview a:active,
#kss-node .kss-description a:hover,
#kss-node .kss-description a:focus,
#kss-node .kss-description a:active {
color: #a51323;
text-decoration: underline; }
#kss-node .kss-doc-title {
text-align: left;
color: #464646;
text-decoration: none;
margin: 0; }
#kss-node h2,
#kss-node h3 {
text-align: left;
color: #464646;
text-decoration: none;
font-weight: normal; }
#kss-node .kss-depth-1 .kss-title,
#kss-node .kss-overview > h1:first-child {
font-weight: 100;
padding-bottom: 0;
margin-bottom: 0;
border-bottom: 0;
font-size: 30px; }
@media (min-width: 55em) {
#kss-node .kss-depth-1 .kss-title,
#kss-node .kss-overview > h1:first-child {
font-size: 38px; } }
#kss-node .kss-depth-2 .kss-title {
font-weight: 100;
padding-bottom: 0;
margin-bottom: 0;
border-bottom: 0;
font-size: 24px; }
@media (min-width: 55em) {
#kss-node .kss-depth-2 .kss-title {
font-size: 28px; } }
#kss-node .kss-header {
background: transparent; }
#kss-node .kss-header .site-logo {
float: left;
margin-top: 1rem;
width: 50%;
max-width: 150px;
margin-top: 0;
margin-bottom: 1rem; }
@media (min-width: 40em) {
#kss-node .kss-header .site-logo {
width: 100%;
max-width: 215px;
margin-top: 1rem;
margin-bottom: 0; } }
#kss-node .kss-overview h1,
#kss-node .kss-overview h2,
#kss-node .kss-overview h3,
#kss-node .kss-overview h4,
#kss-node .kss-overview h5,
#kss-node .kss-overview h6,
#kss-node h1,
#kss-node h2,
#kss-node h3,
#kss-node h4,
#kss-node h5,
#kss-node h6 {
font-weight: normal; }
#kss-node .kss-overview h1 {
margin: 0 0 30px;
padding-bottom: 10px;
font-size: 30px; }
@media (min-width: 55em) {
#kss-node .kss-overview h1 {
font-size: 38px; } }
#kss-node .kss-overview h2 {
font-size: 24px; }
@media (min-width: 55em) {
#kss-node .kss-overview h2 {
font-size: 28px; } }
#kss-node blockquote {
font-style: italic; }
.kss-sidebar,
.nav-btn {
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
overflow: visible !important; }
.kss-sidebar {
width: 200px;
height: 100vh;
position: absolute;
top: 0;
left: 0; }
.no-js .nav-btn {
display: none; }
.nav-btn {
display: none; }
@media (min-width: 40em) {
.nav-btn {
display: block;
position: absolute;
width: 32px;
height: 32px;
background: url("../assets/chevron_left_round_red.png") no-repeat;
right: 10px;
top: 2px;
background-size: 32px;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
min-height: 0; }
.nav-btn:hover, .nav-btn:focus, .nav-btn:active {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
cursor: pointer;
-webkit-box-shadow: 0px 3px 15px #888b8d;
box-shadow: 0px 3px 15px #888b8d;
border-radius: 75%; } }
.kss-menu {
opacity: 1;
-webkit-transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
visibility: visible; }
@media (min-width: 40em) {
.kss-sidebar-collapsed {
-webkit-transform: translateX(-82%);
-ms-transform: translateX(-82%);
transform: translateX(-82%);
overflow-y: hidden !important; }
.kss-sidebar-collapsed .kss-menu,
.kss-sidebar-collapsed .kss-header {
opacity: 0;
visibility: hidden; } }
@media (min-width: 40em) {
#kss-node .kss-sidebar.kss-fixed.kss-sidebar-collapsed,
#kss-node .kss-sidebar-collapsed {
overflow-y: hidden !important; } }
.kss-sidebar-collapsed .nav-btn {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
background: url("../assets/chevron_right_round_red.png") no-repeat;
background-size: 32px;
right: 40px;
top: 2px;
background-position: 50%;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
min-height: 0; }
.kss-sidebar-collapsed .nav-btn:hover, .kss-sidebar-collapsed .nav-btn:focus, .kss-sidebar-collapsed .nav-btn:active {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
cursor: pointer;
-webkit-box-shadow: 0px 3px 15px #888b8d;
box-shadow: 0px 3px 15px #888b8d;
border-radius: 75%; }
.kss-skip-link {
background: #e00000;
border: 3px solid #a51323;
color: #ffffff;
display: inline-block;
left: 0;
list-style: none;
opacity: 1;
padding: 0.8rem;
pointer-events: none;
position: fixed;
text-decoration: underline;
top: -100px;
-webkit-transition: top 0.3s ease-in-out;
-o-transition: top 0.3s ease-in-out;
transition: top 0.3s ease-in-out;
z-index: 99999;
text-transform: capitalize; }
.kss-skip-link:focus, .kss-skip-link:active {
color: #ffffff;
opacity: 1;
top: 0; }
body {
font-family: 'Open Sans', 'Arial', sans-serif;
color: #464646; }
.break {
margin: 3rem 0;
border-bottom: 1px solid #f4f4f4;
clear: both;
float: left;
width: 100%; }
.markup {
margin: 1.5rem 0;
border-bottom: 1px solid #f4f4f4; }
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
white-space: nowrap;
width: 1px; }
.bold {
font-weight: bold !important; }
.js-show-markup {
margin: 0.5rem 0; }
abbr[title] {
text-decoration: none; }
.copied {
color: #42dc42;
display: none; }
.atblock {
position: relative; }
.atblock__title,
.atblock__panel {
overflow: hidden;
position: relative;
padding: 0 0.5rem;
margin: 0 !important; }
.atblock__title p,
.atblock__panel p {
margin: 10px 0 15px !important; }
.atblock__title ul,
.atblock__panel ul {
margin: 0 !important; }
.atblock__title.guidelines p,
.atblock__panel.guidelines p {
margin: 10px 10px 15px 55px !important;
border-left: 2px solid #f4f4f4;
padding-left: 15px;
position: relative; }
.atblock__title + .atblock__panel {
max-height: 0;
visibility: hidden; }
.atblock__title + .atblock__panel[aria-hidden='false'],
.no-js .atblock__title + .atblock__panel:target {
max-height: 100%;
visibility: visible;
padding-bottom: 1rem;
padding-left: 1rem; }
.atblock__title__trigger {
font-size: 18px;
font-weight: normal !important;
padding: 0;
background-repeat: no-repeat;
padding-right: 40px;
display: inline-block !important;
background-image: url("../assets/plus_round_red.png");
background-size: 28px;
background-position: 97% 0%;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
font-family: 'Open Sans', 'Arial', sans-serif;
height: 30px;
line-height: 1.5;
margin: 0.5rem 0; }
@media (min-width: 55em) {
.atblock__title__trigger {
font-size: 20px;
background-size: 32px;
background-position: 100% 50%; } }
.atblock__title__trigger[aria-expanded='true'] {
content: '';
background: url("../assets/minus_round_red.png");
background-size: 28px;
background-repeat: no-repeat;
background-position: 97% 0%; }
@media (min-width: 55em) {
.atblock__title__trigger[aria-expanded='true'] {
background-size: 32px;
background-position: 100% 50%; } }
.atblock__title__trigger:hover, .atblock__title__trigger:focus, .atblock__title__trigger:active {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent; }
.guidelines {
margin-left: 10px;
position: relative; }
.guidelines::before {
content: '';
background: url("../assets/w3c.png");
background-size: 50px;
float: left;
clear: both;
width: 50px;
margin: auto;
position: absolute;
top: 12px;
bottom: 0;
left: 10px;
right: auto;
text-align: left;
background-repeat: no-repeat; }
a[target='_blank']::after {
content: '';
background: url("../assets/icon_new-tab.png");
background-size: 15px;
background-repeat: no-repeat;
margin: 0 0 -2px 5px;
width: 15px;
height: 15px;
display: inline-block; }
.social-link-twitter {
content: '';
background: url("../assets/icon_twitter.png");
background-size: 32px;
background-repeat: no-repeat;
padding: 0.5rem 1rem;
margin: 0.5rem; }
.social-link-twitter[target='_blank']::after {
display: none; }
.social-link-github {
content: '';
background: url("../assets/icon_github.png");
background-size: 32px;
background-repeat: no-repeat;
padding: 0.5rem 1rem;
margin: 0.5rem; }
.social-link-github[target='_blank']::after {
display: none; }
.social-link-out {
position: absolute;
right: 2rem;
top: 2rem; }
.back-to-top {
background-color: transparent;
bottom: 12px;
height: 2.5rem;
width: 2.5rem;
position: fixed;
right: 9px;
-webkit-transform: translateY(130%);
-ms-transform: translateY(130%);
transform: translateY(130%);
-webkit-transition: -webkit-transform 0.5s ease-in-out;
transition: -webkit-transform 0.5s ease-in-out;
-o-transition: transform 0.5s ease-in-out;
transition: transform 0.5s ease-in-out;
transition: transform 0.5s ease-in-out, -webkit-transform 0.5s ease-in-out;
background-image: url("../assets/chevron_up_round_red.png");
background-repeat: no-repeat;
background-size: 42px;
border-radius: 50%;
background-position: 50%; }
.back-to-top:hover, .back-to-top:focus, .back-to-top:active {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
cursor: pointer;
-webkit-box-shadow: 0px 3px 15px #888b8d;
box-shadow: 0px 3px 15px #888b8d;
border-radius: 50%; }
.show-back-to-top .back-to-top {
-webkit-transform: translateY(0%);
-ms-transform: translateY(0%);
transform: translateY(0%); }
.kss-menu {
display: none; }
.kss-menu li {
list-style: none;
padding: 0 10px; }
.kss-menu a {
text-decoration: none; }
.kss-menu.active {
display: block;
clear: both; }
.kss-menu.active li {
display: block;
clear: both; }
@media (min-width: 40em) {
.kss-menu {
display: block; }
.kss-menu #toggle-menu {
display: none; } }
.kss-nav {
margin-bottom: 0 !important; }
.kss-nav .menu-toggle {
float: right;
margin-top: 1.5rem; }
.kss-nav .navbar-mobile-icon {
display: block; }
.kss-nav .navbar-mobile-icon button {
background: #e00000; }
@media (min-width: 40em) {
.kss-nav .navbar-mobile-icon {
display: none; } }
.card {
position: relative;
max-width: 300px;
display: inline-block; }
.card__image img {
max-width: 100%;
border-radius: 4px;
-o-object-fit: cover;
object-fit: cover;
width: 300px;
height: 300px; }
.card__title {
display: block;
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 2rem;
background: rgba(0, 0, 0, 0.65);
margin-bottom: 6px;
border-radius: 0 0 4px 4px;
text-align: center; }
.card__title a {
color: #ffffff; }
| {
"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 651582 95.0495 + . seq2;seq2Range=604088,604285;eValue=4.36568e-78;cigar=91M1D11M2I7M1I7M1D29M1D28M1D22M;mutations=103G,104G,112A,116A,167G,197A
seq1 Stellar eps-matches 659217 659415 95.0738 + . seq2;seq2Range=849261,849459;eValue=1.32813e-78;cigar=26M1I21M1I29M1I56M1D20M1D4M1D7M1I32M1D;mutations=27C,39C,49T,79A,167T,182C
seq1 Stellar eps-matches 99283 99480 95 + . seq2;seq2Range=520291,520485;eValue=4.71708e-77;cigar=49M1D9M1D12M1D55M1I30M1I6M1D31M1D1M;mutations=30G,70A,126T,157G,193G
seq1 Stellar eps-matches 500977 501174 95.0495 + . seq2;seq2Range=588492,588690;eValue=4.36568e-78;cigar=40M1I32M1I4M1I69M1D28M1D19M1D2M1I1M;mutations=15A,41A,74G,79C,163T,184G,198A
seq1 Stellar eps-matches 252575 252771 95.0248 + . seq2;seq2Range=842862,843059;eValue=1.43504e-77;cigar=32M1D44M1I10M1I25M1D17M1D28M1I37M1I1M;mutations=61G,77A,88T,159T,163G,179A,197T
seq1 Stellar eps-matches 479619 479815 95.0495 + . seq2;seq2Range=988803,989003;eValue=4.36568e-78;cigar=2M2I15M1I79M1I55M1I25M1D20M;mutations=3G,4T,20A,23T,81G,100G,156G,160A,162T
seq1 Stellar eps-matches 992727 992922 95.4314 + . seq2;seq2Range=355782,355973;eValue=4.71708e-77;cigar=6M1I88M1D2M1D25M1D51M1D16M1D3M;mutations=7A,103G,187C,191A
seq1 Stellar eps-matches 437656 437850 95.4314 + . seq2;seq2Range=436122,436316;eValue=4.71708e-77;cigar=24M1D31M1D31M1I7M1I100M;mutations=2C,13C,54T,76A,87G,95A,103T
seq1 Stellar eps-matches 13711 13904 95.4314 + . seq2;seq2Range=158249,158441;eValue=4.71708e-77;cigar=28M1D72M1D62M1D13M1I2M1I1M1I10M1D2M;mutations=25G,66A,176G,179T,181A
seq1 Stellar eps-matches 21160 21353 95.4314 + . seq2;seq2Range=481930,482121;eValue=4.71708e-77;cigar=56M1D3M1I6M1D26M1I8M1D3M1I47M1D27M1D13M;mutations=60T,61C,93T,105G
seq1 Stellar eps-matches 559219 559410 95.3608 + . seq2;seq2Range=195779,195965;eValue=1.67535e-75;cigar=6M1D29M1D7M1D12M1D9M1I11M1D4M1I64M1D30M1D13M;mutations=64A,80C
seq1 Stellar eps-matches 675527 675718 95.4081 + . seq2;seq2Range=774605,774797;eValue=1.55054e-76;cigar=41M1I3M1I5M1D59M1I15M1I21M1D23M1D22M;mutations=42G,46T,111T,127G,190A,191G
seq1 Stellar eps-matches 977334 977525 95.3846 + . seq2;seq2Range=696953,697144;eValue=5.09676e-76;cigar=30M1I18M1D34M1D36M1I44M1D4M1I23M;mutations=30G,31A,90T,120T,131C,169C
seq1 Stellar eps-matches 336022 336212 95.4081 + . seq2;seq2Range=218025,218219;eValue=1.55054e-76;cigar=79M1I41M1I5M1I6M1I36M1D21M1I2M;mutations=72A,80G,122C,128A,135C,163C,193T,194C
seq1 Stellar eps-matches 597934 598124 95.3846 + . seq2;seq2Range=29816,30007;eValue=5.09676e-76;cigar=67M1D43M1D45M1D24M1I6M2I1M1I2M;mutations=138T,180C,181C,187G,188G,190G
seq1 Stellar eps-matches 765547 765737 95.3608 + . seq2;seq2Range=310437,310627;eValue=1.67535e-75;cigar=1M1D39M1D1M1I71M1I39M1D30M1I7M;mutations=42C,114G,140T,150G,170C,184T
seq1 Stellar eps-matches 56271 56460 95.3846 + . seq2;seq2Range=109597,109789;eValue=5.09676e-76;cigar=7M1D11M1I27M1I69M1I3M1D33M1I3M1I35M;mutations=19G,47T,81T,117G,154T,158T,192A
seq1 Stellar eps-matches 421416 421605 95.3125 + . seq2;seq2Range=551468,551654;eValue=1.81019e-74;cigar=34M1I28M1D43M1D2M1I39M1D35M2D4M;mutations=35T,68A,109G,128T
seq1 Stellar eps-matches 531751 531940 95.3125 + . seq2;seq2Range=253615,253801;eValue=1.81019e-74;cigar=37M1D7M1D8M1I2M1D82M1I47M2D2M;mutations=13C,53C,138G,183C
seq1 Stellar eps-matches 685350 685539 95.3125 + . seq2;seq2Range=869062,869247;eValue=1.81019e-74;cigar=65M1D10M1D12M1I6M1D42M1I27M1D18M1D3M1D1M;mutations=88C,137T,184C
seq1 Stellar eps-matches 878328 878517 95.3608 + . seq2;seq2Range=938665,938855;eValue=1.67535e-75;cigar=30M1D36M1D10M1I44M1D20M1I20M1I26M1I1M;mutations=77T,91C,100A,142G,163C,190G
seq1 Stellar eps-matches 886096 886285 95.3608 + . seq2;seq2Range=439136,439325;eValue=1.67535e-75;cigar=21M1I12M1I28M1D2M1D7M1I5M1D19M1D32M1I60M;mutations=22T,35T,44G,73G,130C
seq1 Stellar eps-matches 970348 970537 95.4081 + . seq2;seq2Range=14027,14220;eValue=1.55054e-76;cigar=2M1I8M1I3M1I7M1D1M1I88M1D29M1I26M1I24M;mutations=3G,12A,16A,25G,50C,143A,170C
seq1 Stellar eps-matches 76397 76585 95.3367 + . seq2;seq2Range=260294,260482;eValue=5.507e-75;cigar=3M1D2M1I20M1I75M1I6M1D47M1I13M1D18M1D1M;mutations=2C,6G,27A,103C,157C
seq1 Stellar eps-matches 79419 79607 95.3125 + . seq2;seq2Range=77955,78143;eValue=1.81019e-74;cigar=1M1I4M1D28M1I22M1D25M1I3M1D103M;mutations=2A,35A,44G,76C,83C,136C
seq1 Stellar eps-matches 129459 129646 95.238 + . seq2;seq2Range=414470,414653;eValue=6.42919e-73;cigar=25M1D68M1D8M1I57M1D16M1D7M1D2M;mutations=102G,114A,117C,120T
seq1 Stellar eps-matches 753048 753234 95.3125 + . seq2;seq2Range=480175,480363;eValue=1.81019e-74;cigar=36M1I9M1I4M1D33M1D35M1I19M1I42M1I6M1D;mutations=37G,47G,108C,120A,140C,183G
seq1 Stellar eps-matches 971386 971572 95.1871 + . seq2;seq2Range=705903,706083;eValue=6.94668e-72;cigar=23M1D2M1D23M1D71M1D43M1D18M1D1M;mutations=18G,49A,135C
seq1 Stellar eps-matches 332326 332511 95.1612 + . seq2;seq2Range=365648,365826;eValue=2.28343e-71;cigar=59M1D22M1D1M1D30M1D20M1D16M1D29M1D2M;mutations=36A,100G
seq1 Stellar eps-matches 530615 530800 95.238 + . seq2;seq2Range=874954,875139;eValue=6.42919e-73;cigar=22M1I3M1I101M1D42M1I11M1D1M1D3M;mutations=23T,27C,96T,144A,171T,184G
seq1 Stellar eps-matches 896047 896232 95.1871 + . seq2;seq2Range=290110,290293;eValue=6.94668e-72;cigar=5M1D13M1I8M1D64M1D93M;mutations=19T,64G,76T,93G,115G,167A
seq1 Stellar eps-matches 127373 127557 95.2631 + . seq2;seq2Range=202757,202945;eValue=1.9559e-73;cigar=11M1I3M1I28M1I49M1I40M1I4M1D49M;mutations=9C,12T,16T,45G,47T,95T,136T,169A
seq1 Stellar eps-matches 209201 209385 95.2127 + . seq2;seq2Range=653171,653354;eValue=2.11333e-72;cigar=16M1D35M1D16M1I15M1D22M1D26M1I35M1I16M;mutations=7C,68C,79G,132C,168A
seq1 Stellar eps-matches 261900 262084 95.238 + . seq2;seq2Range=172954,173140;eValue=6.42919e-73;cigar=18M1I57M1D20M1I29M1I9M1I2M1D48M;mutations=19G,43T,97G,110C,127T,135G,137A
seq1 Stellar eps-matches 604104 604288 95.2127 + . seq2;seq2Range=988576,988762;eValue=2.11333e-72;cigar=3M1I1M1I31M1D124M1I25M;mutations=4A,6G,118G,122T,162T,169T,182G,186C
seq1 Stellar eps-matches 683906 684090 95.238 + . seq2;seq2Range=790344,790528;eValue=6.42919e-73;cigar=19M1I17M1I36M1D5M1D1M1I16M1I34M1D6M1D47M;mutations=20T,38G,81A,98T,184T
seq1 Stellar eps-matches 738649 738833 95.238 + . seq2;seq2Range=520928,521114;eValue=6.42919e-73;cigar=9M1I37M1I35M1I40M1D2M1D13M1I47M;mutations=10G,48T,84C,111A,140C,143G,186T
seq1 Stellar eps-matches 524028 524211 95.2127 + . seq2;seq2Range=161096,161281;eValue=2.11333e-72;cigar=8M2I52M1I118M1I3M2D1M;mutations=9A,10A,14C,63G,156G,176G,182T
seq1 Stellar eps-matches 653596 653778 95.1871 + . seq2;seq2Range=588056,588238;eValue=6.94668e-72;cigar=1M1I27M1I73M1D15M1D47M1D2M1I7M1I6M1D1M;mutations=2T,30T,158G,168T,176A
seq1 Stellar eps-matches 686951 687133 95.1871 + . seq2;seq2Range=126367,126550;eValue=6.94668e-72;cigar=3M1I3M1I1M1D25M1I12M1I67M1D9M1D60M;mutations=4C,8T,35G,48A,133G,179T
seq1 Stellar eps-matches 45263 45444 95.1612 + . seq2;seq2Range=660657,660839;eValue=2.28343e-71;cigar=28M1D37M1I55M1D9M1D46M1I1M2I3M;mutations=66G,78C,175T,177C,179G,180C
seq1 Stellar eps-matches 85802 85983 95.1351 + . seq2;seq2Range=602934,603116;eValue=7.50582e-71;cigar=82M1I26M1D14M1D24M1I27M1I7M;mutations=24T,68A,83C,148G,149C,161T,176G
seq1 Stellar eps-matches 358894 359075 95.238 + . seq2;seq2Range=390049,390235;eValue=6.42919e-73;cigar=9M2I28M1I42M1D10M1D49M1I5M1I4M2I33M;mutations=10G,11G,40A,142G,148C,153G,154C
seq1 Stellar eps-matches 724785 724966 95.1351 + . seq2;seq2Range=687205,687383;eValue=7.50582e-71;cigar=3M1I14M1D37M1I5M1D73M1D3M1D13M1D18M1I6M1D4M;mutations=4A,56G,169G
seq1 Stellar eps-matches 130091 130271 95.1086 + . seq2;seq2Range=18589,18769;eValue=2.46722e-70;cigar=11M1D14M1D66M1D65M1I7M1I11M1I4M;mutations=19G,111T,157A,165T,177C,178T
seq1 Stellar eps-matches 464879 465059 95.1086 + . seq2;seq2Range=381705,381886;eValue=2.46722e-70;cigar=5M1D8M1I30M1D3M1I77M1I56M;mutations=4T,14C,48T,61G,95A,126G,156G
seq1 Stellar eps-matches 476256 476436 95.0819 + . seq2;seq2Range=380535,380713;eValue=8.10997e-70;cigar=26M1D52M1D21M1I39M1I12M1D25M1D2M;mutations=8T,36C,44T,100A,140A
seq1 Stellar eps-matches 279073 279252 95.0819 + . seq2;seq2Range=906637,906817;eValue=8.10997e-70;cigar=25M1I31M1D32M1I35M1I47M1D8M;mutations=4G,15C,26T,49G,90A,126A,176A
seq1 Stellar eps-matches 619335 619514 95.0549 + . seq2;seq2Range=61913,62091;eValue=2.66581e-69;cigar=2M1I2M1I120M1D34M1D19M1D;mutations=3A,6T,46T,58G,149C,177G
seq1 Stellar eps-matches 684171 684350 95.1086 + . seq2;seq2Range=898074,898257;eValue=2.46722e-70;cigar=25M1I95M1I27M1I3M1I30M;mutations=3G,17A,18A,26C,122C,133T,135G,150G,154C
seq1 Stellar eps-matches 942021 942200 95.0276 + . seq2;seq2Range=141668,141842;eValue=8.76274e-69;cigar=114M1D10M1D13M1I27M1D1M1D1M1D6M1D2M;mutations=36C,65G,138A
seq1 Stellar eps-matches 617394 617572 95.0276 + . seq2;seq2Range=833682,833858;eValue=8.76274e-69;cigar=53M1I3M1D15M1I67M1D31M1D2M1D4M;mutations=24G,54G,73C,94G,175C
seq1 Stellar eps-matches 914375 914553 95.0276 + . seq2;seq2Range=771785,771961;eValue=8.76274e-69;cigar=69M1I55M1D19M2D13M1I7M1D12M;mutations=70A,80C,158C,172T,173C
seq1 Stellar eps-matches 930911 931089 95.0276 + . seq2;seq2Range=602492,602667;eValue=8.76274e-69;cigar=2M1I71M1I25M1D53M1D17M2D4M1D2M;mutations=3G,75G,126T,165C
seq1 Stellar eps-matches 903411 903588 95.1086 + . seq2;seq2Range=59206,59387;eValue=2.46722e-70;cigar=3M1I30M1D17M1I9M1I75M1I12M1I25M1D1M1I4M;mutations=4C,52C,62A,138A,151T,178G,180A
seq1 Stellar eps-matches 622724 622900 95.0276 + . seq2;seq2Range=562529,562706;eValue=8.76274e-69;cigar=12M1I39M1I7M1D14M1D43M1D29M1I29M1I1M;mutations=13G,15C,23G,53C,147T,177G
seq1 Stellar eps-matches 829251 829427 95.0276 + . seq2;seq2Range=780594,780772;eValue=8.76274e-69;cigar=2M1D49M2I43M1I29M1I45M1D7M;mutations=2A,52A,53G,86C,97G,127T,158A
seq1 Stellar eps-matches 566935 567110 95.4545 + . seq2;seq2Range=541251,541421;eValue=9.46806e-68;cigar=14M1D23M1D2M1D130M2D2M;mutations=82T,138G,162G
seq1 Stellar eps-matches 733269 733444 95.0549 + . seq2;seq2Range=289698,289876;eValue=2.66581e-69;cigar=37M1I14M1I9M1I23M1D22M1I36M1D15M1I10M1I5M1D2M;mutations=38T,53C,63T,109A,161A,172A
seq1 Stellar eps-matches 280188 280362 95 + . seq2;seq2Range=115391,115568;eValue=2.88038e-68;cigar=24M1D67M1I23M1D20M1I5M1I29M1I4M1I1M;mutations=15T,84C,92A,136G,142A,172A,177G
seq1 Stellar eps-matches 494973 495147 95.5056 + . seq2;seq2Range=215629,215804;eValue=8.76274e-69;cigar=27M1D12M1I13M1D97M1I13M1I11M;mutations=40T,62A,136T,146G,151T,165A
seq1 Stellar eps-matches 782374 782548 95.4802 + . seq2;seq2Range=936248,936421;eValue=2.88038e-68;cigar=2M1I48M1I33M1D39M1D49M1D1M;mutations=3T,5C,47C,52T,58T
seq1 Stellar eps-matches 92040 92213 95 + . seq2;seq2Range=559640,559817;eValue=2.88038e-68;cigar=2M2D20M1I25M1I3M1I43M1I34M1I29M1I16M;mutations=11G,23C,49C,53T,97G,132C,162C
seq1 Stellar eps-matches 584082 584255 95.4545 + . seq2;seq2Range=896198,896369;eValue=9.46806e-68;cigar=49M1D11M1I25M1D20M1D48M1D16M1I1M;mutations=50T,61G,101G,171G
seq1 Stellar eps-matches 844679 844852 95.5056 + . seq2;seq2Range=587459,587632;eValue=8.76274e-69;cigar=6M1I1M1I2M1D22M1D10M1D77M1D19M1I3M1I30M;mutations=7T,9G,140T,144A
seq1 Stellar eps-matches 878859 879032 95.4285 + . seq2;seq2Range=617824,617992;eValue=3.11223e-67;cigar=25M1I78M1D30M1D18M1D10M1D1M1D3M1D3M;mutations=26A,48A
seq1 Stellar eps-matches 988210 988383 95.4545 + . seq2;seq2Range=484703,484873;eValue=9.46806e-68;cigar=1M1D29M1D38M1D26M1I24M1D43M1D5M1I3M;mutations=25A,95T,168T
seq1 Stellar eps-matches 4876 5048 95.4285 + . seq2;seq2Range=925808,925980;eValue=3.11223e-67;cigar=6M1D18M1I100M1I38M1D9M;mutations=4T,5T,24T,25T,76C,126G
seq1 Stellar eps-matches 475440 475612 95.4545 + . seq2;seq2Range=5398,5571;eValue=9.46806e-68;cigar=5M1D9M1I78M1I70M1I8M1D1M;mutations=15A,84G,94T,99C,161A,165T
seq1 Stellar eps-matches 590859 591031 95.4545 + . seq2;seq2Range=166035,166208;eValue=9.46806e-68;cigar=2M1D5M1I27M1D63M1I56M1I18M;mutations=8T,14G,38A,99A,118T,156A
seq1 Stellar eps-matches 907439 907611 95.4285 + . seq2;seq2Range=536140,536311;eValue=3.11223e-67;cigar=21M1I3M1D66M1D10M1I8M1D62M;mutations=22C,46A,102G,124T,170A
seq1 Stellar eps-matches 87879 88050 95.4022 + . seq2;seq2Range=550194,550364;eValue=1.02301e-66;cigar=58M1D14M1D56M1I22M1I19M1D;mutations=21G,46T,65G,129A,152G
seq1 Stellar eps-matches 647703 647874 95.4545 + . seq2;seq2Range=560600,560774;eValue=9.46806e-68;cigar=32M1D20M1I51M1I37M1I30M1I1M;mutations=18C,22C,53T,65T,105A,143G,174C
seq1 Stellar eps-matches 896848 897019 95.4285 + . seq2;seq2Range=176101,176271;eValue=3.11223e-67;cigar=20M1I27M1D3M1I23M1D53M1D29M1D4M1I9M;mutations=21G,52A,97G,162G
seq1 Stellar eps-matches 674705 674875 95.3757 + . seq2;seq2Range=894881,895051;eValue=3.36273e-66;cigar=11M1I16M1D115M1I27M1D;mutations=12G,18A,21A,116T,144G,159A
seq1 Stellar eps-matches 130394 130563 95.3488 + . seq2;seq2Range=67115,67282;eValue=1.10536e-65;cigar=16M1I54M1D15M1I13M1D41M1D20M1D7M;mutations=17A,73G,87G,154G
seq1 Stellar eps-matches 424633 424802 95.4545 + . seq2;seq2Range=48193,48368;eValue=9.46806e-68;cigar=15M1I12M1I15M1I17M1I2M1I34M1I75M;mutations=16G,29T,45A,63A,66A,88A,101G,107T
seq1 Stellar eps-matches 557020 557189 95.3757 + . seq2;seq2Range=31576,31743;eValue=3.36273e-66;cigar=27M1I7M1I25M1D34M1D18M1D14M2D1M1I39M;mutations=28A,36G,129C
seq1 Stellar eps-matches 43306 43474 95.3216 + . seq2;seq2Range=453450,453617;eValue=3.6334e-65;cigar=5M1I3M1I4M1D93M1D55M1D6M;mutations=4A,6T,10C,78T,137T
seq1 Stellar eps-matches 219592 219760 95.3216 + . seq2;seq2Range=395460,395626;eValue=3.6334e-65;cigar=20M1D23M1I66M1I9M2D16M1D31M;mutations=19T,44G,111T,125T
seq1 Stellar eps-matches 274065 274233 95.3216 + . seq2;seq2Range=470089,470254;eValue=3.6334e-65;cigar=70M1I27M1D1M1I5M1D25M1D4M1D18M1D14M;mutations=65A,71A,100C
seq1 Stellar eps-matches 416579 416747 95.3757 + . seq2;seq2Range=456878,457046;eValue=3.36273e-66;cigar=8M1D27M1D34M1I3M1D4M1I36M1I51M1I1M1D1M;mutations=70G,78T,115C,167G
seq1 Stellar eps-matches 39952 40119 95.2941 + . seq2;seq2Range=309371,309538;eValue=1.19433e-64;cigar=44M1D9M1I35M1D33M1I45M;mutations=3T,5G,54G,64G,116A,123G
seq1 Stellar eps-matches 469409 469576 95.2941 + . seq2;seq2Range=594461,594626;eValue=1.19433e-64;cigar=2M1I42M1D38M1D49M1I30M2D3M;mutations=3A,5G,133A,138C
seq1 Stellar eps-matches 550957 551124 95.2941 + . seq2;seq2Range=676273,676440;eValue=1.19433e-64;cigar=29M1I30M1D1M1I99M1D7M;mutations=30A,37G,62C,90C,99C,104C
seq1 Stellar eps-matches 864557 864724 95.2941 + . seq2;seq2Range=400,565;eValue=1.19433e-64;cigar=31M1I8M1D47M1D13M1D7M1D9M1I49M;mutations=32T,62A,95G,117G
seq1 Stellar eps-matches 221521 221687 95.2941 + . seq2;seq2Range=16266,16431;eValue=1.19433e-64;cigar=5M1D36M1D48M1D8M1I29M1I1M1I34M1D2M;mutations=98C,126G,128T,130A
seq1 Stellar eps-matches 748298 748464 95.2662 + . seq2;seq2Range=861714,861879;eValue=3.92585e-64;cigar=96M1I1M1D14M1I14M1D10M1D29M;mutations=26G,37T,97A,113T,125A
seq1 Stellar eps-matches 45976 46141 95.238 + . seq2;seq2Range=481116,481280;eValue=1.29046e-63;cigar=25M1I48M1I64M2D10M1D16M;mutations=26T,75G,103T,144T,164G
seq1 Stellar eps-matches 640016 640181 95.238 + . seq2;seq2Range=357531,357694;eValue=1.29046e-63;cigar=27M1D90M1I10M2D33M1D1M1I1M;mutations=22G,118C,149T,163A
seq1 Stellar eps-matches 705146 705311 95.238 + . seq2;seq2Range=517379,517541;eValue=1.29046e-63;cigar=4M1D2M1D36M2D62M1I9M1I30M1D18M;mutations=4T,105C,115T
seq1 Stellar eps-matches 768758 768923 95.2095 + . seq2;seq2Range=364159,364319;eValue=4.24184e-63;cigar=2M1D14M1D11M1D20M1D50M1D1M1I2M1D60M;mutations=99A,114T
seq1 Stellar eps-matches 969412 969577 95.2095 + . seq2;seq2Range=397233,397395;eValue=4.24184e-63;cigar=13M1D1M1D4M1D66M1D32M1I46M;mutations=81G,117C,159C,160A
seq1 Stellar eps-matches 66226 66390 95.238 + . seq2;seq2Range=220607,220771;eValue=1.29046e-63;cigar=42M1D3M1I22M1I15M1I74M1D4M1D2M;mutations=2A,46A,69C,85A,128G
seq1 Stellar eps-matches 146145 146309 95.238 + . seq2;seq2Range=483425,483590;eValue=1.29046e-63;cigar=35M1I41M1D12M1D29M1I43M1I3M;mutations=2G,36A,119A,156A,163A,165G
seq1 Stellar eps-matches 210034 210198 95.238 + . seq2;seq2Range=868375,868538;eValue=1.29046e-63;cigar=1M1D1M1D13M1I1M1I4M1D119M1D21M1I1M;mutations=16A,18C,96T,163A
seq1 Stellar eps-matches 884786 884950 95.2662 + . seq2;seq2Range=17185,17350;eValue=3.92585e-64;cigar=19M1D6M1D36M1I15M1I15M1I7M1I21M1D43M;mutations=62C,78T,94G,102C,124T
seq1 Stellar eps-matches 66935 67098 95.1807 + . seq2;seq2Range=325949,326112;eValue=1.39433e-62;cigar=32M1I13M1I20M1D97M1D;mutations=33A,43T,47G,65T,111A,136G
seq1 Stellar eps-matches 157761 157924 95.1515 + . seq2;seq2Range=525266,525427;eValue=4.58327e-62;cigar=5M1D7M1D103M1I20M1D26M;mutations=5G,7A,35T,79T,116C
seq1 Stellar eps-matches 227832 227995 95.1807 + . seq2;seq2Range=448820,448981;eValue=1.39433e-62;cigar=37M1D41M1D18M1I20M1D2M1I4M1D38M;mutations=75A,97T,120T,122T
seq1 Stellar eps-matches 328145 328308 95.238 + . seq2;seq2Range=33628,33793;eValue=1.29046e-63;cigar=2M1I1M1D28M1I32M1I4M1D64M1I31M;mutations=3C,33C,66G,91C,130T,135A
seq1 Stellar eps-matches 345709 345872 95.1807 + . seq2;seq2Range=512994,513156;eValue=1.39433e-62;cigar=5M1D28M1I12M1I42M1D57M1D17M;mutations=34T,47C,52A,78T,122G
seq1 Stellar eps-matches 366421 366584 95.1515 + . seq2;seq2Range=389488,389649;eValue=4.58327e-62;cigar=2M1D110M1D15M1I18M1D16M;mutations=19T,88C,96T,128G,131C
seq1 Stellar eps-matches 581952 582115 95.1515 + . seq2;seq2Range=599726,599886;eValue=4.58327e-62;cigar=29M1I3M1D65M1D22M1D23M1D18M;mutations=30A,33G,147T,160T
seq1 Stellar eps-matches 719289 719452 95.1807 + . seq2;seq2Range=824632,824793;eValue=1.39433e-62;cigar=49M1D28M1D5M1I17M1D31M1I28M1D2M;mutations=40A,83G,132C,146A
seq1 Stellar eps-matches 846534 846697 95.1219 + . seq2;seq2Range=942823,942982;eValue=1.50656e-61;cigar=28M1D35M1D7M1D88M1D2M;mutations=7T,52C,126G,151T
seq1 Stellar eps-matches 972646 972809 95.1807 + . seq2;seq2Range=129371,129534;eValue=1.39433e-62;cigar=16M1I13M1D2M1I86M1D45M;mutations=17A,26G,33G,137G,140G,161C
seq1 Stellar eps-matches 158619 158781 95.1219 + . seq2;seq2Range=886119,886278;eValue=1.50656e-61;cigar=34M1D79M1I25M1D7M1D14M1D;mutations=52T,114C,147T,159A
seq1 Stellar eps-matches 810501 810663 95.1807 + . seq2;seq2Range=946381,946543;eValue=1.39433e-62;cigar=8M1I51M1D9M1I18M1D22M1D6M1I46M;mutations=9G,23G,69G,70T,117T
seq1 Stellar eps-matches 869735 869897 95.1807 + . seq2;seq2Range=699582,699743;eValue=1.39433e-62;cigar=12M1D36M1D43M1I7M1I19M1D12M1D29M1I1M;mutations=92T,100T,135A,161G
seq1 Stellar eps-matches 938356 938518 95.1515 + . seq2;seq2Range=241312,241472;eValue=4.58327e-62;cigar=26M1D29M1D9M1D42M1I17M1I16M1D20M;mutations=36T,107G,125A,132C
seq1 Stellar eps-matches 64119 64280 95.238 + . seq2;seq2Range=717100,717266;eValue=1.29046e-63;cigar=18M1I43M1I12M1I3M1I14M1D13M1I22M1I36M;mutations=19C,63T,76G,80A,88G,108C,131T
seq1 Stellar eps-matches 837810 837971 95.1515 + . seq2;seq2Range=189775,189936;eValue=4.58327e-62;cigar=68M1I12M1D29M1I4M1D14M1D27M1I5M;mutations=19T,69T,111C,127G,157A
seq1 Stellar eps-matches 873654 873815 95.1807 + . seq2;seq2Range=759297,759461;eValue=1.39433e-62;cigar=9M1D60M1I3M1I82M2I7M;mutations=70T,74A,106A,157C,158C,161A,163G
seq1 Stellar eps-matches 932918 933079 95.1219 + . seq2;seq2Range=108122,108282;eValue=1.50656e-61;cigar=46M1D16M1D7M1D55M1I5M1I30M;mutations=3G,4G,45T,125T,131T
seq1 Stellar eps-matches 113574 113733 95.0617 + . seq2;seq2Range=386478,386636;eValue=1.62782e-60;cigar=2M1D51M1D3M1I31M1D41M1I29M;mutations=5T,57T,59C,117G,130A
seq1 Stellar eps-matches 374679 374838 95.0617 + . seq2;seq2Range=260948,261105;eValue=1.62782e-60;cigar=6M1D18M1I6M1I20M1D39M1D61M1D6M;mutations=2A,4A,25T,32A
seq1 Stellar eps-matches 375622 375781 95.031 + . seq2;seq2Range=882272,882425;eValue=5.35078e-60;cigar=18M1I45M1D5M1D21M1D15M1D6M1D3M1D33M1D7M;mutations=19G
seq1 Stellar eps-matches 913483 913641 95.092 + . seq2;seq2Range=231183,231344;eValue=4.95218e-61;cigar=3M1I4M1I49M1I19M1D80M1I3M;mutations=3C,4A,9G,49T,59C,145C,159C
seq1 Stellar eps-matches 55223 55380 95.031 + . seq2;seq2Range=18997,19154;eValue=5.35078e-60;cigar=3M1I25M1D5M1D7M1I32M1I34M1D49M;mutations=4A,42C,75C,94T,101T
seq1 Stellar eps-matches 250915 251072 95 + . seq2;seq2Range=267676,267830;eValue=1.75885e-59;cigar=4M2D42M1I25M1D7M1D33M1D12M1I30M;mutations=47T,86C,125T
seq1 Stellar eps-matches 514485 514642 95.031 + . seq2;seq2Range=950099,950258;eValue=5.35078e-60;cigar=2M1I43M1I97M1I14M1D1M;mutations=3C,47C,119T,145A,153A,154G,155G
seq1 Stellar eps-matches 611971 612128 95.031 + . seq2;seq2Range=181998,182154;eValue=5.35078e-60;cigar=2M1D27M1I49M1I1M1D13M1D30M1D31M1I1M;mutations=4G,30G,80C,156T
seq1 Stellar eps-matches 689599 689756 95 + . seq2;seq2Range=379903,380057;eValue=1.75885e-59;cigar=41M1D26M1D21M1D22M1D23M1I9M1I11M1D;mutations=27T,134G,144A
seq1 Stellar eps-matches 966093 966250 95.031 + . seq2;seq2Range=665811,665970;eValue=5.35078e-60;cigar=5M1I69M1I16M1I57M1D10M;mutations=6C,19T,76T,93A,111A,122G,159C
seq1 Stellar eps-matches 318728 318884 95.031 + . seq2;seq2Range=996824,996984;eValue=5.35078e-60;cigar=94M1I32M1I25M1I5M1I1M;mutations=21A,95G,124G,128C,133G,154C,155G,160G
seq1 Stellar eps-matches 107779 107934 95 + . seq2;seq2Range=304819,304974;eValue=1.75885e-59;cigar=1M1I1M1D59M1D4M1I34M1I4M1D38M1D3M1I8M;mutations=2G,67T,102C,148G
seq1 Stellar eps-matches 114541 114696 95.5414 + . seq2;seq2Range=631926,632079;eValue=1.75885e-59;cigar=45M1I22M1D79M1D7M1D;mutations=6G,46A,97A,130T
seq1 Stellar eps-matches 284241 284396 95.031 + . seq2;seq2Range=674595,674753;eValue=5.35078e-60;cigar=2M1I40M1I56M1I25M1D12M1I15M1I1M1D3M;mutations=3T,21G,44A,101C,139A,155A
seq1 Stellar eps-matches 621237 621392 95.5414 + . seq2;seq2Range=780976,781128;eValue=1.75885e-59;cigar=40M1D9M1D39M1I32M1D25M1D7M;mutations=82G,89A,104C
seq1 Stellar eps-matches 885857 886012 95 + . seq2;seq2Range=782328,782485;eValue=1.75885e-59;cigar=2M1I39M1D31M1I19M1I19M1I23M1D21M;mutations=3C,74G,91G,94C,114C,124T
seq1 Stellar eps-matches 423258 423412 95.5414 + . seq2;seq2Range=161590,161741;eValue=1.75885e-59;cigar=1M1D46M1D15M1I3M1D25M1D9M1D37M1I14M;mutations=63C,138T
seq1 Stellar eps-matches 571624 571778 95.4838 + . seq2;seq2Range=512505,512656;eValue=1.90042e-58;cigar=80M1D23M1D47M1D2M;mutations=7A,71C,103A,142T
seq1 Stellar eps-matches 417666 417819 95.031 + . seq2;seq2Range=468864,469024;eValue=5.35078e-60;cigar=29M1I3M1I16M1I25M1I20M2I59M1I2M;mutations=30A,34C,51G,77A,98C,99T,152T,159A
seq1 Stellar eps-matches 654545 654698 95.5414 + . seq2;seq2Range=283616,283769;eValue=1.75885e-59;cigar=21M2I110M1D7M1D3M1D8M1I2M;mutations=22A,23A,31C,152T
seq1 Stellar eps-matches 777439 777592 95.5414 + . seq2;seq2Range=378741,378894;eValue=1.75885e-59;cigar=24M1D6M1I45M1D9M1I44M1D1M1I22M;mutations=31A,54A,86G,132A
seq1 Stellar eps-matches 966949 967102 95.5414 + . seq2;seq2Range=20890,21045;eValue=1.75885e-59;cigar=87M1I13M1I10M1I27M1D16M;mutations=11C,88C,102G,113A,141C,155G
seq1 Stellar eps-matches 44845 44997 95.5128 + . seq2;seq2Range=832718,832870;eValue=5.78147e-59;cigar=2M1D13M1D46M1I50M1D1M1I35M1I3M;mutations=20G,62G,114C,150G
seq1 Stellar eps-matches 197247 197399 95.5414 + . seq2;seq2Range=941824,941978;eValue=1.75885e-59;cigar=31M1I1M1I1M1D38M1I31M1I14M1D35M;mutations=20C,32T,34T,74A,106A
seq1 Stellar eps-matches 377640 377792 95.4838 + . seq2;seq2Range=930620,930771;eValue=1.90042e-58;cigar=5M1D14M1I14M1D24M1D44M1I49M;mutations=20G,25T,90C,103G
seq1 Stellar eps-matches 729592 729744 95.5128 + . seq2;seq2Range=54478,54629;eValue=5.78147e-59;cigar=6M1I28M1I12M1D28M1D37M1D11M1D25M1I2M;mutations=7C,36A,150C
seq1 Stellar eps-matches 933475 933627 95.4838 + . seq2;seq2Range=348807,348958;eValue=1.90042e-58;cigar=37M1D9M1I51M1D26M1I24M1D3M;mutations=35C,47C,125A,150C
seq1 Stellar eps-matches 963763 963915 95.4545 + . seq2;seq2Range=686289,686436;eValue=6.24682e-58;cigar=35M1D23M1I12M1D1M1D29M1D18M1D29M1D;mutations=59C
seq1 Stellar eps-matches 643 794 95.4545 + . seq2;seq2Range=216373,216523;eValue=6.24682e-58;cigar=1M1D67M1D25M1I44M1I8M1D4M;mutations=39T,64C,94G,139C
seq1 Stellar eps-matches 150842 150993 95.4838 + . seq2;seq2Range=587764,587915;eValue=1.90042e-58;cigar=15M1D1M1D2M1D62M1I30M1I7M1I32M;mutations=61C,81A,112C,120G
seq1 Stellar eps-matches 256457 256608 95.5128 + . seq2;seq2Range=68946,69099;eValue=5.78147e-59;cigar=20M1I24M1D27M1I3M1D23M1I8M1I45M;mutations=21T,73T,100G,107G,109C
seq1 Stellar eps-matches 351302 351452 95.4248 + . seq2;seq2Range=950342,950490;eValue=2.05338e-57;cigar=5M1D52M1D24M1I32M1D19M1D10M1I5M;mutations=82A,100C,144G
seq1 Stellar eps-matches 297311 297460 95.4838 + . seq2;seq2Range=407506,407659;eValue=1.90042e-58;cigar=36M1D12M1I1M1I16M1I79M1I4M1I1M;mutations=49G,51G,68T,148T,151A,153C
seq1 Stellar eps-matches 766247 766396 95.3947 + . seq2;seq2Range=280998,281147;eValue=6.74963e-57;cigar=13M1I36M1D76M1D20M1I3M;mutations=14A,37G,44A,147A,148A
seq1 Stellar eps-matches 937043 937192 95.4248 + . seq2;seq2Range=972878,973027;eValue=2.05338e-57;cigar=3M1I13M1I25M1D42M1I20M1D42M1D2M;mutations=4G,13G,18T,86C
seq1 Stellar eps-matches 962390 962539 95.4545 + . seq2;seq2Range=757349,757500;eValue=6.24682e-58;cigar=15M1D14M1I43M1I2M1I72M1D1M1I1M;mutations=3G,30A,74A,77G,151A
seq1 Stellar eps-matches 96462 96610 95.4545 + . seq2;seq2Range=403609,403760;eValue=6.24682e-58;cigar=62M1I6M1I12M1D9M1I17M1I31M1D2M1I8M;mutations=63A,70C,92T,110T,144C
seq1 Stellar eps-matches 827913 828061 95.3333 + . seq2;seq2Range=594697,594841;eValue=7.29291e-56;cigar=58M1D7M1I2M1D28M1D43M1D6M1D;mutations=66A,144C
seq1 Stellar eps-matches 400179 400326 95.302 + . seq2;seq2Range=496978,497122;eValue=2.39724e-55;cigar=8M1D72M1I60M2D1M1D3M;mutations=81A,129C,144C
seq1 Stellar eps-matches 519379 519526 95.3333 + . seq2;seq2Range=575238,575385;eValue=7.29291e-56;cigar=37M1D1M1I35M1I45M1D28M;mutations=2A,39A,75C,127T,147T
seq1 Stellar eps-matches 708533 708680 95.3333 + . seq2;seq2Range=763167,763311;eValue=7.29291e-56;cigar=3M1I18M2D75M1D9M1D19M1I10M1D9M;mutations=4G,126A
seq1 Stellar eps-matches 942818 942965 95.302 + . seq2;seq2Range=754416,754560;eValue=2.39724e-55;cigar=70M1I14M2D25M1D28M1D7M;mutations=71A,100A,127C
seq1 Stellar eps-matches 329859 330005 95.2702 + . seq2;seq2Range=916219,916363;eValue=7.87992e-55;cigar=74M1D10M1I44M1D16M1D;mutations=38T,85C,89G,120T
seq1 Stellar eps-matches 406734 406880 95.3333 + . seq2;seq2Range=505917,506063;eValue=7.29291e-56;cigar=23M1I14M1D4M1I28M1D19M1D17M1I39M;mutations=24A,43G,108A,119G
seq1 Stellar eps-matches 490129 490275 95.3333 + . seq2;seq2Range=10456,10601;eValue=7.29291e-56;cigar=23M1D16M1I29M1I8M1D36M1I1M1D20M1D10M;mutations=40G,70C,115C
seq1 Stellar eps-matches 951214 951360 95.3333 + . seq2;seq2Range=29646,29793;eValue=7.29291e-56;cigar=10M1I28M1D12M1I37M1D52M1I6M;mutations=11A,52G,114A,142A,144C
seq1 Stellar eps-matches 118921 119066 95.2054 + . seq2;seq2Range=873813,873953;eValue=8.51418e-54;cigar=5M1D3M1D5M1D25M1D100M1D3M;mutations=4T,115G
seq1 Stellar eps-matches 138464 138608 95.2702 + . seq2;seq2Range=705002,705146;eValue=7.87992e-55;cigar=4M1I47M1I3M1D14M1I37M1D2M1D35M;mutations=4G,5T,53G,71G
seq1 Stellar eps-matches 260969 261113 95.302 + . seq2;seq2Range=34161,34308;eValue=2.39724e-55;cigar=9M1I25M1I2M1I4M1I20M1D84M;mutations=10G,20G,36A,39A,44G,81C
seq1 Stellar eps-matches 356135 356279 95.302 + . seq2;seq2Range=683665,683810;eValue=2.39724e-55;cigar=9M1I24M1I27M1D24M1I13M1D29M1D6M1I10M;mutations=10G,35C,87T,136G
seq1 Stellar eps-matches 448280 448424 95.238 + . seq2;seq2Range=85520,85663;eValue=2.59019e-54;cigar=27M1D24M1D48M1D8M1I9M1I26M;mutations=20A,47C,108G,118C
seq1 Stellar eps-matches 722217 722361 95.2702 + . seq2;seq2Range=213233,213378;eValue=7.87992e-55;cigar=21M1I9M1D30M1D2M1I10M1I71M;mutations=22C,51A,64G,75G,105G
seq1 Stellar eps-matches 869162 869306 95.2054 + . seq2;seq2Range=706350,706492;eValue=8.51418e-54;cigar=19M1I1M1D81M1D8M1D33M;mutations=3G,14T,19T,20T
seq1 Stellar eps-matches 474394 474537 95.2054 + . seq2;seq2Range=635965,636105;eValue=8.51418e-54;cigar=9M1I2M1D13M1I12M1D100M1D1M1D1M1D1M;mutations=10C,26A
seq1 Stellar eps-matches 750054 750197 95.1724 + . seq2;seq2Range=476392,476534;eValue=2.79868e-53;cigar=26M1I95M1D7M1D14M;mutations=2G,25G,27C,55T,106A
seq1 Stellar eps-matches 820082 820225 95.2702 + . seq2;seq2Range=724511,724655;eValue=7.87992e-55;cigar=4M2I18M1I16M1I15M1D21M2D67M;mutations=5G,6A,25C,42C
seq1 Stellar eps-matches 271761 271903 95.1388 + . seq2;seq2Range=119080,119220;eValue=9.19948e-53;cigar=30M1D27M1I12M1D16M1D55M;mutations=17T,58T,138G,139A
seq1 Stellar eps-matches 543397 543539 95.1724 + . seq2;seq2Range=249969,250108;eValue=2.79868e-53;cigar=28M1I31M1I21M1D3M1D18M1D10M1D26M1D1M;mutations=29C,61T
seq1 Stellar eps-matches 636211 636353 95.1724 + . seq2;seq2Range=853255,853397;eValue=2.79868e-53;cigar=61M1D17M1D59M1I2M1I2M;mutations=87A,102T,118A,138A,141C
seq1 Stellar eps-matches 751334 751476 95.2054 + . seq2;seq2Range=279609,279752;eValue=8.51418e-54;cigar=21M1D23M1D34M1I61M1I1M1I1M;mutations=79G,83T,118G,141G,143T
seq1 Stellar eps-matches 862439 862581 95.1388 + . seq2;seq2Range=325115,325255;eValue=9.19948e-53;cigar=93M1D14M1I30M1D2M1D1M;mutations=34T,60T,108T,124T
seq1 Stellar eps-matches 946021 946163 95.2702 + . seq2;seq2Range=819262,819409;eValue=7.87992e-55;cigar=11M1I8M1I39M1I20M1I59M1I6M;mutations=5C,12T,21G,61A,68A,82G,142A
seq1 Stellar eps-matches 63569 63710 95.1388 + . seq2;seq2Range=4433,4572;eValue=9.19948e-53;cigar=2M1D19M1D7M1D45M1I8M1D33M1I24M;mutations=74A,116T,132G
seq1 Stellar eps-matches 100678 100819 95.1048 + . seq2;seq2Range=932456,932596;eValue=3.02395e-52;cigar=4M1D58M1D69M1I9M;mutations=3G,30G,61A,108C,132C
seq1 Stellar eps-matches 771550 771691 95.1724 + . seq2;seq2Range=595774,595915;eValue=2.79868e-53;cigar=13M1D6M1I47M1I54M1I4M1D15M1D;mutations=3T,20A,68T,123C
seq1 Stellar eps-matches 776533 776674 95.1724 + . seq2;seq2Range=8510,8653;eValue=2.79868e-53;cigar=41M1I23M1I26M1I20M1D31M;mutations=29T,33T,42A,63A,66A,93C
seq1 Stellar eps-matches 890405 890546 95.1388 + . seq2;seq2Range=155776,155914;eValue=9.19948e-53;cigar=16M1D30M1I30M1D5M1D22M1I34M2D;mutations=47C,105G
seq1 Stellar eps-matches 5114 5254 95.1724 + . seq2;seq2Range=375384,375528;eValue=2.79868e-53;cigar=4M1I21M1I68M1I46M1I2M;mutations=5G,15T,27T,46T,96A,138T,143T
seq1 Stellar eps-matches 655831 655971 95.1388 + . seq2;seq2Range=242013,242154;eValue=9.19948e-53;cigar=4M1D27M1I2M1I4M1D71M1I31M;mutations=3G,32T,35G,45T,111T
seq1 Stellar eps-matches 694055 694195 95.1388 + . seq2;seq2Range=229394,229535;eValue=9.19948e-53;cigar=24M1I39M1I35M1D19M1I20M1D2M;mutations=11A,25G,65G,102A,120G
seq1 Stellar eps-matches 278581 278720 95.0704 + . seq2;seq2Range=207858,207996;eValue=9.93995e-52;cigar=2M1D13M1D7M1I5M1D102M1I8M;mutations=10T,23C,64G,131G
seq1 Stellar eps-matches 285360 285499 95.0354 + . seq2;seq2Range=991329,991466;eValue=3.26734e-51;cigar=57M1I18M1D36M1D23M1D3M;mutations=24T,58C,134C,137G
seq1 Stellar eps-matches 393236 393375 95.1388 + . seq2;seq2Range=793042,793182;eValue=9.19948e-53;cigar=1M1D1M1I50M1I30M2D17M1I37M1I1M;mutations=3A,54A,102A,140G
seq1 Stellar eps-matches 450984 451123 95.1388 + . seq2;seq2Range=802955,803096;eValue=9.19948e-53;cigar=3M1I57M2I7M1I22M1D35M1D14M;mutations=4G,62C,63C,66T,71T
seq1 Stellar eps-matches 712264 712403 95.0704 + . seq2;seq2Range=905599,905735;eValue=9.93995e-52;cigar=17M1D40M1D2M1D9M1D23M1I22M1I18M1D4M;mutations=92C,115A
seq1 Stellar eps-matches 953246 953385 95.1048 + . seq2;seq2Range=91563,91703;eValue=3.02395e-52;cigar=1M1D28M1D34M1I19M1I23M1I33M;mutations=7C,23G,64C,84C,108A
seq1 Stellar eps-matches 178474 178612 95.0354 + . seq2;seq2Range=217436,217572;eValue=3.26734e-51;cigar=10M1I29M1D30M2D65M1I1M1D;mutations=11C,120G,136T
seq1 Stellar eps-matches 539088 539226 95 + . seq2;seq2Range=713053,713189;eValue=1.074e-50;cigar=26M1D52M1D1M1D17M1I40M;mutations=30C,97G,132G,133C
seq1 Stellar eps-matches 542656 542794 95.0704 + . seq2;seq2Range=77405,77544;eValue=9.93995e-52;cigar=2M1I43M1D63M1I16M1D3M1I10M;mutations=3C,19G,76T,110T,130C
seq1 Stellar eps-matches 835686 835824 95.0704 + . seq2;seq2Range=205710,205848;eValue=9.93995e-52;cigar=47M1D8M1I9M1D6M1D26M1I38M1I2M;mutations=21A,56G,98C,137A
seq1 Stellar eps-matches 490769 490906 95 + . seq2;seq2Range=90238,90375;eValue=1.074e-50;cigar=1M1I43M1I24M1D43M1D25M;mutations=2C,46G,56A,104T,137G
seq1 Stellar eps-matches 938985 939122 95.1048 + . seq2;seq2Range=496837,496978;eValue=3.02395e-52;cigar=2M1D50M1I23M1I41M1I15M2I6M;mutations=5C,53C,77G,119C,135A,136A
seq1 Stellar eps-matches 37109 37245 95.0704 + . seq2;seq2Range=711127,711267;eValue=9.93995e-52;cigar=5M1I58M1I21M1I10M1D24M1I4M1I14M;mutations=4T,6A,65G,87T,122A,127T
seq1 Stellar eps-matches 530941 531076 95.6204 + . seq2;seq2Range=345138,345271;eValue=1.074e-50;cigar=62M1D6M1D54M1I11M1D;mutations=66T,94C,123C
seq1 Stellar eps-matches 710550 710685 95.0354 + . seq2;seq2Range=943825,943964;eValue=3.26734e-51;cigar=2M1I1M1I4M1I1M1I20M1I44M1D63M;mutations=3T,5C,7T,10C,12A,33A
seq1 Stellar eps-matches 49750 49884 95.6204 + . seq2;seq2Range=957997,958130;eValue=1.074e-50;cigar=10M1D59M1I2M1I15M1D27M1D19M;mutations=25C,70G,73G
seq1 Stellar eps-matches 263127 263261 95.5882 + . seq2;seq2Range=692416,692547;eValue=3.53033e-50;cigar=24M1D35M1D45M1D14M1I9M1D4M;mutations=108T,119C
seq1 Stellar eps-matches 532173 532307 95.5882 + . seq2;seq2Range=38508,38641;eValue=3.53033e-50;cigar=25M1I21M1D70M1D17M;mutations=26T,71A,78A,93C
seq1 Stellar eps-matches 674934 675067 95.5555 + . seq2;seq2Range=292264,292396;eValue=1.16045e-49;cigar=41M1D56M1I32M1D3M;mutations=33C,98C,103T,128T
seq1 Stellar eps-matches 832221 832354 95.5882 + . seq2;seq2Range=628500,628632;eValue=3.53033e-50;cigar=2M1D58M1I40M1D14M1I10M1D7M;mutations=61G,116A,121C
seq1 Stellar eps-matches 573085 573217 95.5555 + . seq2;seq2Range=3263,3396;eValue=1.16045e-49;cigar=8M1D48M1I2M1I74M;mutations=46A,57C,60A,102T,116T
seq1 Stellar eps-matches 112881 113012 95.4887 + . seq2;seq2Range=13330,13458;eValue=1.25385e-48;cigar=4M1D47M1D47M1D16M1D10M1I4M;mutations=125C,128G
seq1 Stellar eps-matches 247950 248081 95.5555 + . seq2;seq2Range=139731,139864;eValue=1.16045e-49;cigar=24M1I35M1I49M1D1M1I22M;mutations=25G,38G,40C,61T,112T
seq1 Stellar eps-matches 461991 462122 95.5223 + . seq2;seq2Range=24609,24740;eValue=3.81449e-49;cigar=22M1D41M1D27M1I8M1I32M;mutations=39T,91G,100T,101C
seq1 Stellar eps-matches 260439 260569 95.4887 + . seq2;seq2Range=297449,297578;eValue=1.25385e-48;cigar=11M1D1M1D44M1I7M1D7M1I58M;mutations=34A,57C,72G
seq1 Stellar eps-matches 502263 502393 95.4887 + . seq2;seq2Range=382067,382198;eValue=1.25385e-48;cigar=3M1I51M1D57M1I19M;mutations=4C,37A,39T,113G,116C
seq1 Stellar eps-matches 522583 522713 95.4198 + . seq2;seq2Range=762436,762563;eValue=1.35478e-47;cigar=12M1D56M1D4M1D56M;mutations=19G,57A,76A
seq1 Stellar eps-matches 595483 595613 95.5223 + . seq2;seq2Range=402361,402491;eValue=3.81449e-49;cigar=38M1I5M1D34M1I4M1I20M1D26M1D1M;mutations=39G,79T,84A
seq1 Stellar eps-matches 941150 941280 95.4887 + . seq2;seq2Range=535828,535958;eValue=1.25385e-48;cigar=36M1D52M1D5M1I8M1I28M;mutations=94G,95C,103C,125G
seq1 Stellar eps-matches 997152 997282 95.4545 + . seq2;seq2Range=500351,500479;eValue=4.12152e-48;cigar=11M1I17M1D53M1D17M1D30M;mutations=12T,76C,103T
seq1 Stellar eps-matches 872037 872166 95.4198 + . seq2;seq2Range=227864,227991;eValue=1.35478e-47;cigar=38M1D20M1D24M1D5M1I40M;mutations=15G,88G,102A
seq1 Stellar eps-matches 629655 629783 95.4198 + . seq2;seq2Range=878848,878978;eValue=1.35478e-47;cigar=38M1I38M1I53M;mutations=39T,64A,78T,101C,119G,130A
seq1 Stellar eps-matches 943334 943462 95.4198 + . seq2;seq2Range=447731,447858;eValue=1.35478e-47;cigar=1M1I71M1D8M1I14M1D1M1D31M;mutations=2T,82G,110A
seq1 Stellar eps-matches 962004 962132 95.4198 + . seq2;seq2Range=609230,609358;eValue=1.35478e-47;cigar=8M1D12M1D13M1I66M1I28M;mutations=27C,34G,78T,101G
seq1 Stellar eps-matches 306843 306970 95.4887 + . seq2;seq2Range=908106,908237;eValue=1.25385e-48;cigar=8M1I5M1I11M1I61M1I6M1I6M1D30M;mutations=9C,15G,27G,89G,96G
seq1 Stellar eps-matches 789186 789313 95.4198 + . seq2;seq2Range=945426,945554;eValue=1.35478e-47;cigar=4M1D35M1I31M1I7M1I12M1D37M;mutations=40C,72G,76A,80C
seq1 Stellar eps-matches 307699 307825 95.2755 + . seq2;seq2Range=289216,289338;eValue=1.58165e-45;cigar=43M1D32M1D46M2D2M;mutations=8C,100G
seq1 Stellar eps-matches 516921 517047 95.4198 + . seq2;seq2Range=711530,711658;eValue=1.35478e-47;cigar=14M2I56M1I7M1I8M1D36M1D4M;mutations=15A,16G,73T,81C
seq1 Stellar eps-matches 589624 589750 95.3488 + . seq2;seq2Range=965778,965905;eValue=1.46382e-46;cigar=29M1D69M1I21M1I7M;mutations=5A,6A,66G,99T,121C
seq1 Stellar eps-matches 613789 613915 95.3488 + . seq2;seq2Range=747045,747171;eValue=1.46382e-46;cigar=15M1I98M1I4M1D7M1D1M;mutations=16G,47A,56A,115T
seq1 Stellar eps-matches 241343 241468 95.3488 + . seq2;seq2Range=804139,804265;eValue=1.46382e-46;cigar=50M1D11M1I8M1D20M1I34M1I1M;mutations=17T,62C,91G,126A
seq1 Stellar eps-matches 815790 815915 95.3125 + . seq2;seq2Range=746792,746919;eValue=4.81171e-46;cigar=73M1I15M1I38M;mutations=22T,72A,74G,76G,90G,122C
seq1 Stellar eps-matches 879730 879855 95.2755 + . seq2;seq2Range=51159,51283;eValue=1.58165e-45;cigar=32M1D26M1I62M1D4M;mutations=12T,36G,59C,120G
seq1 Stellar eps-matches 742015 742139 95.2755 + . seq2;seq2Range=236208,236331;eValue=1.58165e-45;cigar=29M1D15M1I23M1D46M1I8M1D1M;mutations=34A,45G,115T
seq1 Stellar eps-matches 822857 822981 95.2755 + . seq2;seq2Range=666506,666631;eValue=1.58165e-45;cigar=38M1I24M1D30M1I32M;mutations=8G,19A,39G,94A,96C
seq1 Stellar eps-matches 845355 845479 95.3125 + . seq2;seq2Range=841615,841741;eValue=4.81171e-46;cigar=3M1I14M1I28M1I15M1D64M;mutations=4G,19A,35C,48A,109T
seq1 Stellar eps-matches 931171 931295 95.2755 + . seq2;seq2Range=723373,723498;eValue=1.58165e-45;cigar=1M1D48M1I5M1I70M;mutations=14C,45T,50G,56A,120C
seq1 Stellar eps-matches 19031 19154 95.2 + . seq2;seq2Range=153294,153413;eValue=1.70895e-44;cigar=47M1I32M1D36M3D1M1D3M;mutations=48G
seq1 Stellar eps-matches 625995 626118 95.2755 + . seq2;seq2Range=925232,925355;eValue=1.58165e-45;cigar=4M2I42M1D6M1I26M1D30M1D13M;mutations=5G,6T,55A
seq1 Stellar eps-matches 727096 727219 95.1612 + . seq2;seq2Range=817940,818059;eValue=5.61747e-44;cigar=1M1D7M1D18M1D57M1D37M;mutations=103C,115T
seq1 Stellar eps-matches 768402 768525 95.2 + . seq2;seq2Range=426537,426656;eValue=1.70895e-44;cigar=2M1I3M1D32M1D51M1D2M1D28M1D1M;mutations=3C
seq1 Stellar eps-matches 771849 771972 95.1612 + . seq2;seq2Range=144198,144320;eValue=5.61747e-44;cigar=84M1D39M;mutations=4A,5T,7C,50A,66A
seq1 Stellar eps-matches 172506 172628 95.238 + . seq2;seq2Range=824218,824341;eValue=5.199e-45;cigar=21M1I5M1I74M1D19M1D1M1I1M;mutations=22G,28G,43G,123G
seq1 Stellar eps-matches 532027 532149 95.238 + . seq2;seq2Range=455105,455228;eValue=5.199e-45;cigar=7M1D2M1I7M1I2M1I102M1D1M;mutations=10T,18C,21T,81A
seq1 Stellar eps-matches 624938 625060 95.1612 + . seq2;seq2Range=923087,923208;eValue=5.61747e-44;cigar=56M1I12M1D25M1D28M;mutations=14C,57C,58C,71T
seq1 Stellar eps-matches 687816 687937 95.1219 + . seq2;seq2Range=868859,868976;eValue=1.84651e-43;cigar=5M1I22M1D5M1D26M1D44M1D13M1D2M;mutations=6T
seq1 Stellar eps-matches 938061 938182 95.1612 + . seq2;seq2Range=924282,924403;eValue=5.61747e-44;cigar=9M1D4M1I31M1I76M1D;mutations=14G,46T,57G,121C
seq1 Stellar eps-matches 946564 946685 95.1219 + . seq2;seq2Range=616679,616798;eValue=1.84651e-43;cigar=4M1D8M1D45M1D36M1I26M;mutations=2C,84C,94G
seq1 Stellar eps-matches 39779 39899 95.1612 + . seq2;seq2Range=828242,828363;eValue=5.61747e-44;cigar=47M1I8M1I7M1D26M1I27M1D4M;mutations=48G,54C,57G,91C
seq1 Stellar eps-matches 291039 291159 95.1612 + . seq2;seq2Range=46123,46246;eValue=5.61747e-44;cigar=67M1I11M1I42M1I1M;mutations=68T,74C,80T,87A,118T,123G
seq1 Stellar eps-matches 371302 371422 95.1219 + . seq2;seq2Range=275836,275954;eValue=1.84651e-43;cigar=39M1D21M1I6M1D4M1I15M1D31M1D1M;mutations=61A,72C
seq1 Stellar eps-matches 618235 618355 95.1612 + . seq2;seq2Range=110400,110521;eValue=5.61747e-44;cigar=62M1I12M1I8M1D4M1D32M1I1M;mutations=20A,63G,76C,121G
seq1 Stellar eps-matches 697349 697469 95.2755 + . seq2;seq2Range=157917,158043;eValue=1.58165e-45;cigar=3M1I24M1I11M1I4M1I2M1I66M1I11M;mutations=4T,29G,41G,46A,49A,116G
seq1 Stellar eps-matches 538024 538143 95.0413 + . seq2;seq2Range=833354,833469;eValue=1.99513e-42;cigar=47M1I5M1D57M1D1M2D5M1D;mutations=48C
seq1 Stellar eps-matches 802309 802428 95.1219 + . seq2;seq2Range=806677,806797;eValue=1.84651e-43;cigar=28M1I51M1I15M1D15M1D8M1I1M;mutations=29C,81C,115G,120C
seq1 Stellar eps-matches 885519 885638 95.0413 + . seq2;seq2Range=132204,132322;eValue=1.99513e-42;cigar=68M1D24M1I10M1D16M;mutations=15T,21T,71C,93T
seq1 Stellar eps-matches 131943 132061 95.0413 + . seq2;seq2Range=761156,761272;eValue=1.99513e-42;cigar=31M1I2M1I5M1D8M1D36M1D33M1D;mutations=32C,35A
seq1 Stellar eps-matches 957308 957426 95.0819 + . seq2;seq2Range=537718,537837;eValue=6.06962e-43;cigar=3M1D1M1D14M1I37M1I61M1I1M;mutations=19C,57A,105A,119G
seq1 Stellar eps-matches 580902 581019 95 + . seq2;seq2Range=351103,351220;eValue=6.55817e-42;cigar=1M1I2M1D43M1I54M1D16M;mutations=2G,26G,48A,59A
seq1 Stellar eps-matches 894251 894368 95 + . seq2;seq2Range=59775,59891;eValue=6.55817e-42;cigar=23M1I6M1D6M1I70M1D9M1D1M;mutations=24T,37T,114G
seq1 Stellar eps-matches 911067 911184 95 + . seq2;seq2Range=755685,755802;eValue=6.55817e-42;cigar=6M1I52M1D27M1D27M1I4M;mutations=7A,29A,114A,116A
seq1 Stellar eps-matches 578255 578371 95.7264 + . seq2;seq2Range=836445,836558;eValue=6.55817e-42;cigar=5M1D64M1D17M1D28M;mutations=41T,60C
seq1 Stellar eps-matches 688442 688557 95.7264 + . seq2;seq2Range=582320,582435;eValue=6.55817e-42;cigar=13M1I89M1D13M;mutations=3T,14C,36C,58A
seq1 Stellar eps-matches 872638 872753 95.7627 + . seq2;seq2Range=548279,548395;eValue=1.99513e-42;cigar=1M1D22M1I23M1I69M;mutations=24T,48C,59C,66G
seq1 Stellar eps-matches 963168 963283 95.6896 + . seq2;seq2Range=47468,47578;eValue=2.15572e-41;cigar=14M1D8M1D22M1D6M1D60M1D1M;mutations=
seq1 Stellar eps-matches 73791 73905 95.6896 + . seq2;seq2Range=955446,955560;eValue=2.15572e-41;cigar=57M1I12M1D45M;mutations=4A,11C,58A,67T
seq1 Stellar eps-matches 609182 609296 95.7264 + . seq2;seq2Range=19354,19469;eValue=6.55817e-42;cigar=49M1D10M1I5M1I50M;mutations=2G,46T,60T,66G
seq1 Stellar eps-matches 782060 782174 95.7264 + . seq2;seq2Range=975020,975134;eValue=6.55817e-42;cigar=8M1I18M1D11M1I3M1D73M;mutations=9G,15G,39G
seq1 Stellar eps-matches 30439 30552 95.6521 + . seq2;seq2Range=894466,894577;eValue=7.08604e-41;cigar=3M1D3M1D31M1I43M1D31M;mutations=38A,65T
seq1 Stellar eps-matches 301577 301690 95.6896 + . seq2;seq2Range=785411,785524;eValue=2.15572e-41;cigar=2M1I4M1I48M1D13M1D45M;mutations=3T,8T,71A
seq1 Stellar eps-matches 698487 698600 95.6521 + . seq2;seq2Range=21835,21946;eValue=7.08604e-41;cigar=6M1D8M1D35M1I23M1D39M;mutations=50A,66G
seq1 Stellar eps-matches 777018 777131 95.6521 + . seq2;seq2Range=253336,253448;eValue=7.08604e-41;cigar=70M1I27M1D15M1D;mutations=49C,69C,71T
seq1 Stellar eps-matches 891093 891206 95.7264 + . seq2;seq2Range=228353,228467;eValue=6.55817e-42;cigar=24M2I68M1D12M1I6M1D2M;mutations=25T,26A,107G
seq1 Stellar eps-matches 950479 950592 95.7264 + . seq2;seq2Range=974232,974347;eValue=6.55817e-42;cigar=1M1I51M1D3M1I52M1I6M;mutations=2A,43T,57A,110T
seq1 Stellar eps-matches 966511 966624 95.6521 + . seq2;seq2Range=388665,388776;eValue=7.08604e-41;cigar=15M1D6M1I3M1D23M1D64M;mutations=22C,25A
seq1 Stellar eps-matches 42312 42424 95.614 + . seq2;seq2Range=12457,12568;eValue=2.32924e-40;cigar=16M1I5M1D47M1D43M;mutations=2C,9G,17C
seq1 Stellar eps-matches 51225 51337 95.6521 + . seq2;seq2Range=391757,391870;eValue=7.08604e-41;cigar=30M1I25M1I23M1D34M;mutations=19T,31A,57C,62G
seq1 Stellar eps-matches 246943 247055 95.5752 + . seq2;seq2Range=569446,569556;eValue=7.65639e-40;cigar=40M1D57M1D14M;mutations=15A,60G,73A
seq1 Stellar eps-matches 253397 253509 95.614 + . seq2;seq2Range=946260,946372;eValue=2.32924e-40;cigar=30M1D66M1I16M;mutations=25A,44G,64C,97A
seq1 Stellar eps-matches 361576 361688 95.6896 + . seq2;seq2Range=435823,435938;eValue=2.15572e-41;cigar=15M1I46M1I47M1I5M;mutations=16C,56A,63C,82G,111G
seq1 Stellar eps-matches 566078 566190 95.6521 + . seq2;seq2Range=525530,525642;eValue=7.08604e-41;cigar=15M1I25M1I58M1D10M1D3M;mutations=16A,41G,42A
seq1 Stellar eps-matches 576064 576176 95.5752 + . seq2;seq2Range=331188,331297;eValue=7.65639e-40;cigar=5M1D16M1D66M1D23M;mutations=5T,44T
seq1 Stellar eps-matches 606186 606298 95.7264 + . seq2;seq2Range=100686,100802;eValue=6.55817e-42;cigar=2M1I15M1I24M1I19M1I53M;mutations=3A,19A,44T,64T,93A
seq1 Stellar eps-matches 50586 50697 95.6521 + . seq2;seq2Range=859373,859486;eValue=7.08604e-41;cigar=21M1I1M1D9M1I51M1I29M;mutations=22A,33C,85T,113C
seq1 Stellar eps-matches 82267 82378 95.5752 + . seq2;seq2Range=396984,397094;eValue=7.65639e-40;cigar=5M1D40M1D9M1I56M;mutations=3T,4C,55G
seq1 Stellar eps-matches 333517 333628 95.5752 + . seq2;seq2Range=762219,762327;eValue=7.65639e-40;cigar=9M1I19M1D31M1D10M1D38M1D1M;mutations=10C
seq1 Stellar eps-matches 360098 360209 95.614 + . seq2;seq2Range=372184,372295;eValue=2.32924e-40;cigar=2M1I9M1D22M1I30M1D47M;mutations=3A,35A,62T
seq1 Stellar eps-matches 408769 408880 95.5752 + . seq2;seq2Range=6968,7078;eValue=7.65639e-40;cigar=4M1D70M1D6M1I30M;mutations=81G,93C,99A
seq1 Stellar eps-matches 744193 744304 95.5752 + . seq2;seq2Range=454865,454977;eValue=7.65639e-40;cigar=98M1I14M;mutations=16C,17C,35T,99A,112C
seq1 Stellar eps-matches 99996 100106 95.5752 + . seq2;seq2Range=298278,298389;eValue=7.65639e-40;cigar=12M1D6M1I87M1I5M;mutations=19C,40A,103C,107A
seq1 Stellar eps-matches 206095 206205 95.5752 + . seq2;seq2Range=930499,930608;eValue=7.65639e-40;cigar=25M1I12M1I3M1D3M1D33M1D32M;mutations=26A,39G
seq1 Stellar eps-matches 458536 458646 95.4954 + . seq2;seq2Range=419674,419780;eValue=8.27266e-39;cigar=1M1D1M1D12M1D76M1D17M;mutations=32T
seq1 Stellar eps-matches 701012 701122 95.5357 + . seq2;seq2Range=728372,728480;eValue=2.51672e-39;cigar=27M1D7M1I27M1D30M1D17M;mutations=35G,59T
seq1 Stellar eps-matches 980067 980177 95.4954 + . seq2;seq2Range=499727,499833;eValue=8.27266e-39;cigar=73M1D20M1D7M1D7M1D;mutations=84C
seq1 Stellar eps-matches 471522 471631 95.5357 + . seq2;seq2Range=645303,645411;eValue=2.51672e-39;cigar=2M1D15M1I10M1I18M1D56M1D6M;mutations=18C,29A
seq1 Stellar eps-matches 9094 9202 95.4545 + . seq2;seq2Range=979181,979289;eValue=2.71929e-38;cigar=64M1I30M1D14M;mutations=65A,69C,89T,99T
seq1 Stellar eps-matches 254770 254878 95.4954 + . seq2;seq2Range=443319,443427;eValue=8.27266e-39;cigar=1M1I24M1D10M1I52M1D20M;mutations=2T,37A,90T
seq1 Stellar eps-matches 431092 431200 95.4128 + . seq2;seq2Range=448553,448658;eValue=8.93853e-38;cigar=50M2D54M1D2M;mutations=34C,86T
seq1 Stellar eps-matches 582468 582576 95.5357 + . seq2;seq2Range=108530,108639;eValue=2.51672e-39;cigar=2M1D45M1D5M1I20M1I8M1I27M;mutations=53C,74C,83T
seq1 Stellar eps-matches 905226 905334 95.4128 + . seq2;seq2Range=831534,831640;eValue=8.93853e-38;cigar=8M1D22M1D77M;mutations=30C,73T,79A
seq1 Stellar eps-matches 133536 133642 95.4128 + . seq2;seq2Range=525752,525859;eValue=8.93853e-38;cigar=51M1D26M1I24M1I5M;mutations=64A,78T,98G,103A
seq1 Stellar eps-matches 628841 628947 95.3271 + . seq2;seq2Range=774441,774544;eValue=9.65799e-37;cigar=50M1D2M1D20M1D32M;mutations=21T,62T
seq1 Stellar eps-matches 33377 33482 95.3703 + . seq2;seq2Range=70066,70170;eValue=2.93817e-37;cigar=16M1D1M1I11M1I45M1D30M1D;mutations=18G,30A
seq1 Stellar eps-matches 142351 142456 95.4128 + . seq2;seq2Range=743717,743823;eValue=8.93853e-38;cigar=29M1I2M1D56M1D2M1I12M1I3M;mutations=30A,91C,104G
seq1 Stellar eps-matches 194705 194810 95.3271 + . seq2;seq2Range=424757,424859;eValue=9.65799e-37;cigar=1M1D1M1D18M1D37M1D43M1I2M;mutations=101C
seq1 Stellar eps-matches 235821 235926 95.3271 + . seq2;seq2Range=215010,215114;eValue=9.65799e-37;cigar=68M1D11M1D22M1I3M;mutations=54A,57A,102A
seq1 Stellar eps-matches 686039 686144 95.4128 + . seq2;seq2Range=22554,22661;eValue=8.93853e-38;cigar=9M1I17M1D10M1I68M1I1M;mutations=10A,19T,38A,107C
seq1 Stellar eps-matches 323383 323487 95.283 + . seq2;seq2Range=181323,181426;eValue=3.17466e-36;cigar=42M1D40M1I20M1D1M;mutations=3G,4G,83G
seq1 Stellar eps-matches 378683 378787 95.3703 + . seq2;seq2Range=841846,841952;eValue=2.93817e-37;cigar=22M1D17M1I2M1I4M1I59M;mutations=40C,43A,48C,82T
seq1 Stellar eps-matches 395153 395257 95.4545 + . seq2;seq2Range=457556,457665;eValue=2.71929e-38;cigar=45M2I3M1I33M1I23M1I1M;mutations=46T,47C,51G,85G,109T
seq1 Stellar eps-matches 163906 164009 95.283 + . seq2;seq2Range=262045,262148;eValue=3.17466e-36;cigar=18M1I1M1D23M1D52M1I8M;mutations=19C,65A,96T
seq1 Stellar eps-matches 472414 472517 95.3703 + . seq2;seq2Range=166215,166321;eValue=2.93817e-37;cigar=22M1I3M1I30M1I3M1I45M1D;mutations=23A,27T,58T,62G
seq1 Stellar eps-matches 514903 515006 95.238 + . seq2;seq2Range=138449,138550;eValue=1.04354e-35;cigar=35M1D5M1I5M1D22M1D34M;mutations=41A,80C
seq1 Stellar eps-matches 564802 564905 95.3271 + . seq2;seq2Range=294508,294612;eValue=9.65799e-37;cigar=1M1D5M1D36M1I12M1I35M1I13M;mutations=43G,56T,92G
seq1 Stellar eps-matches 764362 764465 95.3271 + . seq2;seq2Range=222795,222900;eValue=9.65799e-37;cigar=2M1D18M1I1M1I20M1I62M;mutations=13C,21C,23C,44T
seq1 Stellar eps-matches 205335 205437 95.1456 + . seq2;seq2Range=130098,130197;eValue=1.12753e-34;cigar=17M1D4M1D27M1D52M;mutations=47C,68G
seq1 Stellar eps-matches 394322 394424 95.283 + . seq2;seq2Range=669196,669300;eValue=3.17466e-36;cigar=4M1I34M1I50M1I13M1D1M;mutations=5T,7A,40G,91A
seq1 Stellar eps-matches 588601 588703 95.238 + . seq2;seq2Range=193447,193548;eValue=1.04354e-35;cigar=3M1D15M1I7M1D25M1I49M1D1M;mutations=19G,52A
seq1 Stellar eps-matches 928819 928921 95.238 + . seq2;seq2Range=825197,825298;eValue=1.04354e-35;cigar=2M1D41M1I26M1D14M1I16M1D1M;mutations=44G,85T
seq1 Stellar eps-matches 432526 432627 95.238 + . seq2;seq2Range=130661,130764;eValue=1.04354e-35;cigar=23M1I14M1I36M1I21M1D7M;mutations=24T,39A,76T,80T
seq1 Stellar eps-matches 533106 533207 95.238 + . seq2;seq2Range=571262,571364;eValue=1.04354e-35;cigar=20M1D9M1I27M1I42M1I1M1D1M;mutations=30T,58C,101G
seq1 Stellar eps-matches 76729 76829 95.1456 + . seq2;seq2Range=20097,20197;eValue=1.12753e-34;cigar=23M1I5M1D26M1I29M1D16M;mutations=24G,56T,58A
seq1 Stellar eps-matches 782761 782861 95.238 + . seq2;seq2Range=39456,39560;eValue=1.04354e-35;cigar=1M1I1M1I63M1I13M1I23M;mutations=2T,4C,35T,68C,82G
seq1 Stellar eps-matches 850912 851012 95.098 + . seq2;seq2Range=976707,976805;eValue=3.70629e-34;cigar=17M1D4M1D32M1D13M1I32M;mutations=35A,67G
seq1 Stellar eps-matches 929671 929771 95.1456 + . seq2;seq2Range=534406,534506;eValue=1.12753e-34;cigar=6M1I35M1D38M1I13M1D7M;mutations=7G,20T,81G
seq1 Stellar eps-matches 958115 958215 95.1456 + . seq2;seq2Range=734198,734298;eValue=1.12753e-34;cigar=26M1D3M1D30M1I23M1I17M;mutations=60T,73C,84C
seq1 Stellar eps-matches 160221 160320 95.0495 + . seq2;seq2Range=385024,385122;eValue=1.21829e-33;cigar=52M1D4M1D41M1I1M;mutations=57C,92C,98A
seq1 Stellar eps-matches 255658 255757 95.1923 + . seq2;seq2Range=619800,619903;eValue=3.43019e-35;cigar=4M2I21M1I15M1I60M;mutations=4C,5G,6T,28T,44A
seq1 Stellar eps-matches 519774 519873 95.0495 + . seq2;seq2Range=478018,478114;eValue=1.21829e-33;cigar=5M1D15M1D24M1I50M1D1M1D1M;mutations=45G
seq1 Stellar eps-matches 589520 589619 95.098 + . seq2;seq2Range=859713,859812;eValue=3.70629e-34;cigar=22M1I1M1D29M1I44M1D2M;mutations=23C,54T,99C
seq1 Stellar eps-matches 603735 603834 95.1456 + . seq2;seq2Range=815052,815152;eValue=1.12753e-34;cigar=9M1I47M1D21M1I18M1D2M1I1M;mutations=10A,79G,100G
seq1 Stellar eps-matches 646885 646984 95.098 + . seq2;seq2Range=437623,437721;eValue=3.70629e-34;cigar=11M1I35M1D6M1I44M2D1M;mutations=12T,54G
seq1 Stellar eps-matches 739276 739375 95 + . seq2;seq2Range=268529,268625;eValue=4.00461e-33;cigar=10M1D67M1D19M1D1M;mutations=46C,72G
seq1 Stellar eps-matches 773637 773736 95 + . seq2;seq2Range=797773,797870;eValue=4.00461e-33;cigar=19M1D57M1D22M;mutations=49G,74T,96C
seq1 Stellar eps-matches 336836 336934 95.0495 + . seq2;seq2Range=163204,163302;eValue=1.21829e-33;cigar=21M1I2M1D47M1D26M1I1M;mutations=22T,95A,98T
seq1 Stellar eps-matches 343982 344080 95.0495 + . seq2;seq2Range=521219,521319;eValue=1.21829e-33;cigar=19M1I15M1I65M;mutations=3C,20T,29A,34C,36G
seq1 Stellar eps-matches 480330 480428 95 + . seq2;seq2Range=661722,661819;eValue=4.00461e-33;cigar=69M1D5M1D20M1I3M;mutations=65A,95C,96C
seq1 Stellar eps-matches 555418 555516 95 + . seq2;seq2Range=121398,121497;eValue=4.00461e-33;cigar=87M1I12M;mutations=58T,81T,88C,97A,99A
seq1 Stellar eps-matches 590734 590831 95.0495 + . seq2;seq2Range=720431,720531;eValue=1.21829e-33;cigar=16M1I75M2I7M;mutations=17T,93A,94C,96G,97G
seq1 Stellar eps-matches 683698 683795 95.9183 + . seq2;seq2Range=887645,887740;eValue=1.21829e-33;cigar=64M1D26M1D6M;mutations=58G,77A
seq1 Stellar eps-matches 944533 944630 95.0495 + . seq2;seq2Range=494953,495052;eValue=1.21829e-33;cigar=12M1I35M1D46M1I1M1I3M;mutations=13A,45G,95A,97G
seq1 Stellar eps-matches 428384 428480 95.8762 + . seq2;seq2Range=179491,179583;eValue=4.00461e-33;cigar=67M2D5M1D15M1D6M;mutations=
seq1 Stellar eps-matches 261779 261873 95.7894 + . seq2;seq2Range=561660,561750;eValue=4.32694e-32;cigar=5M1D39M2D45M1D2M;mutations=
seq1 Stellar eps-matches 289080 289174 95.7894 + . seq2;seq2Range=515775,515868;eValue=4.32694e-32;cigar=77M1D17M;mutations=39G,50A,52A
seq1 Stellar eps-matches 320094 320188 95.8333 + . seq2;seq2Range=703332,703426;eValue=1.31635e-32;cigar=61M1D29M1I4M;mutations=18T,52T,91G
seq1 Stellar eps-matches 347102 347196 95.8333 + . seq2;seq2Range=603446,603539;eValue=1.31635e-32;cigar=55M1D15M1D10M1I13M;mutations=50T,81T
seq1 Stellar eps-matches 678348 678442 95.7894 + . seq2;seq2Range=246070,246162;eValue=4.32694e-32;cigar=17M1D15M1D61M;mutations=60C,72T
seq1 Stellar eps-matches 911413 911507 95.8762 + . seq2;seq2Range=49193,49287;eValue=4.00461e-33;cigar=3M2I62M1D26M1D2M;mutations=4T,5C
seq1 Stellar eps-matches 119926 120019 95.7894 + . seq2;seq2Range=899394,899486;eValue=4.32694e-32;cigar=18M1I43M1D30M1D1M;mutations=19C,59A
seq1 Stellar eps-matches 152933 153025 95.7446 + . seq2;seq2Range=787257,787347;eValue=1.4223e-31;cigar=41M1D23M1D11M1I14M1D1M;mutations=76T
seq1 Stellar eps-matches 159265 159357 95.7446 + . seq2;seq2Range=992749,992839;eValue=1.4223e-31;cigar=6M1D24M1D27M1D22M1I11M;mutations=80G
seq1 Stellar eps-matches 802887 802979 95.7894 + . seq2;seq2Range=895976,896069;eValue=4.32694e-32;cigar=1M1I6M1D65M1I20M;mutations=2A,74G,76G
seq1 Stellar eps-matches 820931 821023 95.7446 + . seq2;seq2Range=461888,461978;eValue=1.4223e-31;cigar=77M1I5M1D2M1D3M1D3M;mutations=78A
seq1 Stellar eps-matches 331108 331199 95.6521 + . seq2;seq2Range=602088,602175;eValue=1.53678e-30;cigar=9M1D1M1D4M1D74M1D;mutations=
seq1 Stellar eps-matches 510371 510462 95.6989 + . seq2;seq2Range=835922,836013;eValue=4.67522e-31;cigar=59M1I21M1D11M;mutations=54C,60A,89G
seq1 Stellar eps-matches 718211 718302 95.7446 + . seq2;seq2Range=432541,432633;eValue=1.4223e-31;cigar=2M1D13M1I75M1I1M;mutations=16T,84G,92T
seq1 Stellar eps-matches 430674 430764 95.6521 + . seq2;seq2Range=373572,373661;eValue=1.53678e-30;cigar=21M1I15M1D14M1D39M;mutations=22C,88G
seq1 Stellar eps-matches 357746 357835 95.6043 + . seq2;seq2Range=379417,379505;eValue=5.05153e-30;cigar=6M1I42M1D3M1D37M;mutations=7C,87G
seq1 Stellar eps-matches 563468 563557 95.6989 + . seq2;seq2Range=912455,912547;eValue=4.67522e-31;cigar=1M1I29M1I59M1I1M;mutations=2A,26A,32G,92C
seq1 Stellar eps-matches 620076 620165 95.6521 + . seq2;seq2Range=819155,819244;eValue=1.53678e-30;cigar=21M1I8M1D22M1I1M1D36M;mutations=22T,53T
seq1 Stellar eps-matches 773464 773553 95.5555 + . seq2;seq2Range=853014,853099;eValue=1.66048e-29;cigar=2M1D58M1D24M1D2M1D;mutations=
seq1 Stellar eps-matches 958258 958347 95.6521 + . seq2;seq2Range=355282,355373;eValue=1.53678e-30;cigar=9M1I7M1I74M;mutations=9T,10A,17G,18G
seq1 Stellar eps-matches 997308 997397 95.5555 + . seq2;seq2Range=677925,678010;eValue=1.66048e-29;cigar=44M1D18M1D6M1D8M1D10M;mutations=
seq1 Stellar eps-matches 67160 67248 95.5056 + . seq2;seq2Range=310709,310793;eValue=5.45812e-29;cigar=18M1D30M1D28M2D9M;mutations=
seq1 Stellar eps-matches 867736 867824 95.6043 + . seq2;seq2Range=371169,371258;eValue=5.05153e-30;cigar=2M1I38M1I38M1D10M;mutations=3C,28C,42C
seq1 Stellar eps-matches 443484 443571 95.6043 + . seq2;seq2Range=612774,612863;eValue=5.05153e-30;cigar=41M1D22M1I12M1I11M1I1M;mutations=64C,77G,89A
seq1 Stellar eps-matches 329478 329564 95.4545 + . seq2;seq2Range=126951,127037;eValue=1.79413e-28;cigar=30M1D53M1I3M;mutations=76A,84T,86G
seq1 Stellar eps-matches 476897 476983 95.4545 + . seq2;seq2Range=82175,82261;eValue=1.79413e-28;cigar=68M1I13M1D5M;mutations=69A,70C,81G
seq1 Stellar eps-matches 803631 803717 95.4022 + . seq2;seq2Range=136934,137018;eValue=5.89745e-28;cigar=82M1D3M1D;mutations=7T,38A
seq1 Stellar eps-matches 117768 117853 95.5056 + . seq2;seq2Range=6635,6723;eValue=5.45812e-29;cigar=20M1I21M1I12M1I33M;mutations=21C,43T,56T,86C
seq1 Stellar eps-matches 801465 801550 95.4545 + . seq2;seq2Range=943627,943712;eValue=1.79413e-28;cigar=1M1D8M1I46M1I6M1D23M;mutations=10A,57C
seq1 Stellar eps-matches 170738 170822 95.2941 + . seq2;seq2Range=707195,707275;eValue=6.37214e-27;cigar=1M1D12M1D20M1D41M1D7M;mutations=
seq1 Stellar eps-matches 562942 563026 95.4545 + . seq2;seq2Range=958985,959071;eValue=1.79413e-28;cigar=4M1I2M1D42M1I25M1I11M;mutations=5G,50T,76G
seq1 Stellar eps-matches 762855 762939 95.4022 + . seq2;seq2Range=251893,251978;eValue=5.89745e-28;cigar=25M1I31M1I13M1D15M;mutations=26T,50G,58C
seq1 Stellar eps-matches 797831 797915 95.4022 + . seq2;seq2Range=888025,888109;eValue=5.89745e-28;cigar=9M1I12M1I6M1D24M1D32M;mutations=10T,23G
seq1 Stellar eps-matches 231918 232001 95.2941 + . seq2;seq2Range=363068,363151;eValue=6.37214e-27;cigar=32M1I49M1D2M;mutations=33T,36C,53G
seq1 Stellar eps-matches 268969 269052 95.238 + . seq2;seq2Range=800044,800127;eValue=2.09457e-26;cigar=84M;mutations=27T,45T,80A,82C
seq1 Stellar eps-matches 760705 760788 95.2941 + . seq2;seq2Range=443684,443767;eValue=6.37214e-27;cigar=25M1I58M1D;mutations=6A,26G,80C
seq1 Stellar eps-matches 822238 822321 95.2941 + . seq2;seq2Range=110287,110369;eValue=6.37214e-27;cigar=17M1D31M1D7M1I27M;mutations=56T,77A
seq1 Stellar eps-matches 945147 945230 95.2941 + . seq2;seq2Range=33158,33240;eValue=6.37214e-27;cigar=10M1D29M1I40M1D3M;mutations=3G,40G
seq1 Stellar eps-matches 952425 952508 95.4022 + . seq2;seq2Range=419793,419878;eValue=5.89745e-28;cigar=1M1D34M1I11M1I12M1I25M;mutations=36G,48G,61C
seq1 Stellar eps-matches 94819 94901 95.1807 + . seq2;seq2Range=81041,81121;eValue=6.88503e-26;cigar=24M1D26M1D31M;mutations=9G,27G
seq1 Stellar eps-matches 176204 176286 95.2941 + . seq2;seq2Range=683909,683993;eValue=6.37214e-27;cigar=13M1I69M1I1M;mutations=14A,32T,72G,84A
seq1 Stellar eps-matches 276223 276305 95.238 + . seq2;seq2Range=351848,351930;eValue=2.09457e-26;cigar=13M1I62M1D7M;mutations=14C,63G,79C
seq1 Stellar eps-matches 396942 397024 95.238 + . seq2;seq2Range=578019,578100;eValue=2.09457e-26;cigar=51M1D10M1I6M1D14M;mutations=62G,78C
seq1 Stellar eps-matches 734682 734764 95.2941 + . seq2;seq2Range=912246,912328;eValue=6.37214e-27;cigar=17M1I22M1D31M1D8M1I3M;mutations=18T,80C
seq1 Stellar eps-matches 818651 818733 95.3488 + . seq2;seq2Range=712552,712636;eValue=1.93854e-27;cigar=3M1D2M1I69M1I3M1I5M;mutations=6C,76A,80C
seq1 Stellar eps-matches 903607 903689 95.1807 + . seq2;seq2Range=870582,870662;eValue=6.88503e-26;cigar=1M1D71M1D9M;mutations=37T,57G
seq1 Stellar eps-matches 34400 34481 95.238 + . seq2;seq2Range=220326,220407;eValue=2.09457e-26;cigar=39M1I2M1D13M1I21M1D5M;mutations=40A,56C
seq1 Stellar eps-matches 579634 579715 95.1219 + . seq2;seq2Range=211129,211208;eValue=2.26317e-25;cigar=6M1D9M1D65M;mutations=11G,42G
seq1 Stellar eps-matches 672279 672360 95.238 + . seq2;seq2Range=692201,692284;eValue=2.09457e-26;cigar=22M1I24M1I36M;mutations=23G,48T,80A,83G
seq1 Stellar eps-matches 879471 879552 95.2941 + . seq2;seq2Range=332155,332238;eValue=6.37214e-27;cigar=3M1I36M1D10M1I18M1I14M;mutations=4G,51G,70G
seq1 Stellar eps-matches 953724 953805 95.1807 + . seq2;seq2Range=41055,41136;eValue=6.88503e-26;cigar=2M1I21M1D58M;mutations=3T,55T,69A
seq1 Stellar eps-matches 72846 72926 95.1219 + . seq2;seq2Range=283452,283530;eValue=2.26317e-25;cigar=10M1I35M2D31M1D2M;mutations=11T
seq1 Stellar eps-matches 107158 107238 95.1807 + . seq2;seq2Range=633889,633971;eValue=6.88503e-26;cigar=34M1I26M1I21M;mutations=3C,35A,62G,67C
seq1 Stellar eps-matches 404799 404879 95.1219 + . seq2;seq2Range=905409,905489;eValue=2.26317e-25;cigar=4M1D35M1I41M;mutations=3A,40G,43T
seq1 Stellar eps-matches 502523 502603 95.1219 + . seq2;seq2Range=730370,730449;eValue=2.26317e-25;cigar=3M1I42M1D32M1D2M;mutations=4A,34T
seq1 Stellar eps-matches 918917 918997 95.1219 + . seq2;seq2Range=282972,283051;eValue=2.26317e-25;cigar=28M1D27M1D20M1I4M;mutations=42C,76A
seq1 Stellar eps-matches 396438 396517 95.0617 + . seq2;seq2Range=215482,215560;eValue=7.43921e-25;cigar=21M1D37M1I18M1D2M;mutations=35T,59A
seq1 Stellar eps-matches 414468 414547 95 + . seq2;seq2Range=74828,74904;eValue=2.44533e-24;cigar=2M1D23M1D2M1D50M;mutations=72G
seq1 Stellar eps-matches 536938 537017 95.1219 + . seq2;seq2Range=807225,807304;eValue=2.26317e-25;cigar=3M1I17M1D43M1D3M1I12M;mutations=4G,68G
seq1 Stellar eps-matches 718456 718535 95.1219 + . seq2;seq2Range=620156,620236;eValue=2.26317e-25;cigar=5M1I28M1I46M1D;mutations=6T,21T,35T
seq1 Stellar eps-matches 743820 743899 95.1807 + . seq2;seq2Range=692684,692766;eValue=6.88503e-26;cigar=37M2I5M1I38M;mutations=38C,39G,45C,82T
seq1 Stellar eps-matches 174783 174861 95 + . seq2;seq2Range=256820,256897;eValue=2.44533e-24;cigar=1M1D19M1I5M1D52M;mutations=21T,57T
seq1 Stellar eps-matches 311959 312037 95.0617 + . seq2;seq2Range=133386,133466;eValue=7.43921e-25;cigar=7M1I42M1I30M;mutations=2G,8A,40T,51C
seq1 Stellar eps-matches 461842 461920 95 + . seq2;seq2Range=206961,207038;eValue=2.44533e-24;cigar=34M1D10M1D32M1I1M;mutations=13T,77C
seq1 Stellar eps-matches 493111 493188 95 + . seq2;seq2Range=235647,235725;eValue=2.44533e-24;cigar=36M1I1M1D6M1I34M;mutations=3C,37G,45C
seq1 Stellar eps-matches 703029 703105 96.1038 + . seq2;seq2Range=364454,364528;eValue=2.44533e-24;cigar=48M1D26M1D1M;mutations=10C
seq1 Stellar eps-matches 734376 734452 96.1038 + . seq2;seq2Range=763959,764035;eValue=2.44533e-24;cigar=77M;mutations=15T,49A,51T
seq1 Stellar eps-matches 807809 807885 96.1038 + . seq2;seq2Range=812147,812221;eValue=2.44533e-24;cigar=14M1D25M1D36M;mutations=57C
seq1 Stellar eps-matches 870220 870296 96.1038 + . seq2;seq2Range=852811,852884;eValue=2.44533e-24;cigar=5M1D32M1D36M1D1M;mutations=
seq1 Stellar eps-matches 601026 601101 96.1038 + . seq2;seq2Range=246840,246916;eValue=2.44533e-24;cigar=61M1I15M;mutations=55A,62C,75C
seq1 Stellar eps-matches 886289 886364 96.1038 + . seq2;seq2Range=857568,857642;eValue=2.44533e-24;cigar=43M1D17M1I5M1D9M;mutations=61C
seq1 Stellar eps-matches 734068 734142 96 + . seq2;seq2Range=940130,940203;eValue=2.64215e-23;cigar=9M1D65M;mutations=54A,61C
seq1 Stellar eps-matches 165578 165651 96.0526 + . seq2;seq2Range=301547,301621;eValue=8.038e-24;cigar=16M1I19M1I23M1D15M;mutations=17T,37G
seq1 Stellar eps-matches 525666 525739 96.1038 + . seq2;seq2Range=978356,978432;eValue=2.44533e-24;cigar=13M1I8M1I10M1I43M;mutations=14A,23C,34A
seq1 Stellar eps-matches 844430 844503 96.0526 + . seq2;seq2Range=177972,178047;eValue=8.038e-24;cigar=23M1I49M1I2M;mutations=21C,24G,74A
seq1 Stellar eps-matches 200984 201056 95.9459 + . seq2;seq2Range=507812,507884;eValue=8.68498e-23;cigar=18M1I16M1D38M;mutations=19A,29C
seq1 Stellar eps-matches 352002 352074 96 + . seq2;seq2Range=933466,933539;eValue=2.64215e-23;cigar=8M1I38M1D1M1I25M;mutations=9T,49C
seq1 Stellar eps-matches 795087 795159 96.0526 + . seq2;seq2Range=88208,88283;eValue=8.038e-24;cigar=18M1I31M1I16M1I8M;mutations=19T,51C,68G
seq1 Stellar eps-matches 922775 922847 96 + . seq2;seq2Range=963547,963620;eValue=2.64215e-23;cigar=1M1D7M2I64M;mutations=9C,10A
seq1 Stellar eps-matches 924325 924397 96 + . seq2;seq2Range=382316,382389;eValue=2.64215e-23;cigar=2M1I42M1I16M1D12M;mutations=3G,46C
seq1 Stellar eps-matches 306069 306140 95.8904 + . seq2;seq2Range=381419,381490;eValue=2.85482e-22;cigar=8M1D51M1I12M;mutations=46C,60A
seq1 Stellar eps-matches 630904 630975 95.9459 + . seq2;seq2Range=603370,603443;eValue=8.68498e-23;cigar=11M1I59M1I2M;mutations=12T,29T,72A
seq1 Stellar eps-matches 681294 681365 95.8333 + . seq2;seq2Range=888154,888223;eValue=9.38403e-22;cigar=14M1D11M1D45M;mutations=33G
seq1 Stellar eps-matches 753350 753421 96 + . seq2;seq2Range=942692,942766;eValue=2.64215e-23;cigar=2M1I33M1I27M1I10M;mutations=3G,37G,65G
seq1 Stellar eps-matches 790149 790220 95.9459 + . seq2;seq2Range=289463,289536;eValue=8.68498e-23;cigar=12M1I11M1I49M;mutations=3T,13T,25T
seq1 Stellar eps-matches 314922 314992 95.7746 + . seq2;seq2Range=347339,347407;eValue=3.08461e-21;cigar=53M1D6M1D10M;mutations=67C
seq1 Stellar eps-matches 31370 31439 95.7746 + . seq2;seq2Range=667587,667657;eValue=3.08461e-21;cigar=60M1I10M;mutations=9G,27A,61A
seq1 Stellar eps-matches 375034 375103 95.7746 + . seq2;seq2Range=537222,537292;eValue=3.08461e-21;cigar=56M1I14M;mutations=11C,22C,57G
seq1 Stellar eps-matches 425869 425938 95.8333 + . seq2;seq2Range=363589,363659;eValue=9.38403e-22;cigar=5M1D22M1I19M1I23M;mutations=28C,48G
seq1 Stellar eps-matches 456948 457017 95.8333 + . seq2;seq2Range=754960,755030;eValue=9.38403e-22;cigar=26M1D2M1I28M1I13M;mutations=29G,58A
seq1 Stellar eps-matches 34258 34326 95.7142 + . seq2;seq2Range=297945,298012;eValue=1.01394e-20;cigar=8M1D40M1I3M1D16M;mutations=49T
seq1 Stellar eps-matches 492312 492380 95.7746 + . seq2;seq2Range=61757,61827;eValue=3.08461e-21;cigar=36M1I30M1I3M;mutations=37T,56T,68G
seq1 Stellar eps-matches 897257 897325 95.7142 + . seq2;seq2Range=754612,754681;eValue=1.01394e-20;cigar=8M1I61M;mutations=9A,22G,58A
seq1 Stellar eps-matches 246133 246200 95.5882 + . seq2;seq2Range=473389,473454;eValue=1.09555e-19;cigar=21M1D28M1D17M;mutations=31C
seq1 Stellar eps-matches 592208 592275 95.5882 + . seq2;seq2Range=698273,698338;eValue=1.09555e-19;cigar=18M1D1M1D47M;mutations=11C
seq1 Stellar eps-matches 771137 771204 95.7142 + . seq2;seq2Range=644303,644371;eValue=1.01394e-20;cigar=1M1I29M1I35M1D2M;mutations=2C,32G
seq1 Stellar eps-matches 655417 655483 95.6521 + . seq2;seq2Range=870273,870341;eValue=3.33289e-20;cigar=57M2I10M;mutations=58A,59C,61T
seq1 Stellar eps-matches 999554 999620 95.6521 + . seq2;seq2Range=265042,265109;eValue=3.33289e-20;cigar=25M1I15M1D13M1I13M;mutations=26T,55G
seq1 Stellar eps-matches 83977 84041 95.4545 + . seq2;seq2Range=417597,417660;eValue=1.18373e-18;cigar=58M1I3M2D2M;mutations=59T
seq1 Stellar eps-matches 793605 793669 95.5882 + . seq2;seq2Range=577367,577434;eValue=1.09555e-19;cigar=61M1I1M1I1M1I2M;mutations=62C,64G,66G
seq1 Stellar eps-matches 307315 307378 95.3125 + . seq2;seq2Range=214052,214113;eValue=1.27901e-17;cigar=10M1D22M1D30M;mutations=16T
seq1 Stellar eps-matches 393476 393539 95.3846 + . seq2;seq2Range=939966,940029;eValue=3.89101e-18;cigar=24M1D20M1I19M;mutations=45C,56T
seq1 Stellar eps-matches 487063 487126 95.3125 + . seq2;seq2Range=592739,592800;eValue=1.27901e-17;cigar=31M1D27M1D4M;mutations=61A
seq1 Stellar eps-matches 809895 809958 95.3125 + . seq2;seq2Range=795081,795142;eValue=1.27901e-17;cigar=3M1D52M1D7M;mutations=14A
seq1 Stellar eps-matches 338066 338128 95.3846 + . seq2;seq2Range=982730,982793;eValue=3.89101e-18;cigar=1M1D15M1I30M1I16M;mutations=17C,48A
seq1 Stellar eps-matches 418242 418304 95.238 + . seq2;seq2Range=615281,615343;eValue=4.2042e-17;cigar=63M;mutations=7T,61G,62A
seq1 Stellar eps-matches 522378 522440 95.3846 + . seq2;seq2Range=975364,975428;eValue=3.89101e-18;cigar=26M2I37M;mutations=27A,28A,35G
seq1 Stellar eps-matches 604408 604470 95.3125 + . seq2;seq2Range=190186,190248;eValue=1.27901e-17;cigar=22M1I3M1D37M;mutations=18G,23G
seq1 Stellar eps-matches 692226 692288 95.3125 + . seq2;seq2Range=644690,644751;eValue=1.27901e-17;cigar=19M1I6M1D32M1D4M;mutations=20G
seq1 Stellar eps-matches 846349 846411 95.3125 + . seq2;seq2Range=623458,623519;eValue=1.27901e-17;cigar=34M1I7M1D13M1D7M;mutations=35T
seq1 Stellar eps-matches 919266 919328 95.3125 + . seq2;seq2Range=385150,385211;eValue=1.27901e-17;cigar=13M1D16M1D20M1I12M;mutations=50A
seq1 Stellar eps-matches 306977 307038 95.238 + . seq2;seq2Range=510376,510437;eValue=4.2042e-17;cigar=20M1D24M1I17M;mutations=45T,59A
seq1 Stellar eps-matches 415309 415370 95.1612 + . seq2;seq2Range=678973,679032;eValue=1.38195e-16;cigar=2M1D4M1D54M;mutations=41T
seq1 Stellar eps-matches 462748 462809 95.3125 + . seq2;seq2Range=256180,256242;eValue=1.27901e-17;cigar=23M1I12M1I25M1D1M;mutations=24T,37T
seq1 Stellar eps-matches 624612 624673 95.1612 + . seq2;seq2Range=462764,462823;eValue=1.38195e-16;cigar=1M1D12M1D47M;mutations=53C
seq1 Stellar eps-matches 19838 19898 95.0819 + . seq2;seq2Range=359088,359147;eValue=4.5426e-16;cigar=3M1D57M;mutations=28C,54T
seq1 Stellar eps-matches 51519 51579 95.0819 + . seq2;seq2Range=564963,565021;eValue=4.5426e-16;cigar=1M1D29M1D29M;mutations=19G
seq1 Stellar eps-matches 90108 90168 95.238 + . seq2;seq2Range=422207,422269;eValue=4.2042e-17;cigar=16M1I43M1I2M;mutations=6T,17T,61G
seq1 Stellar eps-matches 857295 857355 95.238 + . seq2;seq2Range=306241,306303;eValue=4.2042e-17;cigar=58M2I3M;mutations=39C,59C,60G
seq1 Stellar eps-matches 136259 136318 95 + . seq2;seq2Range=951926,951982;eValue=1.49319e-15;cigar=4M1D4M1D19M1D30M;mutations=
seq1 Stellar eps-matches 282475 282534 95.0819 + . seq2;seq2Range=846152,846210;eValue=4.5426e-16;cigar=37M1I20M2D1M;mutations=38G
seq1 Stellar eps-matches 360911 360970 95.1612 + . seq2;seq2Range=181466,181526;eValue=1.38195e-16;cigar=45M1I4M1D6M1I4M;mutations=46G,57C
seq1 Stellar eps-matches 633878 633937 95.0819 + . seq2;seq2Range=349823,349881;eValue=4.5426e-16;cigar=35M1I20M2D3M;mutations=36T
seq1 Stellar eps-matches 13993 14049 96.4912 + . seq2;seq2Range=154364,154420;eValue=1.49319e-15;cigar=57M;mutations=37C,51G
seq1 Stellar eps-matches 71017 71072 96.4912 + . seq2;seq2Range=526327,526383;eValue=1.49319e-15;cigar=47M1I9M;mutations=46G,48A
seq1 Stellar eps-matches 574387 574442 96.4912 + . seq2;seq2Range=51428,51484;eValue=1.49319e-15;cigar=54M1I2M;mutations=4A,55C
seq1 Stellar eps-matches 18138 18192 96.4285 + . seq2;seq2Range=774839,774894;eValue=4.90823e-15;cigar=13M1I42M;mutations=3A,14G
seq1 Stellar eps-matches 322926 322980 96.4912 + . seq2;seq2Range=554277,554333;eValue=1.49319e-15;cigar=33M1I14M1I8M;mutations=34T,49G
seq1 Stellar eps-matches 350355 350409 96.3636 + . seq2;seq2Range=4812,4864;eValue=1.61338e-14;cigar=32M1D20M1D1M;mutations=
seq1 Stellar eps-matches 370570 370624 96.3636 + . seq2;seq2Range=570498,570550;eValue=1.61338e-14;cigar=12M1D40M1D1M;mutations=
seq1 Stellar eps-matches 524644 524698 96.4285 + . seq2;seq2Range=192061,192115;eValue=4.90823e-15;cigar=4M1D21M1I29M;mutations=26A
seq1 Stellar eps-matches 669509 669563 96.4285 + . seq2;seq2Range=458854,458909;eValue=4.90823e-15;cigar=9M1I46M;mutations=10A,48T
seq1 Stellar eps-matches 210770 210823 96.3636 + . seq2;seq2Range=384829,384883;eValue=1.61338e-14;cigar=42M1I12M;mutations=4C,43A
seq1 Stellar eps-matches 367394 367447 96.2962 + . seq2;seq2Range=228730,228781;eValue=5.3033e-14;cigar=16M1D29M1D7M;mutations=
seq1 Stellar eps-matches 925889 925942 96.3636 + . seq2;seq2Range=621158,621212;eValue=1.61338e-14;cigar=50M1I4M;mutations=3G,51G
seq1 Stellar eps-matches 113996 114048 96.2264 + . seq2;seq2Range=590319,590369;eValue=1.74324e-13;cigar=34M1D15M1D2M;mutations=
seq1 Stellar eps-matches 150509 150561 96.2264 + . seq2;seq2Range=259178,259229;eValue=1.74324e-13;cigar=1M1D51M;mutations=30T
seq1 Stellar eps-matches 117475 117526 96.2264 + . seq2;seq2Range=976152,976203;eValue=1.74324e-13;cigar=44M1D1M1I6M;mutations=46C
seq1 Stellar eps-matches 137657 137708 96.2264 + . seq2;seq2Range=989401,989453;eValue=1.74324e-13;cigar=44M1I8M;mutations=38T,45C
seq1 Stellar eps-matches 690715 690766 96.2264 + . seq2;seq2Range=2411,2462;eValue=1.74324e-13;cigar=1M1I4M1D46M;mutations=2G
seq1 Stellar eps-matches 893400 893451 96.2264 + . seq2;seq2Range=605691,605742;eValue=1.74324e-13;cigar=26M1D1M1I24M;mutations=28A
seq1 Stellar eps-matches 902890 902941 96.2264 + . seq2;seq2Range=590074,590125;eValue=1.74324e-13;cigar=1M1D24M1I26M;mutations=26T
seq1 Stellar eps-matches 562568 562618 96.1538 + . seq2;seq2Range=433916,433967;eValue=5.73016e-13;cigar=10M1I41M;mutations=11T,28A
seq1 Stellar eps-matches 699249 699299 96.1538 + . seq2;seq2Range=529725,529775;eValue=5.73016e-13;cigar=10M1I28M1D12M;mutations=11C
seq1 Stellar eps-matches 267901 267924 95.8333 + . seq2;seq2Range=21369,21392;eValue=4.769;cigar=24M;mutations=11A
seq1 Stellar eps-matches 737546 737568 95.6521 + . seq2;seq2Range=138268,138289;eValue=15.6761;cigar=13M1D9M;mutations=
seq1 Stellar eps-matches 522464 522485 95.4545 + . seq2;seq2Range=639294,639315;eValue=51.5286;cigar=22M;mutations=10T
seq1 Stellar eps-matches 597179 597200 95.4545 + . seq2;seq2Range=770906,770926;eValue=51.5286;cigar=11M1D10M;mutations=
seq1 Stellar eps-matches 682302 682323 95.4545 + . seq2;seq2Range=31838,31859;eValue=51.5286;cigar=22M;mutations=10A
seq1 Stellar eps-matches 43881 43901 95.238 + . seq2;seq2Range=496698,496718;eValue=169.379;cigar=21M;mutations=19G
seq1 Stellar eps-matches 59019 59039 95.4545 + . seq2;seq2Range=974302,974323;eValue=51.5286;cigar=12M1I9M;mutations=13T
seq1 Stellar eps-matches 89548 89568 95.238 + . seq2;seq2Range=136937,136956;eValue=169.379;cigar=1M1D19M;mutations=
seq1 Stellar eps-matches 145004 145024 95.238 + . seq2;seq2Range=158823,158842;eValue=169.379;cigar=17M1D3M;mutations=
seq1 Stellar eps-matches 180492 180512 95.238 + . seq2;seq2Range=648885,648904;eValue=169.379;cigar=8M1D12M;mutations=
seq1 Stellar eps-matches 252143 252163 95.238 + . seq2;seq2Range=220247,220266;eValue=169.379;cigar=10M1D10M;mutations=
seq1 Stellar eps-matches 382617 382637 95.4545 + . seq2;seq2Range=756555,756576;eValue=51.5286;cigar=18M1I3M;mutations=19G
seq1 Stellar eps-matches 432669 432689 95.238 + . seq2;seq2Range=528717,528737;eValue=169.379;cigar=21M;mutations=13A
seq1 Stellar eps-matches 611638 611658 95.4545 + . seq2;seq2Range=161924,161945;eValue=51.5286;cigar=6M1I15M;mutations=7G
seq1 Stellar eps-matches 774761 774781 95.238 + . seq2;seq2Range=384250,384269;eValue=169.379;cigar=9M1D11M;mutations=
seq1 Stellar eps-matches 793084 793104 95.238 + . seq2;seq2Range=703665,703685;eValue=169.379;cigar=21M;mutations=13T
seq1 Stellar eps-matches 814268 814288 95.238 + . seq2;seq2Range=812454,812474;eValue=169.379;cigar=21M;mutations=5G
seq1 Stellar eps-matches 823130 823150 95.238 + . seq2;seq2Range=388876,388896;eValue=169.379;cigar=21M;mutations=15T
seq1 Stellar eps-matches 831259 831279 95.238 + . seq2;seq2Range=902490,902510;eValue=169.379;cigar=21M;mutations=9G
seq1 Stellar eps-matches 872914 872934 95.238 + . seq2;seq2Range=116496,116516;eValue=169.379;cigar=21M;mutations=11A
seq1 Stellar eps-matches 904823 904843 95.238 + . seq2;seq2Range=758430,758449;eValue=169.379;cigar=14M1D6M;mutations=
seq1 Stellar eps-matches 918763 918783 95.238 + . seq2;seq2Range=477968,477988;eValue=169.379;cigar=21M;mutations=6A
seq1 Stellar eps-matches 938740 938760 95.238 + . seq2;seq2Range=33800,33819;eValue=169.379;cigar=17M1D3M;mutations=
seq1 Stellar eps-matches 5112 5131 95 + . seq2;seq2Range=97054,97073;eValue=556.762;cigar=20M;mutations=6T
seq1 Stellar eps-matches 61373 61392 95 + . seq2;seq2Range=308159,308177;eValue=556.762;cigar=9M1D10M;mutations=
seq1 Stellar eps-matches 101254 101273 95 + . seq2;seq2Range=464306,464325;eValue=556.762;cigar=20M;mutations=16T
seq1 Stellar eps-matches 107842 107861 95 + . seq2;seq2Range=370287,370305;eValue=556.762;cigar=13M1D6M;mutations=
seq1 Stellar eps-matches 110412 110431 95.238 + . seq2;seq2Range=888554,888574;eValue=169.379;cigar=4M1I16M;mutations=5A
seq1 Stellar eps-matches 117307 117326 95 + . seq2;seq2Range=922239,922258;eValue=556.762;cigar=20M;mutations=12T
seq1 Stellar eps-matches 121716 121735 95.238 + . seq2;seq2Range=453595,453615;eValue=169.379;cigar=2M1I18M;mutations=3A
seq1 Stellar eps-matches 128742 128761 95 + . seq2;seq2Range=279107,279126;eValue=556.762;cigar=20M;mutations=18G
seq1 Stellar eps-matches 135540 135559 95 + . seq2;seq2Range=544371,544390;eValue=556.762;cigar=20M;mutations=15C
seq1 Stellar eps-matches 137039 137058 95.238 + . seq2;seq2Range=456262,456282;eValue=169.379;cigar=8M1I12M;mutations=9G
seq1 Stellar eps-matches 156159 156178 95 + . seq2;seq2Range=757401,757420;eValue=556.762;cigar=20M;mutations=16T
seq1 Stellar eps-matches 178716 178735 95.238 + . seq2;seq2Range=706838,706858;eValue=169.379;cigar=2M1I18M;mutations=3T
seq1 Stellar eps-matches 187404 187423 95 + . seq2;seq2Range=839902,839921;eValue=556.762;cigar=20M;mutations=8C
seq1 Stellar eps-matches 219222 219241 95 + . seq2;seq2Range=582302,582321;eValue=556.762;cigar=20M;mutations=4A
seq1 Stellar eps-matches 232511 232530 95 + . seq2;seq2Range=561743,561761;eValue=556.762;cigar=15M1D4M;mutations=
seq1 Stellar eps-matches 240541 240560 95 + . seq2;seq2Range=938273,938291;eValue=556.762;cigar=4M1D15M;mutations=
seq1 Stellar eps-matches 260227 260246 95 + . seq2;seq2Range=469781,469800;eValue=556.762;cigar=20M;mutations=17G
seq1 Stellar eps-matches 274379 274398 95 + . seq2;seq2Range=463208,463226;eValue=556.762;cigar=15M1D4M;mutations=
seq1 Stellar eps-matches 283072 283091 95.238 + . seq2;seq2Range=502265,502285;eValue=169.379;cigar=9M1I11M;mutations=10T
seq1 Stellar eps-matches 303005 303024 95 + . seq2;seq2Range=895286,895304;eValue=556.762;cigar=9M1D10M;mutations=
seq1 Stellar eps-matches 306064 306083 95 + . seq2;seq2Range=110443,110462;eValue=556.762;cigar=20M;mutations=9G
seq1 Stellar eps-matches 306935 306954 95 + . seq2;seq2Range=834590,834608;eValue=556.762;cigar=5M1D14M;mutations=
seq1 Stellar eps-matches 341168 341187 95.238 + . seq2;seq2Range=33286,33306;eValue=169.379;cigar=18M1I2M;mutations=19G
seq1 Stellar eps-matches 361339 361358 95 + . seq2;seq2Range=94405,94423;eValue=556.762;cigar=15M1D4M;mutations=
seq1 Stellar eps-matches 364694 364713 95 + . seq2;seq2Range=410818,410837;eValue=556.762;cigar=20M;mutations=4A
seq1 Stellar eps-matches 393624 393643 95.238 + . seq2;seq2Range=126406,126426;eValue=169.379;cigar=4M1I16M;mutations=5A
seq1 Stellar eps-matches 409384 409403 95 + . seq2;seq2Range=600691,600710;eValue=556.762;cigar=20M;mutations=13C
seq1 Stellar eps-matches 422965 422984 95 + . seq2;seq2Range=486912,486931;eValue=556.762;cigar=20M;mutations=8A
seq1 Stellar eps-matches 459039 459058 95.238 + . seq2;seq2Range=497273,497293;eValue=169.379;cigar=14M1I6M;mutations=15C
seq1 Stellar eps-matches 517881 517900 95 + . seq2;seq2Range=401027,401046;eValue=556.762;cigar=20M;mutations=14G
seq1 Stellar eps-matches 521934 521953 95 + . seq2;seq2Range=495894,495912;eValue=556.762;cigar=7M1D12M;mutations=
seq1 Stellar eps-matches 536086 536105 95 + . seq2;seq2Range=575141,575159;eValue=556.762;cigar=18M1D1M;mutations=
seq1 Stellar eps-matches 568035 568054 95 + . seq2;seq2Range=728057,728075;eValue=556.762;cigar=6M1D13M;mutations=
seq1 Stellar eps-matches 576720 576739 95 + . seq2;seq2Range=942798,942816;eValue=556.762;cigar=5M1D14M;mutations=
seq1 Stellar eps-matches 582414 582433 95 + . seq2;seq2Range=141047,141065;eValue=556.762;cigar=15M1D4M;mutations=
seq1 Stellar eps-matches 583225 583244 95 + . seq2;seq2Range=412935,412953;eValue=556.762;cigar=15M1D4M;mutations=
seq1 Stellar eps-matches 615420 615439 95 + . seq2;seq2Range=964041,964060;eValue=556.762;cigar=20M;mutations=12G
seq1 Stellar eps-matches 620445 620464 95 + . seq2;seq2Range=974693,974712;eValue=556.762;cigar=20M;mutations=4C
seq1 Stellar eps-matches 631779 631798 95 + . seq2;seq2Range=327009,327028;eValue=556.762;cigar=20M;mutations=5C
seq1 Stellar eps-matches 638139 638158 95 + . seq2;seq2Range=577375,577394;eValue=556.762;cigar=20M;mutations=16C
seq1 Stellar eps-matches 648875 648894 95 + . seq2;seq2Range=122145,122163;eValue=556.762;cigar=6M1D13M;mutations=
seq1 Stellar eps-matches 651258 651277 95 + . seq2;seq2Range=57120,57139;eValue=556.762;cigar=20M;mutations=13C
seq1 Stellar eps-matches 696678 696697 95 + . seq2;seq2Range=743770,743789;eValue=556.762;cigar=20M;mutations=9A
seq1 Stellar eps-matches 719880 719899 95 + . seq2;seq2Range=315691,315709;eValue=556.762;cigar=11M1D8M;mutations=
seq1 Stellar eps-matches 720484 720503 95 + . seq2;seq2Range=101877,101896;eValue=556.762;cigar=20M;mutations=6G
seq1 Stellar eps-matches 740797 740816 95 + . seq2;seq2Range=145672,145691;eValue=556.762;cigar=20M;mutations=9C
seq1 Stellar eps-matches 748566 748585 95 + . seq2;seq2Range=318037,318056;eValue=556.762;cigar=20M;mutations=14C
seq1 Stellar eps-matches 762792 762811 95 + . seq2;seq2Range=927131,927149;eValue=556.762;cigar=8M1D11M;mutations=
seq1 Stellar eps-matches 795292 795311 95 + . seq2;seq2Range=139658,139677;eValue=556.762;cigar=20M;mutations=4C
seq1 Stellar eps-matches 887607 887626 95 + . seq2;seq2Range=509249,509267;eValue=556.762;cigar=14M1D5M;mutations=
seq1 Stellar eps-matches 904977 904996 95 + . seq2;seq2Range=767626,767644;eValue=556.762;cigar=10M1D9M;mutations=
seq1 Stellar eps-matches 960394 960413 95 + . seq2;seq2Range=174803,174821;eValue=556.762;cigar=5M1D14M;mutations=
seq1 Stellar eps-matches 964004 964023 95 + . seq2;seq2Range=227096,227115;eValue=556.762;cigar=20M;mutations=6T
seq1 Stellar eps-matches 975227 975246 95 + . seq2;seq2Range=965453,965472;eValue=556.762;cigar=20M;mutations=15A
seq1 Stellar eps-matches 984085 984104 95 + . seq2;seq2Range=639600,639619;eValue=556.762;cigar=20M;mutations=5C
seq1 Stellar eps-matches 26770 26788 95 + . seq2;seq2Range=851896,851915;eValue=556.762;cigar=5M1I14M;mutations=6C
seq1 Stellar eps-matches 93677 93695 95 + . seq2;seq2Range=839755,839774;eValue=556.762;cigar=12M1I7M;mutations=13G
seq1 Stellar eps-matches 112709 112727 95 + . seq2;seq2Range=877254,877273;eValue=556.762;cigar=3M1I16M;mutations=4A
seq1 Stellar eps-matches 112852 112870 95 + . seq2;seq2Range=503739,503758;eValue=556.762;cigar=8M1I11M;mutations=9C
seq1 Stellar eps-matches 115635 115653 95 + . seq2;seq2Range=645465,645484;eValue=556.762;cigar=13M1I6M;mutations=14G
seq1 Stellar eps-matches 149772 149790 95 + . seq2;seq2Range=412976,412995;eValue=556.762;cigar=7M1I12M;mutations=8A
seq1 Stellar eps-matches 241157 241175 95 + . seq2;seq2Range=482890,482909;eValue=556.762;cigar=13M1I6M;mutations=14A
seq1 Stellar eps-matches 244214 244232 95 + . seq2;seq2Range=785830,785849;eValue=556.762;cigar=16M1I3M;mutations=17A
seq1 Stellar eps-matches 265794 265812 95 + . seq2;seq2Range=1363,1382;eValue=556.762;cigar=13M1I6M;mutations=14G
seq1 Stellar eps-matches 267960 267978 95 + . seq2;seq2Range=119623,119642;eValue=556.762;cigar=13M1I6M;mutations=14A
seq1 Stellar eps-matches 279990 280008 95 + . seq2;seq2Range=944687,944706;eValue=556.762;cigar=12M1I7M;mutations=13C
seq1 Stellar eps-matches 330182 330200 95 + . seq2;seq2Range=75116,75135;eValue=556.762;cigar=4M1I15M;mutations=5A
seq1 Stellar eps-matches 358255 358273 95 + . seq2;seq2Range=178254,178273;eValue=556.762;cigar=4M1I15M;mutations=5A
seq1 Stellar eps-matches 370227 370245 95 + . seq2;seq2Range=865460,865479;eValue=556.762;cigar=15M1I4M;mutations=16T
seq1 Stellar eps-matches 418022 418040 95 + . seq2;seq2Range=311397,311416;eValue=556.762;cigar=15M1I4M;mutations=16G
seq1 Stellar eps-matches 479978 479996 95 + . seq2;seq2Range=449903,449922;eValue=556.762;cigar=3M1I16M;mutations=4C
seq1 Stellar eps-matches 510646 510664 95 + . seq2;seq2Range=283714,283733;eValue=556.762;cigar=10M1I9M;mutations=11G
seq1 Stellar eps-matches 543411 543429 95 + . seq2;seq2Range=838078,838097;eValue=556.762;cigar=10M1I9M;mutations=11T
seq1 Stellar eps-matches 550428 550446 95 + . seq2;seq2Range=573171,573190;eValue=556.762;cigar=8M1I11M;mutations=9C
seq1 Stellar eps-matches 559669 559687 95 + . seq2;seq2Range=964231,964250;eValue=556.762;cigar=16M1I3M;mutations=17C
seq1 Stellar eps-matches 612338 612356 95 + . seq2;seq2Range=572000,572019;eValue=556.762;cigar=14M1I5M;mutations=15T
seq1 Stellar eps-matches 642016 642034 95 + . seq2;seq2Range=868108,868127;eValue=556.762;cigar=12M1I7M;mutations=13A
seq1 Stellar eps-matches 739905 739923 95 + . seq2;seq2Range=623901,623920;eValue=556.762;cigar=17M1I2M;mutations=18G
seq1 Stellar eps-matches 841474 841492 95 + . seq2;seq2Range=619616,619635;eValue=556.762;cigar=9M1I10M;mutations=10A
seq1 Stellar eps-matches 912127 912145 95 + . seq2;seq2Range=281234,281253;eValue=556.762;cigar=3M1I16M;mutations=4A
seq1 Stellar eps-matches 997497 997515 95 + . seq2;seq2Range=570509,570528;eValue=556.762;cigar=15M1I4M;mutations=16G
| {
"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
* of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject)
* from "Proxy" to "Call", "Block", "With" etc.
*/
extern JS_PUBLIC_API(const char *)
JS_GetDebugClassName(JSObject *obj);
/************************************************************************/
extern JS_PUBLIC_API(const char *)
JS_GetScriptFilename(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(const jschar *)
JS_GetScriptSourceMap(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(unsigned)
JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(unsigned)
JS_GetScriptLineExtent(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(JSVersion)
JS_GetScriptVersion(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(bool)
JS_GetScriptUserBit(JSScript *script);
extern JS_PUBLIC_API(void)
JS_SetScriptUserBit(JSScript *script, bool b);
extern JS_PUBLIC_API(bool)
JS_GetScriptIsSelfHosted(JSScript *script);
/************************************************************************/
/*
* Hook setters for script creation and destruction, see jsprvtd.h for the
* typedefs. These macros provide binary compatibility and newer, shorter
* synonyms.
*/
#define JS_SetNewScriptHook JS_SetNewScriptHookProc
#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc
extern JS_PUBLIC_API(void)
JS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);
extern JS_PUBLIC_API(void)
JS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,
void *callerdata);
/************************************************************************/
typedef struct JSPropertyDesc {
jsval id; /* primary id, atomized string, or int */
jsval value; /* property value */
uint8_t flags; /* flags, see below */
uint8_t spare; /* unused */
jsval alias; /* alias id if JSPD_ALIAS flag */
} JSPropertyDesc;
#define JSPD_ENUMERATE 0x01 /* visible to for/in loop */
#define JSPD_READONLY 0x02 /* assignment is error */
#define JSPD_PERMANENT 0x04 /* property cannot be deleted */
#define JSPD_ALIAS 0x08 /* property has an alias id */
#define JSPD_EXCEPTION 0x40 /* exception occurred fetching the property, */
/* value is exception */
#define JSPD_ERROR 0x80 /* native getter returned JS_FALSE without */
/* throwing an exception */
typedef struct JSPropertyDescArray {
uint32_t length; /* number of elements in array */
JSPropertyDesc *array; /* alloc'd by Get, freed by Put */
} JSPropertyDescArray;
typedef struct JSScopeProperty JSScopeProperty;
extern JS_PUBLIC_API(JSBool)
JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);
extern JS_PUBLIC_API(void)
JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);
/************************************************************************/
/*
* JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a
* StackFrame or baseline JIT frame.
*/
class JS_PUBLIC_API(JSAbstractFramePtr)
{
uintptr_t ptr_;
protected:
JSAbstractFramePtr()
: ptr_(0)
{ }
public:
explicit JSAbstractFramePtr(void *raw);
uintptr_t raw() const { return ptr_; }
operator bool() const { return !!ptr_; }
JSObject *scopeChain(JSContext *cx);
JSObject *callObject(JSContext *cx);
JSFunction *maybeFun();
JSScript *script();
bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv);
bool isDebuggerFrame();
bool evaluateInStackFrame(JSContext *cx,
const char *bytes, unsigned length,
const char *filename, unsigned lineno,
JS::MutableHandleValue rval);
bool evaluateUCInStackFrame(JSContext *cx,
const jschar *chars, unsigned length,
const char *filename, unsigned lineno,
JS::MutableHandleValue rval);
};
class JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr
{
public:
JSNullFramePtr()
: JSAbstractFramePtr()
{}
};
/*
* This class does not work when IonMonkey is active. It's only used by jsd,
* which can only be used when IonMonkey is disabled.
*
* To find the calling script and line number, use JS_DescribeSciptedCaller.
* To summarize the call stack, use JS::DescribeStack.
*/
class JS_PUBLIC_API(JSBrokenFrameIterator)
{
void *data_;
public:
JSBrokenFrameIterator(JSContext *cx);
~JSBrokenFrameIterator();
bool done() const;
JSBrokenFrameIterator& operator++();
JSAbstractFramePtr abstractFramePtr() const;
jsbytecode *pc() const;
bool isConstructing() const;
};
/*
* This hook captures high level script execution and function calls (JS or
* native). It is used by JS_SetExecuteHook to hook top level scripts and by
* JS_SetCallHook to hook function calls. It will get called twice per script
* or function call: just before execution begins and just after it finishes.
* In both cases the 'current' frame is that of the executing code.
*
* The 'before' param is JS_TRUE for the hook invocation before the execution
* and JS_FALSE for the invocation after the code has run.
*
* The 'ok' param is significant only on the post execution invocation to
* signify whether or not the code completed 'normally'.
*
* The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook
* for the 'before'invocation, but is whatever value is returned from that
* invocation for the 'after' invocation. Thus, the hook implementor *could*
* allocate a structure in the 'before' invocation and return a pointer to that
* structure. The pointer would then be handed to the hook for the 'after'
* invocation. Alternately, the 'before' could just return the same value as
* in 'closure' to cause the 'after' invocation to be called with the same
* 'closure' value as the 'before'.
*
* Returning NULL in the 'before' hook will cause the 'after' hook *not* to
* be called.
*/
typedef void *
(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,
JSBool before, JSBool *ok, void *closure);
typedef JSBool
(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,
void *closure);
typedef struct JSDebugHooks {
JSInterruptHook interruptHook;
void *interruptHookData;
JSNewScriptHook newScriptHook;
void *newScriptHookData;
JSDestroyScriptHook destroyScriptHook;
void *destroyScriptHookData;
JSDebuggerHandler debuggerHandler;
void *debuggerHandlerData;
JSSourceHandler sourceHandler;
void *sourceHandlerData;
JSInterpreterHook executeHook;
void *executeHookData;
JSInterpreterHook callHook;
void *callHookData;
JSThrowHook throwHook;
void *throwHookData;
JSDebugErrorHook debugErrorHook;
void *debugErrorHookData;
} JSDebugHooks;
/************************************************************************/
extern JS_PUBLIC_API(JSBool)
JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);
extern JS_PUBLIC_API(JSBool)
JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);
extern JS_PUBLIC_API(JSBool)
JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
extern JS_PUBLIC_API(JSBool)
JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
extern JS_PUBLIC_API(JSBool)
JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);
extern JS_PUBLIC_API(JSBool)
JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);
/************************************************************************/
extern JS_PUBLIC_API(size_t)
JS_GetObjectTotalSize(JSContext *cx, JSObject *obj);
extern JS_PUBLIC_API(size_t)
JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun);
extern JS_PUBLIC_API(size_t)
JS_GetScriptTotalSize(JSContext *cx, JSScript *script);
/************************************************************************/
extern JS_FRIEND_API(void)
js_RevertVersion(JSContext *cx);
extern JS_PUBLIC_API(const JSDebugHooks *)
JS_GetGlobalDebugHooks(JSRuntime *rt);
/**
* Add various profiling-related functions as properties of the given object.
*/
extern JS_PUBLIC_API(JSBool)
JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);
/* Defined in vm/Debugger.cpp. */
extern JS_PUBLIC_API(JSBool)
JS_DefineDebuggerObject(JSContext *cx, JSObject *obj);
extern JS_PUBLIC_API(void)
JS_DumpBytecode(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(void)
JS_DumpCompartmentBytecode(JSContext *cx);
extern JS_PUBLIC_API(void)
JS_DumpPCCounts(JSContext *cx, JSScript *script);
extern JS_PUBLIC_API(void)
JS_DumpCompartmentPCCounts(JSContext *cx);
extern JS_PUBLIC_API(JSObject *)
JS_UnwrapObject(JSObject *obj);
extern JS_PUBLIC_API(JSObject *)
JS_UnwrapObjectAndInnerize(JSObject *obj);
/* Call the context debug handler on the topmost scripted frame. */
extern JS_FRIEND_API(JSBool)
js_CallContextDebugHandler(JSContext *cx);
#endif /* jsdbgapi_h___ */
| {
"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` shell and call the
:method:`sh.disableBalancing()` method.
For example:
.. code-block:: javascript
sh.disableBalancing("students.grades")
The :method:`sh.disableBalancing()` method accepts as its parameter the
full :term:`namespace` of the collection.
Enable Balancing on a Collection
--------------------------------
You can enable balancing for a specific collection with the
:method:`sh.enableBalancing()` method.
When you enable balancing for a collection, MongoDB will not *immediately*
begin balancing data. However, if the data in your sharded collection is
not balanced, MongoDB will be able to begin distributing the data more
evenly.
To enable balancing on a collection, connect to a :binary:`~bin.mongos`
with the :binary:`~bin.mongo` shell and call the
:method:`sh.enableBalancing()` method.
For example:
.. code-block:: javascript
sh.enableBalancing("students.grades")
The :method:`sh.enableBalancing()` method accepts as its parameter the
full :term:`namespace` of the collection.
Confirm Balancing is Enabled or Disabled
----------------------------------------
To confirm whether balancing for a collection is enabled or disabled,
query the ``collections`` collection in the ``config`` database for the
collection :term:`namespace` and check the ``noBalance`` field. For
example:
.. code-block:: javascript
db.getSiblingDB("config").collections.findOne({_id : "students.grades"}).noBalance;
This operation will return a null error, ``true``, ``false``, or no output:
- A null error indicates the collection namespace is incorrect.
- If the result is ``true``, balancing is disabled.
- If the result is ``false``, balancing is enabled currently but has been
disabled in the past for the collection. Balancing of this collection
will begin the next time the balancer runs.
- If the operation returns no output, balancing is enabled currently and
has never been disabled in the past for this collection. Balancing of
this collection will begin the next time the balancer runs.
You can also see if the balancer is enabled using :method:`sh.status()`.
The :data:`~sh.status.balancer.currently-enabled` field indicates if the
balancer is enabled.
.. index:: balancing; secondary throttle
.. index:: secondary throttle
Change Replication Behavior for Chunk Migration
-----------------------------------------------
.. _sharded-cluster-config-secondary-throttle:
Secondary Throttle
~~~~~~~~~~~~~~~~~~
During chunk migration, the ``_secondaryThrottle`` value determines
when the migration proceeds with next document in the chunk.
In the :data:`config.settings` collection:
- If the ``_secondaryThrottle`` setting for the balancer is set to a
write concern, each document move during chunk migration must receive
the requested acknowledgement before proceeding with the next
document.
- If the ``_secondaryThrottle`` setting for the balancer is set to
``true``, each document move during chunk migration must receive
acknowledgement from at least one secondary before the migration
proceeds with the next document in the chunk. This is equivalent to a
write concern of :writeconcern:`{ w: 2 } <\<number\>>`.
- If the ``_secondaryThrottle`` setting is unset, the migration process
does not wait for replication to a secondary and instead continues
with the next document.
Default behavior for :ref:`WiredTiger <storage-wiredtiger>` starting
in MongoDB 3.4.
To change the ``_secondaryThrottle`` setting, connect to a
:binary:`~bin.mongos` instance and directly update the
``_secondaryThrottle`` value in the :data:`~config.settings` collection
of the :ref:`config database <config-database>`. For example, from a
:binary:`~bin.mongo` shell connected to a :binary:`~bin.mongos`, issue
the following command:
.. code-block:: javascript
use config
db.settings.update(
{ "_id" : "balancer" },
{ $set : { "_secondaryThrottle" : { "w": "majority" } } },
{ upsert : true }
)
The effects of changing the ``_secondaryThrottle`` setting may not be
immediate. To ensure an immediate effect, stop and restart the balancer
to enable the selected value of ``_secondaryThrottle``.
For more information on the replication behavior during various steps
of chunk migration, see :ref:`chunk-migration-replication`.
For the :dbcommand:`moveChunk` command, you can use the command's
``_secondaryThrottle`` and ``writeConcern`` options to specify the
behavior during the command. For details, see :dbcommand:`moveChunk`
command.
.. _wait-for-delete-setting:
Wait for Delete
~~~~~~~~~~~~~~~
The ``_waitForDelete`` setting of the balancer and the
:dbcommand:`moveChunk` command affects how the balancer migrates
multiple chunks from a shard. By default, the balancer does not wait
for the on-going migration's delete phase to complete before starting
the next chunk migration. To have the delete phase **block** the start
of the next chunk migration, you can set the ``_waitForDelete`` to
true.
For details on chunk migration, see :ref:`sharding-chunk-migration`.
For details on the chunk migration queuing behavior, see
:ref:`chunk-migration-queuing`.
The ``_waitForDelete`` is generally for internal testing purposes. To
change the balancer's ``_waitForDelete`` value:
#. Connect to a :binary:`~bin.mongos` instance.
#. Update the ``_waitForDelete`` value in the :data:`~config.settings`
collection of the :ref:`config database <config-database>`. For
example:
.. code-block:: javascript
use config
db.settings.update(
{ "_id" : "balancer" },
{ $set : { "_waitForDelete" : true } },
{ upsert : true }
)
Once set to ``true``, to revert to the default behavior:
#. Connect to a :binary:`~bin.mongos` instance.
#. Update or unset the ``_waitForDelete`` field in the
:data:`~config.settings` collection of the :ref:`config database
<config-database>`:
.. code-block:: javascript
use config
db.settings.update(
{ "_id" : "balancer", "_waitForDelete": true },
{ $unset : { "_waitForDelete" : "" } }
)
.. _balance-chunks-that-exceed-size-limit:
Balance Chunks that Exceed Size Limit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default, MongoDB cannot move a chunk if the number of documents in
the chunk is greater than 1.3 times the result of dividing the
configured :ref:`chunk size<sharding-chunk-size>` by the average
document size.
Starting in MongoDB 4.4, by specifying the balancer setting
``attemptToBalanceJumboChunks`` to ``true``, the balancer can migrate
these large chunks as long as they have not been labeled as
:ref:`jumbo <jumbo-chunk>`.
To set the balancer's ``attemptToBalanceJumboChunks`` setting, connect
to a :binary:`~bin.mongos` instance and directly update the
:data:`config.settings` collection. For example, from a
:binary:`~bin.mongo` shell connected to a :binary:`~bin.mongos`
instance, issue the following command:
.. code-block:: javascript
db.getSiblingDB("config").settings.updateOne(
{ _id: "balancer" },
{ $set: { attemptToBalanceJumboChunks : true } },
{ upsert: true }
)
When the balancer attempts to move the chunk, if the queue of writes
that modify any documents being migrated surpasses 500MB of memory the
migration will fail. For details on the migration procedure, see
:ref:`chunk-migration-procedure`.
If the chunk you want to move is labeled ``jumbo``, you can
:ref:`manually clear the jumbo flag <clear-jumbo-flag-manually>` to
have the balancer attempt to migrate the chunk.
Alternatively, you can use the :dbcommand:`moveChunk` command with
:ref:`forceJumbo: true <movechunk-forceJumbo>` to manually migrate
chunks that exceed the size limit (with or without the ``jumbo``
label). However, when you run :dbcommand:`moveChunk` with
:ref:`forceJumbo: true <movechunk-forceJumbo>`, write operations to the
collection may block for a long period of time during the migration.
.. _sharded-cluster-config-max-shard-size:
Change the Maximum Storage Size for a Given Shard
-------------------------------------------------
By default shards have no constraints in storage size. However, you can set a
maximum storage size for a given shard in the sharded cluster. When
selecting potential destination shards, the balancer ignores shards
where a migration would exceed the configured maximum storage size.
The :data:`~config.shards` collection in the :ref:`config
database<config-database>` stores configuration data related to shards.
.. code-block:: javascript
{ "_id" : "shard0000", "host" : "shard1.example.com:27100" }
{ "_id" : "shard0001", "host" : "shard2.example.com:27200" }
To limit the storage size for a given shard, use the
:method:`db.collection.updateOne()` method with the :update:`$set` operator to
create the ``maxSize`` field and assign it an ``integer`` value. The
``maxSize`` field represents the maximum storage size for the shard in
``megabytes``.
The following operation sets a maximum size on a shard of ``1024 megabytes``:
.. code-block:: javascript
config = db.getSiblingDB("config")
config.shards.updateOne( { "_id" : "<shard>"}, { $set : { "maxSize" : 1024 } } )
This value includes the mapped size of *all* data files on the
shard, including the ``local`` and ``admin`` databases.
By default, ``maxSize`` is not specified, allowing shards to consume the
total amount of available space on their machines if necessary.
You can also set ``maxSize`` when adding a shard.
To set ``maxSize`` when adding a shard, set the :dbcommand:`addShard`
command's ``maxSize`` parameter to the maximum size in ``megabytes``. The
following command run in the :binary:`~bin.mongo` shell adds a shard with a
maximum size of 125 megabytes:
.. code-block:: javascript
config = db.getSiblingDB("config")
config.runCommand( { addshard : "example.net:34008", maxSize : 125 } )
| {
"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, 4, 120, 108, 101, 15680, 5484 },
{ 1, 77, 24, 1, 118, 1, 320, 101, 88, 15855, 7598 },
{ 1, 7, 24, 0, 122, 4, 89, 110, 103, 16195, 13448 },
{ 1, 59, 24, 0, 124, 7, 295, 99, 86, 16333, 4663 },
{ 1, 7, 78, 0, 152, 8, 34, 103, 87, 18184, 10290 },
{ 1, 37, 24, 0, 156, 2, 144, 105, 91, 18541, 6624 },
{ 1, 50, 39, 1, 159, 7, 234, 80, 69, 18991, 21271 },
{ 1, 54, 24, 1, 163, 2, 99, 107, 97, 19168, 4287 },
{ 1, 10, 24, 1, 170, 4, 304, 102, 99, 19918, 3383 },
{ 1, 50, 24, 0, 174, 19, 92, 108, 91, 20750, 15667 },
{ 1, 37, 24, 1, 175, 1, 133, 90, 86, 20714, 11272 },
{ 1, 10, 24, 0, 182, 9, 9, 104, 103, 21513, 1232 },
{ 1, 10, 24, 0, 185, 4, 18, 98, 96, 21721, 410 },
{ 1, 22, 24, 0, 186, 10, 73, 104, 102, 21996, 9563 },
{ 1, 37, 24, 0, 187, 4, 337, 110, 94, 22034, 12026 },
{ 1, 22, 24, 0, 195, 98, 139, 108, 102, 24301, 3066 },
{ 1, 82, 20, 0, 208, 4, 302, 79, 78, 26947, 19684 },
{ 1, 46, 24, 0, 215, 15, 176, 100, 98, 28047, 6459 },
{ 1, 82, 24, 0, 229, 7, 256, 104, 101, 29493, 14967 },
{ 1, 82, 24, 0, 234, 5, 175, 106, 99, 31441, 15032 },
{ 1, 82, 24, 1, 235, 9, 43, 101, 82, 31509, 22239 },
{ 1, 85, 24, 0, 256, 11, 101, 101, 98, 35337, 348 },
{ 1, 11, 24, 0, 261, 26, 339, 101, 99, 36046, 11682 },
{ 1, 24, 24, 0, 266, 20, 358, 109, 105, 36793, 5719 },
{ 1, 11, 24, 1, 269, 3, 225, 106, 98, 36994, 12709 },
{ 1, 8, 24, 0, 288, 10, 159, 101, 94, 40659, 5718 },
{ 1, 8, 24, 1, 298, 13, 187, 109, 97, 42600, 14491 },
{ 1, 8, 24, 1, 298, 1204, 328, 103, 94, 42600, 14491 },
{ 1, 73, 24, 1, 303, 16, 175, 106, 102, 43732, 4832 },
{ 1, 33, 6, 1, 312, 44, 143, 107, 53, 44783, 22396 },
{ 1, 33, 6, 1, 312, 5658, 240, 106, 53, 44783, 22396 },
{ 1, 39, 24, 0, 313, 9, 129, 108, 105, 45172, 14604 },
{ 1, 58, 45, 0, 315, 7, 310, 98, 83, 46031, 443 },
{ 1, 39, 24, 1, 338, 8, 164, 99, 97, 48787, 5580 },
{ 1, 39, 24, 1, 341, 1331, 238, 101, 97, 49417, 7808 },
{ 1, 58, 96, 1, 342, 16, 156, 100, 62, 49487, 3482 },
{ 1, 33, 24, 1, 351, 8, 29, 108, 104, 50304, 17753 },
{ 1, 33, 20, 1, 353, 5, 266, 84, 70, 50097, 25972 },
{ 1, 39, 24, 1, 358, 16, 148, 96, 94, 50785, 6180 },
{ 1, 39, 24, 1, 358, 1987, 235, 110, 92, 50785, 6180 },
{ 1, 39, 24, 0, 359, 8, 6, 91, 88, 50768, 8594 },
{ 1, 33, 24, 0, 363, 5, 340, 106, 100, 50854, 28284 },
{ 1, 51, 24, 1, 365, 4, 288, 108, 97, 51698, 16103 },
{ 1, 3, 24, 1, 368, 11, 219, 110, 100, 52612, 5884 },
{ 1, 33, 24, 0, 369, 7, 8, 104, 103, 52206, 26241 },
{ 1, 51, 24, 1, 371, 9, 159, 101, 95, 52609, 9996 },
{ 1, 3, 21, 1, 380, 4, 76, 91, 79, 53820, 4306 },
{ 1, 87, 24, 0, 382, 3, 323, 101, 98, 53789, 9969 },
{ 1, 30, 24, 1, 383, 8, 15, 108, 95, 53837, 14826 },
{ 1, 30, 24, 1, 384, 10, 197, 107, 101, 53875, 13952 },
{ 1, 30, 24, 0, 387, 5, 106, 104, 96, 54100, 12856 },
{ 1, 87, 24, 1, 388, 38, 137, 109, 108, 54264, 9416 },
{ 1, 30, 24, 1, 392, 1, 184, 109, 91, 54519, 15386 },
{ 1, 87, 40, 0, 395, 7, 128, 87, 83, 54705, 9079 },
{ 1, 30, 24, 1, 403, 10, 171, 101, 98, 55267, 15329 },
{ 1, 30, 24, 1, 410, 9, 3, 93, 92, 56414, 14774 },
{ 1, 30, 10, 1, 413, 10, 6, 88, 72, 56771, 13285 },
{ 1, 87, 24, 1, 417, 9, 28, 109, 107, 57029, 10611 },
{ 1, 30, 24, 0, 418, 10, 283, 108, 107, 57109, 11908 },
{ 1, 30, 24, 0, 432, 14, 115, 106, 103, 57996, 14981 },
{ 1, 34, 24, 0, 435, 7, 239, 107, 108, 58318, 1051 },
{ 1, 30, 24, 1, 437, 25, 19, 99, 97, 58292, 11815 },
{ 1, 30, 24, 1, 447, 289, 44, 110, 102, 59141, 15192 },
{ 1, 18, 24, 0, 457, 14, 246, 107, 85, 59871, 23782 },
{ 1, 18, 24, 1, 458, 10, 348, 109, 97, 59913, 21770 },
{ 1, 18, 39, 1, 461, 1840, 72, 103, 92, 60252, 21777 },
{ 1, 18, 39, 1, 461, 2371, 37, 95, 92, 60252, 21777 },
{ 1, 18, 39, 1, 461, 1364, 346, 95, 103, 60270, 21783 },
{ 1, 18, 39, 1, 461, 1931, 34, 106, 95, 60266, 21796 },
{ 1, 45, 24, 1, 476, 5, 301, 96, 99, 62035, 17173 },
{ 1, 61, 76, 0, 483, 5, 14, 98, 86, 62769, 4270 },
{ 1, 18, 24, 0, 487, 3, 14, 108, 95, 62862, 29411 },
{ 1, 18, 15, 1, 489, 11, 4, 93, 71, 63165, 27447 },
{ 1, 16, 24, 0, 495, 4, 122, 103, 100, 63904, 20947 },
{ 1, 0, 24, 1, 500, 4, 14, 99, 86, 64514, 16176 },
{ 1, 16, 24, 1, 507, 7, 323, 103, 93, 65019, 23620 },
{ 1, 16, 24, 1, 507, 500, 349, 109, 93, 65019, 23620 },
{ 1, 16, 30, 1, 508, 15, 194, 104, 82, 65028, 22651 },
{ 1, 0, 24, 1, 510, 7, 120, 109, 104, 65151, 15321 },
{ 1, 0, 20, 1, 515, 6, 115, 81, 71, 3163, 17200 },
{ 1, 59, 24, 1, 517, 7, 240, 95, 93, 14269, 716 },
{ 1, 34, 24, 0, 527, 4, 115, 106, 96, 57709, 1876 },
{ 1, 34, 3, 1, 535, 3, 206, 80, 77, 58003, 3643 },
{ 1, 61, 24, 1, 536, 0, 165, 98, 95, 62741, 3407 },
{ 1, 7, 61, 1, 545, 42, 305, 97, 51, 16371, 13548 },
{ 1, 77, 63, 1, 559, 1766, 357, 106, 85, 11166, 8013 },
{ 1, 50, 24, 1, 565, 2261, 308, 109, 92, 22618, 21550 },
{ 1, 75, 39, 1, 592, 2170, 335, 94, 84, 54800, 6215 },
};
| {
"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_GameObject: {fileID: 1000012934959352}
m_Mesh: {fileID: 4300006, guid: 2e710f2b5a4f9674183207e79056e879, type: 3}
--- !u!33 &33000013398391394
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013687127692}
m_Mesh: {fileID: 4300006, guid: 2e710f2b5a4f9674183207e79056e879, type: 3}
--- !u!64 &64000010941696098
MeshCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012934959352}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 4300006, guid: 2e710f2b5a4f9674183207e79056e879, type: 3}
--- !u!64 &64000013517629686
MeshCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000013687127692}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 4300006, guid: 2e710f2b5a4f9674183207e79056e879, type: 3}
| {
"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\": \"UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"date_created\": \"2015-07-30T20:00:00Z\",\"sid\": \"UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"field_type\": \"field_type\"}", TwilioRestClient.HTTP_STATUS_CODE_CREATED);
twilioRestClient.getObjectMapper();
result = new ObjectMapper();
}};
Field.creator("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "field_type", "unique_name").create();
}
@Test
public void testDeleteRequest() {
new NonStrictExpectations() {{
Request request = new Request(HttpMethod.DELETE,
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.deleter("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete();
fail("Expected TwilioException to be thrown for 500");
} catch (TwilioException e) {}
}
@Test
public void testDeleteResponse() {
new NonStrictExpectations() {{
twilioRestClient.request((Request) any);
result = new Response("null", TwilioRestClient.HTTP_STATUS_CODE_NO_CONTENT);
twilioRestClient.getObjectMapper();
result = new ObjectMapper();
}};
Field.deleter("UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "UEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete();
}
} | {
"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 Devices)
0x09, 0xE9, // USAGE (Volume Increment) // Volume Up 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 Devices)
0x09, 0xEA, // USAGE (Volume Decrement) // Volume Down 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, 0xCA, // USAGE (System Display Rotation Lock Slider Switch) // Rotation Lock Button
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x03, // REPORT_COUNT (3) // unused bits in 8-bit Input Report
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0xCB, // USAGE (Control Enable)
0x95, 0x01, // REPORT_COUNT (1)
0xB1, 0x02, // FEATURE (Data,Var,Abs)
0x95, 0x03, // REPORT_COUNT (3) // unused bits in 8-bit Feature Report
0xB1, 0x03, // FEATURE (Cnst,Var,Abs)
0xC0, // END_COLLECTION
0xC0, // END_COLLECTION
//***************************************************************
//
// hotkeys (consumer)
//
// report consists of:
// 1 byte report ID
// 1 word Consumer Key
//
//***************************************************************
0x05, 0x0C, // USAGE_PAGE (Consumer Devices)
0x09, 0x01, // HID_USAGE (Consumer Control)
0xA1, 0x01, // COLLECTION (Application)
0x85, REPORTID_HOTKEYS, // REPORT_ID (REPORTID_HOTKEYS)
0x75, 0x10, // REPORT_SIZE(16),
0x95, 0x01, // REPORT_COUNT (1)
0x15, 0x00, // LOGICAL_MIN (0)
0x26, 0xff, 0x03, // HID_LOGICAL_MAX (1023)
0x19, 0x00, // HID_USAGE_MIN (0)
0x2A, 0xff, 0x03, // HID_USAGE_MAX (1023)
0x81, 0x00, // HID_INPUT (Data,Arr,Abs)
0xC0 // END_COLLECTION
};
// HID Device Descriptor with just one report representing the Portable Device Buttons.
//
static
const
HID_DESCRIPTOR
g_HidPortableDeviceButtons_HidDescriptor =
{
0x09, // Length of HID descriptor
0x21, // Descriptor type == HID 0x21
0x0100, // HID spec release
0x00, // Country code == English
0x01, // Number of HID class descriptors
{
0x22, // Descriptor type
// Total length of report descriptor.
//
(USHORT) sizeof(g_HidPortableDeviceButtons_HidReportDescriptor)
}
};
_Function_class_(EVT_VHF_ASYNC_OPERATION)
VOID
HidPortableDeviceButtons_GetFeature(
_In_ VOID* VhfClientContext,
_In_ VHFOPERATIONHANDLE VhfOperationHandle,
_In_ VOID* VhfOperationContext,
_In_ PHID_XFER_PACKET HidTransferPacket
)
/*++
Routine Description:
Handle's GET_FEATURE for buttons which allows Client to inquire about
the enable/disable status of buttons.
This function receives the request from upper layer and returns the enable/disable
status of each button which has been stored in the Module Context. Upper layer
uses this data to send back enable/disable requests for each of the buttons
as a bit mask.
Arguments:
VhfClientContext - This Module's handle.
VhfOperationHandle - Vhf context for this transaction.
VhfOperationContext - Client context for this transaction.
HidTransferPacket - Contains SET_FEATURE report data.
Return Value:
None
--*/
{
DMFMODULE dmfModule;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
NTSTATUS ntStatus;
FuncEntry(DMF_TRACE);
UNREFERENCED_PARAMETER(VhfOperationContext);
ntStatus = STATUS_INVALID_DEVICE_REQUEST;
dmfModule = DMFMODULEVOID_TO_MODULE(VhfClientContext);
moduleContext = DMF_CONTEXT_GET(dmfModule);
if (HidTransferPacket->reportBufferLen < REPORT_SIZE)
{
DMF_BRANCHTRACK_MODULE_NEVER(dmfModule, "HidPortableDeviceButtons_GetFeature.BadReportBufferSize");
goto Exit;
}
if (HidTransferPacket->reportId != REPORTID_BUTTONS)
{
DMF_BRANCHTRACK_MODULE_NEVER(dmfModule, "HidPortableDeviceButtons_GetFeature.BadReportId");
goto Exit;
}
ntStatus = STATUS_SUCCESS;
BUTTONS_INPUT_REPORT* featureReport = (BUTTONS_INPUT_REPORT*)HidTransferPacket->reportBuffer;
DMF_ModuleLock(dmfModule);
DmfAssert(sizeof(moduleContext->InputReportEnabledState) <= HidTransferPacket->reportBufferLen);
DmfAssert(HidTransferPacket->reportBufferLen >= REPORT_SIZE);
*featureReport = moduleContext->InputReportEnabledState;
DMF_ModuleUnlock(dmfModule);
DMF_BRANCHTRACK_MODULE_AT_LEAST(dmfModule, "HidPortableDeviceButtons_GetFeature{Enter connected standby without audio playing}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
Exit:
DMF_VirtualHidDeviceVhf_AsynchronousOperationComplete(moduleContext->DmfModuleVirtualHidDeviceVhf,
VhfOperationHandle,
ntStatus);
FuncExitVoid(DMF_TRACE);
}
_Function_class_(EVT_VHF_ASYNC_OPERATION)
VOID
HidPortableDeviceButtons_SetFeature(
_In_ VOID* VhfClientContext,
_In_ VHFOPERATIONHANDLE VhfOperationHandle,
_In_ VOID* VhfOperationContext,
_In_ PHID_XFER_PACKET HidTransferPacket
)
/*++
Routine Description:
Handle's set feature for buttons which allows Client to enable/disable buttons.
This function receives the request from client and stores the enable/disable
status of each button in the Module Context. Later, if that button is pressed
and the Module Context indicates that the button is disabled, that button
press is never sent to the upper layer.
Arguments:
VhfClientContext - This Module's handle.
VhfOperationHandle - Vhf context for this transaction.
VhfOperationContext - Client context for this transaction.
HidTransferPacket - Contains SET_FEATURE report data.
Return Value:
None
--*/
{
DMFMODULE dmfModule;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
NTSTATUS ntStatus;
FuncEntry(DMF_TRACE);
UNREFERENCED_PARAMETER(VhfOperationContext);
ntStatus = STATUS_INVALID_DEVICE_REQUEST;
dmfModule = DMFMODULEVOID_TO_MODULE(VhfClientContext);
moduleContext = DMF_CONTEXT_GET(dmfModule);
if (HidTransferPacket->reportBufferLen < REPORT_SIZE)
{
DMF_BRANCHTRACK_MODULE_NEVER(dmfModule, "HidPortableDeviceButtons_SetFeature.BadReportBufferSize");
goto Exit;
}
if (HidTransferPacket->reportId != REPORTID_BUTTONS)
{
DMF_BRANCHTRACK_MODULE_NEVER(dmfModule, "HidPortableDeviceButtons_SetFeature.BadReportId");
goto Exit;
}
BUTTONS_INPUT_REPORT* featureReport = (BUTTONS_INPUT_REPORT*)HidTransferPacket->reportBuffer;
DMF_ModuleLock(dmfModule);
if (! featureReport->u.Buttons.Power)
{
// Fail this request...Power button should never be disabled.
//
DmfAssert(FALSE);
DMF_BRANCHTRACK_MODULE_NEVER(dmfModule, "HidPortableDeviceButtons_SetFeature.DisablePowerButton");
}
else
{
moduleContext->InputReportEnabledState = *featureReport;
ntStatus = STATUS_SUCCESS;
DMF_BRANCHTRACK_MODULE_AT_LEAST(dmfModule, "HidPortableDeviceButtons_SetFeature{Enter connected standby without audio playing}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
}
DMF_ModuleUnlock(dmfModule);
Exit:
DMF_VirtualHidDeviceVhf_AsynchronousOperationComplete(moduleContext->DmfModuleVirtualHidDeviceVhf,
VhfOperationHandle,
ntStatus);
FuncExitVoid(DMF_TRACE);
}
_Function_class_(EVT_VHF_ASYNC_OPERATION)
VOID
HidPortableDeviceButtons_GetInputReport(
_In_ VOID* VhfClientContext,
_In_ VHFOPERATIONHANDLE VhfOperationHandle,
_In_ VOID* VhfOperationContext,
_In_ PHID_XFER_PACKET HidTransferPacket
)
/*++
Routine Description:
Handle's GET_INPUT_REPORT for buttons which allows Client to inquire about
the current pressed/unpressed status of buttons.
This function receives the request from upper layer and returns the pressed/unpressed
status of each button which has been stored in the Module Context.
Arguments:
VhfClientContext - This Module's handle.
VhfOperationHandle - Vhf context for this transaction.
VhfOperationContext - Client context for this transaction.
HidTransferPacket - Contains GET_INPUT_REPORT report data.
Return Value:
None
--*/
{
DMFMODULE dmfModule;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
NTSTATUS ntStatus;
FuncEntry(DMF_TRACE);
UNREFERENCED_PARAMETER(VhfOperationContext);
ntStatus = STATUS_INVALID_DEVICE_REQUEST;
dmfModule = DMFMODULEVOID_TO_MODULE(VhfClientContext);
moduleContext = DMF_CONTEXT_GET(dmfModule);
if (HidTransferPacket->reportBufferLen < REPORT_SIZE)
{
DMF_BRANCHTRACK_MODULE_NEVER(dmfModule, "HidPortableDeviceButtons_GetInputReport.BadReportBufferSize");
goto Exit;
}
if (HidTransferPacket->reportId != REPORTID_BUTTONS)
{
DMF_BRANCHTRACK_MODULE_NEVER(dmfModule, "HidPortableDeviceButtons_GetInputReport.BadReportId");
goto Exit;
}
ntStatus = STATUS_SUCCESS;
BUTTONS_INPUT_REPORT* inputReport = (BUTTONS_INPUT_REPORT*)HidTransferPacket->reportBuffer;
DMF_ModuleLock(dmfModule);
DmfAssert(sizeof(moduleContext->InputReportEnabledState) <= HidTransferPacket->reportBufferLen);
DmfAssert(HidTransferPacket->reportBufferLen >= REPORT_SIZE);
*inputReport = moduleContext->InputReportButtonState;
DMF_ModuleUnlock(dmfModule);
Exit:
DMF_VirtualHidDeviceVhf_AsynchronousOperationComplete(moduleContext->DmfModuleVirtualHidDeviceVhf,
VhfOperationHandle,
ntStatus);
FuncExitVoid(DMF_TRACE);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
// WDF Module Callbacks
///////////////////////////////////////////////////////////////////////////////////////////////////////
//
_Function_class_(DMF_ModuleD0Entry)
_IRQL_requires_max_(PASSIVE_LEVEL)
_Must_inspect_result_
static
NTSTATUS
DMF_HidPortableDeviceButtons_ModuleD0Entry(
_In_ DMFMODULE DmfModule,
_In_ WDF_POWER_DEVICE_STATE PreviousState
)
/*++
Routine Description:
On the way up clear the state of the buttons in case they were held during hibernate.
Arguments:
DmfModule - The given DMF Module.
PreviousState - The WDF Power State that the given DMF Module should exit from.
Return Value:
NTSTATUS of either the given DMF Module's Open Callback or STATUS_SUCCESS.
--*/
{
NTSTATUS ntStatus;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
UNREFERENCED_PARAMETER(PreviousState);
FuncEntry(DMF_TRACE);
moduleContext = DMF_CONTEXT_GET(DmfModule);
// Clear the state of buttons in case they are held down during power transitions.
//
DMF_HidPortableDeviceButtons_ButtonStateChange(DmfModule,
HidPortableDeviceButtons_ButtonId_Power,
FALSE);
DMF_HidPortableDeviceButtons_ButtonStateChange(DmfModule,
HidPortableDeviceButtons_ButtonId_VolumePlus,
FALSE);
DMF_HidPortableDeviceButtons_ButtonStateChange(DmfModule,
HidPortableDeviceButtons_ButtonId_VolumeMinus,
FALSE);
ntStatus = STATUS_SUCCESS;
FuncExit(DMF_TRACE, "ntStatus=%!STATUS!", ntStatus);
return ntStatus;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
// DMF Module Callbacks
///////////////////////////////////////////////////////////////////////////////////////////////////////
//
#pragma code_seg("PAGE")
_Function_class_(DMF_Open)
_IRQL_requires_max_(PASSIVE_LEVEL)
_Must_inspect_result_
static
NTSTATUS
DMF_HidPortableDeviceButtons_Open(
_In_ DMFMODULE DmfModule
)
/*++
Routine Description:
Initialize an instance of a DMF Module of type HidPortableDeviceButtons.
Arguments:
DmfModule - The given DMF Module.
Return Value:
NTSTATUS
--*/
{
NTSTATUS ntStatus;
DMF_CONFIG_HidPortableDeviceButtons* moduleConfig;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
PAGED_CODE();
FuncEntry(DMF_TRACE);
moduleContext = DMF_CONTEXT_GET(DmfModule);
moduleConfig = DMF_CONFIG_GET(DmfModule);
ntStatus = STATUS_SUCCESS;
// Set these static values now because they don't change.
//
moduleContext->VhfHidReport.reportBuffer = (UCHAR*)&moduleContext->InputReportButtonState;
moduleContext->VhfHidReport.reportBufferLen = REPORT_SIZE;
// Only one type of report is used. Set it now.
//
moduleContext->InputReportButtonState.ReportId = REPORTID_BUTTONS;
moduleContext->InputReportButtonState.u.Data = 0;
moduleContext->VhfHidReport.reportId = moduleContext->InputReportButtonState.ReportId;
// Enable buttons by default.
// NOTE: Unused buttons are left disabled.
//
moduleContext->InputReportEnabledState.u.Data = 0;
moduleContext->InputReportEnabledState.u.Buttons.Power = 1;
moduleContext->InputReportEnabledState.u.Buttons.VolumeDown = 1;
moduleContext->InputReportEnabledState.u.Buttons.VolumeUp = 1;
FuncExit(DMF_TRACE, "ntStatus=%!STATUS!", ntStatus);
return ntStatus;
}
#pragma code_seg()
#pragma code_seg("PAGE")
_Function_class_(DMF_Close)
_IRQL_requires_max_(PASSIVE_LEVEL)
static
VOID
DMF_HidPortableDeviceButtons_Close(
_In_ DMFMODULE DmfModule
)
/*++
Routine Description:
Uninitialize an instance of a DMF Module of type HidPortableDeviceButtons.
Arguments:
DmfModule - The given DMF Module.
Return Value:
NTSTATUS
--*/
{
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
DMF_CONFIG_HidPortableDeviceButtons* moduleConfig;
PAGED_CODE();
FuncEntry(DMF_TRACE);
moduleContext = DMF_CONTEXT_GET(DmfModule);
moduleConfig = DMF_CONFIG_GET(DmfModule);
FuncExitVoid(DMF_TRACE);
}
#pragma code_seg()
#pragma code_seg("PAGE")
_Function_class_(DMF_ChildModulesAdd)
_IRQL_requires_max_(PASSIVE_LEVEL)
VOID
DMF_HidPortableDeviceButtons_ChildModulesAdd(
_In_ DMFMODULE DmfModule,
_In_ DMF_MODULE_ATTRIBUTES* DmfParentModuleAttributes,
_In_ PDMFMODULE_INIT DmfModuleInit
)
/*++
Routine Description:
Configure and add the required Child Modules to the given Parent Module.
Arguments:
DmfModule - The given Parent Module.
DmfParentModuleAttributes - Pointer to the parent DMF_MODULE_ATTRIBUTES structure.
DmfModuleInit - Opaque structure to be passed to DMF_DmfModuleAdd.
Return Value:
None
--*/
{
DMF_MODULE_ATTRIBUTES moduleAttributes;
DMF_CONFIG_HidPortableDeviceButtons* moduleConfig;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
DMF_CONFIG_VirtualHidDeviceVhf virtualHidDeviceMsModuleConfig;
UNREFERENCED_PARAMETER(DmfParentModuleAttributes);
PAGED_CODE();
FuncEntry(DMF_TRACE);
moduleConfig = DMF_CONFIG_GET(DmfModule);
moduleContext = DMF_CONTEXT_GET(DmfModule);
// VirtualHidDeviceVhf
// -------------------
//
DMF_CONFIG_VirtualHidDeviceVhf_AND_ATTRIBUTES_INIT(&virtualHidDeviceMsModuleConfig,
&moduleAttributes);
virtualHidDeviceMsModuleConfig.VendorId = moduleConfig->VendorId;
virtualHidDeviceMsModuleConfig.ProductId = moduleConfig->ProductId;
virtualHidDeviceMsModuleConfig.VersionNumber = 0x0001;
virtualHidDeviceMsModuleConfig.HidDescriptor = &g_HidPortableDeviceButtons_HidDescriptor;
virtualHidDeviceMsModuleConfig.HidDescriptorLength = sizeof(g_HidPortableDeviceButtons_HidDescriptor);
virtualHidDeviceMsModuleConfig.HidReportDescriptor = g_HidPortableDeviceButtons_HidReportDescriptor;
virtualHidDeviceMsModuleConfig.HidReportDescriptorLength = sizeof(g_HidPortableDeviceButtons_HidReportDescriptor);
// Set virtual device attributes.
//
virtualHidDeviceMsModuleConfig.HidDeviceAttributes.VendorID = moduleConfig->VendorId;
virtualHidDeviceMsModuleConfig.HidDeviceAttributes.ProductID = moduleConfig->ProductId;
virtualHidDeviceMsModuleConfig.HidDeviceAttributes.VersionNumber = moduleConfig->VersionNumber;
virtualHidDeviceMsModuleConfig.HidDeviceAttributes.Size = sizeof(virtualHidDeviceMsModuleConfig.HidDeviceAttributes);
virtualHidDeviceMsModuleConfig.StartOnOpen = TRUE;
virtualHidDeviceMsModuleConfig.VhfClientContext = DmfModule;
// Set callbacks from upper layer.
//
virtualHidDeviceMsModuleConfig.IoctlCallback_IOCTL_HID_GET_FEATURE = HidPortableDeviceButtons_GetFeature;
virtualHidDeviceMsModuleConfig.IoctlCallback_IOCTL_HID_SET_FEATURE = HidPortableDeviceButtons_SetFeature;
virtualHidDeviceMsModuleConfig.IoctlCallback_IOCTL_HID_GET_INPUT_REPORT = HidPortableDeviceButtons_GetInputReport;
DMF_DmfModuleAdd(DmfModuleInit,
&moduleAttributes,
WDF_NO_OBJECT_ATTRIBUTES,
&moduleContext->DmfModuleVirtualHidDeviceVhf);
FuncExitVoid(DMF_TRACE);
}
#pragma code_seg()
VOID
DMF_HidPortableDeviceButtons_BranchTrackInitialize(
_In_ DMFMODULE DmfModule
)
/*++
Routine Description:
Create the BranchTrack table. These entries are necessary to allow the consumer of this data
to know what code paths did not execute that *should* have executed.
Arguments:
DmfModule - This Module's handle.
Return Value:
None
--*/
{
// It not used in RELEASE build.
//
UNREFERENCED_PARAMETER(DmfModule);
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HidPortableDeviceButtons_GetFeature.BadReportBufferSize");
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HidPortableDeviceButtons_GetFeature.BadReportId");
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "HidPortableDeviceButtons_GetFeature{Enter connected standby without audio playing}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HidPortableDeviceButtons_SetFeature.BadReportBufferSize");
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HidPortableDeviceButtons_SetFeature.BadReportId");
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HidPortableDeviceButtons_SetFeature.DisablePowerButton");
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "HidPortableDeviceButtons_SetFeature{Enter connected standby without audio playing}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HidPortableDeviceButtons_GetInputReport.BadReportBufferSize");
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HidPortableDeviceButtons_GetInputReport.BadReportId");
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_Power.True{Press or release power}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_Power.False");
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumePlus.True{Play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumePlus.False{Don't play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumeMinus.False{Play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumeMinus.False{Don't play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "ButtonIsEnabled.BadButton");
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.Down{Power press}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.Up{Power release}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumePlus.Down{Vol+ press}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.ScreenCapture{Press Power and Vol+}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumePlus.Up{Vol+ release}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumeMinus.Down{Vol- press}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.SAS{Press Power and Vol-}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumeMinus.Up{Vol- release}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power");
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessUp.Down{Backlight+ press}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessUp.Up{Backlight+ release}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessDown.Down{BacklightDown- press}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_AT_LEAST_CREATE(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessDown.Up{BacklightDown- release}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
DMF_BRANCHTRACK_MODULE_NEVER_CREATE(DmfModule, "HotkeyStateChange.DMF_HidPortableDeviceButtons_HotkeyStateChange");
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Public Calls by Client
///////////////////////////////////////////////////////////////////////////////////////////////////////
//
#pragma code_seg("PAGE")
_IRQL_requires_max_(PASSIVE_LEVEL)
_Must_inspect_result_
NTSTATUS
DMF_HidPortableDeviceButtons_Create(
_In_ WDFDEVICE Device,
_In_ DMF_MODULE_ATTRIBUTES* DmfModuleAttributes,
_In_ WDF_OBJECT_ATTRIBUTES* ObjectAttributes,
_Out_ DMFMODULE* DmfModule
)
/*++
Routine Description:
Create an instance of a DMF Module of type HidPortableDeviceButtons.
Arguments:
Device - Client driver's WDFDEVICE object.
DmfModuleAttributes - Opaque structure that contains parameters DMF needs to initialize the Module.
ObjectAttributes - WDF object attributes for DMFMODULE.
DmfModule - Address of the location where the created DMFMODULE handle is returned.
Return Value:
NTSTATUS
--*/
{
NTSTATUS ntStatus;
DMF_MODULE_DESCRIPTOR dmfModuleDescriptor_HidPortableDeviceButtons;
DMF_CALLBACKS_DMF dmfCallbacksDmf_HidPortableDeviceButtons;
DMF_CALLBACKS_WDF dmfCallbacksWdf_HidPortableDeviceButtons;
PAGED_CODE();
FuncEntry(DMF_TRACE);
DMF_CALLBACKS_DMF_INIT(&dmfCallbacksDmf_HidPortableDeviceButtons);
dmfCallbacksDmf_HidPortableDeviceButtons.DeviceOpen = DMF_HidPortableDeviceButtons_Open;
dmfCallbacksDmf_HidPortableDeviceButtons.DeviceClose = DMF_HidPortableDeviceButtons_Close;
dmfCallbacksDmf_HidPortableDeviceButtons.ChildModulesAdd = DMF_HidPortableDeviceButtons_ChildModulesAdd;
DMF_CALLBACKS_WDF_INIT(&dmfCallbacksWdf_HidPortableDeviceButtons);
dmfCallbacksWdf_HidPortableDeviceButtons.ModuleD0Entry = DMF_HidPortableDeviceButtons_ModuleD0Entry;
DMF_MODULE_DESCRIPTOR_INIT_CONTEXT_TYPE(dmfModuleDescriptor_HidPortableDeviceButtons,
HidPortableDeviceButtons,
DMF_CONTEXT_HidPortableDeviceButtons,
DMF_MODULE_OPTIONS_PASSIVE,
DMF_MODULE_OPEN_OPTION_OPEN_PrepareHardware);
dmfModuleDescriptor_HidPortableDeviceButtons.CallbacksDmf = &dmfCallbacksDmf_HidPortableDeviceButtons;
dmfModuleDescriptor_HidPortableDeviceButtons.CallbacksWdf = &dmfCallbacksWdf_HidPortableDeviceButtons;
ntStatus = DMF_ModuleCreate(Device,
DmfModuleAttributes,
ObjectAttributes,
&dmfModuleDescriptor_HidPortableDeviceButtons,
DmfModule);
if (! NT_SUCCESS(ntStatus))
{
TraceEvents(TRACE_LEVEL_ERROR, DMF_TRACE, "DMF_ModuleCreate fails: ntStatus=%!STATUS!", ntStatus);
}
FuncExit(DMF_TRACE, "ntStatus=%!STATUS!", ntStatus);
return(ntStatus);
}
#pragma code_seg()
// Module Methods
//
_IRQL_requires_max_(PASSIVE_LEVEL)
BOOLEAN
DMF_HidPortableDeviceButtons_ButtonIsEnabled(
_In_ DMFMODULE DmfModule,
_In_ HidPortableDeviceButtons_ButtonIdType ButtonId
)
/*++
Routine Description:
Determines if a given button is enabled or disabled.
Arguments:
DmfModule - This Module's handle.
ButtonId - The given button.
Return Value:
TRUE if given button is enabled.
FALSE if given button is disabled.
--*/
{
BOOLEAN returnValue;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
FuncEntry(DMF_TRACE);
DMFMODULE_VALIDATE_IN_METHOD(DmfModule,
HidPortableDeviceButtons);
moduleContext = DMF_CONTEXT_GET(DmfModule);
returnValue = FALSE;
DMF_ModuleLock(DmfModule);
// If statements are used below for clarity and ease of debugging. Also, it prevents
// need to cast and allows for possible different states later.
//
switch (ButtonId)
{
case HidPortableDeviceButtons_ButtonId_Power:
{
if (moduleContext->InputReportEnabledState.u.Buttons.Power)
{
returnValue = TRUE;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_Power.True{Press or release power}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
}
else
{
DMF_BRANCHTRACK_MODULE_NEVER(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_Power.False");
}
break;
}
case HidPortableDeviceButtons_ButtonId_VolumePlus:
{
if (moduleContext->InputReportEnabledState.u.Buttons.VolumeUp)
{
returnValue = TRUE;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumePlus.True{Play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
else
{
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumePlus.False{Don't play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
break;
}
case HidPortableDeviceButtons_ButtonId_VolumeMinus:
{
if (moduleContext->InputReportEnabledState.u.Buttons.VolumeDown)
{
returnValue = TRUE;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumeMinus.False{Play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
else
{
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonIsEnabled.HidPortableDeviceButtons_ButtonId_VolumeMinus.False{Don't play audio during connected standby}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
break;
}
default:
{
DmfAssert(FALSE);
DMF_BRANCHTRACK_MODULE_NEVER(DmfModule, "ButtonIsEnabled.BadButton");
break;
}
}
DMF_ModuleUnlock(DmfModule);
FuncExit(DMF_TRACE, "returnValue=%d", returnValue);
return returnValue;
}
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
DMF_HidPortableDeviceButtons_ButtonStateChange(
_In_ DMFMODULE DmfModule,
_In_ HidPortableDeviceButtons_ButtonIdType ButtonId,
_In_ ULONG ButtonStateDown
)
/*++
Routine Description:
Updates the state of a given button.
Arguments:
DmfModule - This Module's handle.
ButtonId - The given button.
ButtonStateDown - Indicates if the button is pressed DOWN.
Return Value:
STATUS_SUCCESS means the updated state was successfully sent to HID stack.
Other NTSTATUS if there is an error.
--*/
{
NTSTATUS ntStatus;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
FuncEntry(DMF_TRACE);
DMFMODULE_VALIDATE_IN_METHOD(DmfModule,
HidPortableDeviceButtons);
moduleContext = DMF_CONTEXT_GET(DmfModule);
// Lock the Module context because the Client Driver may call from different threads
// (e.g. button press thread is different than rotation lock thread).
//
DMF_ModuleLock(DmfModule);
DmfAssert(moduleContext->InputReportButtonState.ReportId == REPORTID_BUTTONS);
DmfAssert(moduleContext->VhfHidReport.reportId == moduleContext->InputReportButtonState.ReportId);
// If statements are used below for clarity and ease of debugging. Also, it prevents
// need to cast and allows for possible different states later.
//
switch (ButtonId)
{
case HidPortableDeviceButtons_ButtonId_Power:
{
if (ButtonStateDown)
{
moduleContext->InputReportButtonState.u.Buttons.Power = 1;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.Down{Power press}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
}
else
{
moduleContext->InputReportButtonState.u.Buttons.Power = 0;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.Up{Power release}[HidPortableDeviceButtons]", HidPortableDeviceButtons_ButtonPresses);
}
break;
}
case HidPortableDeviceButtons_ButtonId_VolumePlus:
{
if (ButtonStateDown)
{
moduleContext->InputReportButtonState.u.Buttons.VolumeUp = 1;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumePlus.Down{Vol+ press}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
if (moduleContext->InputReportButtonState.u.Buttons.Power)
{
// Verify Screen Capture runs.
//
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.ScreenCapture{Press Power and Vol+}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
}
else
{
moduleContext->InputReportButtonState.u.Buttons.VolumeUp = 0;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumePlus.Up{Vol+ release}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
break;
}
case HidPortableDeviceButtons_ButtonId_VolumeMinus:
{
if (ButtonStateDown)
{
moduleContext->InputReportButtonState.u.Buttons.VolumeDown = 1;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumeMinus.Down{Vol- press}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
if (moduleContext->InputReportButtonState.u.Buttons.Power)
{
// Verify SAS runs.
//
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power.SAS{Press Power and Vol-}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
}
else
{
moduleContext->InputReportButtonState.u.Buttons.VolumeDown = 0;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_VolumeMinus.Up{Vol- release}[HidPortableDeviceButtons,Volume]", HidPortableDeviceButtons_ButtonPresses);
}
break;
}
default:
{
DmfAssert(FALSE);
ntStatus = STATUS_NOT_SUPPORTED;
DMF_BRANCHTRACK_MODULE_NEVER(DmfModule, "ButtonStateChange.HidPortableDeviceButtons_ButtonId_Power");
DMF_ModuleUnlock(DmfModule);
goto Exit;
}
}
// Don't send requests with lock held. Copy the data to send to local variable,
// unlock and send.
//
BUTTONS_INPUT_REPORT inputReportButtonState;
HID_XFER_PACKET hidXferPacket;
inputReportButtonState = moduleContext->InputReportButtonState;
hidXferPacket.reportBuffer = (UCHAR*)&inputReportButtonState;
hidXferPacket.reportBufferLen = moduleContext->VhfHidReport.reportBufferLen;
hidXferPacket.reportId = moduleContext->VhfHidReport.reportId;
TraceEvents(TRACE_LEVEL_ERROR, DMF_TRACE, "Buttons state=0x%02x", moduleContext->InputReportButtonState.u.Data);
DMF_ModuleUnlock(DmfModule);
// This function actually populates the upper layer's input report with expected button data.
//
ntStatus = DMF_VirtualHidDeviceVhf_ReadReportSend(moduleContext->DmfModuleVirtualHidDeviceVhf,
&hidXferPacket);
Exit:
FuncExit(DMF_TRACE, "ntStatus=%!STATUS!", ntStatus);
return ntStatus;
}
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
DMF_HidPortableDeviceButtons_HotkeyStateChange(
_In_ DMFMODULE DmfModule,
_In_ HidPortableDeviceButtons_ButtonIdType Hotkey,
_In_ ULONG HotkeyStateDown
)
/*++
Routine Description:
Updates the state of a given hotkey.
Arguments:
DmfModule - This Module's handle.
ButtonId - The given hotkey.
ButtonStateDown - Indicates if the hotkey is pressed DOWN.
Return Value:
STATUS_SUCCESS means the updated state was successfully sent to HID stack.
Other NTSTATUS if there is an error.
--*/
{
NTSTATUS ntStatus;
DMF_CONTEXT_HidPortableDeviceButtons* moduleContext;
BUTTONS_HOTKEY_INPUT_REPORT hotkeyInputReport;
HID_XFER_PACKET hidXferPacket;
FuncEntry(DMF_TRACE);
DMFMODULE_VALIDATE_IN_METHOD(DmfModule,
HidPortableDeviceButtons);
moduleContext = DMF_CONTEXT_GET(DmfModule);
hotkeyInputReport.ReportId = REPORTID_HOTKEYS;
hotkeyInputReport.HotKey = 0;
// If statements are used below for clarity and ease of debugging. Also, it prevents
// need to cast and allows for possible different states later.
//
switch (Hotkey)
{
case HidPortableDeviceButtons_Hotkey_BrightnessUp:
if (HotkeyStateDown)
{
hotkeyInputReport.HotKey = DISPLAY_BACKLIGHT_BRIGHTNESS_INCREMENT;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessUp.Down{Backlight+ press}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
}
else
{
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessUp.Up{Backlight+ release}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
}
break;
case HidPortableDeviceButtons_Hotkey_BrightnessDown:
if (HotkeyStateDown)
{
hotkeyInputReport.HotKey = DISPLAY_BACKLIGHT_BRIGHTNESS_DECREMENT;
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessDown.Down{BacklightDown- press}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
}
else
{
DMF_BRANCHTRACK_MODULE_AT_LEAST(DmfModule, "HotkeyStateChange.HidPortableDeviceButtons_Hotkey_BrightnessDown.Up{BacklightDown- release}[SshKeypad]", HidPortableDeviceButtons_ButtonPresses);
}
break;
default:
DmfAssert(FALSE);
ntStatus = STATUS_NOT_SUPPORTED;
DMF_BRANCHTRACK_MODULE_NEVER(DmfModule, "HotkeyStateChange.DMF_HidPortableDeviceButtons_HotkeyStateChange");
DMF_ModuleUnlock(DmfModule);
goto Exit;
}
hidXferPacket.reportBuffer = (UCHAR*)&hotkeyInputReport;
hidXferPacket.reportBufferLen = sizeof(BUTTONS_HOTKEY_INPUT_REPORT);
hidXferPacket.reportId = REPORTID_HOTKEYS;
TraceEvents(TRACE_LEVEL_ERROR, DMF_TRACE, "Hotkey input report hotkey=0x%02x", hotkeyInputReport.HotKey);
// This function actually populates the upper layer's input report with expected button data.
//
ntStatus = DMF_VirtualHidDeviceVhf_ReadReportSend(moduleContext->DmfModuleVirtualHidDeviceVhf,
&hidXferPacket);
Exit:
FuncExit(DMF_TRACE, "ntStatus=%!STATUS!", ntStatus);
return ntStatus;
}
// eof: Dmf_HidPortableDeviceButtons.c
//
| {
"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;
}
public String getProcessDefinitionKey() {
return processDefinitionKey;
}
public void setProcessDefinitionKey(String processDefinitionKey) {
this.processDefinitionKey = processDefinitionKey;
}
public String getProcessDefinitionName() {
return processDefinitionName;
}
public void setProcessDefinitionName(String processDefinitionName) {
this.processDefinitionName = processDefinitionName;
}
public Integer getProcessDefinitionVersion() {
return processDefinitionVersion;
}
public void setProcessDefinitionVersion(Integer processDefinitionVersion) {
this.processDefinitionVersion = processDefinitionVersion;
}
public String getDeploymentId() {
return deploymentId;
}
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
public String getActivityId() {
return activityId;
}
public void setActivityId(String activityId) {
this.activityId = activityId;
}
public String getActivityName() {
return activityName;
}
public void setActivityName(String activityName) {
this.activityName = activityName;
}
public String getProcessInstanceId() {
return processInstanceId;
}
public void setProcessInstanceId(String processInstanceId) {
this.processInstanceId = processInstanceId;
}
public String getBusinessKey() {
return businessKey;
}
public void setBusinessKey(String businessKey) {
this.businessKey = businessKey;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getSuperExecutionId() {
return superExecutionId;
}
public void setSuperExecutionId(String superExecutionId) {
this.superExecutionId = superExecutionId;
}
public String getRootProcessInstanceId() {
return rootProcessInstanceId;
}
public void setRootProcessInstanceId(String rootProcessInstanceId) {
this.rootProcessInstanceId = rootProcessInstanceId;
}
public boolean isForcedUpdate() {
return forcedUpdate;
}
public void setForcedUpdate(boolean forcedUpdate) {
this.forcedUpdate = forcedUpdate;
}
public String getCallbackId() {
return callbackId;
}
public void setCallbackId(String callbackId) {
this.callbackId = callbackId;
}
public String getCallbackType() {
return callbackType;
}
public void setCallbackType(String callbackType) {
this.callbackType = callbackType;
}
}
| {
"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: '',
// protocol: 'myapp://path',
// Window only
// win32metadata: { ... }
},
builder: {
// https://www.electron.build/configuration/configuration
// appId: 'quasar-app'
}
}
};
};
| {
"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 (packetSize == 0) continue; // sanity check
delete[] fSavedPacket/*if any*/; fSavedPacket = new u_int8_t[packetSize];
getBytes(fSavedPacket, packetSize);
fPacketSizeTable->totSizes -= packetSize;
// The start of the packet tells us whether its a header that we know about:
Boolean headerIsKnown = False;
unsigned index = 0;
if (isVorbis) {
u_int8_t const firstByte = fSavedPacket[0];
headerIsKnown = firstByte == 1 || firstByte == 3 || firstByte == 5;
index = (firstByte-1)/2; // 1, 3, or 5 => 0, 1, or 2
} else if (isTheora) {
u_int8_t const firstByte = fSavedPacket[0];
headerIsKnown = firstByte == 0x80 || firstByte == 0x81 || firstByte == 0x82;
index = firstByte &~0x80; // 0x80, 0x81, or 0x82 => 0, 1, or 2
} else { // Opus
if (strncmp((char const*)fSavedPacket, "OpusHead", 8) == 0) {
headerIsKnown = True;
index = 0; // "identification" header
} else if (strncmp((char const*)fSavedPacket, "OpusTags", 8) == 0) {
headerIsKnown = True;
index = 1; // "comment" header
}
}
if (headerIsKnown) {
#ifdef DEBUG
char const* headerName[3] = { "identification", "comment", "setup" };
fprintf(stderr, "Saved %d-byte %s \"%s\" header\n", packetSize, track->mimeType,
headerName[index]);
#endif
// This is a header, but first check it for validity:
if (!validateHeader(track, fSavedPacket, packetSize)) continue;
// Save this header (deleting any old header of the same type that we'd saved before)
delete[] track->vtoHdrs.header[index];
track->vtoHdrs.header[index] = fSavedPacket;
fSavedPacket = NULL;
track->vtoHdrs.headerSize[index] = packetSize;
if (!track->weNeedHeaders()) {
// We now have all of the needed Vorbis, Theora, or Opus headers for this track:
--fNumUnfulfilledTracks;
}
// Note: The above code won't work if a required header is fragmented over
// more than one 'page'. We assume that that won't ever happen...
}
}
}
}
// Skip over any remaining packet data bytes:
if (fPacketSizeTable->totSizes > 0) {
#ifdef DEBUG
fprintf(stderr, "Skipping %d remaining packet data bytes\n", fPacketSizeTable->totSizes);
#endif
skipBytes(fPacketSizeTable->totSizes);
}
return header_type_flag;
}
// A simple bit vector class for reading bits in little-endian order.
// (We can't use our usual "BitVector" class, because that's big-endian.)
class LEBitVector {
public:
LEBitVector(u_int8_t const* p, unsigned numBytes)
: fPtr(p), fEnd(&p[numBytes]), fNumBitsRemainingInCurrentByte(8) {
}
u_int32_t getBits(unsigned numBits/*<=32*/) {
if (noMoreBits()) {
return 0;
} else if (numBits == fNumBitsRemainingInCurrentByte) {
u_int32_t result = (*fPtr++)>>(8-fNumBitsRemainingInCurrentByte);
fNumBitsRemainingInCurrentByte = 8;
return result;
} else if (numBits < fNumBitsRemainingInCurrentByte) {
u_int8_t mask = 0xFF>>(8-numBits);
u_int32_t result = ((*fPtr)>>(8-fNumBitsRemainingInCurrentByte)) & mask;
fNumBitsRemainingInCurrentByte -= numBits;
return result;
} else { // numBits > fNumBitsRemainingInCurrentByte
// Do two recursive calls to get the result:
unsigned nbr = fNumBitsRemainingInCurrentByte;
u_int32_t firstBits = getBits(nbr);
u_int32_t nextBits = getBits(numBits - nbr);
return (nextBits<<nbr) | firstBits;
}
}
void skipBits(unsigned numBits) {
while (numBits > 32) {
(void)getBits(32);
numBits -= 32;
}
(void)getBits(numBits);
}
unsigned numBitsRemaining() { return (fEnd-fPtr-1)*8 + fNumBitsRemainingInCurrentByte; }
Boolean noMoreBits() const { return fPtr >= fEnd; }
private:
u_int8_t const* fPtr;
u_int8_t const* fEnd;
unsigned fNumBitsRemainingInCurrentByte; // 1..8
};
static unsigned ilog(int n) {
if (n < 0) return 0;
unsigned x = (unsigned)n;
unsigned result = 0;
while (x > 0) {
++result;
x >>= 1;
}
return result;
}
static unsigned lookup1_values(unsigned codebook_entries, unsigned codebook_dimensions) {
// "the greatest integer value for which [return_value] to the power of [codebook_dimensions]
// is less than or equal to [codebook_entries]"
unsigned return_value = 0;
unsigned powerValue;
do {
++return_value;
// Compute powerValue = return_value ** codebook_dimensions
if (return_value == 1) powerValue = 1; // optimization
else {
powerValue = 1;
for (unsigned i = 0; i < codebook_dimensions; ++i) {
powerValue *= return_value;
}
}
} while (powerValue <= codebook_entries);
return_value -= 1;
return return_value;
}
static Boolean parseVorbisSetup_codebook(LEBitVector& bv) {
if (bv.noMoreBits()) return False;
unsigned sync = bv.getBits(24);
if (sync != 0x564342) return False;
unsigned codebook_dimensions = bv.getBits(16);
unsigned codebook_entries = bv.getBits(24);
unsigned ordered = bv.getBits(1);
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\t\tcodebook_dimensions: %d; codebook_entries: %d, ordered: %d\n",
codebook_dimensions, codebook_entries, ordered);
#endif
unsigned codewordLength;
if (!ordered) {
unsigned sparse = bv.getBits(1);
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\t\t!ordered: sparse %d\n", sparse);
#endif
for (unsigned i = 0; i < codebook_entries; ++i) {
if (sparse) {
unsigned flag = bv.getBits(1);
if (flag) {
codewordLength = bv.getBits(5) + 1;
} else {
codewordLength = 0;
}
} else {
codewordLength = bv.getBits(5) + 1;
}
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\t\t\tcodeword length[%d]:\t%d\n", i, codewordLength);
#endif
}
} else { // ordered
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\t\tordered:\n");
#endif
unsigned current_entry = 0;
unsigned current_length = bv.getBits(5) + 1;
do {
unsigned number = bv.getBits(ilog(codebook_entries - current_entry));
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\t\t\tcodeword length[%d..%d]:\t%d\n",
current_entry, current_entry + number - 1, current_length);
#endif
current_entry += number;
if (current_entry > codebook_entries) {
fprintf(stderr, "Vorbis codebook parsing error: current_entry %d > codebook_entries %d!\n", current_entry, codebook_entries);
return False;
}
++current_length;
} while (current_entry < codebook_entries);
}
unsigned codebook_lookup_type = bv.getBits(4);
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\t\tcodebook_lookup_type: %d\n", codebook_lookup_type);
#endif
if (codebook_lookup_type > 2) {
fprintf(stderr, "Vorbis codebook parsing error: codebook_lookup_type %d!\n", codebook_lookup_type);
return False;
} else if (codebook_lookup_type > 0) { // 1 or 2
bv.skipBits(32+32); // "codebook_minimum_value" and "codebook_delta_value"
unsigned codebook_value_bits = bv.getBits(4) + 1;
bv.skipBits(1); // "codebook_lookup_p"
unsigned codebook_lookup_values;
if (codebook_lookup_type == 1) {
codebook_lookup_values = lookup1_values(codebook_entries, codebook_dimensions);
} else { // 2
codebook_lookup_values = codebook_entries*codebook_dimensions;
}
bv.skipBits(codebook_lookup_values*codebook_value_bits); // "codebook_multiplicands"
}
return True;
}
static Boolean parseVorbisSetup_codebooks(LEBitVector& bv) {
if (bv.noMoreBits()) return False;
unsigned vorbis_codebook_count = bv.getBits(8) + 1;
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\tCodebooks: vorbis_codebook_count: %d\n", vorbis_codebook_count);
#endif
for (unsigned i = 0; i < vorbis_codebook_count; ++i) {
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\tCodebook %d:\n", i);
#endif
if (!parseVorbisSetup_codebook(bv)) return False;
}
return True;
}
static Boolean parseVorbisSetup_timeDomainTransforms(LEBitVector& bv) {
if (bv.noMoreBits()) return False;
unsigned vorbis_time_count = bv.getBits(6) + 1;
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\tTime domain transforms: vorbis_time_count: %d\n", vorbis_time_count);
#endif
for (unsigned i = 0; i < vorbis_time_count; ++i) {
unsigned val = bv.getBits(16);
if (val != 0) {
fprintf(stderr, "Vorbis Time domain transforms, read non-zero value %d\n", val);
return False;
}
}
return True;
}
static Boolean parseVorbisSetup_floors(LEBitVector& bv) {
if (bv.noMoreBits()) return False;
unsigned vorbis_floor_count = bv.getBits(6) + 1;
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\tFloors: vorbis_floor_count: %d\n", vorbis_floor_count);
#endif
for (unsigned i = 0; i < vorbis_floor_count; ++i) {
unsigned floorType = bv.getBits(16);
if (floorType == 0) {
bv.skipBits(8+16+16+6+8);
unsigned floor0_number_of_books = bv.getBits(4) + 1;
bv.skipBits(floor0_number_of_books*8);
} else if (floorType == 1) {
unsigned floor1_partitions = bv.getBits(5);
unsigned* floor1_partition_class_list = new unsigned[floor1_partitions];
unsigned maximum_class = 0, j;
for (j = 0; j < floor1_partitions; ++j) {
floor1_partition_class_list[j] = bv.getBits(4);
if (floor1_partition_class_list[j] > maximum_class) maximum_class = floor1_partition_class_list[j];
}
unsigned* floor1_class_dimensions = new unsigned[maximum_class + 1];
for (j = 0; j <= maximum_class; ++j) {
floor1_class_dimensions[j] = bv.getBits(3) + 1;
unsigned floor1_class_subclasses = bv.getBits(2);
if (floor1_class_subclasses != 0) {
bv.skipBits(8); // "floor1_class_masterbooks[j]"
}
unsigned twoExp_floor1_class_subclasses = 1 << floor1_class_subclasses;
bv.skipBits(twoExp_floor1_class_subclasses*8); // "floor1_subclass_books[j][*]"
}
bv.skipBits(2); // "floor1_multiplier"
unsigned rangebits = bv.getBits(4);
for (j = 0; j < floor1_partitions; ++j) {
unsigned current_class_number = floor1_partition_class_list[j];
bv.skipBits(floor1_class_dimensions[current_class_number] * rangebits);
}
delete[] floor1_partition_class_list;
delete[] floor1_class_dimensions;
} else { // floorType > 1
fprintf(stderr, "Vorbis Floors, read bad floor type %d\n", floorType);
return False;
}
}
return True;
}
static Boolean parseVorbisSetup_residues(LEBitVector& bv) {
if (bv.noMoreBits()) return False;
unsigned vorbis_residue_count = bv.getBits(6) + 1;
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\tResidues: vorbis_residue_count: %d\n", vorbis_residue_count);
#endif
for (unsigned i = 0; i < vorbis_residue_count; ++i) {
unsigned vorbis_residue_type = bv.getBits(16);
if (vorbis_residue_type > 2) {
fprintf(stderr, "Vorbis Residues, read bad vorbis_residue_type: %d\n", vorbis_residue_type);
return False;
} else {
bv.skipBits(24+24+24); // "residue_begin", "residue_end", "residue_partition_size"
unsigned residue_classifications = bv.getBits(6) + 1;
bv.skipBits(8); // "residue_classbook"
u_int8_t* residue_cascade = new u_int8_t[residue_classifications];
unsigned j;
for (j = 0; j < residue_classifications; ++j) {
u_int8_t high_bits = 0;
u_int8_t low_bits = bv.getBits(3);
unsigned bitflag = bv.getBits(1);
if (bitflag) {
high_bits = bv.getBits(5);
}
residue_cascade[j] = (high_bits<<3) | low_bits;
}
for (j = 0; j < residue_classifications; ++j) {
u_int8_t const cascade = residue_cascade[j];
u_int8_t mask = 0x80;
while (mask != 0) {
if ((cascade&mask) != 0) bv.skipBits(8); // "residue_books[j][*]"
mask >>= 1;
}
}
delete[] residue_cascade;
}
}
return True;
}
static Boolean parseVorbisSetup_mappings(LEBitVector& bv, unsigned audio_channels) {
if (bv.noMoreBits()) return False;
unsigned vorbis_mapping_count = bv.getBits(6) + 1;
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\tMappings: vorbis_mapping_count: %d\n", vorbis_mapping_count);
#endif
for (unsigned i = 0; i < vorbis_mapping_count; ++i) {
unsigned vorbis_mapping_type = bv.getBits(16);
if (vorbis_mapping_type != 0) {
fprintf(stderr, "Vorbis Mappings, read bad vorbis_mapping_type: %d\n", vorbis_mapping_type);
return False;
}
unsigned vorbis_mapping_submaps = 1;
if (bv.getBits(1)) vorbis_mapping_submaps = bv.getBits(4) + 1;
if (bv.getBits(1)) { // "square polar channel mapping is in use"
unsigned vorbis_mapping_coupling_steps = bv.getBits(8) + 1;
for (unsigned j = 0; j < vorbis_mapping_coupling_steps; ++j) {
unsigned ilog_audio_channels_minus_1 = ilog(audio_channels - 1);
bv.skipBits(2*ilog_audio_channels_minus_1); // "vorbis_mapping_magnitude", "vorbis_mapping_angle"
}
}
unsigned reserved = bv.getBits(2);
if (reserved != 0) {
fprintf(stderr, "Vorbis Mappings, read bad 'reserved' field\n");
return False;
}
if (vorbis_mapping_submaps > 1) {
for (unsigned j = 0; j < audio_channels; ++j) {
unsigned vorbis_mapping_mux = bv.getBits(4);
fprintf(stderr, "\t\t\t\tvorbis_mapping_mux[%d]: %d\n", j, vorbis_mapping_mux);
if (vorbis_mapping_mux >= vorbis_mapping_submaps) {
fprintf(stderr, "Vorbis Mappings, read bad \"vorbis_mapping_mux\" %d (>= \"vorbis_mapping_submaps\" %d)\n", vorbis_mapping_mux, vorbis_mapping_submaps);
return False;
}
}
}
bv.skipBits(vorbis_mapping_submaps*(8+8+8)); // "the floor and residue numbers"
}
return True;
}
static Boolean parseVorbisSetup_modes(LEBitVector& bv, OggTrack* track) {
if (bv.noMoreBits()) return False;
unsigned vorbis_mode_count = bv.getBits(6) + 1;
unsigned ilog_vorbis_mode_count_minus_1 = ilog(vorbis_mode_count - 1);
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\tModes: vorbis_mode_count: %d (ilog(%d-1):%d)\n",
vorbis_mode_count, vorbis_mode_count, ilog_vorbis_mode_count_minus_1);
#endif
track->vtoHdrs.vorbis_mode_count = vorbis_mode_count;
track->vtoHdrs.ilog_vorbis_mode_count_minus_1 = ilog_vorbis_mode_count_minus_1;
track->vtoHdrs.vorbis_mode_blockflag = new u_int8_t[vorbis_mode_count];
for (unsigned i = 0; i < vorbis_mode_count; ++i) {
track->vtoHdrs.vorbis_mode_blockflag[i] = (u_int8_t)bv.getBits(1);
#ifdef DEBUG_SETUP_HEADER
fprintf(stderr, "\t\tMode %d: vorbis_mode_blockflag: %d\n", i, track->vtoHdrs.vorbis_mode_blockflag[i]);
#endif
bv.skipBits(16+16+8); // "vorbis_mode_windowtype", "vorbis_mode_transformtype", "vorbis_mode_mapping"
}
return True;
}
static Boolean parseVorbisSetupHeader(OggTrack* track, u_int8_t const* p, unsigned headerSize) {
LEBitVector bv(p, headerSize);
do {
if (!parseVorbisSetup_codebooks(bv)) break;
if (!parseVorbisSetup_timeDomainTransforms(bv)) break;
if (!parseVorbisSetup_floors(bv)) break;
if (!parseVorbisSetup_residues(bv)) break;
if (!parseVorbisSetup_mappings(bv, track->numChannels)) break;
if (!parseVorbisSetup_modes(bv, track)) break;
unsigned framingFlag = bv.getBits(1);
if (framingFlag == 0) {
fprintf(stderr, "Vorbis \"setup\" header did not end with a 'framing flag'!\n");
break;
}
return True;
} while (0);
// An error occurred:
return False;
}
#ifdef DEBUG
#define CHECK_PTR if (p >= pEnd) return False
#define printComment(p, len) do { for (unsigned k = 0; k < len; ++k) { CHECK_PTR; fprintf(stderr, "%c", *p++); } } while (0)
#endif
static Boolean validateCommentHeader(u_int8_t const *p, unsigned headerSize,
unsigned isOpus = 0) {
if (headerSize < 15+isOpus) { // need 7+isOpus + 4(vendor_length) + 4(user_comment_list_length)
fprintf(stderr, "\"comment\" header is too short (%d bytes)\n", headerSize);
return False;
}
#ifdef DEBUG
u_int8_t const* pEnd = &p[headerSize];
p += 7+isOpus;
u_int32_t vendor_length = (p[3]<<24)|(p[2]<<16)|(p[1]<<8)|p[0]; p += 4;
fprintf(stderr, "\tvendor_string:");
printComment(p, vendor_length);
fprintf(stderr, "\n");
u_int32_t user_comment_list_length = (p[3]<<24)|(p[2]<<16)|(p[1]<<8)|p[0]; p += 4;
for (unsigned i = 0; i < user_comment_list_length; ++i) {
CHECK_PTR; u_int32_t length = (p[3]<<24)|(p[2]<<16)|(p[1]<<8)|p[0]; p += 4;
fprintf(stderr, "\tuser_comment[%d]:", i);
printComment(p, length);
fprintf(stderr, "\n");
}
#endif
return True;
}
static unsigned blocksizeFromExponent(unsigned exponent) {
unsigned result = 1;
for (unsigned i = 0; i < exponent; ++i) result = 2*result;
return result;
}
Boolean OggFileParser::validateHeader(OggTrack* track, u_int8_t const* p, unsigned headerSize) {
// Assert: headerSize >= 7 (because we've already checked "<packet_type>XXXXXX" or "OpusXXXX")
if (strcmp(track->mimeType, "audio/VORBIS") == 0) {
u_int8_t const firstByte = p[0];
if (firstByte == 1) { // "identification" header
if (headerSize < 30) {
fprintf(stderr, "Vorbis \"identification\" header is too short (%d bytes)\n", headerSize);
return False;
} else if ((p[29]&0x1) != 1) {
fprintf(stderr, "Vorbis \"identification\" header: 'framing_flag' is not set\n");
return False;
}
p += 7;
u_int32_t vorbis_version = (p[3]<<24)|(p[2]<<16)|(p[1]<<8)|p[0]; p += 4;
if (vorbis_version != 0) {
fprintf(stderr, "Vorbis \"identification\" header has a bad 'vorbis_version': 0x%08x\n", vorbis_version);
return False;
}
u_int8_t audio_channels = *p++;
if (audio_channels == 0) {
fprintf(stderr, "Vorbis \"identification\" header: 'audio_channels' is 0!\n");
return False;
}
track->numChannels = audio_channels;
u_int32_t audio_sample_rate = (p[3]<<24)|(p[2]<<16)|(p[1]<<8)|p[0]; p += 4;
if (audio_sample_rate == 0) {
fprintf(stderr, "Vorbis \"identification\" header: 'audio_sample_rate' is 0!\n");
return False;
}
track->samplingFrequency = audio_sample_rate;
p += 4; // skip over 'bitrate_maximum'
u_int32_t bitrate_nominal = (p[3]<<24)|(p[2]<<16)|(p[1]<<8)|p[0]; p += 4;
if (bitrate_nominal > 0) track->estBitrate = (bitrate_nominal+500)/1000; // round
p += 4; // skip over 'bitrate_maximum'
// Note the two 'block sizes' (samples per packet), and their durations in microseconds:
u_int8_t blocksizeBits = *p++;
unsigned& blocksize_0 = track->vtoHdrs.blocksize[0]; // alias
unsigned& blocksize_1 = track->vtoHdrs.blocksize[1]; // alias
blocksize_0 = blocksizeFromExponent(blocksizeBits&0x0F);
blocksize_1 = blocksizeFromExponent(blocksizeBits>>4);
double uSecsPerSample = 1000000.0/(track->samplingFrequency*2);
// Why the "2"? I don't know, but it seems to be necessary
track->vtoHdrs.uSecsPerPacket[0] = (unsigned)(uSecsPerSample*blocksize_0);
track->vtoHdrs.uSecsPerPacket[1] = (unsigned)(uSecsPerSample*blocksize_1);
#ifdef DEBUG
fprintf(stderr, "\t%u Hz, %u-channel, %u kbps (est), block sizes: %u,%u (%u,%u us)\n",
track->samplingFrequency, track->numChannels, track->estBitrate,
blocksize_0, blocksize_1,
track->vtoHdrs.uSecsPerPacket[0], track->vtoHdrs.uSecsPerPacket[1]);
#endif
// To be valid, "blocksize_0" must be <= "blocksize_1", and both must be in [64,8192]:
if (!(blocksize_0 <= blocksize_1 && blocksize_0 >= 64 && blocksize_1 <= 8192)) {
fprintf(stderr, "Invalid Vorbis \"blocksize_0\" (%d) and/or \"blocksize_1\" (%d)!\n",
blocksize_0, blocksize_1);
return False;
}
} else if (firstByte == 3) { // "comment" header
if (!validateCommentHeader(p, headerSize)) return False;
} else if (firstByte == 5) { // "setup" header
// Parse the "setup" header to get the values that we want:
// "vorbis_mode_count", and "vorbis_mode_blockflag" for each mode. Unfortunately these come
// near the end of the header, so we have to parse lots of other crap first.
p += 7;
if (!parseVorbisSetupHeader(track, p, headerSize)) {
fprintf(stderr, "Failed to parse Vorbis \"setup\" header!\n");
return False;
}
}
} else if (strcmp(track->mimeType, "video/THEORA") == 0) {
u_int8_t const firstByte = p[0];
if (firstByte == 0x80) { // "identification" header
if (headerSize < 42) {
fprintf(stderr, "Theora \"identification\" header is too short (%d bytes)\n", headerSize);
return False;
} else if ((p[41]&0x7) != 0) {
fprintf(stderr, "Theora \"identification\" header: 'res' bits are non-zero\n");
return False;
}
track->vtoHdrs.KFGSHIFT = ((p[40]&3)<<3) | (p[41]>>5);
u_int32_t FRN = (p[22]<<24) | (p[23]<<16) | (p[24]<<8) | p[25]; // Frame rate numerator
u_int32_t FRD = (p[26]<<24) | (p[27]<<16) | (p[28]<<8) | p[29]; // Frame rate numerator
#ifdef DEBUG
fprintf(stderr, "\tKFGSHIFT %d, Frame rate numerator %d, Frame rate denominator %d\n", track->vtoHdrs.KFGSHIFT, FRN, FRD);
#endif
if (FRN == 0 || FRD == 0) {
fprintf(stderr, "Theora \"identification\" header: Bad FRN and/or FRD values: %d, %d\n", FRN, FRD);
return False;
}
track->vtoHdrs.uSecsPerFrame = (unsigned)((1000000.0*FRD)/FRN);
#ifdef DEBUG
fprintf(stderr, "\t\t=> %u microseconds per frame\n", track->vtoHdrs.uSecsPerFrame);
#endif
} else if (firstByte == 0x81) { // "comment" header
if (!validateCommentHeader(p, headerSize)) return False;
} else if (firstByte == 0x82) { // "setup" header
// We don't care about the contents of the Theora "setup" header; just assume it's valid
}
} else { // Opus audio
if (strncmp((char const*)p, "OpusHead", 8) == 0) { // "identification" header
// Just check the size, and the 'major' number of the version byte:
if (headerSize < 19 || (p[8]&0xF0) != 0) return False;
} else { // comment header
if (!validateCommentHeader(p, headerSize, 1/*isOpus*/)) return False;
}
}
return True;
}
void OggFileParser::parseAndDeliverPages() {
#ifdef DEBUG
fprintf(stderr, "parsing and delivering data\n");
#endif
while (parseAndDeliverPage()) {}
}
Boolean OggFileParser::parseAndDeliverPage() {
u_int8_t header_type_flag;
u_int32_t bitstream_serial_number;
parseStartOfPage(header_type_flag, bitstream_serial_number);
OggDemuxedTrack* demuxedTrack = fOurDemux->lookupDemuxedTrack(bitstream_serial_number);
if (demuxedTrack == NULL) { // this track is not being read
#ifdef DEBUG
fprintf(stderr, "\tIgnoring page from unread track; skipping %d remaining packet data bytes\n",
fPacketSizeTable->totSizes);
#endif
skipBytes(fPacketSizeTable->totSizes);
return True;
} else if (fPacketSizeTable->totSizes == 0) {
// This page is empty (has no packets). Skip it and continue
#ifdef DEBUG
fprintf(stderr, "\t[track: %s] Skipping empty page\n", demuxedTrack->MIMEtype());
#endif
return True;
}
// Start delivering packets next:
demuxedTrack->fCurrentPageIsContinuation = (header_type_flag&0x01) != 0;
fCurrentTrackNumber = bitstream_serial_number;
fCurrentParseState = DELIVERING_PACKET_WITHIN_PAGE;
saveParserState();
return False;
}
Boolean OggFileParser::deliverPacketWithinPage() {
OggDemuxedTrack* demuxedTrack = fOurDemux->lookupDemuxedTrack(fCurrentTrackNumber);
if (demuxedTrack == NULL) return False; // should not happen
unsigned packetNum = fPacketSizeTable->nextPacketNumToDeliver;
unsigned packetSize = fPacketSizeTable->size[packetNum];
if (!demuxedTrack->isCurrentlyAwaitingData()) {
// Someone has been reading this stream, but isn't right now.
// We can't deliver this frame until he asks for it, so punt for now.
// The next time he asks for a frame, he'll get it.
#ifdef DEBUG
fprintf(stderr, "\t[track: %s] Deferring delivery of packet %d (%d bytes%s)\n",
demuxedTrack->MIMEtype(), packetNum, packetSize,
packetNum == fPacketSizeTable->numCompletedPackets ? " (incomplete)" : "");
#endif
return True;
}
// Deliver the next packet:
#ifdef DEBUG
fprintf(stderr, "\t[track: %s] Delivering packet %d (%d bytes%s)\n", demuxedTrack->MIMEtype(),
packetNum, packetSize,
packetNum == fPacketSizeTable->numCompletedPackets ? " (incomplete)" : "");
#endif
unsigned numBytesDelivered
= packetSize < demuxedTrack->maxSize() ? packetSize : demuxedTrack->maxSize();
getBytes(demuxedTrack->to(), numBytesDelivered);
u_int8_t firstByte = numBytesDelivered > 0 ? demuxedTrack->to()[0] : 0x00;
u_int8_t secondByte = numBytesDelivered > 1 ? demuxedTrack->to()[1] : 0x00;
demuxedTrack->to() += numBytesDelivered;
if (demuxedTrack->fCurrentPageIsContinuation) { // the previous page's read was incomplete
demuxedTrack->frameSize() += numBytesDelivered;
} else {
// This is the first delivery for this "doGetNextFrame()" call.
demuxedTrack->frameSize() = numBytesDelivered;
}
if (packetSize > demuxedTrack->maxSize()) {
demuxedTrack->numTruncatedBytes() += packetSize - demuxedTrack->maxSize();
}
demuxedTrack->maxSize() -= numBytesDelivered;
// Figure out the duration and presentation time of this frame.
unsigned durationInMicroseconds;
OggTrack* track = fOurFile.lookup(demuxedTrack->fOurTrackNumber);
if (strcmp(track->mimeType, "audio/VORBIS") == 0) {
if ((firstByte&0x01) != 0) { // This is a header packet
durationInMicroseconds = 0;
} else { // This is a data packet.
// Parse the first byte to figure out its duration.
// Extract the next "track->vtoHdrs.ilog_vorbis_mode_count_minus_1" bits of the first byte:
u_int8_t const mask = 0xFE<<(track->vtoHdrs.ilog_vorbis_mode_count_minus_1);
u_int8_t const modeNumber = (firstByte&~mask)>>1;
if (modeNumber >= track->vtoHdrs.vorbis_mode_count) {
fprintf(stderr, "Error: Bad mode number %d (>= vorbis_mode_count %d) in Vorbis packet!\n",
modeNumber, track->vtoHdrs.vorbis_mode_count);
durationInMicroseconds = 0;
} else {
unsigned blockNumber = track->vtoHdrs.vorbis_mode_blockflag[modeNumber];
durationInMicroseconds = track->vtoHdrs.uSecsPerPacket[blockNumber];
}
}
} else if (strcmp(track->mimeType, "video/THEORA") == 0) {
if ((firstByte&0x80) != 0) { // This is a header packet
durationInMicroseconds = 0;
} else { // This is a data packet.
durationInMicroseconds = track->vtoHdrs.uSecsPerFrame;
}
} else { // "audio/OPUS"
if (firstByte == 0x4F/*'O'*/ && secondByte == 0x70/*'p*/) { // This is a header packet
durationInMicroseconds = 0;
} else { // This is a data packet.
// Parse the first byte to figure out the duration of each frame, and then (if necessary)
// parse the second byte to figure out how many frames are in this packet:
u_int8_t config = firstByte >> 3;
u_int8_t c = firstByte & 0x03;
unsigned const configDuration[32] = { // in microseconds
10000, 20000, 40000, 60000, // config 0..3
10000, 20000, 40000, 60000, // config 4..7
10000, 20000, 40000, 60000, // config 8..11
10000, 20000, // config 12..13
10000, 20000, // config 14..15
2500, 5000, 10000, 20000, // config 16..19
2500, 5000, 10000, 20000, // config 20..23
2500, 5000, 10000, 20000, // config 24..27
2500, 5000, 10000, 20000 // config 28..31
};
unsigned const numFramesInPacket = c == 0 ? 1 : c == 3 ? (secondByte&0x3F) : 2;
durationInMicroseconds = numFramesInPacket*configDuration[config];
}
}
if (demuxedTrack->nextPresentationTime().tv_sec == 0 && demuxedTrack->nextPresentationTime().tv_usec == 0) {
// This is the first delivery. Initialize "demuxedTrack->nextPresentationTime()":
gettimeofday(&demuxedTrack->nextPresentationTime(), NULL);
}
demuxedTrack->presentationTime() = demuxedTrack->nextPresentationTime();
demuxedTrack->durationInMicroseconds() = durationInMicroseconds;
demuxedTrack->nextPresentationTime().tv_usec += durationInMicroseconds;
while (demuxedTrack->nextPresentationTime().tv_usec >= 1000000) {
++demuxedTrack->nextPresentationTime().tv_sec;
demuxedTrack->nextPresentationTime().tv_usec -= 1000000;
}
saveParserState();
// And check whether there's a next packet in this page:
if (packetNum == fPacketSizeTable->numCompletedPackets) {
// This delivery was for an incomplete packet, at the end of the page.
// Return without completing delivery:
fCurrentParseState = PARSING_AND_DELIVERING_PAGES;
return False;
}
if (packetNum < fPacketSizeTable->numCompletedPackets-1
|| fPacketSizeTable->lastPacketIsIncomplete) {
// There is at least one more packet (possibly incomplete) left in this packet.
// Deliver it next:
++fPacketSizeTable->nextPacketNumToDeliver;
} else {
// Start parsing a new page next:
fCurrentParseState = PARSING_AND_DELIVERING_PAGES;
}
FramedSource::afterGetting(demuxedTrack); // completes delivery
return True;
}
void OggFileParser::parseStartOfPage(u_int8_t& header_type_flag,
u_int32_t& bitstream_serial_number) {
saveParserState();
// First, make sure we start with the 'capture_pattern': 0x4F676753 ('OggS'):
while (test4Bytes() != 0x4F676753) {
skipBytes(1);
saveParserState(); // ensures forward progress through the file
}
skipBytes(4);
#ifdef DEBUG
fprintf(stderr, "\nSaw Ogg page header:\n");
#endif
u_int8_t stream_structure_version = get1Byte();
if (stream_structure_version != 0) {
fprintf(stderr, "Saw page with unknown Ogg file version number: 0x%02x\n", stream_structure_version);
}
header_type_flag = get1Byte();
#ifdef DEBUG
fprintf(stderr, "\theader_type_flag: 0x%02x (", header_type_flag);
if (header_type_flag&0x01) fprintf(stderr, "continuation ");
if (header_type_flag&0x02) fprintf(stderr, "bos ");
if (header_type_flag&0x04) fprintf(stderr, "eos ");
fprintf(stderr, ")\n");
#endif
u_int32_t granule_position1 = byteSwap(get4Bytes());
u_int32_t granule_position2 = byteSwap(get4Bytes());
bitstream_serial_number = byteSwap(get4Bytes());
u_int32_t page_sequence_number = byteSwap(get4Bytes());
u_int32_t CRC_checksum = byteSwap(get4Bytes());
u_int8_t number_page_segments = get1Byte();
#ifdef DEBUG
fprintf(stderr, "\tgranule_position 0x%08x%08x, bitstream_serial_number 0x%08x, page_sequence_number 0x%08x, CRC_checksum 0x%08x, number_page_segments %d\n", granule_position2, granule_position1, bitstream_serial_number, page_sequence_number, CRC_checksum, number_page_segments);
#else
// Dummy statements to prevent 'unused variable' compiler warnings:
#define DUMMY_STATEMENT(x) do {x = x;} while (0)
DUMMY_STATEMENT(granule_position1);
DUMMY_STATEMENT(granule_position2);
DUMMY_STATEMENT(page_sequence_number);
DUMMY_STATEMENT(CRC_checksum);
#endif
// Look at the "segment_table" to count the sizes of the packets in this page:
delete fPacketSizeTable/*if any*/; fPacketSizeTable = new PacketSizeTable(number_page_segments);
u_int8_t lacing_value = 0;
#ifdef DEBUG
fprintf(stderr, "\tsegment_table\n");
#endif
for (unsigned i = 0; i < number_page_segments; ++i) {
lacing_value = get1Byte();
#ifdef DEBUG
fprintf(stderr, "\t\t%d:\t%d", i, lacing_value);
#endif
fPacketSizeTable->totSizes += lacing_value;
fPacketSizeTable->size[fPacketSizeTable->numCompletedPackets] += lacing_value;
if (lacing_value < 255) {
// This completes a packet:
#ifdef DEBUG
fprintf(stderr, " (->%d)", fPacketSizeTable->size[fPacketSizeTable->numCompletedPackets]);
#endif
++fPacketSizeTable->numCompletedPackets;
}
#ifdef DEBUG
fprintf(stderr, "\n");
#endif
}
fPacketSizeTable->lastPacketIsIncomplete = lacing_value == 255;
}
| {
"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="l00033"></a>00033 <span class="comment">// +--------------------------------------------+</span>
<a name="l00034"></a>00034 <span class="comment">// | MCU |</span>
<a name="l00035"></a>00035 <span class="comment">// | IO1 IO2 IO3 |</span>
<a name="l00036"></a>00036 <span class="comment">// +----+-------------+-------------+-----------+</span>
<a name="l00037"></a>00037 <span class="comment">// | | |</span>
<a name="l00038"></a>00038 <span class="comment">// | | |</span>
<a name="l00039"></a>00039 <span class="comment">// +----+-------------+-------------+-----------+</span>
<a name="l00040"></a>00040 <span class="comment">// | Strobe Data Clock |</span>
<a name="l00041"></a>00041 <span class="comment">// | 8-bit shift/latch register | 74HC595N</span>
<a name="l00042"></a>00042 <span class="comment">// | Qa0 Qb1 Qc2 Qd3 Qe4 Qf5 Qg6 Qh7 |</span>
<a name="l00043"></a>00043 <span class="comment">// +----+----+----+----+----+----+----+----+----+</span>
<a name="l00044"></a>00044 <span class="comment">// | | | | | | | </span>
<a name="l00045"></a>00045 <span class="comment">// |11 |12 |13 |14 |6 |5 |4 (LCD pins)</span>
<a name="l00046"></a>00046 <span class="comment">// +----+----+----+----+----+----+----+----+----+</span>
<a name="l00047"></a>00047 <span class="comment">// | DB4 DB5 DB6 DB7 E Rw RS |</span>
<a name="l00048"></a>00048 <span class="comment">// | LCD Module |</span>
<a name="l00049"></a>00049 <span class="comment">//</span>
<a name="l00050"></a>00050 <span class="comment">// NOTE: Rw is not used by the driver so it can be connected to GND.</span>
<a name="l00051"></a>00051 <span class="comment">//</span>
<a name="l00052"></a>00052 <span class="comment">// The functionality provided by this class and its base class is identical</span>
<a name="l00053"></a>00053 <span class="comment">// to the original functionality of the Arduino LiquidCrystal library.</span>
<a name="l00054"></a>00054 <span class="comment">//</span>
<a name="l00055"></a>00055 <span class="comment">//</span>
<a name="l00056"></a>00056 <span class="comment">// History</span>
<a name="l00057"></a>00057 <span class="comment">// 2012.03.29 bperrybap - fixed constructors not properly using Rs</span>
<a name="l00058"></a>00058 <span class="comment">// Fixed incorrect use of 5x10 for default font </span>
<a name="l00059"></a>00059 <span class="comment">// - now matches original LQ library.</span>
<a name="l00060"></a>00060 <span class="comment">// moved delay to send() so it is per cmd/write vs shiftout()</span>
<a name="l00061"></a>00061 <span class="comment">// NOTE: delay is on hairy edge of working when FAST_MODE is on.</span>
<a name="l00062"></a>00062 <span class="comment">// because of waitUsec().</span>
<a name="l00063"></a>00063 <span class="comment">// There is margin at 16Mhz AVR but might fail on 20Mhz AVRs.</span>
<a name="l00064"></a>00064 <span class="comment">// </span>
<a name="l00065"></a>00065 <span class="comment">// @author F. Malpartida - [email protected]</span>
<a name="l00066"></a>00066 <span class="comment">// ---------------------------------------------------------------------------</span>
<a name="l00067"></a>00067 <span class="comment">// flags for backlight control</span>
<a name="l00068"></a>00068 <span class="preprocessor">#include <stdio.h></span>
<a name="l00069"></a>00069 <span class="preprocessor">#include <string.h></span>
<a name="l00070"></a>00070 <span class="preprocessor">#include <inttypes.h></span>
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="preprocessor">#if (ARDUINO < 100)</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#include <WProgram.h></span>
<a name="l00074"></a>00074 <span class="preprocessor">#else</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#include <Arduino.h></span>
<a name="l00076"></a>00076 <span class="preprocessor">#endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="_liquid_crystal___s_r3_w_8h.html">LiquidCrystal_SR3W.h</a>"</span>
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="preprocessor">#include "<a class="code" href="_fast_i_o_8h.html">FastIO.h</a>"</span>
<a name="l00080"></a>00080
<a name="l00086"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a65fa786d6e31fe8b1aa51784a9736581">00086</a> <span class="preprocessor">#define LCD_NOBACKLIGHT 0x00</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span>
<a name="l00093"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#ac059d24dfe9c1e1f7c07cb7869a1833b">00093</a> <span class="preprocessor">#define LCD_BACKLIGHT 0xFF</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span>
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="comment">// Default library configuration parameters used by class constructor with</span>
<a name="l00097"></a>00097 <span class="comment">// only the I2C address field.</span>
<a name="l00098"></a>00098 <span class="comment">// ---------------------------------------------------------------------------</span>
<a name="l00104"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a22e6626f2c98ed902f8ded47f6438c05">00104</a> <span class="comment"></span><span class="preprocessor">#define EN 4 // Enable bit</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span>
<a name="l00111"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#afc4ded33ac0ca43defcce639e965748a">00111</a> <span class="preprocessor">#define RW 5 // Read/Write bit</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
<a name="l00118"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#af8903d8eea3868940c60af887473b152">00118</a> <span class="preprocessor">#define RS 6 // Register select bit</span>
<a name="l00119"></a>00119 <span class="preprocessor"></span>
<a name="l00126"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a3d9bb178282c3cb69740c94ba1e48fed">00126</a> <span class="preprocessor">#define D4 0</span>
<a name="l00127"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a2ddd4183d444d6d128cbdbd6269e4e0c">00127</a> <span class="preprocessor"></span><span class="preprocessor">#define D5 1</span>
<a name="l00128"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a79a18a7f5ccf7a7ca31f302bd62527a6">00128</a> <span class="preprocessor"></span><span class="preprocessor">#define D6 2</span>
<a name="l00129"></a><a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a2ba78f059a7ebebc95e7beef690e88d6">00129</a> <span class="preprocessor"></span><span class="preprocessor">#define D7 3</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span>
<a name="l00131"></a>00131
<a name="l00132"></a>00132
<a name="l00133"></a><a class="code" href="class_liquid_crystal___s_r3_w.html#ae1396bcd5e9c5b7ed13182c166de776b">00133</a> <a class="code" href="class_liquid_crystal___s_r3_w.html#ae1396bcd5e9c5b7ed13182c166de776b">LiquidCrystal_SR3W::LiquidCrystal_SR3W</a>(uint8_t data, uint8_t clk, uint8_t strobe)
<a name="l00134"></a>00134 {
<a name="l00135"></a>00135 init( data, clk, strobe, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#af8903d8eea3868940c60af887473b152">RS</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#afc4ded33ac0ca43defcce639e965748a">RW</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a22e6626f2c98ed902f8ded47f6438c05">EN</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a3d9bb178282c3cb69740c94ba1e48fed">D4</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a2ddd4183d444d6d128cbdbd6269e4e0c">D5</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a79a18a7f5ccf7a7ca31f302bd62527a6">D6</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a2ba78f059a7ebebc95e7beef690e88d6">D7</a> );
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137
<a name="l00138"></a><a class="code" href="class_liquid_crystal___s_r3_w.html#a7b2f382b76bc9d88adb8d681e824b4de">00138</a> <a class="code" href="class_liquid_crystal___s_r3_w.html#ae1396bcd5e9c5b7ed13182c166de776b">LiquidCrystal_SR3W::LiquidCrystal_SR3W</a>(uint8_t data, uint8_t clk, uint8_t strobe,
<a name="l00139"></a>00139 uint8_t backlighPin, <a class="code" href="_l_c_d_8h.html#aeeef728bf4726268aa5e99391a1502bc">t_backlighPol</a> pol)
<a name="l00140"></a>00140 {
<a name="l00141"></a>00141 init( data, clk, strobe, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#af8903d8eea3868940c60af887473b152">RS</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#afc4ded33ac0ca43defcce639e965748a">RW</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a22e6626f2c98ed902f8ded47f6438c05">EN</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a3d9bb178282c3cb69740c94ba1e48fed">D4</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a2ddd4183d444d6d128cbdbd6269e4e0c">D5</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a79a18a7f5ccf7a7ca31f302bd62527a6">D6</a>, <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a2ba78f059a7ebebc95e7beef690e88d6">D7</a> );
<a name="l00142"></a>00142 <a class="code" href="class_liquid_crystal___s_r3_w.html#a894d0ea8ea61c1d15acd8a26d417e477">setBacklightPin</a>(backlighPin, pol);
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144
<a name="l00145"></a><a class="code" href="class_liquid_crystal___s_r3_w.html#a4fab8ff2f21bba3efd133cd8c87fffc0">00145</a> <a class="code" href="class_liquid_crystal___s_r3_w.html#ae1396bcd5e9c5b7ed13182c166de776b">LiquidCrystal_SR3W::LiquidCrystal_SR3W</a>(uint8_t data, uint8_t clk, uint8_t strobe,
<a name="l00146"></a>00146 uint8_t En, uint8_t Rw, uint8_t Rs,
<a name="l00147"></a>00147 uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7 )
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149 init( data, clk, strobe, Rs, Rw, En, d4, d5, d6, d7 );
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151
<a name="l00152"></a><a class="code" href="class_liquid_crystal___s_r3_w.html#a24f051747dfeda48f7b207c3358c8015">00152</a> <a class="code" href="class_liquid_crystal___s_r3_w.html#ae1396bcd5e9c5b7ed13182c166de776b">LiquidCrystal_SR3W::LiquidCrystal_SR3W</a>(uint8_t data, uint8_t clk, uint8_t strobe,
<a name="l00153"></a>00153 uint8_t En, uint8_t Rw, uint8_t Rs,
<a name="l00154"></a>00154 uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
<a name="l00155"></a>00155 uint8_t backlighPin, <a class="code" href="_l_c_d_8h.html#aeeef728bf4726268aa5e99391a1502bc">t_backlighPol</a> pol)
<a name="l00156"></a>00156 {
<a name="l00157"></a>00157 init( data, clk, strobe, Rs, Rw, En, d4, d5, d6, d7 );
<a name="l00158"></a>00158 <a class="code" href="class_liquid_crystal___s_r3_w.html#a894d0ea8ea61c1d15acd8a26d417e477">setBacklightPin</a>(backlighPin, pol);
<a name="l00159"></a>00159 }
<a name="l00160"></a>00160
<a name="l00161"></a>00161
<a name="l00162"></a><a class="code" href="class_liquid_crystal___s_r3_w.html#ade34af5b7fe795482f1848c2176d6e56">00162</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___s_r3_w.html#ade34af5b7fe795482f1848c2176d6e56">LiquidCrystal_SR3W::send</a>(uint8_t value, uint8_t mode)
<a name="l00163"></a>00163 {
<a name="l00164"></a>00164
<a name="l00165"></a>00165 <span class="keywordflow">if</span> ( mode != <a class="code" href="_l_c_d_8h.html#aa1e30e32b6c2cf8d90a9281328472dbe">FOUR_BITS</a> )
<a name="l00166"></a>00166 {
<a name="l00167"></a>00167 write4bits( (value >> 4), mode ); <span class="comment">// upper nibble</span>
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169 write4bits( (value & 0x0F), mode); <span class="comment">// lower nibble</span>
<a name="l00170"></a>00170
<a name="l00171"></a>00171
<a name="l00172"></a>00172 <span class="preprocessor">#if (F_CPU <= 16000000)</span>
<a name="l00173"></a>00173 <span class="preprocessor"></span> <span class="comment">// No need to use the delay routines on AVR since the time taken to write</span>
<a name="l00174"></a>00174 <span class="comment">// on AVR with SR pin mapping even with fio is longer than LCD command execution.</span>
<a name="l00175"></a>00175 <a class="code" href="_l_c_d_8h.html#a6eac41e4be58d7736ac0c19de225c0dc">waitUsec</a>(37); <span class="comment">//goes away on AVRs</span>
<a name="l00176"></a>00176 <span class="preprocessor">#else</span>
<a name="l00177"></a>00177 <span class="preprocessor"></span> delayMicroseconds ( 37 ); <span class="comment">// commands & data writes need > 37us to complete</span>
<a name="l00178"></a>00178 <span class="preprocessor">#endif</span>
<a name="l00179"></a>00179 <span class="preprocessor"></span>
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181
<a name="l00182"></a>00182
<a name="l00183"></a><a class="code" href="class_liquid_crystal___s_r3_w.html#a894d0ea8ea61c1d15acd8a26d417e477">00183</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___s_r3_w.html#a894d0ea8ea61c1d15acd8a26d417e477">LiquidCrystal_SR3W::setBacklightPin</a> ( uint8_t value, <a class="code" href="_l_c_d_8h.html#aeeef728bf4726268aa5e99391a1502bc">t_backlighPol</a> pol = <a class="code" href="_l_c_d_8h.html#aeeef728bf4726268aa5e99391a1502bca03d440bbbfb042afc85347f994b44fb5">POSITIVE</a> )
<a name="l00184"></a>00184 {
<a name="l00185"></a>00185 _backlightPinMask = ( 1 << value );
<a name="l00186"></a>00186 _backlightStsMask = <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a65fa786d6e31fe8b1aa51784a9736581">LCD_NOBACKLIGHT</a>;
<a name="l00187"></a>00187 <a class="code" href="class_l_c_d.html#a990338759d2abe10b0fb1743b7789566">_polarity</a> = pol;
<a name="l00188"></a>00188 <a class="code" href="class_liquid_crystal___s_r3_w.html#a6d0fc7907ef9fd87c408a21b9bd49295">setBacklight</a> (<a class="code" href="_l_c_d_8h.html#a0f50ae3b4bdb42dd5ad74b2c604a7515">BACKLIGHT_OFF</a>); <span class="comment">// Set backlight to off as initial setup</span>
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190
<a name="l00191"></a><a class="code" href="class_liquid_crystal___s_r3_w.html#a6d0fc7907ef9fd87c408a21b9bd49295">00191</a> <span class="keywordtype">void</span> <a class="code" href="class_liquid_crystal___s_r3_w.html#a6d0fc7907ef9fd87c408a21b9bd49295">LiquidCrystal_SR3W::setBacklight</a> ( uint8_t value )
<a name="l00192"></a>00192 {
<a name="l00193"></a>00193 <span class="comment">// Check if backlight is available</span>
<a name="l00194"></a>00194 <span class="comment">// ----------------------------------------------------</span>
<a name="l00195"></a>00195 <span class="keywordflow">if</span> ( _backlightPinMask != 0x0 )
<a name="l00196"></a>00196 {
<a name="l00197"></a>00197 <span class="comment">// Check for polarity to configure mask accordingly</span>
<a name="l00198"></a>00198 <span class="comment">// ----------------------------------------------------------</span>
<a name="l00199"></a>00199 <span class="keywordflow">if</span> (((<a class="code" href="class_l_c_d.html#a990338759d2abe10b0fb1743b7789566">_polarity</a> == <a class="code" href="_l_c_d_8h.html#aeeef728bf4726268aa5e99391a1502bca03d440bbbfb042afc85347f994b44fb5">POSITIVE</a>) && (value > 0)) ||
<a name="l00200"></a>00200 ((<a class="code" href="class_l_c_d.html#a990338759d2abe10b0fb1743b7789566">_polarity</a> == <a class="code" href="_l_c_d_8h.html#aeeef728bf4726268aa5e99391a1502bca62d66a51fa7574c652597716f7709865">NEGATIVE</a> ) && ( value == 0 )))
<a name="l00201"></a>00201 {
<a name="l00202"></a>00202 _backlightStsMask = _backlightPinMask & <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#ac059d24dfe9c1e1f7c07cb7869a1833b">LCD_BACKLIGHT</a>;
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204 <span class="keywordflow">else</span>
<a name="l00205"></a>00205 {
<a name="l00206"></a>00206 _backlightStsMask = _backlightPinMask & <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a65fa786d6e31fe8b1aa51784a9736581">LCD_NOBACKLIGHT</a>;
<a name="l00207"></a>00207 }
<a name="l00208"></a>00208 loadSR( _backlightStsMask );
<a name="l00209"></a>00209 }
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211
<a name="l00212"></a>00212
<a name="l00213"></a>00213 <span class="comment">// PRIVATE METHODS</span>
<a name="l00214"></a>00214 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00215"></a>00215
<a name="l00216"></a>00216 <span class="keywordtype">int</span> LiquidCrystal_SR3W::init(uint8_t data, uint8_t clk, uint8_t strobe,
<a name="l00217"></a>00217 uint8_t Rs, uint8_t Rw, uint8_t En,
<a name="l00218"></a>00218 uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
<a name="l00219"></a>00219 {
<a name="l00220"></a>00220 _data = <a class="code" href="_fast_i_o_8cpp.html#a07a19dfbdca1afaca5d666bdaa3be7d5">fio_pinToBit</a>(data);
<a name="l00221"></a>00221 _clk = <a class="code" href="_fast_i_o_8cpp.html#a07a19dfbdca1afaca5d666bdaa3be7d5">fio_pinToBit</a>(clk);
<a name="l00222"></a>00222 _strobe = <a class="code" href="_fast_i_o_8cpp.html#a07a19dfbdca1afaca5d666bdaa3be7d5">fio_pinToBit</a>(strobe);
<a name="l00223"></a>00223 _data_reg = <a class="code" href="_fast_i_o_8cpp.html#a04210cc785c3b4a11c86f794949c327f">fio_pinToOutputRegister</a>(data);
<a name="l00224"></a>00224 _clk_reg = <a class="code" href="_fast_i_o_8cpp.html#a04210cc785c3b4a11c86f794949c327f">fio_pinToOutputRegister</a>(clk);
<a name="l00225"></a>00225 _strobe_reg = <a class="code" href="_fast_i_o_8cpp.html#a04210cc785c3b4a11c86f794949c327f">fio_pinToOutputRegister</a>(strobe);
<a name="l00226"></a>00226
<a name="l00227"></a>00227 <span class="comment">// LCD pin mapping</span>
<a name="l00228"></a>00228 _backlightPinMask = 0;
<a name="l00229"></a>00229 _backlightStsMask = <a class="code" href="_liquid_crystal___s_r3_w_8cpp.html#a65fa786d6e31fe8b1aa51784a9736581">LCD_NOBACKLIGHT</a>;
<a name="l00230"></a>00230 <a class="code" href="class_l_c_d.html#a990338759d2abe10b0fb1743b7789566">_polarity</a> = <a class="code" href="_l_c_d_8h.html#aeeef728bf4726268aa5e99391a1502bca03d440bbbfb042afc85347f994b44fb5">POSITIVE</a>;
<a name="l00231"></a>00231
<a name="l00232"></a>00232 _En = ( 1 << En );
<a name="l00233"></a>00233 _Rw = ( 1 << Rw );
<a name="l00234"></a>00234 _Rs = ( 1 << Rs );
<a name="l00235"></a>00235
<a name="l00236"></a>00236 <span class="comment">// Initialise pin mapping</span>
<a name="l00237"></a>00237 _data_pins[0] = ( 1 << d4 );
<a name="l00238"></a>00238 _data_pins[1] = ( 1 << d5 );
<a name="l00239"></a>00239 _data_pins[2] = ( 1 << d6 );
<a name="l00240"></a>00240 _data_pins[3] = ( 1 << d7 );
<a name="l00241"></a>00241
<a name="l00242"></a>00242 <a class="code" href="class_l_c_d.html#aef093ba3f8e1016267b40ac235a0fa0f">_displayfunction</a> = <a class="code" href="_l_c_d_8h.html#ab8c35d355d2372090c7a347e961c9224">LCD_4BITMODE</a> | <a class="code" href="_l_c_d_8h.html#a8c85cf88d8af66a47c42249d81c94641">LCD_1LINE</a> | <a class="code" href="_l_c_d_8h.html#a9ef57e724c1b846dae0f531aff6fb464">LCD_5x8DOTS</a>;
<a name="l00243"></a>00243
<a name="l00244"></a>00244 <span class="keywordflow">return</span> (1);
<a name="l00245"></a>00245 }
<a name="l00246"></a>00246
<a name="l00247"></a>00247 <span class="keywordtype">void</span> LiquidCrystal_SR3W::write4bits(uint8_t value, uint8_t mode)
<a name="l00248"></a>00248 {
<a name="l00249"></a>00249 uint8_t pinMapValue = 0;
<a name="l00250"></a>00250
<a name="l00251"></a>00251 <span class="comment">// Map the value to LCD pin mapping</span>
<a name="l00252"></a>00252 <span class="comment">// --------------------------------</span>
<a name="l00253"></a>00253 <span class="keywordflow">for</span> ( uint8_t i = 0; i < 4; i++ )
<a name="l00254"></a>00254 {
<a name="l00255"></a>00255 <span class="keywordflow">if</span> ( ( value & 0x1 ) == 1 )
<a name="l00256"></a>00256 {
<a name="l00257"></a>00257 pinMapValue |= _data_pins[i];
<a name="l00258"></a>00258 }
<a name="l00259"></a>00259 value = ( value >> 1 );
<a name="l00260"></a>00260 }
<a name="l00261"></a>00261
<a name="l00262"></a>00262 <span class="comment">// Is it a command or data</span>
<a name="l00263"></a>00263 <span class="comment">// -----------------------</span>
<a name="l00264"></a>00264 mode = ( mode == <a class="code" href="_l_c_d_8h.html#aad9ae913bdfab20dd94ad04ee2d5b045">DATA</a> ) ? _Rs : 0;
<a name="l00265"></a>00265
<a name="l00266"></a>00266 pinMapValue |= mode | _backlightStsMask;
<a name="l00267"></a>00267 loadSR ( pinMapValue | _En ); <span class="comment">// Send with enable high</span>
<a name="l00268"></a>00268 loadSR ( pinMapValue); <span class="comment">// Send with enable low</span>
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270
<a name="l00271"></a>00271
<a name="l00272"></a>00272 <span class="keywordtype">void</span> LiquidCrystal_SR3W::loadSR(uint8_t value)
<a name="l00273"></a>00273 {
<a name="l00274"></a>00274 <span class="comment">// Load the shift register with information</span>
<a name="l00275"></a>00275 <a class="code" href="_fast_i_o_8cpp.html#a56c72b9f00680662229895ab22aaa743">fio_shiftOut</a>(_data_reg, _data, _clk_reg, _clk, value, MSBFIRST);
<a name="l00276"></a>00276
<a name="l00277"></a>00277 <span class="comment">// Strobe the data into the latch</span>
<a name="l00278"></a>00278 <a class="code" href="_fast_i_o_8h.html#a04971fe5fabe4129736708c494e08e6d">ATOMIC_BLOCK</a>(<a class="code" href="_fast_i_o_8h.html#a362c18b15a09703e42e1c246c47420ef">ATOMIC_RESTORESTATE</a>)
<a name="l00279"></a>00279 {
<a name="l00280"></a>00280 <a class="code" href="_fast_i_o_8h.html#a89e1c62276052100c62b6c82a2e95622">fio_digitalWrite_HIGH</a>(_strobe_reg, _strobe);
<a name="l00281"></a>00281 <a class="code" href="_fast_i_o_8h.html#accae9687fdfc5f3492fb6344d62eb190">fio_digitalWrite_SWITCHTO</a>(_strobe_reg, _strobe, LOW);
<a name="l00282"></a>00282 }
<a name="l00283"></a>00283 }
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Apr 5 2012 18:17:46 for LCD Library by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
| {
"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;
iasio->Release();
lpdrv->asiodrv = 0;
}
}
return 0;
}
LONG AsioDriverList::asioGetDriverName (int drvID,char *drvname,int drvnamesize)
{
LPASIODRVSTRUCT lpdrv = 0;
if (!drvname) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (strlen(lpdrv->drvname) < (unsigned int)drvnamesize) {
strcpy(drvname,lpdrv->drvname);
}
else {
memcpy(drvname,lpdrv->drvname,drvnamesize-4);
drvname[drvnamesize-4] = '.';
drvname[drvnamesize-3] = '.';
drvname[drvnamesize-2] = '.';
drvname[drvnamesize-1] = 0;
}
return 0;
}
return DRVERR_DEVICE_NOT_FOUND;
}
LONG AsioDriverList::asioGetDriverPath (int drvID,char *dllpath,int dllpathsize)
{
LPASIODRVSTRUCT lpdrv = 0;
if (!dllpath) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (strlen(lpdrv->dllpath) < (unsigned int)dllpathsize) {
strcpy(dllpath,lpdrv->dllpath);
return 0;
}
dllpath[0] = 0;
return DRVERR_INVALID_PARAM;
}
return DRVERR_DEVICE_NOT_FOUND;
}
LONG AsioDriverList::asioGetDriverCLSID (int drvID,CLSID *clsid)
{
LPASIODRVSTRUCT lpdrv = 0;
if (!clsid) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
memcpy(clsid,&lpdrv->clsid,sizeof(CLSID));
return 0;
}
return DRVERR_DEVICE_NOT_FOUND;
}
| {
"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.$"
Route110_Text_16F1D0:: @ 816F1D0
.string "This is CYCLING ROAD.\p"
.string "If you were to ride from MAUVILLE to\n"
.string "SLATEPORT on a MACH BIKE, you would\l"
.string "be rated for the number of collisions\l"
.string "and your total time.$"
Route110_Text_16F26A:: @ 816F26A
.string "Regardless of the results, I count on\n"
.string "seeing more challenges from you.\l"
.string "Always aim higher!$"
Route110_Text_16F2C4:: @ 816F2C4
.string "On this CYCLING ROAD, those riding\n"
.string "MACH BIKES are rated for their number\l"
.string "of collisions and their total times.\p"
.string "ACRO BIKES do not qualify for rating.\n"
.string "They are easy to turn, so it's not fair.$"
Route110_Text_16F381:: @ 816F381
.string "ROUTE 110\n"
.string "{0x7A} SLATEPORT CITY$"
Route110_Text_16F39C:: @ 816F39C
.string "SEASIDE CYCLING ROAD$"
Route110_Text_16F3B1:: @ 816F3B1
.string "“TEAM {EVIL_TEAM} RULEZ!”\p"
.string "Somebody scribbled that on the sign...$"
Route110_Text_16F3E9:: @ 816F3E9
.string "ROUTE 110\n"
.string "{0x7B} ROUTE 103$"
Route110_Text_16F3FF:: @ 816F3FF
.string "SEASIDE PARKING$"
Route110_Text_16F40F:: @ 816F40F
.string "ROUTE 110\n"
.string "{0x79} MAUVILLE CITY$"
Route110_Text_16F429:: @ 816F429
.string "TRAINER TIPS\p"
.string "The foe can be made helpless by\n"
.string "paralyzing it or causing it to sleep.\p"
.string "It is an important technique for\n"
.string "POKéMON battles.$"
Route110_Text_16F4AE:: @ 816F4AE
.string "TRAINER TIPS\p"
.string "The items in the BAG can be reorganized\n"
.string "by pressing SELECT.$"
Route110_Text_16F4F7:: @ 816F4F7
.string "“Three steps {0x7C} and two steps {0x79}\n"
.string "to reach the wondrous TRICK HOUSE.”$"
Route110_Text_16F53A:: @ 816F53A
.string "THE BEST RECORD TO DATE...\p"
.string "No. of collisions: {STR_VAR_1}\p"
.string "Elapsed time: {STR_VAR_2}$"
Route110_Text_16F57C:: @ 816F57C
.string "THE BEST RECORD TO DATE...\p"
.string "No one seems to have taken the\n"
.string "challenge. There is no record...$"
UnknownString_816F5D7: @ 816F5D7
.string "I watered the plants every day.\n"
.string "They grew lots of flowers.\p"
.string "And they gave me lots of BERRIES, too.\p"
.string "Here you go!\n"
.string "You can have it!$"
UnknownString_816F657: @ 816F657
.string "I'm trying to make RED {POKEBLOCK}S!\n"
.string "I hope you do, too!$"
UnknownString_816F68A: @ 816F68A
.string "Your BAG's BERRIES POCKET is full.\p"
.string "I'll give it to you another time.$"
UnknownString_816F6CF: @ 816F6CF
.string "I'm going to look for red BERRIES to\n"
.string "make RED {POKEBLOCK}S.$"
| {
"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);
}
}
@Override
public void set(Collection<AttributeDefRef> facetDefRefs, AttributeSet attributeSet) throws QuickFixException {
RootDefinition rootDef = getRootDefinition();
Map<DefDescriptor<AttributeDef>, AttributeDef> attrs = rootDef.getAttributeDefs();
Map<DefDescriptor<?>, Object> lookup = Maps.newHashMap();
for (Attribute attribute : attributeSet) {
lookup.put(Aura.getDefinitionService().getDefDescriptor(attribute.getName(), AttributeDef.class), attribute);
}
for (AttributeDefRef attributeDefRef : facetDefRefs) {
lookup.put(attributeDefRef.getDescriptor(), attributeDefRef);
}
for (DefDescriptor<AttributeDef> desc : attrs.keySet()) {
Object val = lookup.get(desc);
if (val != null) {
if (val instanceof Attribute) {
Attribute attribute = (Attribute) val;
setExpression(attribute.getDescriptor(), new PropertyReferenceImpl("v." + attribute.getName(),
SUPER_PASSTHROUGH));
} else if (val instanceof AttributeDefRef) {
set((AttributeDefRef) val);
}
}
}
}
@Override
public void set(Map<String, Object> attributeMap) throws QuickFixException {
if (attributeMap != null) {
Map<DefDescriptor<AttributeDef>, AttributeDef> attrs = getRootDefinition().getAttributeDefs();
for (Map.Entry<String, Object> entry : attributeMap.entrySet()) {
try {
DefDescriptor<AttributeDef> desc = Aura.getDefinitionService().getDefDescriptor(entry.getKey(), AttributeDef.class);
if (attrs.containsKey(desc)) {
setExpression(desc, entry.getValue());
}
} catch (AuraRuntimeException arex) {
throw new InvalidDefinitionException("Error setting attribute: " + entry.getKey(), new Location(this.parent.getDescriptor().toString(), 0), arex);
}
}
}
}
@Override
public Object getValue(String name) throws QuickFixException {
PropertyReference expr = getPropertyReferenceByName(name);
return getValue(expr);
}
/**
* Returns raw object instead of evaluated value of attribute
*
* @param name
* @return Raw Object from attributes map
* @throws QuickFixException
*/
@Override
public Object getRawValue(String name) throws QuickFixException {
PropertyReference expr = getPropertyReferenceByName(name);
return getExpression(expr.getRoot());
}
@Override
public <T> T getValue(String name, Class<T> clazz) throws QuickFixException {
Object val = getValue(name);
if (val == null) {
return null;
}
try {
return clazz.cast(val);
} catch (ClassCastException cce) {
throw new AuraRuntimeException("attribute <" + name + "> is of the wrong type: expected "
+ clazz.getName() + " but got " + val.getClass().getName());
}
}
@Override
public Object getExpression(String name) {
DefDescriptor<AttributeDef> desc = Aura.getDefinitionService().getDefDescriptor(name, AttributeDef.class);
Attribute at = attributes.get(desc);
if (at != null) {
return at.getValue();
}
return null;
}
private void setExpression(DefDescriptor<AttributeDef> desc, Object value) throws QuickFixException {
RootDefinition rd = getRootDefinition();
AttributeDef ad = rd.getAttributeDefs().get(desc);
if (ad == null) {
// this location isn't even close to right...
throw new InvalidDefinitionException(String.format("Attribute %s not defined on %s", desc.getName(),
rootDefDescriptor.getName()), rd.getLocation());
}
AttributeImpl att = new AttributeImpl(desc);
if (value instanceof Expression) {
att.setValue(value);
} else {
InstanceStack iStack = Aura.getContextService().getCurrentContext().getInstanceStack();
iStack.markParent(parent);
iStack.setAttributeName(desc.toString());
if (valueProvider != null) {
iStack.pushAccess(valueProvider);
}
att.setValue(getRootDefinition().getAttributeDef(att.getName()).getTypeDef().initialize(value, null));
if (valueProvider != null) {
iStack.popAccess(valueProvider);
}
iStack.clearAttributeName(desc.toString());
iStack.clearParent(parent);
}
set(att);
}
/**
* Due to dynamic providers, we need to fetch definition each time when setting attributes.
*
* TODO: Why?
*
* @return Definition
* @throws QuickFixException
*/
private RootDefinition getRootDefinition() throws QuickFixException {
DefinitionService definitionService = Aura.getDefinitionService();
if (this.useUnlinkedDefinition) {
// when serializing module instances, we normalize attributes with the component,
// but the def should be stored in context cache as it will be serialized to the client
return definitionService.getUnlinkedDefinition(rootDefDescriptor);
} else {
return definitionService.getDefinition(rootDefDescriptor);
}
}
@Override
public Object getValue(PropertyReference expr) throws QuickFixException {
Object value = getExpression(expr.getRoot());
PropertyReference stem = expr.getStem();
if (value instanceof Expression) {
value = ((Expression) value).evaluate(valueProvider);
}
if (value instanceof ValueProvider && stem != null) {
value = ((ValueProvider) value).getValue(stem);
} else if (stem != null) {
AttributeDef attributeDef = getRootDefinition().getAttributeDef(expr.getRoot());
if (attributeDef == null) {
// no such attribute.
throw new NoAccessException("No attribute "+expr.getRoot()+" in "+rootDefDescriptor);
}
value = attributeDef.getTypeDef().wrap(value);
if (value instanceof ValueProvider) {
value = ((ValueProvider) value).getValue(stem);
}
}
if (value instanceof Wrapper) {
value = ((Wrapper) value).unwrap();
}
return value;
}
@Override
public void serialize(Json json) throws IOException {
try {
json.writeMapBegin();
json.writeMapEntry("valueProvider", valueProvider);
if (!attributes.isEmpty()) {
RootDefinition def = getRootDefinition();
json.writeMapKey("values");
json.writeMapBegin();
for (Attribute attribute : attributes.values()) {
String name = attribute.getName();
AttributeDef attributeDef = def.getAttributeDef(name);
if (attributeDef == null) {
throw new AttributeNotFoundException(rootDefDescriptor, name, def.getLocation());
}
if (attributeDef.getSerializeTo() == AttributeDef.SerializeToType.BOTH) {
TypeDef typeDef = attributeDef.getTypeDef();
if ((valueProvider == null && !((typeDef instanceof ComponentArrayTypeDef) || (typeDef instanceof ComponentTypeDef)))
|| attribute.isDirty()) {
json.writeMapEntry(name, attribute.getValue());
}
}
}
json.writeMapEnd();
}
if (!events.isEmpty()) {
json.writeMapEntry("events", events);
}
json.writeMapEnd();
} catch (QuickFixException e) {
throw new AuraUnhandledException("unhandled exception", e);
}
}
@Override
public int size() {
return attributes.size();
}
/**
* @return Returns the valueProvider.
*/
@Override
public BaseComponent<?, ?> getValueProvider() {
return valueProvider;
}
@Override
public Iterator<Attribute> iterator() {
return attributes.values().iterator();
}
@Override
public boolean isEmpty() {
return attributes.isEmpty() && events.isEmpty();
}
@Override
public void startTrackingDirtyValues() {
trackDirty = true;
}
@Override
public void validate() throws QuickFixException {
Set<AttributeDef> missingAttributes = this.getMissingAttributes();
if (missingAttributes != null && !missingAttributes.isEmpty()) {
throw new MissingRequiredAttributeException(rootDefDescriptor, missingAttributes.iterator().next()
.getName());
}
}
@Override
public Set<AttributeDef> getMissingAttributes() throws QuickFixException {
Map<DefDescriptor<AttributeDef>, AttributeDef> attrs = getRootDefinition().getAttributeDefs();
Set<AttributeDef> missingAttributes = null;
for (Map.Entry<DefDescriptor<AttributeDef>, AttributeDef> attr : attrs.entrySet()) {
if (attr.getValue().isRequired() && !attributes.containsKey(attr.getKey())) {
if (missingAttributes == null) {
missingAttributes = new HashSet<>(attrs.entrySet().size());
}
missingAttributes.add(attr.getValue());
}
}
return missingAttributes;
}
private PropertyReference getPropertyReferenceByName(String name) throws InvalidDefinitionException {
PropertyReference expr = new PropertyReferenceImpl(name,
AuraUtil.getExternalLocation("direct attributeset access"));
if (expr.size() != 1) {
throw new InvalidDefinitionException("No dots allowed", expr.getLocation());
}
return expr;
}
}
| {
"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" class="form-control" id="inputNs3" name="domainns3" value="{$domainns3}" />
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="inputNs1">{$LANG.domainnameserver4}</label>
<input type="text" class="form-control" id="inputNs4" name="domainns4" value="{$domainns4}" />
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label for="inputNs5">{$LANG.domainnameserver5}</label>
<input type="text" class="form-control" id="inputNs5" name="domainns5" value="{$domainns5}" />
</div>
</div>
</div>
{/if}
<div class="text-center">
<button type="submit" class="btn btn-primary btn-lg">
{$LANG.continue}
<i class="fa fa-arrow-circle-right"></i>
</button>
</div>
</form>
</div>
</div>
</div>
| {
"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" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "[email protected]"
}
],
"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 datareader_properties;
DDS_Security_EndpointSecurityAttributes datareader_security_attributes;
local_datareader_crypto *reader_crypto;
/* Check if we actually have the function. */
CU_ASSERT_FATAL(crypto != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory->register_local_datareader != NULL);
memset(&exception, 0, sizeof(DDS_Security_SecurityException));
memset(&datareader_properties, 0, sizeof(datareader_properties));
prepare_endpoint_security_attributes(&datareader_security_attributes);
/* Now call the function. */
result = crypto->crypto_key_factory->register_local_datareader(
crypto->crypto_key_factory,
local_participant_crypto_handle,
&datareader_properties,
&datareader_security_attributes,
&exception);
/* A valid handle to be returned */
CU_ASSERT(result != 0);
assert(result != 0); // for Clang's static analyzer
CU_ASSERT(exception.code == DDS_SECURITY_ERR_OK_CODE);
/* NOTE: It would be better to check if the keys have been generated but there is no interface to get them from handle */
reader_crypto = (local_datareader_crypto *)result;
CU_ASSERT_FATAL(reader_crypto->reader_key_material != NULL);
CU_ASSERT(master_salt_not_empty(reader_crypto->reader_key_material));
CU_ASSERT(master_key_not_empty(reader_crypto->reader_key_material));
CU_ASSERT(reader_crypto->metadata_protectionKind == DDS_SECURITY_PROTECTION_KIND_ENCRYPT);
reset_exception(&exception);
}
CU_Test(ddssec_builtin_register_local_datareader, builtin_endpoint, .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 datareader_properties;
DDS_Security_EndpointSecurityAttributes datareader_security_attributes;
local_datareader_crypto *reader_crypto;
memset(&exception, 0, sizeof(DDS_Security_SecurityException));
memset(&datareader_properties, 0, sizeof(datareader_properties));
/* Check if we actually have the function. */
CU_ASSERT_FATAL(crypto != NULL);
assert(crypto != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory != NULL);
assert(crypto->crypto_key_factory != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory->register_local_datareader != NULL);
assert(crypto->crypto_key_factory->register_local_datareader != 0);
datareader_properties._buffer = DDS_Security_PropertySeq_allocbuf(1);
datareader_properties._length = datareader_properties._maximum = 1;
datareader_properties._buffer[0].name = ddsrt_strdup("dds.sec.builtin_endpoint_name");
datareader_properties._buffer[0].value = ddsrt_strdup("BuiltinSecureEndpointName");
prepare_endpoint_security_attributes(&datareader_security_attributes);
/* Now call the function. */
result = crypto->crypto_key_factory->register_local_datareader(
crypto->crypto_key_factory,
local_participant_crypto_handle,
&datareader_properties,
&datareader_security_attributes,
&exception);
if (exception.code != 0)
printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing");
/* A valid handle to be returned */
CU_ASSERT(result != 0);
CU_ASSERT(exception.code == DDS_SECURITY_ERR_OK_CODE);
assert(result != 0); // for Clang's static analyzer
/* NOTE: It would be better to check if the keys have been generated but there is no interface to get them from handle */
reader_crypto = (local_datareader_crypto *)result;
CU_ASSERT_FATAL(reader_crypto->reader_key_material != NULL);
CU_ASSERT(master_salt_not_empty(reader_crypto->reader_key_material));
CU_ASSERT(master_key_not_empty(reader_crypto->reader_key_material));
CU_ASSERT(reader_crypto->metadata_protectionKind == DDS_SECURITY_PROTECTION_KIND_ENCRYPT);
CU_ASSERT(reader_crypto->is_builtin_participant_volatile_message_secure_reader == false);
DDS_Security_PropertySeq_deinit(&datareader_properties);
reset_exception(&exception);
}
CU_Test(ddssec_builtin_register_local_datareader, special_endpoint_name, .init = suite_register_local_datareader_init, .fini = suite_register_local_datareader_fini)
{
DDS_Security_DatareaderCryptoHandle result;
DDS_Security_SecurityException exception = {NULL, 0, 0};
DDS_Security_PropertySeq datareader_properties;
DDS_Security_EndpointSecurityAttributes datareader_security_attributes;
memset(&exception, 0, sizeof(DDS_Security_SecurityException));
memset(&datareader_properties, 0, sizeof(datareader_properties));
/* Check if we actually have the function. */
CU_ASSERT_FATAL(crypto != NULL);
assert(crypto != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory != NULL);
assert(crypto->crypto_key_factory != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory->register_local_datareader != NULL);
assert(crypto->crypto_key_factory->register_local_datareader != 0);
/*set special endpoint name*/
datareader_properties._buffer = DDS_Security_PropertySeq_allocbuf(1);
datareader_properties._length = datareader_properties._maximum = 1;
datareader_properties._buffer[0].name = ddsrt_strdup("dds.sec.builtin_endpoint_name");
datareader_properties._buffer[0].value = ddsrt_strdup("BuiltinParticipantVolatileMessageSecureReader");
prepare_endpoint_security_attributes(&datareader_security_attributes);
/* Now call the function. */
result = crypto->crypto_key_factory->register_local_datareader(
crypto->crypto_key_factory,
local_participant_crypto_handle,
&datareader_properties,
&datareader_security_attributes,
&exception);
if (exception.code != 0)
printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing");
/* A valid handle to be returned */
CU_ASSERT_FATAL(result != 0);
assert(result != 0); // for Clang's static analyzer
CU_ASSERT_FATAL(exception.code == DDS_SECURITY_ERR_OK_CODE);
CU_ASSERT_FATAL(((local_datareader_crypto *)result)->is_builtin_participant_volatile_message_secure_reader);
reset_exception(&exception);
DDS_Security_PropertySeq_deinit(&datareader_properties);
}
CU_Test(ddssec_builtin_register_local_datareader, invalid_participant, .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 datareader_properties;
DDS_Security_EndpointSecurityAttributes datareader_security_attributes;
/* Check if we actually have the function. */
CU_ASSERT_FATAL(crypto != NULL);
assert(crypto != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory != NULL);
assert(crypto->crypto_key_factory != NULL);
CU_ASSERT_FATAL(crypto->crypto_key_factory->register_local_datareader != NULL);
assert(crypto->crypto_key_factory->register_local_datareader != 0);
memset(&exception, 0, sizeof(DDS_Security_SecurityException));
memset(&datareader_properties, 0, sizeof(datareader_properties));
prepare_endpoint_security_attributes(&datareader_security_attributes);
/* Now call the function. */
result = crypto->crypto_key_factory->register_local_datareader(
crypto->crypto_key_factory,
8, /*non existing handle*/
&datareader_properties,
&datareader_security_attributes,
&exception);
/* Invalid handle should be returned */
CU_ASSERT(result == 0);
CU_ASSERT_FATAL(exception.code == DDS_SECURITY_ERR_INVALID_CRYPTO_HANDLE_CODE);
CU_ASSERT_NSTRING_EQUAL_FATAL(exception.message, DDS_SECURITY_ERR_INVALID_CRYPTO_HANDLE_MESSAGE, sizeof(DDS_SECURITY_ERR_INVALID_CRYPTO_HANDLE_MESSAGE));
reset_exception(&exception);
}
| {
"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
}
/**
* @param typeWriters
* @param mediaType
* @param reference
*/
private void updateTypeWriter(Map<MediaType,List<ServiceReference>> typeWriters,
MediaType mediaType,
ServiceReference reference) {
List<ServiceReference> l = typeWriters.get(mediaType);
if(l != null && l.contains(reference)){
Collections.sort(l); //maybe service.ranking has changed
}
}
public ModelWriterTracker(BundleContext context) {
super(context, ModelWriter.class.getName(), null);
//add the union key value mapping
writers.put(null, new HashMap<MediaType,List<ServiceReference>>());
}
/**
* @param mts
* @return
*/
private Set<MediaType> parseMediaTypes(Collection<MediaType> mts) {
if(mts == null || mts.isEmpty()){
return Collections.emptySet();
}
Set<MediaType> mediaTypes = new HashSet<MediaType>(mts.size());
for(MediaType mt : mts){
if(mt != null){
//strip all parameters
MediaType mediaType = mt.getParameters().isEmpty() ? mt :
new MediaType(mt.getType(),mt.getSubtype());
mediaTypes.add(mediaType);
}
}
return mediaTypes;
}
/**
* Getter for a sorted list of References to {@link ModelWriter} that can
* serialise Representations to the parsed {@link MediaType}. If a
* nativeType of the Representation is given {@link ModelWriter} for that
* specific type will be preferred.
* @param mediaType The {@link MediaType}. Wildcards are supported
* @param nativeType optionally the native type of the {@link Representation}
* @return A sorted collection of references to compatible {@link ModelWriter}.
* Use {@link #getService()} to receive the actual service. However note that
* such calls may return <code>null</code> if the service was deactivated in
* the meantime.
*/
public Collection<ServiceReference> getModelWriters(MediaType mediaType, Class<? extends Representation> nativeType){
Collection<ServiceReference> refs;
String nativeTypeName = nativeType == null ? null : nativeType.getName();
CacheKey key = new CacheKey(mediaType, nativeTypeName);
lock.readLock().lock();
try {
refs = cache.get(key);
} finally {
lock.readLock().unlock();
}
if(refs == null){ //not found in cache
refs = new ArrayList<ServiceReference>();
Map<MediaType, List<ServiceReference>> typeWriters = writers.get(
nativeTypeName);
if(typeWriters != null){ //there are some native writers for this type
refs.addAll(getTypeWriters(typeWriters, mediaType));
}
if(nativeType != null){ //if we have a native type
//also add writers for the generic type to the end
refs.addAll(getTypeWriters(writers.get(null), mediaType));
}
refs = Collections.unmodifiableCollection(refs);
lock.writeLock().lock();
try {
cache.put(key, refs);
} finally {
lock.writeLock().unlock();
}
}
return refs;
}
private Collection<ServiceReference> getTypeWriters(
Map<MediaType,List<ServiceReference>> typeWriters, MediaType mediaType) {
//use a linked has set to keep order but filter duplicates
Collection<ServiceReference> refs = new LinkedHashSet<ServiceReference>();
boolean wildcard = mediaType.isWildcardSubtype() || mediaType.isWildcardType();
lock.readLock().lock();
try {
if(!wildcard){
//add writer that explicitly mention this type first
List<ServiceReference> l = typeWriters.get(mediaType);
if(l != null){
refs.addAll(l);
}
}
List<ServiceReference> wildcardMatches = null;
int count = 0;
for(Entry<MediaType,List<ServiceReference>> entry : typeWriters.entrySet()){
MediaType mt = entry.getKey();
if(mt.isCompatible(mediaType) &&
//ignore exact matches already treated above
(wildcard || !mt.equals(mediaType))){
if(count == 0){
wildcardMatches = entry.getValue();
} else {
if(count == 1){
wildcardMatches = new ArrayList<ServiceReference>(wildcardMatches);
}
wildcardMatches.addAll(entry.getValue());
}
}
}
if(count > 1){ //sort matches for different media types
Collections.sort(wildcardMatches);
}
//add wildcard matches to the linked has set
if(count > 0){
refs.addAll(wildcardMatches);
}
} finally {
lock.readLock().unlock();
}
return refs;
}
@Override
public ModelWriter getService() {
return (ModelWriter)super.getService();
}
@Override
public ModelWriter getService(ServiceReference reference) {
return (ModelWriter)super.getService(reference);
}
/**
* Used as key for {@link ModelWriterTracker#cache}
*/
private static class CacheKey {
final String nativeType;
final MediaType mediaType;
CacheKey(MediaType mediaType, String nativeType){
this.nativeType = nativeType;
this.mediaType = mediaType;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + mediaType.hashCode();
result = prime * result + ((nativeType == null) ? 0 : nativeType.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
CacheKey other = (CacheKey) obj;
if (!mediaType.equals(other.mediaType)) return false;
if (nativeType == null) {
if (other.nativeType != null) return false;
} else if (!nativeType.equals(other.nativeType)) return false;
return true;
}
}
}
| {
"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.8" y="29.3"/>
<line x="24.3" y="31"/>
<line x="25.7" y="31.2"/>
<line x="26" y="31.2"/>
<line x="26.3" y="32.9"/>
<line x="28.1" y="32.6"/>
<line x="28.7" y="34.3"/>
<line x="30.3" y="33.5"/>
<line x="31.3" y="35"/>
<line x="32.6" y="33.8"/>
<line x="34" y="35"/>
<line x="35" y="33.5"/>
<line x="36.6" y="34.3"/>
<line x="37.1" y="32.6"/>
<line x="38.9" y="32.9"/>
<line x="39.1" y="31.2"/>
<line x="39.2" y="31.2"/>
<line x="40.8" y="31"/>
<line x="40.4" y="29.3"/>
<line x="42.1" y="28.7"/>
<line x="41.3" y="27.1"/>
<line x="42.8" y="26.1"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#FFFFFF"/>
<path>
<move x="30.9" y="25.8"/>
<line x="28.4" y="23.1"/>
<line x="25.6" y="25.9"/>
<line x="25.6" y="25.9"/>
<line x="30.8" y="31.1"/>
<line x="39.6" y="22.3"/>
<line x="37.6" y="20.2"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="72.4" name="Cloud HSM" strokewidth="inherit" w="60">
<connections>
<constraint name="N" perimeter="0" x="0.5" y="0"/>
<constraint name="S" perimeter="0" x="0.5" y="1"/>
<constraint name="W" perimeter="0" x="0" y="0.5"/>
<constraint name="E" perimeter="0" x="1" y="0.5"/>
<constraint name="NW" perimeter="0" x="0" y="0.21"/>
<constraint name="NE" perimeter="0" x="1" y="0.21"/>
<constraint name="SW" perimeter="0" x="0" y="0.79"/>
<constraint name="SE" perimeter="0" x="1" y="0.79"/>
</connections>
<foreground>
<fillcolor color="#769B3F"/>
<path>
<move x="13.9" y="25.3"/>
<line x="6.1" y="24.3"/>
<line x="6.1" y="11.9"/>
<line x="13.9" y="13.9"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="46" y="23.4"/>
<line x="53.9" y="22.3"/>
<line x="53.9" y="11.9"/>
<line x="46" y="13.9"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="42.9" y="66"/>
<line x="30" y="72.4"/>
<line x="30" y="0"/>
<line x="42.9" y="6.4"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="60" y="36.2"/>
<line x="30" y="36.2"/>
<line x="30" y="14.8"/>
<line x="60" y="23.6"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="53.9" y="60.5"/>
<line x="60" y="57.4"/>
<line x="60" y="15"/>
<line x="53.9" y="11.9"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="17.3" y="66.1"/>
<line x="30" y="72.4"/>
<line x="30" y="0"/>
<line x="17.3" y="6.3"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="6.1" y="60.5"/>
<line x="0" y="57.4"/>
<line x="0" y="15"/>
<line x="6.1" y="11.9"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="0" y="57.4"/>
<line x="30" y="72.4"/>
<line x="30" y="14.8"/>
<line x="0" y="23.6"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="42.9" y="36.2"/>
<line x="53.9" y="36.2"/>
<line x="53.9" y="60.5"/>
<line x="42.9" y="57.7"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="72" name="Directory Service" strokewidth="inherit" w="59.6">
<connections>
<constraint name="N" perimeter="0" x="0.5" y="0"/>
<constraint name="S" perimeter="0" x="0.5" y="1"/>
<constraint name="W" perimeter="0" x="0" y="0.5"/>
<constraint name="E" perimeter="0" x="1" y="0.5"/>
<constraint name="NW" perimeter="0" x="0" y="0.21"/>
<constraint name="NE" perimeter="0" x="1" y="0.21"/>
<constraint name="SW" perimeter="0" x="0" y="0.79"/>
<constraint name="SE" perimeter="0" x="1" y="0.79"/>
</connections>
<foreground>
<fillcolor color="#4B612C"/>
<path>
<move x="37.1" y="36"/>
<line x="45.7" y="36"/>
<line x="45.7" y="41.6"/>
<line x="37.1" y="41.1"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="49.9" y="36"/>
<line x="55.8" y="36"/>
<line x="55.8" y="40.6"/>
<line x="49.9" y="40.3"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#759C3E"/>
<path>
<move x="24.6" y="11.4"/>
<line x="13.9" y="8"/>
<line x="13.9" y="41.6"/>
<line x="24.6" y="40.9"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="11.1" y="14.7"/>
<line x="3.8" y="13"/>
<line x="3.8" y="40.6"/>
<line x="11.1" y="40.3"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="59.6" y="48.7"/>
<line x="29.8" y="57.6"/>
<line x="29.8" y="72"/>
<line x="59.6" y="57.1"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4B612C"/>
<path>
<move x="20.9" y="4.5"/>
<line x="29.8" y="0"/>
<line x="29.8" y="43.2"/>
<line x="20.9" y="42.3"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="0" y="48.7"/>
<line x="29.8" y="57.6"/>
<line x="29.8" y="72"/>
<line x="0" y="57.1"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="8.4" y="10.7"/>
<line x="13.9" y="7.9"/>
<line x="13.9" y="41.6"/>
<line x="8.4" y="41.1"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="0" y="14.9"/>
<line x="3.8" y="13"/>
<line x="3.8" y="40.6"/>
<line x="0" y="40.2"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#B7CA9D"/>
<path>
<move x="59.6" y="48.7"/>
<line x="29.8" y="44.9"/>
<line x="0" y="48.7"/>
<line x="29.8" y="57.6"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#759C3E"/>
<path>
<move x="38.7" y="4.5"/>
<line x="29.8" y="0"/>
<line x="29.8" y="43.2"/>
<line x="38.7" y="42.3"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="55.8" y="19.8"/>
<line x="59.6" y="21.1"/>
<line x="59.6" y="40.2"/>
<line x="55.8" y="40.6"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="51.2" y="30.9"/>
<line x="45.7" y="30.4"/>
<line x="45.7" y="41.6"/>
<line x="51.2" y="41.1"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="29.8" y="0"/>
<line x="59.6" y="14.9"/>
<line x="59.6" y="36"/>
<line x="29.8" y="36"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="82.4" name="Key Management Service" strokewidth="inherit" w="68.2">
<connections>
<constraint name="N" perimeter="0" x="0.5" y="0"/>
<constraint name="S" perimeter="0" x="0.5" y="1"/>
<constraint name="W" perimeter="0" x="0" y="0.45"/>
<constraint name="E" perimeter="0" x="1" y="0.45"/>
<constraint name="NW" perimeter="0" x="0" y="0.21"/>
<constraint name="NE" perimeter="0" x="1" y="0.21"/>
<constraint name="SW" perimeter="0" x="0.2" y="0.8"/>
<constraint name="SE" perimeter="0" x="0.8" y="0.8"/>
</connections>
<foreground>
<fillcolor color="#769B3F"/>
<path>
<move x="14.4" y="25.8"/>
<line x="6.8" y="24.6"/>
<line x="6.8" y="13.7"/>
<line x="17" y="16.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="14.9" y="27.2"/>
<line x="0" y="28.5"/>
<line x="0" y="17.1"/>
<line x="6.8" y="13.7"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="53.8" y="25.8"/>
<line x="61.4" y="24.6"/>
<line x="61.4" y="13.7"/>
<line x="51.2" y="16.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="53.3" y="27.2"/>
<line x="68.2" y="28.5"/>
<line x="68.2" y="17.1"/>
<line x="61.4" y="13.7"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="19.7" y="7.2"/>
<line x="11.9" y="23.2"/>
<line x="11.9" y="23.2"/>
<line x="0" y="26.7"/>
<line x="0" y="36.9"/>
<line x="13.8" y="66.4"/>
<line x="34.1" y="82.4"/>
<line x="34.1" y="65.9"/>
<line x="34.1" y="16.5"/>
<line x="34.1" y="0"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="68.2" y="36.9"/>
<line x="68.2" y="26.7"/>
<line x="56.3" y="23.2"/>
<line x="56.3" y="23.2"/>
<line x="48.5" y="7.2"/>
<line x="34.1" y="0"/>
<line x="34.1" y="16.5"/>
<line x="34.1" y="65.9"/>
<line x="34.1" y="82.4"/>
<line x="54.4" y="66.4"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="82.4" name="Service Catalog" strokewidth="inherit" w="68.2">
<connections>
<constraint name="N" perimeter="0" x="0.5" y="0"/>
<constraint name="S" perimeter="0" x="0.5" y="1"/>
<constraint name="W" perimeter="0" x="0.29" y="0.5"/>
<constraint name="E" perimeter="0" x="0.71" y="0.5"/>
<constraint name="NW" perimeter="0" x="0.29" y="0.09"/>
<constraint name="NE" perimeter="0" x="0.71" y="0.09"/>
<constraint name="SW" perimeter="0" x="0" y="0.79"/>
<constraint name="SE" perimeter="0" x="1" y="0.79"/>
</connections>
<foreground>
<fillcolor color="#B6C99C"/>
<path>
<move x="68.2" y="59.1"/>
<line x="34" y="52.7"/>
<line x="0" y="59.1"/>
<line x="34" y="73.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="0" y="59.1"/>
<line x="0" y="65.3"/>
<line x="4.4" y="67.5"/>
<line x="34.1" y="82.4"/>
<line x="34.1" y="72"/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="68.2" y="59.1"/>
<line x="68.2" y="65.3"/>
<line x="63.8" y="67.5"/>
<line x="34.1" y="82.4"/>
<line x="34.1" y="72"/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="19.7" y="61.6"/>
<line x="34.1" y="65.9"/>
<line x="34.1" y="53.6"/>
<line x="19.7" y="51.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="48.5" y="61.6"/>
<line x="34.1" y="65.9"/>
<line x="34.1" y="53.6"/>
<line x="48.5" y="51.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="19.7" y="7.3"/>
<line x="34.1" y="0"/>
<line x="34.1" y="46.5"/>
<line x="19.7" y="45.3"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="48.5" y="45.3"/>
<line x="34.1" y="46.5"/>
<line x="34.1" y="0"/>
<line x="48.5" y="7.3"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#B6C99C"/>
<path>
<move x="34.1" y="50"/>
<line x="48.5" y="51.5"/>
<line x="34.1" y="53.6"/>
<line x="19.7" y="51.5"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
<shape aspect="variable" h="82.4" name="WebApp Firewall" strokewidth="inherit" w="68.2">
<connections>
<constraint name="N" perimeter="0" x="0.5" y="0"/>
<constraint name="S" perimeter="0" x="0.5" y="1"/>
<constraint name="W" perimeter="0" x="0" y="0.56"/>
<constraint name="E" perimeter="0" x="1" y="0.56"/>
<constraint name="NW" perimeter="0" x="0.29" y="0.09"/>
<constraint name="NE" perimeter="0" x="0.71" y="0.09"/>
<constraint name="SW" perimeter="0" x="0" y="0.79"/>
<constraint name="SE" perimeter="0" x="1" y="0.79"/>
</connections>
<foreground>
<fillcolor color="#4C612C"/>
<path>
<move x="19.7" y="61.6"/>
<line x="34.1" y="65.9"/>
<line x="34.1" y="0"/>
<line x="19.7" y="7.2"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="48.5" y="61.6"/>
<line x="34.1" y="65.9"/>
<line x="34.1" y="0"/>
<line x="48.5" y="7.2"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="58.4" y="55.8"/>
<line x="63.8" y="56.5"/>
<line x="63.8" y="46.5"/>
<line x="58.4" y="46.2"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="9.8" y="55.8"/>
<line x="4.4" y="56.5"/>
<line x="4.4" y="46.5"/>
<line x="9.8" y="46.2"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#B6C99C"/>
<path>
<move x="33.5" y="55.4"/>
<line x="9.6" y="51.2"/>
<line x="4.4" y="51.7"/>
<line x="27.6" y="56.4"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="68.2" y="50.8"/>
<line x="34.1" y="57.7"/>
<line x="34.1" y="82.4"/>
<line x="68.2" y="65.3"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="63.8" y="46.5"/>
<line x="68.2" y="46"/>
<line x="68.2" y="65.3"/>
<line x="63.8" y="67.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#B6C99C"/>
<path>
<move x="68.2" y="46"/>
<line x="63" y="45.8"/>
<line x="58.4" y="46.2"/>
<line x="63.8" y="46.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#4C612C"/>
<path>
<move x="0" y="50.8"/>
<line x="34.1" y="57.7"/>
<line x="34.1" y="82.4"/>
<line x="0" y="65.3"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="23.9" y="77.3"/>
<line x="34.1" y="82.4"/>
<line x="34.1" y="49.4"/>
<line x="23.9" y="48.4"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="4.4" y="46.5"/>
<line x="0" y="46"/>
<line x="0" y="65.3"/>
<line x="4.4" y="67.5"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#B6C99C"/>
<path>
<move x="0" y="46"/>
<line x="5.2" y="45.8"/>
<line x="9.8" y="46.2"/>
<line x="4.4" y="46.5"/>
<close/>
</path>
<fillstroke/>
<path>
<move x="34.1" y="55.5"/>
<line x="39.9" y="56.5"/>
<line x="63.8" y="51.7"/>
<line x="58.7" y="51.2"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#769B3F"/>
<path>
<move x="44.3" y="76.5"/>
<line x="34.1" y="81.6"/>
<line x="34.1" y="48.6"/>
<line x="44.3" y="47.6"/>
<close/>
</path>
<fillstroke/>
<fillcolor color="#B6C99C"/>
<path>
<move x="44.3" y="48.4"/>
<line x="34.1" y="47.6"/>
<line x="23.9" y="48.4"/>
<line x="34.1" y="49.4"/>
<close/>
</path>
<fillstroke/>
</foreground>
</shape>
</shapes> | {
"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"
} |