text
stringlengths 2
99.9k
| meta
dict |
|---|---|
{
"100": "Continue",
"101": "Switching Protocols",
"102": "Processing",
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-Authoritative Information",
"204": "No Content",
"205": "Reset Content",
"206": "Partial Content",
"207": "Multi-Status",
"208": "Already Reported",
"226": "IM Used",
"300": "Multiple Choices",
"301": "Moved Permanently",
"302": "Found",
"303": "See Other",
"304": "Not Modified",
"305": "Use Proxy",
"306": "(Unused)",
"307": "Temporary Redirect",
"308": "Permanent Redirect",
"400": "Bad Request",
"401": "Unauthorized",
"402": "Payment Required",
"403": "Forbidden",
"404": "Not Found",
"405": "Method Not Allowed",
"406": "Not Acceptable",
"407": "Proxy Authentication Required",
"408": "Request Timeout",
"409": "Conflict",
"410": "Gone",
"411": "Length Required",
"412": "Precondition Failed",
"413": "Payload Too Large",
"414": "URI Too Long",
"415": "Unsupported Media Type",
"416": "Range Not Satisfiable",
"417": "Expectation Failed",
"418": "I'm a teapot",
"421": "Misdirected Request",
"422": "Unprocessable Entity",
"423": "Locked",
"424": "Failed Dependency",
"425": "Unordered Collection",
"426": "Upgrade Required",
"428": "Precondition Required",
"429": "Too Many Requests",
"431": "Request Header Fields Too Large",
"451": "Unavailable For Legal Reasons",
"500": "Internal Server Error",
"501": "Not Implemented",
"502": "Bad Gateway",
"503": "Service Unavailable",
"504": "Gateway Timeout",
"505": "HTTP Version Not Supported",
"506": "Variant Also Negotiates",
"507": "Insufficient Storage",
"508": "Loop Detected",
"509": "Bandwidth Limit Exceeded",
"510": "Not Extended",
"511": "Network Authentication Required"
}
|
{
"pile_set_name": "Github"
}
|
{
"acno": "D32821",
"acquisitionYear": 1856,
"all_artists": "Joseph Mallord William Turner",
"catalogueGroup": {
"accessionRanges": "D32756-D32779; D32781-D32814; D32816-D32835; D32837-D32846; D32848-D32853; D32855-D32880; D41148-D41149",
"completeStatus": "COMPLETE",
"finbergNumber": "CCCXXV",
"groupType": "Turner Sketchbook",
"id": 65949,
"shortTitle": "Rhine and Switzerland Sketchbook"
},
"classification": "on paper, unique",
"contributorCount": 1,
"contributors": [
{
"birthYear": 1775,
"date": "1775\u20131851",
"displayOrder": 1,
"fc": "Joseph Mallord William Turner",
"gender": "Male",
"id": 558,
"mda": "Turner, Joseph Mallord William",
"role": "artist",
"startLetter": "T"
}
],
"creditLine": "Accepted by the nation as part of the Turner Bequest 1856",
"dateRange": {
"endYear": 1841,
"startYear": 1837,
"text": "c.1837-41"
},
"dateText": "c.1837\u201341",
"depth": "",
"dimensions": "support: 90 x 113 mm",
"finberg": "CCCXXV 36 a",
"foreignTitle": null,
"groupTitle": "Rhine and Switzerland Sketchbook",
"height": "113",
"id": 60012,
"inscription": null,
"medium": "Graphite on paper",
"movementCount": 0,
"pageNumber": 74,
"subjectCount": 2,
"subjects": {
"children": [
{
"children": [
{
"children": [
{
"id": 1065,
"name": "tower"
}
],
"id": 17,
"name": "features"
},
{
"children": [
{
"id": 989,
"name": "townscape, distant"
}
],
"id": 28,
"name": "townscapes, man-made features"
}
],
"id": 13,
"name": "architecture"
}
],
"id": 1,
"name": "subject"
},
"thumbnailCopyright": null,
"thumbnailUrl": "http://www.tate.org.uk/art/images/work/D/D32/D32821_8.jpg",
"title": "View of Buildings, Etc.",
"units": "mm",
"url": "http://www.tate.org.uk/art/artworks/turner-view-of-buildings-etc-d32821",
"width": "90"
}
|
{
"pile_set_name": "Github"
}
|
# This source code refers to The Go Authors for copyright purposes.
# The master list of authors is in the main Go distribution,
# visible at http://tip.golang.org/AUTHORS.
|
{
"pile_set_name": "Github"
}
|
using System.Drawing;
using System.Windows.Forms;
using Terminals.Common.Properties;
using Terminals.Data;
namespace Terminals.Connections
{
public class Connection : Control, IConnection
{
// cached images, bad performace, but simplifies check, if the image is known
public static readonly Image Terminalsicon = Resources.terminalsicon;
public delegate void LogHandler(string entry);
public event LogHandler OnLog;
public delegate void Disconnected(Connection connection);
public event Disconnected OnDisconnected;
public string LastError { get; protected set; }
public virtual bool Connected
{
get; private set;
}
/// <summary>
/// Gets or sets the associated favorite.
/// If the connection is virtual, it doesnt have any favorite, so it can be null.
/// </summary>
public IFavorite Favorite { get; set; }
/// <summary>
/// Gets or sets the original Favorite used create this connection.
/// It can be null in case Adhoc connection, which user doesnt want to save.
/// </summary>
public IFavorite OriginFavorite { get; set; }
public IConnectionMainView ParentForm { get; set; }
public IGuardedCredentialFactory CredentialFactory { get; set; }
/// <summary>
/// Create this control doesnt mean to open the connection.
/// Use explicit call instead. Because there may be related resources,
/// call Dispose to close the connection to prevent memory leak.
/// </summary>
public virtual bool Connect()
{
return true;
}
protected void Log(string text)
{
if (this.OnLog != null)
this.OnLog(text);
}
/// <summary>
/// Default empty implementation to be overriden by connection
/// </summary>
public virtual void ChangeDesktopSize(DesktopSize size)
{
}
/// <summary>
/// Avoid to call remove the tab control from connection.
/// Instead we are going to fire event to the MainForm, which will do for us:
/// - remove the tab
/// - Close the connection, when necessary
/// - and finally the expected Dispose of Disposable resources
/// After that the connection wouldnt need reference to the TabControl and MainForm.
/// </summary>
protected void FireDisconnected()
{
if (this.OnDisconnected != null)
this.OnDisconnected(this);
}
protected IGuardedSecurity ResolveFavoriteCredentials()
{
IGuardedSecurity security = this.CredentialFactory.CreateSecurityOptoins(this.Favorite.Security);
return security.GetResolvedCredentials();
}
}
}
|
{
"pile_set_name": "Github"
}
|
# Copyright 2019 BDL Benchmarks Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Script for training and evaluating a deterministic baseline for Diabetic
Retinopathy Diagnosis benchmark."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
import tensorflow as tf
from absl import app
from absl import flags
from absl import logging
import bdlb
from baselines.diabetic_retinopathy_diagnosis.deterministic.model import \
predict
from baselines.diabetic_retinopathy_diagnosis.mc_dropout.model import VGGDrop
from bdlb.core import plotting
tfk = tf.keras
##########################
# Command line arguments #
##########################
FLAGS = flags.FLAGS
flags.DEFINE_string(
name="output_dir",
default="/tmp",
help="Path to store model, tensorboard and report outputs.",
)
flags.DEFINE_enum(
name="level",
default="medium",
enum_values=["realworld", "medium"],
help="Downstream task level, one of {'medium', 'realworld'}.",
)
flags.DEFINE_integer(
name="batch_size",
default=128,
help="Batch size used for training.",
)
flags.DEFINE_integer(
name="num_epochs",
default=50,
help="Number of epochs of training over the whole training set.",
)
flags.DEFINE_enum(
name="uncertainty",
default="entropy",
enum_values=["stddev", "entropy"],
help="Uncertainty type, one of those defined "
"with `estimator` function.",
)
flags.DEFINE_integer(
name="num_base_filters",
default=32,
help="Number of base filters in convolutional layers.",
)
flags.DEFINE_float(
name="learning_rate",
default=4e-4,
help="ADAM optimizer learning rate.",
)
flags.DEFINE_float(
name="dropout_rate",
default=0.1,
help="The rate of dropout, between [0.0, 1.0).",
)
flags.DEFINE_float(
name="l2_reg",
default=5e-5,
help="The L2-regularization coefficient.",
)
def main(argv):
print(argv)
print(FLAGS)
##########################
# Hyperparmeters & Model #
##########################
input_shape = dict(medium=(256, 256, 3), realworld=(512, 512, 3))[FLAGS.level]
hparams = dict(dropout_rate=FLAGS.dropout_rate,
num_base_filters=FLAGS.num_base_filters,
learning_rate=FLAGS.learning_rate,
l2_reg=FLAGS.l2_reg,
input_shape=input_shape)
classifier = VGGDrop(**hparams)
classifier.summary()
#############
# Load Task #
#############
dtask = bdlb.load(
benchmark="diabetic_retinopathy_diagnosis",
level=FLAGS.level,
batch_size=FLAGS.batch_size,
download_and_prepare=False, # do not download data from this script
)
ds_train, ds_validation, ds_test = dtask.datasets
#################
# Training Loop #
#################
history = classifier.fit(
ds_train,
epochs=FLAGS.num_epochs,
validation_data=ds_validation,
class_weight=dtask.class_weight(),
callbacks=[
tfk.callbacks.TensorBoard(
log_dir=os.path.join(FLAGS.output_dir, "tensorboard"),
update_freq="epoch",
write_graph=True,
histogram_freq=1,
),
tfk.callbacks.ModelCheckpoint(
filepath=os.path.join(
FLAGS.output_dir,
"checkpoints",
"weights-{epoch}.ckpt",
),
verbose=1,
save_weights_only=True,
)
],
)
plotting.tfk_history(history,
output_dir=os.path.join(FLAGS.output_dir, "history"))
##############
# Evaluation #
##############
dtask.evaluate(functools.partial(predict,
model=classifier,
type=FLAGS.uncertainty),
dataset=ds_test,
output_dir=FLAGS.output_dir)
if __name__ == "__main__":
app.run(main)
|
{
"pile_set_name": "Github"
}
|
# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
import hashlib
import os
import socket
NAMESPACE_PATH = '/proc/self/ns'
def _namespaces():
hash = ''
if os.path.exists(NAMESPACE_PATH):
for file in os.listdir(NAMESPACE_PATH):
if hash != '':
hash += ' '
hash += os.readlink(os.path.join(NAMESPACE_PATH, file))
return hash
def _hash(string):
return hashlib.md5(string.encode('ascii')).hexdigest()
def host_hash(salt=None):
"""
Computes a hash that represents this host, a unit of processing power that shares memory.
The hash contains the part of the hostname, e.g. `host` for hostname `host.example.com`,
plus a hash derived from the full hostname and further information about this machine.
The hash can be salted with a given string to add extra information opaque to this mehtod.
:param salt: salt for hashing, ignores Falsy values
"""
hostname = socket.gethostname()
host = hostname.split('.')[0]
ns = _namespaces()
host_info = '{hostname}-{ns}'.format(hostname=hostname, ns=ns)
if salt:
host_info = '{host_info}-{salt}'.format(host_info=host_info, salt=str(salt))
return '{host}-{hash}'.format(host=host, hash=_hash(host_info))
|
{
"pile_set_name": "Github"
}
|
package sockaddr
import (
"encoding/binary"
"fmt"
"net"
"regexp"
"strconv"
"strings"
)
type (
// IPv4Address is a named type representing an IPv4 address.
IPv4Address uint32
// IPv4Network is a named type representing an IPv4 network.
IPv4Network uint32
// IPv4Mask is a named type representing an IPv4 network mask.
IPv4Mask uint32
)
// IPv4HostMask is a constant represents a /32 IPv4 Address
// (i.e. 255.255.255.255).
const IPv4HostMask = IPv4Mask(0xffffffff)
// ipv4AddrAttrMap is a map of the IPv4Addr type-specific attributes.
var ipv4AddrAttrMap map[AttrName]func(IPv4Addr) string
var ipv4AddrAttrs []AttrName
var trailingHexNetmaskRE *regexp.Regexp
// IPv4Addr implements a convenience wrapper around the union of Go's
// built-in net.IP and net.IPNet types. In UNIX-speak, IPv4Addr implements
// `sockaddr` when the the address family is set to AF_INET
// (i.e. `sockaddr_in`).
type IPv4Addr struct {
IPAddr
Address IPv4Address
Mask IPv4Mask
Port IPPort
}
func init() {
ipv4AddrInit()
trailingHexNetmaskRE = regexp.MustCompile(`/([0f]{8})$`)
}
// NewIPv4Addr creates an IPv4Addr from a string. String can be in the form
// of either an IPv4:port (e.g. `1.2.3.4:80`, in which case the mask is
// assumed to be a `/32`), an IPv4 address (e.g. `1.2.3.4`, also with a `/32`
// mask), or an IPv4 CIDR (e.g. `1.2.3.4/24`, which has its IP port
// initialized to zero). ipv4Str can not be a hostname.
//
// NOTE: Many net.*() routines will initialize and return an IPv6 address.
// To create uint32 values from net.IP, always test to make sure the address
// returned can be converted to a 4 byte array using To4().
func NewIPv4Addr(ipv4Str string) (IPv4Addr, error) {
// Strip off any bogus hex-encoded netmasks that will be mis-parsed by Go. In
// particular, clients with the Barracuda VPN client will see something like:
// `192.168.3.51/00ffffff` as their IP address.
trailingHexNetmaskRe := trailingHexNetmaskRE.Copy()
if match := trailingHexNetmaskRe.FindStringIndex(ipv4Str); match != nil {
ipv4Str = ipv4Str[:match[0]]
}
// Parse as an IPv4 CIDR
ipAddr, network, err := net.ParseCIDR(ipv4Str)
if err == nil {
ipv4 := ipAddr.To4()
if ipv4 == nil {
return IPv4Addr{}, fmt.Errorf("Unable to convert %s to an IPv4 address", ipv4Str)
}
// If we see an IPv6 netmask, convert it to an IPv4 mask.
netmaskSepPos := strings.LastIndexByte(ipv4Str, '/')
if netmaskSepPos != -1 && netmaskSepPos+1 < len(ipv4Str) {
netMask, err := strconv.ParseUint(ipv4Str[netmaskSepPos+1:], 10, 8)
if err != nil {
return IPv4Addr{}, fmt.Errorf("Unable to convert %s to an IPv4 address: unable to parse CIDR netmask: %v", ipv4Str, err)
} else if netMask > 128 {
return IPv4Addr{}, fmt.Errorf("Unable to convert %s to an IPv4 address: invalid CIDR netmask", ipv4Str)
}
if netMask >= 96 {
// Convert the IPv6 netmask to an IPv4 netmask
network.Mask = net.CIDRMask(int(netMask-96), IPv4len*8)
}
}
ipv4Addr := IPv4Addr{
Address: IPv4Address(binary.BigEndian.Uint32(ipv4)),
Mask: IPv4Mask(binary.BigEndian.Uint32(network.Mask)),
}
return ipv4Addr, nil
}
// Attempt to parse ipv4Str as a /32 host with a port number.
tcpAddr, err := net.ResolveTCPAddr("tcp4", ipv4Str)
if err == nil {
ipv4 := tcpAddr.IP.To4()
if ipv4 == nil {
return IPv4Addr{}, fmt.Errorf("Unable to resolve %+q as an IPv4 address", ipv4Str)
}
ipv4Uint32 := binary.BigEndian.Uint32(ipv4)
ipv4Addr := IPv4Addr{
Address: IPv4Address(ipv4Uint32),
Mask: IPv4HostMask,
Port: IPPort(tcpAddr.Port),
}
return ipv4Addr, nil
}
// Parse as a naked IPv4 address
ip := net.ParseIP(ipv4Str)
if ip != nil {
ipv4 := ip.To4()
if ipv4 == nil {
return IPv4Addr{}, fmt.Errorf("Unable to string convert %+q to an IPv4 address", ipv4Str)
}
ipv4Uint32 := binary.BigEndian.Uint32(ipv4)
ipv4Addr := IPv4Addr{
Address: IPv4Address(ipv4Uint32),
Mask: IPv4HostMask,
}
return ipv4Addr, nil
}
return IPv4Addr{}, fmt.Errorf("Unable to parse %+q to an IPv4 address: %v", ipv4Str, err)
}
// AddressBinString returns a string with the IPv4Addr's Address represented
// as a sequence of '0' and '1' characters. This method is useful for
// debugging or by operators who want to inspect an address.
func (ipv4 IPv4Addr) AddressBinString() string {
return fmt.Sprintf("%032s", strconv.FormatUint(uint64(ipv4.Address), 2))
}
// AddressHexString returns a string with the IPv4Addr address represented as
// a sequence of hex characters. This method is useful for debugging or by
// operators who want to inspect an address.
func (ipv4 IPv4Addr) AddressHexString() string {
return fmt.Sprintf("%08s", strconv.FormatUint(uint64(ipv4.Address), 16))
}
// Broadcast is an IPv4Addr-only method that returns the broadcast address of
// the network.
//
// NOTE: IPv6 only supports multicast, so this method only exists for
// IPv4Addr.
func (ipv4 IPv4Addr) Broadcast() IPAddr {
// Nothing should listen on a broadcast address.
return IPv4Addr{
Address: IPv4Address(ipv4.BroadcastAddress()),
Mask: IPv4HostMask,
}
}
// BroadcastAddress returns a IPv4Network of the IPv4Addr's broadcast
// address.
func (ipv4 IPv4Addr) BroadcastAddress() IPv4Network {
return IPv4Network(uint32(ipv4.Address)&uint32(ipv4.Mask) | ^uint32(ipv4.Mask))
}
// CmpAddress follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because its address is lower than arg
// - 0 if the SockAddr arg is equal to the receiving IPv4Addr or the argument is
// of a different type.
// - 1 If the argument should sort first.
func (ipv4 IPv4Addr) CmpAddress(sa SockAddr) int {
ipv4b, ok := sa.(IPv4Addr)
if !ok {
return sortDeferDecision
}
switch {
case ipv4.Address == ipv4b.Address:
return sortDeferDecision
case ipv4.Address < ipv4b.Address:
return sortReceiverBeforeArg
default:
return sortArgBeforeReceiver
}
}
// CmpPort follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because its port is lower than arg
// - 0 if the SockAddr arg's port number is equal to the receiving IPv4Addr,
// regardless of type.
// - 1 If the argument should sort first.
func (ipv4 IPv4Addr) CmpPort(sa SockAddr) int {
var saPort IPPort
switch v := sa.(type) {
case IPv4Addr:
saPort = v.Port
case IPv6Addr:
saPort = v.Port
default:
return sortDeferDecision
}
switch {
case ipv4.Port == saPort:
return sortDeferDecision
case ipv4.Port < saPort:
return sortReceiverBeforeArg
default:
return sortArgBeforeReceiver
}
}
// CmpRFC follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because it belongs to the RFC and its
// arg does not
// - 0 if the receiver and arg both belong to the same RFC or neither do.
// - 1 If the arg belongs to the RFC but receiver does not.
func (ipv4 IPv4Addr) CmpRFC(rfcNum uint, sa SockAddr) int {
recvInRFC := IsRFC(rfcNum, ipv4)
ipv4b, ok := sa.(IPv4Addr)
if !ok {
// If the receiver is part of the desired RFC and the SockAddr
// argument is not, return -1 so that the receiver sorts before
// the non-IPv4 SockAddr. Conversely, if the receiver is not
// part of the RFC, punt on sorting and leave it for the next
// sorter.
if recvInRFC {
return sortReceiverBeforeArg
} else {
return sortDeferDecision
}
}
argInRFC := IsRFC(rfcNum, ipv4b)
switch {
case (recvInRFC && argInRFC), (!recvInRFC && !argInRFC):
// If a and b both belong to the RFC, or neither belong to
// rfcNum, defer sorting to the next sorter.
return sortDeferDecision
case recvInRFC && !argInRFC:
return sortReceiverBeforeArg
default:
return sortArgBeforeReceiver
}
}
// Contains returns true if the SockAddr is contained within the receiver.
func (ipv4 IPv4Addr) Contains(sa SockAddr) bool {
ipv4b, ok := sa.(IPv4Addr)
if !ok {
return false
}
return ipv4.ContainsNetwork(ipv4b)
}
// ContainsAddress returns true if the IPv4Address is contained within the
// receiver.
func (ipv4 IPv4Addr) ContainsAddress(x IPv4Address) bool {
return IPv4Address(ipv4.NetworkAddress()) <= x &&
IPv4Address(ipv4.BroadcastAddress()) >= x
}
// ContainsNetwork returns true if the network from IPv4Addr is contained
// within the receiver.
func (ipv4 IPv4Addr) ContainsNetwork(x IPv4Addr) bool {
return ipv4.NetworkAddress() <= x.NetworkAddress() &&
ipv4.BroadcastAddress() >= x.BroadcastAddress()
}
// DialPacketArgs returns the arguments required to be passed to
// net.DialUDP(). If the Mask of ipv4 is not a /32 or the Port is 0,
// DialPacketArgs() will fail. See Host() to create an IPv4Addr with its
// mask set to /32.
func (ipv4 IPv4Addr) DialPacketArgs() (network, dialArgs string) {
if ipv4.Mask != IPv4HostMask || ipv4.Port == 0 {
return "udp4", ""
}
return "udp4", fmt.Sprintf("%s:%d", ipv4.NetIP().String(), ipv4.Port)
}
// DialStreamArgs returns the arguments required to be passed to
// net.DialTCP(). If the Mask of ipv4 is not a /32 or the Port is 0,
// DialStreamArgs() will fail. See Host() to create an IPv4Addr with its
// mask set to /32.
func (ipv4 IPv4Addr) DialStreamArgs() (network, dialArgs string) {
if ipv4.Mask != IPv4HostMask || ipv4.Port == 0 {
return "tcp4", ""
}
return "tcp4", fmt.Sprintf("%s:%d", ipv4.NetIP().String(), ipv4.Port)
}
// Equal returns true if a SockAddr is equal to the receiving IPv4Addr.
func (ipv4 IPv4Addr) Equal(sa SockAddr) bool {
ipv4b, ok := sa.(IPv4Addr)
if !ok {
return false
}
if ipv4.Port != ipv4b.Port {
return false
}
if ipv4.Address != ipv4b.Address {
return false
}
if ipv4.NetIPNet().String() != ipv4b.NetIPNet().String() {
return false
}
return true
}
// FirstUsable returns an IPv4Addr set to the first address following the
// network prefix. The first usable address in a network is normally the
// gateway and should not be used except by devices forwarding packets
// between two administratively distinct networks (i.e. a router). This
// function does not discriminate against first usable vs "first address that
// should be used." For example, FirstUsable() on "192.168.1.10/24" would
// return the address "192.168.1.1/24".
func (ipv4 IPv4Addr) FirstUsable() IPAddr {
addr := ipv4.NetworkAddress()
// If /32, return the address itself. If /31 assume a point-to-point
// link and return the lower address.
if ipv4.Maskbits() < 31 {
addr++
}
return IPv4Addr{
Address: IPv4Address(addr),
Mask: IPv4HostMask,
}
}
// Host returns a copy of ipv4 with its mask set to /32 so that it can be
// used by DialPacketArgs(), DialStreamArgs(), ListenPacketArgs(), or
// ListenStreamArgs().
func (ipv4 IPv4Addr) Host() IPAddr {
// Nothing should listen on a broadcast address.
return IPv4Addr{
Address: ipv4.Address,
Mask: IPv4HostMask,
Port: ipv4.Port,
}
}
// IPPort returns the Port number attached to the IPv4Addr
func (ipv4 IPv4Addr) IPPort() IPPort {
return ipv4.Port
}
// LastUsable returns the last address before the broadcast address in a
// given network.
func (ipv4 IPv4Addr) LastUsable() IPAddr {
addr := ipv4.BroadcastAddress()
// If /32, return the address itself. If /31 assume a point-to-point
// link and return the upper address.
if ipv4.Maskbits() < 31 {
addr--
}
return IPv4Addr{
Address: IPv4Address(addr),
Mask: IPv4HostMask,
}
}
// ListenPacketArgs returns the arguments required to be passed to
// net.ListenUDP(). If the Mask of ipv4 is not a /32, ListenPacketArgs()
// will fail. See Host() to create an IPv4Addr with its mask set to /32.
func (ipv4 IPv4Addr) ListenPacketArgs() (network, listenArgs string) {
if ipv4.Mask != IPv4HostMask {
return "udp4", ""
}
return "udp4", fmt.Sprintf("%s:%d", ipv4.NetIP().String(), ipv4.Port)
}
// ListenStreamArgs returns the arguments required to be passed to
// net.ListenTCP(). If the Mask of ipv4 is not a /32, ListenStreamArgs()
// will fail. See Host() to create an IPv4Addr with its mask set to /32.
func (ipv4 IPv4Addr) ListenStreamArgs() (network, listenArgs string) {
if ipv4.Mask != IPv4HostMask {
return "tcp4", ""
}
return "tcp4", fmt.Sprintf("%s:%d", ipv4.NetIP().String(), ipv4.Port)
}
// Maskbits returns the number of network mask bits in a given IPv4Addr. For
// example, the Maskbits() of "192.168.1.1/24" would return 24.
func (ipv4 IPv4Addr) Maskbits() int {
mask := make(net.IPMask, IPv4len)
binary.BigEndian.PutUint32(mask, uint32(ipv4.Mask))
maskOnes, _ := mask.Size()
return maskOnes
}
// MustIPv4Addr is a helper method that must return an IPv4Addr or panic on
// invalid input.
func MustIPv4Addr(addr string) IPv4Addr {
ipv4, err := NewIPv4Addr(addr)
if err != nil {
panic(fmt.Sprintf("Unable to create an IPv4Addr from %+q: %v", addr, err))
}
return ipv4
}
// NetIP returns the address as a net.IP (address is always presized to
// IPv4).
func (ipv4 IPv4Addr) NetIP() *net.IP {
x := make(net.IP, IPv4len)
binary.BigEndian.PutUint32(x, uint32(ipv4.Address))
return &x
}
// NetIPMask create a new net.IPMask from the IPv4Addr.
func (ipv4 IPv4Addr) NetIPMask() *net.IPMask {
ipv4Mask := net.IPMask{}
ipv4Mask = make(net.IPMask, IPv4len)
binary.BigEndian.PutUint32(ipv4Mask, uint32(ipv4.Mask))
return &ipv4Mask
}
// NetIPNet create a new net.IPNet from the IPv4Addr.
func (ipv4 IPv4Addr) NetIPNet() *net.IPNet {
ipv4net := &net.IPNet{}
ipv4net.IP = make(net.IP, IPv4len)
binary.BigEndian.PutUint32(ipv4net.IP, uint32(ipv4.NetworkAddress()))
ipv4net.Mask = *ipv4.NetIPMask()
return ipv4net
}
// Network returns the network prefix or network address for a given network.
func (ipv4 IPv4Addr) Network() IPAddr {
return IPv4Addr{
Address: IPv4Address(ipv4.NetworkAddress()),
Mask: ipv4.Mask,
}
}
// NetworkAddress returns an IPv4Network of the IPv4Addr's network address.
func (ipv4 IPv4Addr) NetworkAddress() IPv4Network {
return IPv4Network(uint32(ipv4.Address) & uint32(ipv4.Mask))
}
// Octets returns a slice of the four octets in an IPv4Addr's Address. The
// order of the bytes is big endian.
func (ipv4 IPv4Addr) Octets() []int {
return []int{
int(ipv4.Address >> 24),
int((ipv4.Address >> 16) & 0xff),
int((ipv4.Address >> 8) & 0xff),
int(ipv4.Address & 0xff),
}
}
// String returns a string representation of the IPv4Addr
func (ipv4 IPv4Addr) String() string {
if ipv4.Port != 0 {
return fmt.Sprintf("%s:%d", ipv4.NetIP().String(), ipv4.Port)
}
if ipv4.Maskbits() == 32 {
return ipv4.NetIP().String()
}
return fmt.Sprintf("%s/%d", ipv4.NetIP().String(), ipv4.Maskbits())
}
// Type is used as a type switch and returns TypeIPv4
func (IPv4Addr) Type() SockAddrType {
return TypeIPv4
}
// IPv4AddrAttr returns a string representation of an attribute for the given
// IPv4Addr.
func IPv4AddrAttr(ipv4 IPv4Addr, selector AttrName) string {
fn, found := ipv4AddrAttrMap[selector]
if !found {
return ""
}
return fn(ipv4)
}
// IPv4Attrs returns a list of attributes supported by the IPv4Addr type
func IPv4Attrs() []AttrName {
return ipv4AddrAttrs
}
// ipv4AddrInit is called once at init()
func ipv4AddrInit() {
// Sorted for human readability
ipv4AddrAttrs = []AttrName{
"size", // Same position as in IPv6 for output consistency
"broadcast",
"uint32",
}
ipv4AddrAttrMap = map[AttrName]func(ipv4 IPv4Addr) string{
"broadcast": func(ipv4 IPv4Addr) string {
return ipv4.Broadcast().String()
},
"size": func(ipv4 IPv4Addr) string {
return fmt.Sprintf("%d", 1<<uint(IPv4len*8-ipv4.Maskbits()))
},
"uint32": func(ipv4 IPv4Addr) string {
return fmt.Sprintf("%d", uint32(ipv4.Address))
},
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2009 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 amd64,openbsd
package unix
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: sec, Nsec: nsec}
}
func setTimeval(sec, usec int64) Timeval {
return Timeval{Sec: sec, Usec: usec}
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
k.Ident = uint64(fd)
k.Filter = int16(mode)
k.Flags = uint16(flags)
}
func (iov *Iovec) SetLen(length int) {
iov.Len = uint64(length)
}
func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
// of openbsd/amd64 the syscall is called sysctl instead of __sysctl.
const SYS___SYSCTL = SYS_SYSCTL
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="F58-2D-HiH">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Greetings View Controller-->
<scene sceneID="1CD-lE-WF0">
<objects>
<viewController storyboardIdentifier="LogoutViewController" id="kPr-An-dER" customClass="GreetingsViewController" customModule="ReMVVMBasicExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="9ki-2i-CPf">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="9" translatesAutoresizingMaskIntoConstraints="NO" id="b3p-oq-GG2">
<rect key="frame" x="10" y="314" width="355" height="59.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hallo world" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gwR-fr-PFL">
<rect key="frame" x="0.0" y="0.0" width="355" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="do0-3o-AA9">
<rect key="frame" x="0.0" y="29.5" width="355" height="30"/>
<state key="normal" title="Logout"/>
</button>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="b3p-oq-GG2" firstAttribute="centerY" secondItem="ss6-cz-zzp" secondAttribute="centerY" id="Ltb-fc-p2s"/>
<constraint firstItem="b3p-oq-GG2" firstAttribute="width" secondItem="9ki-2i-CPf" secondAttribute="width" constant="-20" id="MIg-Aa-bvX"/>
<constraint firstItem="b3p-oq-GG2" firstAttribute="centerX" secondItem="ss6-cz-zzp" secondAttribute="centerX" id="bce-59-jKi"/>
</constraints>
<viewLayoutGuide key="safeArea" id="ss6-cz-zzp"/>
</view>
<connections>
<outlet property="logoutButton" destination="do0-3o-AA9" id="CFg-Nc-aOM"/>
<outlet property="messageLabel" destination="gwR-fr-PFL" id="PAN-i5-xSX"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="7kQ-Qt-hpk" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1711" y="54"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="zmq-co-VN7">
<objects>
<navigationController id="F58-2D-HiH" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="8D7-pz-pz3">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="gv0-i0-Jqx" kind="relationship" relationship="rootViewController" id="R9X-Es-TPM"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fHI-N9-hRb" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1668" y="99"/>
</scene>
<!--View Controller-->
<scene sceneID="LZv-vi-Taw">
<objects>
<viewController id="gv0-i0-Jqx" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Lda-yo-Jk4">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VAi-Um-USV">
<rect key="frame" x="30" y="94" width="325" height="543"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bcA-jt-OXx">
<rect key="frame" x="32.5" y="256.5" width="30" height="30"/>
<state key="normal" title="GO"/>
<connections>
<segue destination="BYZ-38-t0r" kind="show" id="E2j-x8-oba"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="bcA-jt-OXx" firstAttribute="centerY" secondItem="VAi-Um-USV" secondAttribute="centerY" id="B6u-ll-yXR"/>
<constraint firstItem="bcA-jt-OXx" firstAttribute="leading" secondItem="VAi-Um-USV" secondAttribute="trailing" multiplier="0.1" id="yXb-Jq-Cfh"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="pxX-zu-MZA" firstAttribute="trailing" secondItem="VAi-Um-USV" secondAttribute="trailing" constant="20" id="3Nt-7c-bfU"/>
<constraint firstItem="VAi-Um-USV" firstAttribute="top" secondItem="pxX-zu-MZA" secondAttribute="top" constant="30" id="ER6-D1-QWV"/>
<constraint firstItem="VAi-Um-USV" firstAttribute="leading" secondItem="pxX-zu-MZA" secondAttribute="leading" constant="30" id="VOa-50-y4H"/>
<constraint firstItem="pxX-zu-MZA" firstAttribute="bottom" secondItem="VAi-Um-USV" secondAttribute="bottom" constant="30" id="kPb-Ai-2ak"/>
</constraints>
<viewLayoutGuide key="safeArea" id="pxX-zu-MZA"/>
</view>
<navigationItem key="navigationItem" id="jdI-UR-D2p"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Dxo-tU-ZRU" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-748" y="69"/>
</scene>
<!--Login View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="LoginViewController" customModule="ReMVVMBasicExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="9" translatesAutoresizingMaskIntoConstraints="NO" id="Mlw-dX-9PH">
<rect key="frame" x="10" y="282" width="355" height="167"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="First name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4An-xT-Jjk">
<rect key="frame" x="0.0" y="0.0" width="355" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="8v6-MZ-HQe">
<rect key="frame" x="0.0" y="29.5" width="355" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Last Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vfK-yW-pkG">
<rect key="frame" x="0.0" y="68.5" width="355" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="uRA-YJ-lwu">
<rect key="frame" x="0.0" y="98" width="355" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="T8R-nR-68r">
<rect key="frame" x="0.0" y="137" width="355" height="30"/>
<state key="normal" title="Login"/>
</button>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Mlw-dX-9PH" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="0UA-KJ-bWL"/>
<constraint firstItem="Mlw-dX-9PH" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="Nv6-bj-VLw"/>
<constraint firstItem="Mlw-dX-9PH" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" constant="-20" id="hIK-gj-pOX"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="6w7-vN-7Tu"/>
<connections>
<outlet property="firstNameTextField" destination="8v6-MZ-HQe" id="zSU-qU-lpl"/>
<outlet property="lastNameTextField" destination="uRA-YJ-lwu" id="8mT-OC-HvX"/>
<outlet property="loginButton" destination="T8R-nR-68r" id="gO9-CU-a00"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
|
{
"pile_set_name": "Github"
}
|
/**************************************************************************//**
* @file core_cmInstr.h
* @brief CMSIS Cortex-M Core Instruction Access Header File
* @version V4.00
* @date 28. August 2014
*
* @note
*
******************************************************************************/
/* Copyright (c) 2009 - 2014 ARM LIMITED
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of ARM 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 COPYRIGHT HOLDERS AND CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------*/
#ifndef __CORE_CMINSTR_H
#define __CORE_CMINSTR_H
/* ########################## Core Instruction Access ######################### */
/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
Access to dedicated instructions
@{
*/
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
/* ARM armcc specific functions */
#if (__ARMCC_VERSION < 400677)
#error "Please use ARM Compiler Toolchain V4.0.677 or later!"
#endif
/** \brief No Operation
No Operation does nothing. This instruction can be used for code alignment purposes.
*/
#define __NOP __nop
/** \brief Wait For Interrupt
Wait For Interrupt is a hint instruction that suspends execution
until one of a number of events occurs.
*/
#define __WFI __wfi
/** \brief Wait For Event
Wait For Event is a hint instruction that permits the processor to enter
a low-power state until one of a number of events occurs.
*/
#define __WFE __wfe
/** \brief Send Event
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
*/
#define __SEV __sev
/** \brief Instruction Synchronization Barrier
Instruction Synchronization Barrier flushes the pipeline in the processor,
so that all instructions following the ISB are fetched from cache or
memory, after the instruction has been completed.
*/
#define __ISB() __isb(0xF)
/** \brief Data Synchronization Barrier
This function acts as a special kind of Data Memory Barrier.
It completes when all explicit memory accesses before this instruction complete.
*/
#define __DSB() __dsb(0xF)
/** \brief Data Memory Barrier
This function ensures the apparent order of the explicit memory operations before
and after the instruction, without ensuring their completion.
*/
#define __DMB() __dmb(0xF)
/** \brief Reverse byte order (32 bit)
This function reverses the byte order in integer value.
\param [in] value Value to reverse
\return Reversed value
*/
#define __REV __rev
/** \brief Reverse byte order (16 bit)
This function reverses the byte order in two unsigned short values.
\param [in] value Value to reverse
\return Reversed value
*/
#ifndef __NO_EMBEDDED_ASM
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
{
rev16 r0, r0
bx lr
}
#endif
/** \brief Reverse byte order in signed short value
This function reverses the byte order in a signed short value with sign extension to integer.
\param [in] value Value to reverse
\return Reversed value
*/
#ifndef __NO_EMBEDDED_ASM
__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value)
{
revsh r0, r0
bx lr
}
#endif
/** \brief Rotate Right in unsigned value (32 bit)
This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
\param [in] value Value to rotate
\param [in] value Number of Bits to rotate
\return Rotated value
*/
#define __ROR __ror
/** \brief Breakpoint
This function causes the processor to enter Debug state.
Debug tools can use this to investigate system state when the instruction at a particular address is reached.
\param [in] value is ignored by the processor.
If required, a debugger can use it to store additional information about the breakpoint.
*/
#define __BKPT(value) __breakpoint(value)
#if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
/** \brief Reverse bit order of value
This function reverses the bit order of the given value.
\param [in] value Value to reverse
\return Reversed value
*/
#define __RBIT __rbit
/** \brief LDR Exclusive (8 bit)
This function executes a exclusive LDR instruction for 8 bit value.
\param [in] ptr Pointer to data
\return value of type uint8_t at (*ptr)
*/
#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
/** \brief LDR Exclusive (16 bit)
This function executes a exclusive LDR instruction for 16 bit values.
\param [in] ptr Pointer to data
\return value of type uint16_t at (*ptr)
*/
#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
/** \brief LDR Exclusive (32 bit)
This function executes a exclusive LDR instruction for 32 bit values.
\param [in] ptr Pointer to data
\return value of type uint32_t at (*ptr)
*/
#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
/** \brief STR Exclusive (8 bit)
This function executes a exclusive STR instruction for 8 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
\return 0 Function succeeded
\return 1 Function failed
*/
#define __STREXB(value, ptr) __strex(value, ptr)
/** \brief STR Exclusive (16 bit)
This function executes a exclusive STR instruction for 16 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
\return 0 Function succeeded
\return 1 Function failed
*/
#define __STREXH(value, ptr) __strex(value, ptr)
/** \brief STR Exclusive (32 bit)
This function executes a exclusive STR instruction for 32 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
\return 0 Function succeeded
\return 1 Function failed
*/
#define __STREXW(value, ptr) __strex(value, ptr)
/** \brief Remove the exclusive lock
This function removes the exclusive lock which is created by LDREX.
*/
#define __CLREX __clrex
/** \brief Signed Saturate
This function saturates a signed value.
\param [in] value Value to be saturated
\param [in] sat Bit position to saturate to (1..32)
\return Saturated value
*/
#define __SSAT __ssat
/** \brief Unsigned Saturate
This function saturates an unsigned value.
\param [in] value Value to be saturated
\param [in] sat Bit position to saturate to (0..31)
\return Saturated value
*/
#define __USAT __usat
/** \brief Count leading zeros
This function counts the number of leading zeros of a data value.
\param [in] value Value to count the leading zeros
\return number of leading zeros in value
*/
#define __CLZ __clz
/** \brief Rotate Right with Extend (32 bit)
This function moves each bit of a bitstring right by one bit. The carry input is shifted in at the left end of the bitstring.
\param [in] value Value to rotate
\return Rotated value
*/
#ifndef __NO_EMBEDDED_ASM
__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value)
{
rrx r0, r0
bx lr
}
#endif
/** \brief LDRT Unprivileged (8 bit)
This function executes a Unprivileged LDRT instruction for 8 bit value.
\param [in] ptr Pointer to data
\return value of type uint8_t at (*ptr)
*/
#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr))
/** \brief LDRT Unprivileged (16 bit)
This function executes a Unprivileged LDRT instruction for 16 bit values.
\param [in] ptr Pointer to data
\return value of type uint16_t at (*ptr)
*/
#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr))
/** \brief LDRT Unprivileged (32 bit)
This function executes a Unprivileged LDRT instruction for 32 bit values.
\param [in] ptr Pointer to data
\return value of type uint32_t at (*ptr)
*/
#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr))
/** \brief STRT Unprivileged (8 bit)
This function executes a Unprivileged STRT instruction for 8 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
*/
#define __STRBT(value, ptr) __strt(value, ptr)
/** \brief STRT Unprivileged (16 bit)
This function executes a Unprivileged STRT instruction for 16 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
*/
#define __STRHT(value, ptr) __strt(value, ptr)
/** \brief STRT Unprivileged (32 bit)
This function executes a Unprivileged STRT instruction for 32 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
*/
#define __STRT(value, ptr) __strt(value, ptr)
#endif /* (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) */
#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
/* GNU gcc specific functions */
/* Define macros for porting to both thumb1 and thumb2.
* For thumb1, use low register (r0-r7), specified by constrant "l"
* Otherwise, use general registers, specified by constrant "r" */
#if defined (__thumb__) && !defined (__thumb2__)
#define __CMSIS_GCC_OUT_REG(r) "=l" (r)
#define __CMSIS_GCC_USE_REG(r) "l" (r)
#else
#define __CMSIS_GCC_OUT_REG(r) "=r" (r)
#define __CMSIS_GCC_USE_REG(r) "r" (r)
#endif
/** \brief No Operation
No Operation does nothing. This instruction can be used for code alignment purposes.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __NOP(void)
{
__ASM volatile ("nop");
}
/** \brief Wait For Interrupt
Wait For Interrupt is a hint instruction that suspends execution
until one of a number of events occurs.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFI(void)
{
__ASM volatile ("wfi");
}
/** \brief Wait For Event
Wait For Event is a hint instruction that permits the processor to enter
a low-power state until one of a number of events occurs.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __WFE(void)
{
__ASM volatile ("wfe");
}
/** \brief Send Event
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __SEV(void)
{
__ASM volatile ("sev");
}
/** \brief Instruction Synchronization Barrier
Instruction Synchronization Barrier flushes the pipeline in the processor,
so that all instructions following the ISB are fetched from cache or
memory, after the instruction has been completed.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __ISB(void)
{
__ASM volatile ("isb");
}
/** \brief Data Synchronization Barrier
This function acts as a special kind of Data Memory Barrier.
It completes when all explicit memory accesses before this instruction complete.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __DSB(void)
{
__ASM volatile ("dsb");
}
/** \brief Data Memory Barrier
This function ensures the apparent order of the explicit memory operations before
and after the instruction, without ensuring their completion.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __DMB(void)
{
__ASM volatile ("dmb");
}
/** \brief Reverse byte order (32 bit)
This function reverses the byte order in integer value.
\param [in] value Value to reverse
\return Reversed value
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV(uint32_t value)
{
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
return __builtin_bswap32(value);
#else
uint32_t result;
__ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
return(result);
#endif
}
/** \brief Reverse byte order (16 bit)
This function reverses the byte order in two unsigned short values.
\param [in] value Value to reverse
\return Reversed value
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __REV16(uint32_t value)
{
uint32_t result;
__ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
return(result);
}
/** \brief Reverse byte order in signed short value
This function reverses the byte order in a signed short value with sign extension to integer.
\param [in] value Value to reverse
\return Reversed value
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __REVSH(int32_t value)
{
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
return (short)__builtin_bswap16(value);
#else
uint32_t result;
__ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
return(result);
#endif
}
/** \brief Rotate Right in unsigned value (32 bit)
This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
\param [in] value Value to rotate
\param [in] value Number of Bits to rotate
\return Rotated value
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
{
return (op1 >> op2) | (op1 << (32 - op2));
}
/** \brief Breakpoint
This function causes the processor to enter Debug state.
Debug tools can use this to investigate system state when the instruction at a particular address is reached.
\param [in] value is ignored by the processor.
If required, a debugger can use it to store additional information about the breakpoint.
*/
#define __BKPT(value) __ASM volatile ("bkpt "#value)
#if (__CORTEX_M >= 0x03) || ((defined(__CORTEX_SC)) && (__CORTEX_SC >= 300))
/** \brief Reverse bit order of value
This function reverses the bit order of the given value.
\param [in] value Value to reverse
\return Reversed value
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
{
uint32_t result;
__ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
return(result);
}
/** \brief LDR Exclusive (8 bit)
This function executes a exclusive LDR instruction for 8 bit value.
\param [in] ptr Pointer to data
\return value of type uint8_t at (*ptr)
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr)
{
uint32_t result;
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
__ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) );
#else
/* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
accepted by assembler. So has to use following less efficient pattern.
*/
__ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
#endif
return ((uint8_t) result); /* Add explicit type cast here */
}
/** \brief LDR Exclusive (16 bit)
This function executes a exclusive LDR instruction for 16 bit values.
\param [in] ptr Pointer to data
\return value of type uint16_t at (*ptr)
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr)
{
uint32_t result;
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
__ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) );
#else
/* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
accepted by assembler. So has to use following less efficient pattern.
*/
__ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
#endif
return ((uint16_t) result); /* Add explicit type cast here */
}
/** \brief LDR Exclusive (32 bit)
This function executes a exclusive LDR instruction for 32 bit values.
\param [in] ptr Pointer to data
\return value of type uint32_t at (*ptr)
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr)
{
uint32_t result;
__ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) );
return(result);
}
/** \brief STR Exclusive (8 bit)
This function executes a exclusive STR instruction for 8 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
\return 0 Function succeeded
\return 1 Function failed
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)
{
uint32_t result;
__ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );
return(result);
}
/** \brief STR Exclusive (16 bit)
This function executes a exclusive STR instruction for 16 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
\return 0 Function succeeded
\return 1 Function failed
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)
{
uint32_t result;
__ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );
return(result);
}
/** \brief STR Exclusive (32 bit)
This function executes a exclusive STR instruction for 32 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
\return 0 Function succeeded
\return 1 Function failed
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)
{
uint32_t result;
__ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) );
return(result);
}
/** \brief Remove the exclusive lock
This function removes the exclusive lock which is created by LDREX.
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __CLREX(void)
{
__ASM volatile ("clrex" ::: "memory");
}
/** \brief Signed Saturate
This function saturates a signed value.
\param [in] value Value to be saturated
\param [in] sat Bit position to saturate to (1..32)
\return Saturated value
*/
#define __SSAT(ARG1,ARG2) \
({ \
uint32_t __RES, __ARG1 = (ARG1); \
__ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
__RES; \
})
/** \brief Unsigned Saturate
This function saturates an unsigned value.
\param [in] value Value to be saturated
\param [in] sat Bit position to saturate to (0..31)
\return Saturated value
*/
#define __USAT(ARG1,ARG2) \
({ \
uint32_t __RES, __ARG1 = (ARG1); \
__ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
__RES; \
})
/** \brief Count leading zeros
This function counts the number of leading zeros of a data value.
\param [in] value Value to count the leading zeros
\return number of leading zeros in value
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __CLZ(uint32_t value)
{
uint32_t result;
__ASM volatile ("clz %0, %1" : "=r" (result) : "r" (value) );
return ((uint8_t) result); /* Add explicit type cast here */
}
/** \brief Rotate Right with Extend (32 bit)
This function moves each bit of a bitstring right by one bit. The carry input is shifted in at the left end of the bitstring.
\param [in] value Value to rotate
\return Rotated value
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __RRX(uint32_t value)
{
uint32_t result;
__ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
return(result);
}
/** \brief LDRT Unprivileged (8 bit)
This function executes a Unprivileged LDRT instruction for 8 bit value.
\param [in] ptr Pointer to data
\return value of type uint8_t at (*ptr)
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *addr)
{
uint32_t result;
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
__ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*addr) );
#else
/* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
accepted by assembler. So has to use following less efficient pattern.
*/
__ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
#endif
return ((uint8_t) result); /* Add explicit type cast here */
}
/** \brief LDRT Unprivileged (16 bit)
This function executes a Unprivileged LDRT instruction for 16 bit values.
\param [in] ptr Pointer to data
\return value of type uint16_t at (*ptr)
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *addr)
{
uint32_t result;
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
__ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*addr) );
#else
/* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not
accepted by assembler. So has to use following less efficient pattern.
*/
__ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (addr) : "memory" );
#endif
return ((uint16_t) result); /* Add explicit type cast here */
}
/** \brief LDRT Unprivileged (32 bit)
This function executes a Unprivileged LDRT instruction for 32 bit values.
\param [in] ptr Pointer to data
\return value of type uint32_t at (*ptr)
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *addr)
{
uint32_t result;
__ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*addr) );
return(result);
}
/** \brief STRT Unprivileged (8 bit)
This function executes a Unprivileged STRT instruction for 8 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *addr)
{
__ASM volatile ("strbt %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) );
}
/** \brief STRT Unprivileged (16 bit)
This function executes a Unprivileged STRT instruction for 16 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *addr)
{
__ASM volatile ("strht %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) );
}
/** \brief STRT Unprivileged (32 bit)
This function executes a Unprivileged STRT instruction for 32 bit values.
\param [in] value Value to store
\param [in] ptr Pointer to location
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *addr)
{
__ASM volatile ("strt %1, %0" : "=Q" (*addr) : "r" (value) );
}
#endif /* (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) */
#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
/* IAR iccarm specific functions */
#include <cmsis_iar.h>
#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
/* TI CCS specific functions */
#include <cmsis_ccs.h>
#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
/* TASKING carm specific functions */
/*
* The CMSIS functions have been implemented as intrinsics in the compiler.
* Please use "carm -?i" to get an up to date list of all intrinsics,
* Including the CMSIS ones.
*/
#elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/
/* Cosmic specific functions */
#include <cmsis_csm.h>
#endif
/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
#endif /* __CORE_CMINSTR_H */
|
{
"pile_set_name": "Github"
}
|
/**
* @file
*/
/*
Copyright (C) 2002-2020 UFO: Alien Invasion.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#pragma once
#include "../../e_main.h"
void CL_ActorRevitalised(const eventRegister_t* self, dbuffer* msg);
|
{
"pile_set_name": "Github"
}
|
content-security-policy: default-src 'self'; img-src 'none'; report-uri http://mochi.test:8888/tests/content/base/test/csp/file_bug836922_npolicies_violation.sjs
content-security-policy-report-only: default-src *; img-src 'self'; script-src 'none'; report-uri http://mochi.test:8888/tests/content/base/test/csp/file_bug836922_npolicies_ro_violation.sjs
|
{
"pile_set_name": "Github"
}
|
/*
* (c) Copyright Christian P. Fries, Germany. Contact: email@christian-fries.de.
*
* Created on 07.09.2013
*/
package net.finmath.time.daycount;
import java.io.Serializable;
import java.time.LocalDate;
/**
* This is a special day count convention, where the day count between two dates is always 0.0
* and the year fraction for an interval is always 1.0.
*
* The latter property is probably the relevant property: you may use this day count convention if a coupon period
* pays the coupon without applying a year fraction of the accrual period, but the implementation requires an object implementing
* {@link DayCountConvention}.
*
* @author Christian Fries
* @version 1.0
*/
public class DayCountConvention_NONE implements DayCountConvention, Serializable {
private static final long serialVersionUID = 1234679674480984332L;
/**
* Create a day count convention with a constant year fraction of 1.0 for all periods.
*/
public DayCountConvention_NONE() {
}
@Override
public double getDaycount(final LocalDate startDate, final LocalDate endDate) {
return 0.0;
}
@Override
public double getDaycountFraction(final LocalDate startDate, final LocalDate endDate) {
return 1.0;
}
}
|
{
"pile_set_name": "Github"
}
|
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build amd64,linux
package unix
const (
SizeofPtr = 0x8
SizeofShort = 0x2
SizeofInt = 0x4
SizeofLong = 0x8
SizeofLongLong = 0x8
PathMax = 0x1000
)
type (
_C_short int16
_C_int int32
_C_long int64
_C_long_long int64
)
type Timespec struct {
Sec int64
Nsec int64
}
type Timeval struct {
Sec int64
Usec int64
}
type Timex struct {
Modes uint32
_ [4]byte
Offset int64
Freq int64
Maxerror int64
Esterror int64
Status int32
_ [4]byte
Constant int64
Precision int64
Tolerance int64
Time Timeval
Tick int64
Ppsfreq int64
Jitter int64
Shift int32
_ [4]byte
Stabil int64
Jitcnt int64
Calcnt int64
Errcnt int64
Stbcnt int64
Tai int32
_ [44]byte
}
type Time_t int64
type Tms struct {
Utime int64
Stime int64
Cutime int64
Cstime int64
}
type Utimbuf struct {
Actime int64
Modtime int64
}
type Rusage struct {
Utime Timeval
Stime Timeval
Maxrss int64
Ixrss int64
Idrss int64
Isrss int64
Minflt int64
Majflt int64
Nswap int64
Inblock int64
Oublock int64
Msgsnd int64
Msgrcv int64
Nsignals int64
Nvcsw int64
Nivcsw int64
}
type Rlimit struct {
Cur uint64
Max uint64
}
type _Gid_t uint32
type Stat_t struct {
Dev uint64
Ino uint64
Nlink uint64
Mode uint32
Uid uint32
Gid uint32
_ int32
Rdev uint64
Size int64
Blksize int64
Blocks int64
Atim Timespec
Mtim Timespec
Ctim Timespec
_ [3]int64
}
type StatxTimestamp struct {
Sec int64
Nsec uint32
_ int32
}
type Statx_t struct {
Mask uint32
Blksize uint32
Attributes uint64
Nlink uint32
Uid uint32
Gid uint32
Mode uint16
_ [1]uint16
Ino uint64
Size uint64
Blocks uint64
Attributes_mask uint64
Atime StatxTimestamp
Btime StatxTimestamp
Ctime StatxTimestamp
Mtime StatxTimestamp
Rdev_major uint32
Rdev_minor uint32
Dev_major uint32
Dev_minor uint32
_ [14]uint64
}
type Dirent struct {
Ino uint64
Off int64
Reclen uint16
Type uint8
Name [256]int8
_ [5]byte
}
type Fsid struct {
Val [2]int32
}
type Flock_t struct {
Type int16
Whence int16
_ [4]byte
Start int64
Len int64
Pid int32
_ [4]byte
}
type FscryptPolicy struct {
Version uint8
Contents_encryption_mode uint8
Filenames_encryption_mode uint8
Flags uint8
Master_key_descriptor [8]uint8
}
type FscryptKey struct {
Mode uint32
Raw [64]uint8
Size uint32
}
type KeyctlDHParams struct {
Private int32
Prime int32
Base int32
}
const (
FADV_NORMAL = 0x0
FADV_RANDOM = 0x1
FADV_SEQUENTIAL = 0x2
FADV_WILLNEED = 0x3
FADV_DONTNEED = 0x4
FADV_NOREUSE = 0x5
)
type RawSockaddrInet4 struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
Zero [8]uint8
}
type RawSockaddrInet6 struct {
Family uint16
Port uint16
Flowinfo uint32
Addr [16]byte /* in6_addr */
Scope_id uint32
}
type RawSockaddrUnix struct {
Family uint16
Path [108]int8
}
type RawSockaddrLinklayer struct {
Family uint16
Protocol uint16
Ifindex int32
Hatype uint16
Pkttype uint8
Halen uint8
Addr [8]uint8
}
type RawSockaddrNetlink struct {
Family uint16
Pad uint16
Pid uint32
Groups uint32
}
type RawSockaddrHCI struct {
Family uint16
Dev uint16
Channel uint16
}
type RawSockaddrL2 struct {
Family uint16
Psm uint16
Bdaddr [6]uint8
Cid uint16
Bdaddr_type uint8
_ [1]byte
}
type RawSockaddrRFCOMM struct {
Family uint16
Bdaddr [6]uint8
Channel uint8
_ [1]byte
}
type RawSockaddrCAN struct {
Family uint16
_ [2]byte
Ifindex int32
Addr [8]byte
}
type RawSockaddrALG struct {
Family uint16
Type [14]uint8
Feat uint32
Mask uint32
Name [64]uint8
}
type RawSockaddrVM struct {
Family uint16
Reserved1 uint16
Port uint32
Cid uint32
Zero [4]uint8
}
type RawSockaddrXDP struct {
Family uint16
Flags uint16
Ifindex uint32
Queue_id uint32
Shared_umem_fd uint32
}
type RawSockaddr struct {
Family uint16
Data [14]int8
}
type RawSockaddrAny struct {
Addr RawSockaddr
Pad [96]int8
}
type _Socklen uint32
type Linger struct {
Onoff int32
Linger int32
}
type Iovec struct {
Base *byte
Len uint64
}
type IPMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type IPMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type IPv6Mreq struct {
Multiaddr [16]byte /* in6_addr */
Interface uint32
}
type PacketMreq struct {
Ifindex int32
Type uint16
Alen uint16
Address [8]uint8
}
type Msghdr struct {
Name *byte
Namelen uint32
_ [4]byte
Iov *Iovec
Iovlen uint64
Control *byte
Controllen uint64
Flags int32
_ [4]byte
}
type Cmsghdr struct {
Len uint64
Level int32
Type int32
}
type Inet4Pktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type Inet6Pktinfo struct {
Addr [16]byte /* in6_addr */
Ifindex uint32
}
type IPv6MTUInfo struct {
Addr RawSockaddrInet6
Mtu uint32
}
type ICMPv6Filter struct {
Data [8]uint32
}
type Ucred struct {
Pid int32
Uid uint32
Gid uint32
}
type TCPInfo struct {
State uint8
Ca_state uint8
Retransmits uint8
Probes uint8
Backoff uint8
Options uint8
_ [2]byte
Rto uint32
Ato uint32
Snd_mss uint32
Rcv_mss uint32
Unacked uint32
Sacked uint32
Lost uint32
Retrans uint32
Fackets uint32
Last_data_sent uint32
Last_ack_sent uint32
Last_data_recv uint32
Last_ack_recv uint32
Pmtu uint32
Rcv_ssthresh uint32
Rtt uint32
Rttvar uint32
Snd_ssthresh uint32
Snd_cwnd uint32
Advmss uint32
Reordering uint32
Rcv_rtt uint32
Rcv_space uint32
Total_retrans uint32
}
const (
SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c
SizeofSockaddrAny = 0x70
SizeofSockaddrUnix = 0x6e
SizeofSockaddrLinklayer = 0x14
SizeofSockaddrNetlink = 0xc
SizeofSockaddrHCI = 0x6
SizeofSockaddrL2 = 0xe
SizeofSockaddrRFCOMM = 0xa
SizeofSockaddrCAN = 0x10
SizeofSockaddrALG = 0x58
SizeofSockaddrVM = 0x10
SizeofSockaddrXDP = 0x10
SizeofLinger = 0x8
SizeofIovec = 0x10
SizeofIPMreq = 0x8
SizeofIPMreqn = 0xc
SizeofIPv6Mreq = 0x14
SizeofPacketMreq = 0x10
SizeofMsghdr = 0x38
SizeofCmsghdr = 0x10
SizeofInet4Pktinfo = 0xc
SizeofInet6Pktinfo = 0x14
SizeofIPv6MTUInfo = 0x20
SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc
SizeofTCPInfo = 0x68
)
const (
IFA_UNSPEC = 0x0
IFA_ADDRESS = 0x1
IFA_LOCAL = 0x2
IFA_LABEL = 0x3
IFA_BROADCAST = 0x4
IFA_ANYCAST = 0x5
IFA_CACHEINFO = 0x6
IFA_MULTICAST = 0x7
IFLA_UNSPEC = 0x0
IFLA_ADDRESS = 0x1
IFLA_BROADCAST = 0x2
IFLA_IFNAME = 0x3
IFLA_INFO_KIND = 0x1
IFLA_MTU = 0x4
IFLA_LINK = 0x5
IFLA_QDISC = 0x6
IFLA_STATS = 0x7
IFLA_COST = 0x8
IFLA_PRIORITY = 0x9
IFLA_MASTER = 0xa
IFLA_WIRELESS = 0xb
IFLA_PROTINFO = 0xc
IFLA_TXQLEN = 0xd
IFLA_MAP = 0xe
IFLA_WEIGHT = 0xf
IFLA_OPERSTATE = 0x10
IFLA_LINKMODE = 0x11
IFLA_LINKINFO = 0x12
IFLA_NET_NS_PID = 0x13
IFLA_IFALIAS = 0x14
IFLA_NUM_VF = 0x15
IFLA_VFINFO_LIST = 0x16
IFLA_STATS64 = 0x17
IFLA_VF_PORTS = 0x18
IFLA_PORT_SELF = 0x19
IFLA_AF_SPEC = 0x1a
IFLA_GROUP = 0x1b
IFLA_NET_NS_FD = 0x1c
IFLA_EXT_MASK = 0x1d
IFLA_PROMISCUITY = 0x1e
IFLA_NUM_TX_QUEUES = 0x1f
IFLA_NUM_RX_QUEUES = 0x20
IFLA_CARRIER = 0x21
IFLA_PHYS_PORT_ID = 0x22
IFLA_CARRIER_CHANGES = 0x23
IFLA_PHYS_SWITCH_ID = 0x24
IFLA_LINK_NETNSID = 0x25
IFLA_PHYS_PORT_NAME = 0x26
IFLA_PROTO_DOWN = 0x27
IFLA_GSO_MAX_SEGS = 0x28
IFLA_GSO_MAX_SIZE = 0x29
IFLA_PAD = 0x2a
IFLA_XDP = 0x2b
IFLA_EVENT = 0x2c
IFLA_NEW_NETNSID = 0x2d
IFLA_IF_NETNSID = 0x2e
IFLA_MAX = 0x31
RT_SCOPE_UNIVERSE = 0x0
RT_SCOPE_SITE = 0xc8
RT_SCOPE_LINK = 0xfd
RT_SCOPE_HOST = 0xfe
RT_SCOPE_NOWHERE = 0xff
RT_TABLE_UNSPEC = 0x0
RT_TABLE_COMPAT = 0xfc
RT_TABLE_DEFAULT = 0xfd
RT_TABLE_MAIN = 0xfe
RT_TABLE_LOCAL = 0xff
RT_TABLE_MAX = 0xffffffff
RTA_UNSPEC = 0x0
RTA_DST = 0x1
RTA_SRC = 0x2
RTA_IIF = 0x3
RTA_OIF = 0x4
RTA_GATEWAY = 0x5
RTA_PRIORITY = 0x6
RTA_PREFSRC = 0x7
RTA_METRICS = 0x8
RTA_MULTIPATH = 0x9
RTA_FLOW = 0xb
RTA_CACHEINFO = 0xc
RTA_TABLE = 0xf
RTA_MARK = 0x10
RTA_MFC_STATS = 0x11
RTA_VIA = 0x12
RTA_NEWDST = 0x13
RTA_PREF = 0x14
RTA_ENCAP_TYPE = 0x15
RTA_ENCAP = 0x16
RTA_EXPIRES = 0x17
RTA_PAD = 0x18
RTA_UID = 0x19
RTA_TTL_PROPAGATE = 0x1a
RTA_IP_PROTO = 0x1b
RTA_SPORT = 0x1c
RTA_DPORT = 0x1d
RTN_UNSPEC = 0x0
RTN_UNICAST = 0x1
RTN_LOCAL = 0x2
RTN_BROADCAST = 0x3
RTN_ANYCAST = 0x4
RTN_MULTICAST = 0x5
RTN_BLACKHOLE = 0x6
RTN_UNREACHABLE = 0x7
RTN_PROHIBIT = 0x8
RTN_THROW = 0x9
RTN_NAT = 0xa
RTN_XRESOLVE = 0xb
RTNLGRP_NONE = 0x0
RTNLGRP_LINK = 0x1
RTNLGRP_NOTIFY = 0x2
RTNLGRP_NEIGH = 0x3
RTNLGRP_TC = 0x4
RTNLGRP_IPV4_IFADDR = 0x5
RTNLGRP_IPV4_MROUTE = 0x6
RTNLGRP_IPV4_ROUTE = 0x7
RTNLGRP_IPV4_RULE = 0x8
RTNLGRP_IPV6_IFADDR = 0x9
RTNLGRP_IPV6_MROUTE = 0xa
RTNLGRP_IPV6_ROUTE = 0xb
RTNLGRP_IPV6_IFINFO = 0xc
RTNLGRP_IPV6_PREFIX = 0x12
RTNLGRP_IPV6_RULE = 0x13
RTNLGRP_ND_USEROPT = 0x14
SizeofNlMsghdr = 0x10
SizeofNlMsgerr = 0x14
SizeofRtGenmsg = 0x1
SizeofNlAttr = 0x4
SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10
SizeofIfAddrmsg = 0x8
SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8
)
type NlMsghdr struct {
Len uint32
Type uint16
Flags uint16
Seq uint32
Pid uint32
}
type NlMsgerr struct {
Error int32
Msg NlMsghdr
}
type RtGenmsg struct {
Family uint8
}
type NlAttr struct {
Len uint16
Type uint16
}
type RtAttr struct {
Len uint16
Type uint16
}
type IfInfomsg struct {
Family uint8
_ uint8
Type uint16
Index int32
Flags uint32
Change uint32
}
type IfAddrmsg struct {
Family uint8
Prefixlen uint8
Flags uint8
Scope uint8
Index uint32
}
type RtMsg struct {
Family uint8
Dst_len uint8
Src_len uint8
Tos uint8
Table uint8
Protocol uint8
Scope uint8
Type uint8
Flags uint32
}
type RtNexthop struct {
Len uint16
Flags uint8
Hops uint8
Ifindex int32
}
const (
SizeofSockFilter = 0x8
SizeofSockFprog = 0x10
)
type SockFilter struct {
Code uint16
Jt uint8
Jf uint8
K uint32
}
type SockFprog struct {
Len uint16
_ [6]byte
Filter *SockFilter
}
type InotifyEvent struct {
Wd int32
Mask uint32
Cookie uint32
Len uint32
}
const SizeofInotifyEvent = 0x10
type PtraceRegs struct {
R15 uint64
R14 uint64
R13 uint64
R12 uint64
Rbp uint64
Rbx uint64
R11 uint64
R10 uint64
R9 uint64
R8 uint64
Rax uint64
Rcx uint64
Rdx uint64
Rsi uint64
Rdi uint64
Orig_rax uint64
Rip uint64
Cs uint64
Eflags uint64
Rsp uint64
Ss uint64
Fs_base uint64
Gs_base uint64
Ds uint64
Es uint64
Fs uint64
Gs uint64
}
type FdSet struct {
Bits [16]int64
}
type Sysinfo_t struct {
Uptime int64
Loads [3]uint64
Totalram uint64
Freeram uint64
Sharedram uint64
Bufferram uint64
Totalswap uint64
Freeswap uint64
Procs uint16
Pad uint16
_ [4]byte
Totalhigh uint64
Freehigh uint64
Unit uint32
_ [0]int8
_ [4]byte
}
type Utsname struct {
Sysname [65]byte
Nodename [65]byte
Release [65]byte
Version [65]byte
Machine [65]byte
Domainname [65]byte
}
type Ustat_t struct {
Tfree int32
_ [4]byte
Tinode uint64
Fname [6]int8
Fpack [6]int8
_ [4]byte
}
type EpollEvent struct {
Events uint32
Fd int32
Pad int32
}
const (
AT_EMPTY_PATH = 0x1000
AT_FDCWD = -0x64
AT_NO_AUTOMOUNT = 0x800
AT_REMOVEDIR = 0x200
AT_STATX_SYNC_AS_STAT = 0x0
AT_STATX_FORCE_SYNC = 0x2000
AT_STATX_DONT_SYNC = 0x4000
AT_SYMLINK_FOLLOW = 0x400
AT_SYMLINK_NOFOLLOW = 0x100
AT_EACCESS = 0x200
)
type PollFd struct {
Fd int32
Events int16
Revents int16
}
const (
POLLIN = 0x1
POLLPRI = 0x2
POLLOUT = 0x4
POLLRDHUP = 0x2000
POLLERR = 0x8
POLLHUP = 0x10
POLLNVAL = 0x20
)
type Sigset_t struct {
Val [16]uint64
}
const RNDGETENTCNT = 0x80045200
const PERF_IOC_FLAG_GROUP = 0x1
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Line uint8
Cc [19]uint8
Ispeed uint32
Ospeed uint32
}
type Winsize struct {
Row uint16
Col uint16
Xpixel uint16
Ypixel uint16
}
type Taskstats struct {
Version uint16
_ [2]byte
Ac_exitcode uint32
Ac_flag uint8
Ac_nice uint8
_ [6]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
}
const (
TASKSTATS_CMD_UNSPEC = 0x0
TASKSTATS_CMD_GET = 0x1
TASKSTATS_CMD_NEW = 0x2
TASKSTATS_TYPE_UNSPEC = 0x0
TASKSTATS_TYPE_PID = 0x1
TASKSTATS_TYPE_TGID = 0x2
TASKSTATS_TYPE_STATS = 0x3
TASKSTATS_TYPE_AGGR_PID = 0x4
TASKSTATS_TYPE_AGGR_TGID = 0x5
TASKSTATS_TYPE_NULL = 0x6
TASKSTATS_CMD_ATTR_UNSPEC = 0x0
TASKSTATS_CMD_ATTR_PID = 0x1
TASKSTATS_CMD_ATTR_TGID = 0x2
TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3
TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4
)
type CGroupStats struct {
Sleeping uint64
Running uint64
Stopped uint64
Uninterruptible uint64
Io_wait uint64
}
const (
CGROUPSTATS_CMD_UNSPEC = 0x3
CGROUPSTATS_CMD_GET = 0x4
CGROUPSTATS_CMD_NEW = 0x5
CGROUPSTATS_TYPE_UNSPEC = 0x0
CGROUPSTATS_TYPE_CGROUP_STATS = 0x1
CGROUPSTATS_CMD_ATTR_UNSPEC = 0x0
CGROUPSTATS_CMD_ATTR_FD = 0x1
)
type Genlmsghdr struct {
Cmd uint8
Version uint8
Reserved uint16
}
const (
CTRL_CMD_UNSPEC = 0x0
CTRL_CMD_NEWFAMILY = 0x1
CTRL_CMD_DELFAMILY = 0x2
CTRL_CMD_GETFAMILY = 0x3
CTRL_CMD_NEWOPS = 0x4
CTRL_CMD_DELOPS = 0x5
CTRL_CMD_GETOPS = 0x6
CTRL_CMD_NEWMCAST_GRP = 0x7
CTRL_CMD_DELMCAST_GRP = 0x8
CTRL_CMD_GETMCAST_GRP = 0x9
CTRL_ATTR_UNSPEC = 0x0
CTRL_ATTR_FAMILY_ID = 0x1
CTRL_ATTR_FAMILY_NAME = 0x2
CTRL_ATTR_VERSION = 0x3
CTRL_ATTR_HDRSIZE = 0x4
CTRL_ATTR_MAXATTR = 0x5
CTRL_ATTR_OPS = 0x6
CTRL_ATTR_MCAST_GROUPS = 0x7
CTRL_ATTR_OP_UNSPEC = 0x0
CTRL_ATTR_OP_ID = 0x1
CTRL_ATTR_OP_FLAGS = 0x2
CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0
CTRL_ATTR_MCAST_GRP_NAME = 0x1
CTRL_ATTR_MCAST_GRP_ID = 0x2
)
type cpuMask uint64
const (
_CPU_SETSIZE = 0x400
_NCPUBITS = 0x40
)
const (
BDADDR_BREDR = 0x0
BDADDR_LE_PUBLIC = 0x1
BDADDR_LE_RANDOM = 0x2
)
type PerfEventAttr struct {
Type uint32
Size uint32
Config uint64
Sample uint64
Sample_type uint64
Read_format uint64
Bits uint64
Wakeup uint32
Bp_type uint32
Ext1 uint64
Ext2 uint64
Branch_sample_type uint64
Sample_regs_user uint64
Sample_stack_user uint32
Clockid int32
Sample_regs_intr uint64
Aux_watermark uint32
_ uint32
}
type PerfEventMmapPage struct {
Version uint32
Compat_version uint32
Lock uint32
Index uint32
Offset int64
Time_enabled uint64
Time_running uint64
Capabilities uint64
Pmc_width uint16
Time_shift uint16
Time_mult uint32
Time_offset uint64
Time_zero uint64
Size uint32
_ [948]uint8
Data_head uint64
Data_tail uint64
Data_offset uint64
Data_size uint64
Aux_head uint64
Aux_tail uint64
Aux_offset uint64
Aux_size uint64
}
const (
PerfBitDisabled uint64 = CBitFieldMaskBit0
PerfBitInherit = CBitFieldMaskBit1
PerfBitPinned = CBitFieldMaskBit2
PerfBitExclusive = CBitFieldMaskBit3
PerfBitExcludeUser = CBitFieldMaskBit4
PerfBitExcludeKernel = CBitFieldMaskBit5
PerfBitExcludeHv = CBitFieldMaskBit6
PerfBitExcludeIdle = CBitFieldMaskBit7
PerfBitMmap = CBitFieldMaskBit8
PerfBitComm = CBitFieldMaskBit9
PerfBitFreq = CBitFieldMaskBit10
PerfBitInheritStat = CBitFieldMaskBit11
PerfBitEnableOnExec = CBitFieldMaskBit12
PerfBitTask = CBitFieldMaskBit13
PerfBitWatermark = CBitFieldMaskBit14
PerfBitPreciseIPBit1 = CBitFieldMaskBit15
PerfBitPreciseIPBit2 = CBitFieldMaskBit16
PerfBitMmapData = CBitFieldMaskBit17
PerfBitSampleIDAll = CBitFieldMaskBit18
PerfBitExcludeHost = CBitFieldMaskBit19
PerfBitExcludeGuest = CBitFieldMaskBit20
PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
PerfBitExcludeCallchainUser = CBitFieldMaskBit22
PerfBitMmap2 = CBitFieldMaskBit23
PerfBitCommExec = CBitFieldMaskBit24
PerfBitUseClockID = CBitFieldMaskBit25
PerfBitContextSwitch = CBitFieldMaskBit26
)
const (
PERF_TYPE_HARDWARE = 0x0
PERF_TYPE_SOFTWARE = 0x1
PERF_TYPE_TRACEPOINT = 0x2
PERF_TYPE_HW_CACHE = 0x3
PERF_TYPE_RAW = 0x4
PERF_TYPE_BREAKPOINT = 0x5
PERF_COUNT_HW_CPU_CYCLES = 0x0
PERF_COUNT_HW_INSTRUCTIONS = 0x1
PERF_COUNT_HW_CACHE_REFERENCES = 0x2
PERF_COUNT_HW_CACHE_MISSES = 0x3
PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
PERF_COUNT_HW_BRANCH_MISSES = 0x5
PERF_COUNT_HW_BUS_CYCLES = 0x6
PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
PERF_COUNT_HW_CACHE_L1D = 0x0
PERF_COUNT_HW_CACHE_L1I = 0x1
PERF_COUNT_HW_CACHE_LL = 0x2
PERF_COUNT_HW_CACHE_DTLB = 0x3
PERF_COUNT_HW_CACHE_ITLB = 0x4
PERF_COUNT_HW_CACHE_BPU = 0x5
PERF_COUNT_HW_CACHE_NODE = 0x6
PERF_COUNT_HW_CACHE_OP_READ = 0x0
PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
PERF_COUNT_SW_CPU_CLOCK = 0x0
PERF_COUNT_SW_TASK_CLOCK = 0x1
PERF_COUNT_SW_PAGE_FAULTS = 0x2
PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
PERF_COUNT_SW_EMULATION_FAULTS = 0x8
PERF_COUNT_SW_DUMMY = 0x9
PERF_SAMPLE_IP = 0x1
PERF_SAMPLE_TID = 0x2
PERF_SAMPLE_TIME = 0x4
PERF_SAMPLE_ADDR = 0x8
PERF_SAMPLE_READ = 0x10
PERF_SAMPLE_CALLCHAIN = 0x20
PERF_SAMPLE_ID = 0x40
PERF_SAMPLE_CPU = 0x80
PERF_SAMPLE_PERIOD = 0x100
PERF_SAMPLE_STREAM_ID = 0x200
PERF_SAMPLE_RAW = 0x400
PERF_SAMPLE_BRANCH_STACK = 0x800
PERF_SAMPLE_BRANCH_USER = 0x1
PERF_SAMPLE_BRANCH_KERNEL = 0x2
PERF_SAMPLE_BRANCH_HV = 0x4
PERF_SAMPLE_BRANCH_ANY = 0x8
PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
PERF_SAMPLE_BRANCH_IND_CALL = 0x40
PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
PERF_FORMAT_ID = 0x4
PERF_FORMAT_GROUP = 0x8
PERF_RECORD_MMAP = 0x1
PERF_RECORD_LOST = 0x2
PERF_RECORD_COMM = 0x3
PERF_RECORD_EXIT = 0x4
PERF_RECORD_THROTTLE = 0x5
PERF_RECORD_UNTHROTTLE = 0x6
PERF_RECORD_FORK = 0x7
PERF_RECORD_READ = 0x8
PERF_RECORD_SAMPLE = 0x9
PERF_CONTEXT_HV = -0x20
PERF_CONTEXT_KERNEL = -0x80
PERF_CONTEXT_USER = -0x200
PERF_CONTEXT_GUEST = -0x800
PERF_CONTEXT_GUEST_KERNEL = -0x880
PERF_CONTEXT_GUEST_USER = -0xa00
PERF_FLAG_FD_NO_GROUP = 0x1
PERF_FLAG_FD_OUTPUT = 0x2
PERF_FLAG_PID_CGROUP = 0x4
)
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
_ [118]int8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
type HDDriveCmdHdr struct {
Command uint8
Number uint8
Feature uint8
Count uint8
}
type HDGeometry struct {
Heads uint8
Sectors uint8
Cylinders uint16
_ [4]byte
Start uint64
}
type HDDriveID struct {
Config uint16
Cyls uint16
Reserved2 uint16
Heads uint16
Track_bytes uint16
Sector_bytes uint16
Sectors uint16
Vendor0 uint16
Vendor1 uint16
Vendor2 uint16
Serial_no [20]uint8
Buf_type uint16
Buf_size uint16
Ecc_bytes uint16
Fw_rev [8]uint8
Model [40]uint8
Max_multsect uint8
Vendor3 uint8
Dword_io uint16
Vendor4 uint8
Capability uint8
Reserved50 uint16
Vendor5 uint8
TPIO uint8
Vendor6 uint8
TDMA uint8
Field_valid uint16
Cur_cyls uint16
Cur_heads uint16
Cur_sectors uint16
Cur_capacity0 uint16
Cur_capacity1 uint16
Multsect uint8
Multsect_valid uint8
Lba_capacity uint32
Dma_1word uint16
Dma_mword uint16
Eide_pio_modes uint16
Eide_dma_min uint16
Eide_dma_time uint16
Eide_pio uint16
Eide_pio_iordy uint16
Words69_70 [2]uint16
Words71_74 [4]uint16
Queue_depth uint16
Words76_79 [4]uint16
Major_rev_num uint16
Minor_rev_num uint16
Command_set_1 uint16
Command_set_2 uint16
Cfsse uint16
Cfs_enable_1 uint16
Cfs_enable_2 uint16
Csf_default uint16
Dma_ultra uint16
Trseuc uint16
TrsEuc uint16
CurAPMvalues uint16
Mprc uint16
Hw_config uint16
Acoustic uint16
Msrqs uint16
Sxfert uint16
Sal uint16
Spg uint32
Lba_capacity_2 uint64
Words104_125 [22]uint16
Last_lun uint16
Word127 uint16
Dlf uint16
Csfo uint16
Words130_155 [26]uint16
Word156 uint16
Words157_159 [3]uint16
Cfa_power uint16
Words161_175 [15]uint16
Words176_205 [30]uint16
Words206_254 [49]uint16
Integrity_word uint16
}
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid Fsid
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
const (
ST_MANDLOCK = 0x40
ST_NOATIME = 0x400
ST_NODEV = 0x4
ST_NODIRATIME = 0x800
ST_NOEXEC = 0x8
ST_NOSUID = 0x2
ST_RDONLY = 0x1
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
const (
NF_INET_PRE_ROUTING = 0x0
NF_INET_LOCAL_IN = 0x1
NF_INET_FORWARD = 0x2
NF_INET_LOCAL_OUT = 0x3
NF_INET_POST_ROUTING = 0x4
NF_INET_NUMHOOKS = 0x5
)
const (
NF_NETDEV_INGRESS = 0x0
NF_NETDEV_NUMHOOKS = 0x1
)
const (
NFPROTO_UNSPEC = 0x0
NFPROTO_INET = 0x1
NFPROTO_IPV4 = 0x2
NFPROTO_ARP = 0x3
NFPROTO_NETDEV = 0x5
NFPROTO_BRIDGE = 0x7
NFPROTO_IPV6 = 0xa
NFPROTO_DECNET = 0xc
NFPROTO_NUMPROTO = 0xd
)
type Nfgenmsg struct {
Nfgen_family uint8
Version uint8
Res_id uint16
}
const (
NFNL_BATCH_UNSPEC = 0x0
NFNL_BATCH_GENID = 0x1
)
const (
NFT_REG_VERDICT = 0x0
NFT_REG_1 = 0x1
NFT_REG_2 = 0x2
NFT_REG_3 = 0x3
NFT_REG_4 = 0x4
NFT_REG32_00 = 0x8
NFT_REG32_01 = 0x9
NFT_REG32_02 = 0xa
NFT_REG32_03 = 0xb
NFT_REG32_04 = 0xc
NFT_REG32_05 = 0xd
NFT_REG32_06 = 0xe
NFT_REG32_07 = 0xf
NFT_REG32_08 = 0x10
NFT_REG32_09 = 0x11
NFT_REG32_10 = 0x12
NFT_REG32_11 = 0x13
NFT_REG32_12 = 0x14
NFT_REG32_13 = 0x15
NFT_REG32_14 = 0x16
NFT_REG32_15 = 0x17
NFT_CONTINUE = -0x1
NFT_BREAK = -0x2
NFT_JUMP = -0x3
NFT_GOTO = -0x4
NFT_RETURN = -0x5
NFT_MSG_NEWTABLE = 0x0
NFT_MSG_GETTABLE = 0x1
NFT_MSG_DELTABLE = 0x2
NFT_MSG_NEWCHAIN = 0x3
NFT_MSG_GETCHAIN = 0x4
NFT_MSG_DELCHAIN = 0x5
NFT_MSG_NEWRULE = 0x6
NFT_MSG_GETRULE = 0x7
NFT_MSG_DELRULE = 0x8
NFT_MSG_NEWSET = 0x9
NFT_MSG_GETSET = 0xa
NFT_MSG_DELSET = 0xb
NFT_MSG_NEWSETELEM = 0xc
NFT_MSG_GETSETELEM = 0xd
NFT_MSG_DELSETELEM = 0xe
NFT_MSG_NEWGEN = 0xf
NFT_MSG_GETGEN = 0x10
NFT_MSG_TRACE = 0x11
NFT_MSG_NEWOBJ = 0x12
NFT_MSG_GETOBJ = 0x13
NFT_MSG_DELOBJ = 0x14
NFT_MSG_GETOBJ_RESET = 0x15
NFT_MSG_MAX = 0x19
NFTA_LIST_UNPEC = 0x0
NFTA_LIST_ELEM = 0x1
NFTA_HOOK_UNSPEC = 0x0
NFTA_HOOK_HOOKNUM = 0x1
NFTA_HOOK_PRIORITY = 0x2
NFTA_HOOK_DEV = 0x3
NFT_TABLE_F_DORMANT = 0x1
NFTA_TABLE_UNSPEC = 0x0
NFTA_TABLE_NAME = 0x1
NFTA_TABLE_FLAGS = 0x2
NFTA_TABLE_USE = 0x3
NFTA_CHAIN_UNSPEC = 0x0
NFTA_CHAIN_TABLE = 0x1
NFTA_CHAIN_HANDLE = 0x2
NFTA_CHAIN_NAME = 0x3
NFTA_CHAIN_HOOK = 0x4
NFTA_CHAIN_POLICY = 0x5
NFTA_CHAIN_USE = 0x6
NFTA_CHAIN_TYPE = 0x7
NFTA_CHAIN_COUNTERS = 0x8
NFTA_CHAIN_PAD = 0x9
NFTA_RULE_UNSPEC = 0x0
NFTA_RULE_TABLE = 0x1
NFTA_RULE_CHAIN = 0x2
NFTA_RULE_HANDLE = 0x3
NFTA_RULE_EXPRESSIONS = 0x4
NFTA_RULE_COMPAT = 0x5
NFTA_RULE_POSITION = 0x6
NFTA_RULE_USERDATA = 0x7
NFTA_RULE_PAD = 0x8
NFTA_RULE_ID = 0x9
NFT_RULE_COMPAT_F_INV = 0x2
NFT_RULE_COMPAT_F_MASK = 0x2
NFTA_RULE_COMPAT_UNSPEC = 0x0
NFTA_RULE_COMPAT_PROTO = 0x1
NFTA_RULE_COMPAT_FLAGS = 0x2
NFT_SET_ANONYMOUS = 0x1
NFT_SET_CONSTANT = 0x2
NFT_SET_INTERVAL = 0x4
NFT_SET_MAP = 0x8
NFT_SET_TIMEOUT = 0x10
NFT_SET_EVAL = 0x20
NFT_SET_OBJECT = 0x40
NFT_SET_POL_PERFORMANCE = 0x0
NFT_SET_POL_MEMORY = 0x1
NFTA_SET_DESC_UNSPEC = 0x0
NFTA_SET_DESC_SIZE = 0x1
NFTA_SET_UNSPEC = 0x0
NFTA_SET_TABLE = 0x1
NFTA_SET_NAME = 0x2
NFTA_SET_FLAGS = 0x3
NFTA_SET_KEY_TYPE = 0x4
NFTA_SET_KEY_LEN = 0x5
NFTA_SET_DATA_TYPE = 0x6
NFTA_SET_DATA_LEN = 0x7
NFTA_SET_POLICY = 0x8
NFTA_SET_DESC = 0x9
NFTA_SET_ID = 0xa
NFTA_SET_TIMEOUT = 0xb
NFTA_SET_GC_INTERVAL = 0xc
NFTA_SET_USERDATA = 0xd
NFTA_SET_PAD = 0xe
NFTA_SET_OBJ_TYPE = 0xf
NFT_SET_ELEM_INTERVAL_END = 0x1
NFTA_SET_ELEM_UNSPEC = 0x0
NFTA_SET_ELEM_KEY = 0x1
NFTA_SET_ELEM_DATA = 0x2
NFTA_SET_ELEM_FLAGS = 0x3
NFTA_SET_ELEM_TIMEOUT = 0x4
NFTA_SET_ELEM_EXPIRATION = 0x5
NFTA_SET_ELEM_USERDATA = 0x6
NFTA_SET_ELEM_EXPR = 0x7
NFTA_SET_ELEM_PAD = 0x8
NFTA_SET_ELEM_OBJREF = 0x9
NFTA_SET_ELEM_LIST_UNSPEC = 0x0
NFTA_SET_ELEM_LIST_TABLE = 0x1
NFTA_SET_ELEM_LIST_SET = 0x2
NFTA_SET_ELEM_LIST_ELEMENTS = 0x3
NFTA_SET_ELEM_LIST_SET_ID = 0x4
NFT_DATA_VALUE = 0x0
NFT_DATA_VERDICT = 0xffffff00
NFTA_DATA_UNSPEC = 0x0
NFTA_DATA_VALUE = 0x1
NFTA_DATA_VERDICT = 0x2
NFTA_VERDICT_UNSPEC = 0x0
NFTA_VERDICT_CODE = 0x1
NFTA_VERDICT_CHAIN = 0x2
NFTA_EXPR_UNSPEC = 0x0
NFTA_EXPR_NAME = 0x1
NFTA_EXPR_DATA = 0x2
NFTA_IMMEDIATE_UNSPEC = 0x0
NFTA_IMMEDIATE_DREG = 0x1
NFTA_IMMEDIATE_DATA = 0x2
NFTA_BITWISE_UNSPEC = 0x0
NFTA_BITWISE_SREG = 0x1
NFTA_BITWISE_DREG = 0x2
NFTA_BITWISE_LEN = 0x3
NFTA_BITWISE_MASK = 0x4
NFTA_BITWISE_XOR = 0x5
NFT_BYTEORDER_NTOH = 0x0
NFT_BYTEORDER_HTON = 0x1
NFTA_BYTEORDER_UNSPEC = 0x0
NFTA_BYTEORDER_SREG = 0x1
NFTA_BYTEORDER_DREG = 0x2
NFTA_BYTEORDER_OP = 0x3
NFTA_BYTEORDER_LEN = 0x4
NFTA_BYTEORDER_SIZE = 0x5
NFT_CMP_EQ = 0x0
NFT_CMP_NEQ = 0x1
NFT_CMP_LT = 0x2
NFT_CMP_LTE = 0x3
NFT_CMP_GT = 0x4
NFT_CMP_GTE = 0x5
NFTA_CMP_UNSPEC = 0x0
NFTA_CMP_SREG = 0x1
NFTA_CMP_OP = 0x2
NFTA_CMP_DATA = 0x3
NFT_RANGE_EQ = 0x0
NFT_RANGE_NEQ = 0x1
NFTA_RANGE_UNSPEC = 0x0
NFTA_RANGE_SREG = 0x1
NFTA_RANGE_OP = 0x2
NFTA_RANGE_FROM_DATA = 0x3
NFTA_RANGE_TO_DATA = 0x4
NFT_LOOKUP_F_INV = 0x1
NFTA_LOOKUP_UNSPEC = 0x0
NFTA_LOOKUP_SET = 0x1
NFTA_LOOKUP_SREG = 0x2
NFTA_LOOKUP_DREG = 0x3
NFTA_LOOKUP_SET_ID = 0x4
NFTA_LOOKUP_FLAGS = 0x5
NFT_DYNSET_OP_ADD = 0x0
NFT_DYNSET_OP_UPDATE = 0x1
NFT_DYNSET_F_INV = 0x1
NFTA_DYNSET_UNSPEC = 0x0
NFTA_DYNSET_SET_NAME = 0x1
NFTA_DYNSET_SET_ID = 0x2
NFTA_DYNSET_OP = 0x3
NFTA_DYNSET_SREG_KEY = 0x4
NFTA_DYNSET_SREG_DATA = 0x5
NFTA_DYNSET_TIMEOUT = 0x6
NFTA_DYNSET_EXPR = 0x7
NFTA_DYNSET_PAD = 0x8
NFTA_DYNSET_FLAGS = 0x9
NFT_PAYLOAD_LL_HEADER = 0x0
NFT_PAYLOAD_NETWORK_HEADER = 0x1
NFT_PAYLOAD_TRANSPORT_HEADER = 0x2
NFT_PAYLOAD_CSUM_NONE = 0x0
NFT_PAYLOAD_CSUM_INET = 0x1
NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1
NFTA_PAYLOAD_UNSPEC = 0x0
NFTA_PAYLOAD_DREG = 0x1
NFTA_PAYLOAD_BASE = 0x2
NFTA_PAYLOAD_OFFSET = 0x3
NFTA_PAYLOAD_LEN = 0x4
NFTA_PAYLOAD_SREG = 0x5
NFTA_PAYLOAD_CSUM_TYPE = 0x6
NFTA_PAYLOAD_CSUM_OFFSET = 0x7
NFTA_PAYLOAD_CSUM_FLAGS = 0x8
NFT_EXTHDR_F_PRESENT = 0x1
NFT_EXTHDR_OP_IPV6 = 0x0
NFT_EXTHDR_OP_TCPOPT = 0x1
NFTA_EXTHDR_UNSPEC = 0x0
NFTA_EXTHDR_DREG = 0x1
NFTA_EXTHDR_TYPE = 0x2
NFTA_EXTHDR_OFFSET = 0x3
NFTA_EXTHDR_LEN = 0x4
NFTA_EXTHDR_FLAGS = 0x5
NFTA_EXTHDR_OP = 0x6
NFTA_EXTHDR_SREG = 0x7
NFT_META_LEN = 0x0
NFT_META_PROTOCOL = 0x1
NFT_META_PRIORITY = 0x2
NFT_META_MARK = 0x3
NFT_META_IIF = 0x4
NFT_META_OIF = 0x5
NFT_META_IIFNAME = 0x6
NFT_META_OIFNAME = 0x7
NFT_META_IIFTYPE = 0x8
NFT_META_OIFTYPE = 0x9
NFT_META_SKUID = 0xa
NFT_META_SKGID = 0xb
NFT_META_NFTRACE = 0xc
NFT_META_RTCLASSID = 0xd
NFT_META_SECMARK = 0xe
NFT_META_NFPROTO = 0xf
NFT_META_L4PROTO = 0x10
NFT_META_BRI_IIFNAME = 0x11
NFT_META_BRI_OIFNAME = 0x12
NFT_META_PKTTYPE = 0x13
NFT_META_CPU = 0x14
NFT_META_IIFGROUP = 0x15
NFT_META_OIFGROUP = 0x16
NFT_META_CGROUP = 0x17
NFT_META_PRANDOM = 0x18
NFT_RT_CLASSID = 0x0
NFT_RT_NEXTHOP4 = 0x1
NFT_RT_NEXTHOP6 = 0x2
NFT_RT_TCPMSS = 0x3
NFT_HASH_JENKINS = 0x0
NFT_HASH_SYM = 0x1
NFTA_HASH_UNSPEC = 0x0
NFTA_HASH_SREG = 0x1
NFTA_HASH_DREG = 0x2
NFTA_HASH_LEN = 0x3
NFTA_HASH_MODULUS = 0x4
NFTA_HASH_SEED = 0x5
NFTA_HASH_OFFSET = 0x6
NFTA_HASH_TYPE = 0x7
NFTA_META_UNSPEC = 0x0
NFTA_META_DREG = 0x1
NFTA_META_KEY = 0x2
NFTA_META_SREG = 0x3
NFTA_RT_UNSPEC = 0x0
NFTA_RT_DREG = 0x1
NFTA_RT_KEY = 0x2
NFT_CT_STATE = 0x0
NFT_CT_DIRECTION = 0x1
NFT_CT_STATUS = 0x2
NFT_CT_MARK = 0x3
NFT_CT_SECMARK = 0x4
NFT_CT_EXPIRATION = 0x5
NFT_CT_HELPER = 0x6
NFT_CT_L3PROTOCOL = 0x7
NFT_CT_SRC = 0x8
NFT_CT_DST = 0x9
NFT_CT_PROTOCOL = 0xa
NFT_CT_PROTO_SRC = 0xb
NFT_CT_PROTO_DST = 0xc
NFT_CT_LABELS = 0xd
NFT_CT_PKTS = 0xe
NFT_CT_BYTES = 0xf
NFT_CT_AVGPKT = 0x10
NFT_CT_ZONE = 0x11
NFT_CT_EVENTMASK = 0x12
NFTA_CT_UNSPEC = 0x0
NFTA_CT_DREG = 0x1
NFTA_CT_KEY = 0x2
NFTA_CT_DIRECTION = 0x3
NFTA_CT_SREG = 0x4
NFT_LIMIT_PKTS = 0x0
NFT_LIMIT_PKT_BYTES = 0x1
NFT_LIMIT_F_INV = 0x1
NFTA_LIMIT_UNSPEC = 0x0
NFTA_LIMIT_RATE = 0x1
NFTA_LIMIT_UNIT = 0x2
NFTA_LIMIT_BURST = 0x3
NFTA_LIMIT_TYPE = 0x4
NFTA_LIMIT_FLAGS = 0x5
NFTA_LIMIT_PAD = 0x6
NFTA_COUNTER_UNSPEC = 0x0
NFTA_COUNTER_BYTES = 0x1
NFTA_COUNTER_PACKETS = 0x2
NFTA_COUNTER_PAD = 0x3
NFTA_LOG_UNSPEC = 0x0
NFTA_LOG_GROUP = 0x1
NFTA_LOG_PREFIX = 0x2
NFTA_LOG_SNAPLEN = 0x3
NFTA_LOG_QTHRESHOLD = 0x4
NFTA_LOG_LEVEL = 0x5
NFTA_LOG_FLAGS = 0x6
NFTA_QUEUE_UNSPEC = 0x0
NFTA_QUEUE_NUM = 0x1
NFTA_QUEUE_TOTAL = 0x2
NFTA_QUEUE_FLAGS = 0x3
NFTA_QUEUE_SREG_QNUM = 0x4
NFT_QUOTA_F_INV = 0x1
NFT_QUOTA_F_DEPLETED = 0x2
NFTA_QUOTA_UNSPEC = 0x0
NFTA_QUOTA_BYTES = 0x1
NFTA_QUOTA_FLAGS = 0x2
NFTA_QUOTA_PAD = 0x3
NFTA_QUOTA_CONSUMED = 0x4
NFT_REJECT_ICMP_UNREACH = 0x0
NFT_REJECT_TCP_RST = 0x1
NFT_REJECT_ICMPX_UNREACH = 0x2
NFT_REJECT_ICMPX_NO_ROUTE = 0x0
NFT_REJECT_ICMPX_PORT_UNREACH = 0x1
NFT_REJECT_ICMPX_HOST_UNREACH = 0x2
NFT_REJECT_ICMPX_ADMIN_PROHIBITED = 0x3
NFTA_REJECT_UNSPEC = 0x0
NFTA_REJECT_TYPE = 0x1
NFTA_REJECT_ICMP_CODE = 0x2
NFT_NAT_SNAT = 0x0
NFT_NAT_DNAT = 0x1
NFTA_NAT_UNSPEC = 0x0
NFTA_NAT_TYPE = 0x1
NFTA_NAT_FAMILY = 0x2
NFTA_NAT_REG_ADDR_MIN = 0x3
NFTA_NAT_REG_ADDR_MAX = 0x4
NFTA_NAT_REG_PROTO_MIN = 0x5
NFTA_NAT_REG_PROTO_MAX = 0x6
NFTA_NAT_FLAGS = 0x7
NFTA_MASQ_UNSPEC = 0x0
NFTA_MASQ_FLAGS = 0x1
NFTA_MASQ_REG_PROTO_MIN = 0x2
NFTA_MASQ_REG_PROTO_MAX = 0x3
NFTA_REDIR_UNSPEC = 0x0
NFTA_REDIR_REG_PROTO_MIN = 0x1
NFTA_REDIR_REG_PROTO_MAX = 0x2
NFTA_REDIR_FLAGS = 0x3
NFTA_DUP_UNSPEC = 0x0
NFTA_DUP_SREG_ADDR = 0x1
NFTA_DUP_SREG_DEV = 0x2
NFTA_FWD_UNSPEC = 0x0
NFTA_FWD_SREG_DEV = 0x1
NFTA_OBJREF_UNSPEC = 0x0
NFTA_OBJREF_IMM_TYPE = 0x1
NFTA_OBJREF_IMM_NAME = 0x2
NFTA_OBJREF_SET_SREG = 0x3
NFTA_OBJREF_SET_NAME = 0x4
NFTA_OBJREF_SET_ID = 0x5
NFTA_GEN_UNSPEC = 0x0
NFTA_GEN_ID = 0x1
NFTA_GEN_PROC_PID = 0x2
NFTA_GEN_PROC_NAME = 0x3
NFTA_FIB_UNSPEC = 0x0
NFTA_FIB_DREG = 0x1
NFTA_FIB_RESULT = 0x2
NFTA_FIB_FLAGS = 0x3
NFT_FIB_RESULT_UNSPEC = 0x0
NFT_FIB_RESULT_OIF = 0x1
NFT_FIB_RESULT_OIFNAME = 0x2
NFT_FIB_RESULT_ADDRTYPE = 0x3
NFTA_FIB_F_SADDR = 0x1
NFTA_FIB_F_DADDR = 0x2
NFTA_FIB_F_MARK = 0x4
NFTA_FIB_F_IIF = 0x8
NFTA_FIB_F_OIF = 0x10
NFTA_FIB_F_PRESENT = 0x20
NFTA_CT_HELPER_UNSPEC = 0x0
NFTA_CT_HELPER_NAME = 0x1
NFTA_CT_HELPER_L3PROTO = 0x2
NFTA_CT_HELPER_L4PROTO = 0x3
NFTA_OBJ_UNSPEC = 0x0
NFTA_OBJ_TABLE = 0x1
NFTA_OBJ_NAME = 0x2
NFTA_OBJ_TYPE = 0x3
NFTA_OBJ_DATA = 0x4
NFTA_OBJ_USE = 0x5
NFTA_TRACE_UNSPEC = 0x0
NFTA_TRACE_TABLE = 0x1
NFTA_TRACE_CHAIN = 0x2
NFTA_TRACE_RULE_HANDLE = 0x3
NFTA_TRACE_TYPE = 0x4
NFTA_TRACE_VERDICT = 0x5
NFTA_TRACE_ID = 0x6
NFTA_TRACE_LL_HEADER = 0x7
NFTA_TRACE_NETWORK_HEADER = 0x8
NFTA_TRACE_TRANSPORT_HEADER = 0x9
NFTA_TRACE_IIF = 0xa
NFTA_TRACE_IIFTYPE = 0xb
NFTA_TRACE_OIF = 0xc
NFTA_TRACE_OIFTYPE = 0xd
NFTA_TRACE_MARK = 0xe
NFTA_TRACE_NFPROTO = 0xf
NFTA_TRACE_POLICY = 0x10
NFTA_TRACE_PAD = 0x11
NFT_TRACETYPE_UNSPEC = 0x0
NFT_TRACETYPE_POLICY = 0x1
NFT_TRACETYPE_RETURN = 0x2
NFT_TRACETYPE_RULE = 0x3
NFTA_NG_UNSPEC = 0x0
NFTA_NG_DREG = 0x1
NFTA_NG_MODULUS = 0x2
NFTA_NG_TYPE = 0x3
NFTA_NG_OFFSET = 0x4
NFT_NG_INCREMENTAL = 0x0
NFT_NG_RANDOM = 0x1
)
type RTCTime struct {
Sec int32
Min int32
Hour int32
Mday int32
Mon int32
Year int32
Wday int32
Yday int32
Isdst int32
}
type RTCWkAlrm struct {
Enabled uint8
Pending uint8
_ [2]byte
Time RTCTime
}
type RTCPLLInfo struct {
Ctrl int32
Value int32
Max int32
Min int32
Posmult int32
Negmult int32
Clock int64
}
type BlkpgIoctlArg struct {
Op int32
Flags int32
Datalen int32
_ [4]byte
Data *byte
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x1269
BLKPG_ADD_PARTITION = 0x1
BLKPG_DEL_PARTITION = 0x2
BLKPG_RESIZE_PARTITION = 0x3
)
const (
NETNSA_NONE = 0x0
NETNSA_NSID = 0x1
NETNSA_PID = 0x2
NETNSA_FD = 0x3
)
type XDPRingOffset struct {
Producer uint64
Consumer uint64
Desc uint64
}
type XDPMmapOffsets struct {
Rx XDPRingOffset
Tx XDPRingOffset
Fr XDPRingOffset
Cr XDPRingOffset
}
type XDPUmemReg struct {
Addr uint64
Len uint64
Size uint32
Headroom uint32
}
type XDPStatistics struct {
Rx_dropped uint64
Rx_invalid_descs uint64
Tx_invalid_descs uint64
}
type XDPDesc struct {
Addr uint64
Len uint32
Options uint32
}
const (
NCSI_CMD_UNSPEC = 0x0
NCSI_CMD_PKG_INFO = 0x1
NCSI_CMD_SET_INTERFACE = 0x2
NCSI_CMD_CLEAR_INTERFACE = 0x3
NCSI_ATTR_UNSPEC = 0x0
NCSI_ATTR_IFINDEX = 0x1
NCSI_ATTR_PACKAGE_LIST = 0x2
NCSI_ATTR_PACKAGE_ID = 0x3
NCSI_ATTR_CHANNEL_ID = 0x4
NCSI_PKG_ATTR_UNSPEC = 0x0
NCSI_PKG_ATTR = 0x1
NCSI_PKG_ATTR_ID = 0x2
NCSI_PKG_ATTR_FORCED = 0x3
NCSI_PKG_ATTR_CHANNEL_LIST = 0x4
NCSI_CHANNEL_ATTR_UNSPEC = 0x0
NCSI_CHANNEL_ATTR = 0x1
NCSI_CHANNEL_ATTR_ID = 0x2
NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3
NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4
NCSI_CHANNEL_ATTR_VERSION_STR = 0x5
NCSI_CHANNEL_ATTR_LINK_STATE = 0x6
NCSI_CHANNEL_ATTR_ACTIVE = 0x7
NCSI_CHANNEL_ATTR_FORCED = 0x8
NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9
NCSI_CHANNEL_ATTR_VLAN_ID = 0xa
)
|
{
"pile_set_name": "Github"
}
|
KDWSDL_OPTIONS = -namespace KDAB
include( $${TOP_SOURCE_DIR}/unittests/unittests.pri )
QT += network xml
SOURCES = test_dwservice_combined_wsdl.cpp
test.target = test
test.commands = ./$(TARGET)
test.depends = $(TARGET)
QMAKE_EXTRA_TARGETS += test
KDWSDL = DWServiceCombined.wsdl
OTHER_FILES += $$KDWSDL
|
{
"pile_set_name": "Github"
}
|
package com.oasisfeng.android.ui;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.PaintDrawable;
import androidx.annotation.UiThread;
/**
* Utility class to resize icons to match default icon size.
*
* Derived from {@link android.app.LauncherActivity.IconResizer}
*/
public class IconResizer {
// Code is borrowed from com.android.launcher.Utilities.
private final int mIconWidth, mIconHeight;
private final Rect mOldBounds = new Rect();
private final Canvas mCanvas = new Canvas();
public IconResizer() {
this((int) Resources.getSystem().getDimension(android.R.dimen.app_icon_size));
}
public IconResizer(final int size) {
mCanvas.setDrawFilter(new PaintFlagsDrawFilter(Paint.DITHER_FLAG,
Paint.FILTER_BITMAP_FLAG));
mIconWidth = mIconHeight = size;
}
/**
* Returns a Drawable representing the thumbnail of the specified Drawable.
* The size of the thumbnail is defined by the dimension
* android.R.dimen.launcher_application_icon_size.
*
* This method is not thread-safe and should be invoked on the UI thread only.
*
* @param icon The icon to get a thumbnail of.
*
* @return A thumbnail for the specified icon or the icon itself if the
* thumbnail could not be created.
*/
@UiThread public Drawable createIconThumbnail(Drawable icon) {
int width = mIconWidth;
int height = mIconHeight;
final int iconWidth = icon.getIntrinsicWidth();
final int iconHeight = icon.getIntrinsicHeight();
if (icon instanceof PaintDrawable) {
final PaintDrawable painter = (PaintDrawable) icon;
painter.setIntrinsicWidth(width);
painter.setIntrinsicHeight(height);
}
if (width > 0 && height > 0) {
if (width < iconWidth || height < iconHeight) {
final float ratio = (float) iconWidth / iconHeight;
if (iconWidth > iconHeight) {
height = (int) (width / ratio);
} else if (iconHeight > iconWidth) {
width = (int) (height * ratio);
}
final Bitmap.Config c = icon.getOpacity() != PixelFormat.OPAQUE ?
Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565;
final Bitmap thumb = Bitmap.createBitmap(mIconWidth, mIconHeight, c);
final Canvas canvas = mCanvas;
canvas.setBitmap(thumb);
// Copy the old bounds to restore them later
// If we were to do oldBounds = icon.getBounds(),
// the call to setBounds() that follows would
// change the same instance and we would lose the
// old bounds
mOldBounds.set(icon.getBounds());
final int x = (mIconWidth - width) / 2;
final int y = (mIconHeight - height) / 2;
icon.setBounds(x, y, x + width, y + height);
icon.draw(canvas);
icon.setBounds(mOldBounds);
icon = new BitmapDrawable(Resources.getSystem(), thumb);
canvas.setBitmap(null);
} else if (iconWidth < width && iconHeight < height) {
final Bitmap.Config c = Bitmap.Config.ARGB_8888;
final Bitmap thumb = Bitmap.createBitmap(mIconWidth, mIconHeight, c);
final Canvas canvas = mCanvas;
canvas.setBitmap(thumb);
mOldBounds.set(icon.getBounds());
final int x = (width - iconWidth) / 2;
final int y = (height - iconHeight) / 2;
icon.setBounds(x, y, x + iconWidth, y + iconHeight);
icon.draw(canvas);
icon.setBounds(mOldBounds);
icon = new BitmapDrawable(Resources.getSystem(), thumb);
canvas.setBitmap(null);
}
}
return icon;
}
}
|
{
"pile_set_name": "Github"
}
|
/* GRID OF TWELVE ============================================================================= */
.span_12_of_12 {
width: 100%;
}
.span_11_of_12 {
width: 91.46%;
}
.span_10_of_12 {
width: 83%;
}
.span_9_of_12 {
width: 74.54%;
}
.span_8_of_12 {
width: 66.08%;
}
.span_7_of_12 {
width: 57.62%;
}
.span_6_of_12 {
width: 49.16%;
}
.span_5_of_12 {
width: 40.7%;
}
.span_4_of_12 {
width: 32.24%;
}
.span_3_of_12 {
width: 23.78%;
}
.span_2_of_12 {
width: 15.32%;
}
.span_1_of_12 {
width: 6.86%;
}
/* GO FULL WIDTH AT LESS THAN 480 PIXELS */
@media only screen and (max-width: 480px) {
.span_12_of_12 {
width: 100%;
}
.span_11_of_12 {
width: 100%;
}
.span_10_of_12 {
width: 100%;
}
.span_9_of_12 {
width: 100%;
}
.span_8_of_12 {
width: 100%;
}
.span_7_of_12 {
width: 100%;
}
.span_6_of_12 {
width: 100%;
}
.span_5_of_12 {
width: 100%;
}
.span_4_of_12 {
width: 100%;
}
.span_3_of_12 {
width: 100%;
}
.span_2_of_12 {
width: 100%;
}
.span_1_of_12 {
width: 100%;
}
}
|
{
"pile_set_name": "Github"
}
|
<script>
const AvatarChip = require("../../core/components/AvatarChip.svelte");
export let msg;
let person = msg.value.author;
let otherPersonFeed = encodeURIComponent(msg.value.content.contact);
let otherPersonName = otherPersonFeed;
let verb = msg.value.content.following ? "followed" : "unfollowed";
if (msg.value.content.blocking) {
verb = "blocked";
}
ssb.avatar(msg.value.author).then(data => (person = data.name));
ssb
.avatar(msg.value.content.contact)
.then(data => {
otherPersonName = data.name;
})
.catch(n => console.log(n));
const goProfile = ev => {
ev.stopPropagation();
ev.preventDefault();
patchfox.go("contacts", "profile", { feed: msg.value.content.contact });
};
</script>
<p class="m-2">
<AvatarChip feed={msg.value.author} /> {verb}
<a
href="?pkg=contacts&view=profile&feed={otherPersonFeed}"
on:click={goProfile}>
{otherPersonName}
</a>
</p>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2010-2016 Marvell International Ltd.
* Copyright (C) 2002-2010 Kinoma, 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.
*/
import Arith from "arith";
export default class RSA {
constructor(e, m, p, q, dp, dq, C2) {
var esize = e.sizeof();
var z = new Arith.Z();
if (esize > 4 && p && !p.isNaN() && q && !q.isNaN()) {
// use CRT
this.dp = dp && !dp.isNaN() ? dp : z.mod(e, z.inc(p, -1));
this.dq = dq && !dq.isNaN() ? dq : z.mod(e, z.inc(q, -1));
this.mp = new Arith.Mont({z: z, m: p});
this.mq = new Arith.Mont({z: z, m: q});
this.C2 = C2 && !C2.isNaN() ? C2 : this.mp.mulinv(q); // (C2 = q^-1 mod p) according to PKCS8
this.p = p;
this.q = q;
this.order = m ? m.sizeof() : z.mul(p, q).sizeof();
}
else {
if (!m && p && !p.isNaN() && q && !q.isNaN())
m = z.mul(p, q);
this.mn = new Arith.Module(z, m, esize <= 4 ? 2: 0); // use the simple LR method in the case of small exponent (i.e public key)
this.e = e;
this.order = m.sizeof();
}
this.z = z;
};
process(c) {
if (this.mp && this.mq) {
var z = this.z;
var v1 = this.mq.exp(c, this.dq);
var v2 = this.mp.exp(c, this.dp);
var u = this.mp.mul(this.C2, this.mp.sub(v2, v1));
return(z.add(v1, z.mul(u, this.q)));
}
else
return(this.mn.exp(c, this.e));
};
get modulusSize() {
return this.order;
};
};
|
{
"pile_set_name": "Github"
}
|
[
{
"name": "Elliot Doe",
"first_name": "Elliot",
"last_name": "Doe",
"email": "admin@admin.com",
"password": "$2y$10$Ima71Zf7AeNR7VqqVQtYCuPQBC5fSV22ASneSOx/ZEzo0hY.c7rAG",
"profile_image": "elliot.jpg",
"timezone": "Asia/Karachi"
},
{
"name": "Tom Matt",
"first_name": "Tom",
"last_name": "Matt",
"email": "tom_matt@yahoo.com",
"password": "$2y$10$Ima71Zf7AeNR7VqqVQtYCuPQBC5fSV22ASneSOx/ZEzo0hY.c7rAG",
"profile_image": "tom.jpg",
"timezone": "Asia/Karachi"
}
]
|
{
"pile_set_name": "Github"
}
|
//-----------------------------------------------------------------------
// <copyright file="BrowseController.cs" company="(none)">
// Copyright © 2013 John Gietzen and the WebGit .NET Authors. All rights reserved.
// </copyright>
// <author>John Gietzen</author>
//-----------------------------------------------------------------------
namespace WebGitNet.Controllers
{
using System.Linq;
using System.Threading.Tasks;
using System.Web.Mvc;
using System.Web.Routing;
using Castle.Windsor;
using WebGitNet.Search;
public class SearchController : SharedControllerBase
{
private readonly IWindsorContainer container;
public SearchController(IWindsorContainer container)
{
this.container = container;
}
public ActionResult Search(string q)
{
return Search(q, null);
}
public ActionResult SearchRepo(string repo, string q)
{
var resourceInfo = this.FileManager.GetResourceInfo(repo);
if (resourceInfo.Type != ResourceType.Directory)
{
return HttpNotFound();
}
var repoInfo = GitUtilities.GetRepoInfo(resourceInfo.FullPath);
if (!repoInfo.IsGitRepo)
{
return HttpNotFound();
}
return Search(q, repoInfo);
}
private ActionResult Search(string q, RepoInfo repoInfo)
{
var searchProviders = container.ResolveAll<ISearchProvider>();
var query = new SearchQuery(q);
var results = (from p in searchProviders
select p.Search(query, this.FileManager, repoInfo, 0, 100)).ToArray();
Task.WaitAll(results);
return View("Search", results.Select(r => r.Result).SelectMany(r => r));
}
public class RouteRegisterer : IRouteRegisterer
{
public void RegisterRoutes(RouteCollection routes)
{
routes.MapRoute(
"Search All",
"search",
new { controller = "Search", action = "Search" });
routes.MapRoute(
"Search Repo",
"browse/{repo}/search",
new { controller = "Search", action = "SearchRepo" });
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
---
packages:
- name: loggregator_trafficcontroller
version: 038175d95748933723834ea037f2f2b9fa8e2f8a
fingerprint: 038175d95748933723834ea037f2f2b9fa8e2f8a
sha1: ad4a241b248e9b7cb2bfda4d37f8af5e469a0657
dependencies:
- golang1.6
- name: syslog_drain_binder
version: c16f0ed931d3b4932891ee79094c42bc443db38e
fingerprint: c16f0ed931d3b4932891ee79094c42bc443db38e
sha1: 85c2e2cd5ae03152eed973837ce9d138377154db
dependencies:
- golang1.6
- name: dea_logging_agent
version: 9c045f99b19e8d87ea0d6ad6b0cc4fb3ec6eb8d1
fingerprint: 9c045f99b19e8d87ea0d6ad6b0cc4fb3ec6eb8d1
sha1: ef992782193b5e88b2a5193888724bc29dcde64a
dependencies:
- golang1.6
- name: loggregator-acceptance-tests
version: af2231d93f5a8ef8130a617dfbca1236c5330ef8
fingerprint: af2231d93f5a8ef8130a617dfbca1236c5330ef8
sha1: 1aa42b16cc668386124caacf75e9cef9048f6aeb
dependencies:
- golang1.6
- name: metron_agent
version: 0bb15d6f347fa91ca9840ac69e5298da5c4e1af3
fingerprint: 0bb15d6f347fa91ca9840ac69e5298da5c4e1af3
sha1: 48075d5ee8d960929a99e8aba31c11a34804ff21
dependencies:
- golang1.6
- name: doppler
version: e1baac7abbea4267620e84a721761bad87a5cd2d
fingerprint: e1baac7abbea4267620e84a721761bad87a5cd2d
sha1: 95f5243017391398a0beb47e2850f8d96b02552b
dependencies:
- golang1.6
- name: loggregator_common
version: 6e89e9e4c155576dfc47b5959887807831ddf2df
fingerprint: 6e89e9e4c155576dfc47b5959887807831ddf2df
sha1: cc47bdaa9017e8eaab3cc7e4e624676c9b5dc318
dependencies: []
- name: statsd-injector
version: 3f082441e4ce31be7c0a162ffd44306f07d4a625
fingerprint: 3f082441e4ce31be7c0a162ffd44306f07d4a625
sha1: 5563a5cf3137911b3c341f4b23b7b90f946de421
dependencies:
- golang1.6
- name: golang1.6
version: 7c83e83f822259c6324742e3dfc5d4aaae25e9e6
fingerprint: 7c83e83f822259c6324742e3dfc5d4aaae25e9e6
sha1: cba92aa23ce90f210484da98922687bf65420fb8
dependencies: []
jobs:
- name: loggregator_trafficcontroller
version: 4f17ac8b62ee3a8da39f340636d8a2f1b2a3cca4
fingerprint: 4f17ac8b62ee3a8da39f340636d8a2f1b2a3cca4
sha1: d74b161c7efd635b2ab085b024a5b4e6a6f0ab04
- name: syslog_drain_binder
version: b2344e2f6ddbd83442bea50839eeb2750353409a
fingerprint: b2344e2f6ddbd83442bea50839eeb2750353409a
sha1: 068a1c536a3452cb06db14546e77841674a0c511
- name: dea_logging_agent
version: 43603a14a55eaa2266f4f414e4bae4d2ac3fe25b
fingerprint: 43603a14a55eaa2266f4f414e4bae4d2ac3fe25b
sha1: a9fd594e2a4ebc14cc230c9dff68659ac31f3875
- name: loggregator-acceptance-tests
version: 6498a459609ea6ca74cc9023550310ef761d6b89
fingerprint: 6498a459609ea6ca74cc9023550310ef761d6b89
sha1: ba2e226438b6ca843629975ff4c86eedfafbbb98
- name: metron_agent
version: 8a311e9188385aef946a18b7d87f0ee1bced3e9a
fingerprint: 8a311e9188385aef946a18b7d87f0ee1bced3e9a
sha1: f752d6a3bf7ee2c1c5c1e4de3c4cff17a637ffcd
- name: doppler
version: 88124e13799a998067e5f02459fd719d2e394573
fingerprint: 88124e13799a998067e5f02459fd719d2e394573
sha1: 5c0cfc26f83d27165e2193b18007b92447ab15ef
- name: statsd-injector
version: 7bb836cf603a4084493d1cc0bb5403b867c0dc15
fingerprint: 7bb836cf603a4084493d1cc0bb5403b867c0dc15
sha1: 2deb2e4a6a66b1994cb720d3de0a97737f350c27
license:
version: 29f14304ab1dc334aa64268c1a5c57bbc1fb0673
fingerprint: 29f14304ab1dc334aa64268c1a5c57bbc1fb0673
sha1: 70557eb603cf8c7771e38a9c79dd51db9f982c44
commit_hash: 1448b986
uncommitted_changes: true
name: loggregator
version: '36'
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package factory
import (
"context"
"fmt"
"net"
"net/url"
"path"
"sync"
"sync/atomic"
"time"
grpcprom "github.com/grpc-ecosystem/go-grpc-prometheus"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/transport"
"google.golang.org/grpc"
utilnet "k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/server/egressselector"
"k8s.io/apiserver/pkg/storage"
"k8s.io/apiserver/pkg/storage/etcd3"
"k8s.io/apiserver/pkg/storage/storagebackend"
"k8s.io/apiserver/pkg/storage/value"
"k8s.io/component-base/metrics/legacyregistry"
)
// The short keepalive timeout and interval have been chosen to aggressively
// detect a failed etcd server without introducing much overhead.
const keepaliveTime = 30 * time.Second
const keepaliveTimeout = 10 * time.Second
// dialTimeout is the timeout for failing to establish a connection.
// It is set to 20 seconds as times shorter than that will cause TLS connections to fail
// on heavily loaded arm64 CPUs (issue #64649)
const dialTimeout = 20 * time.Second
func init() {
// grpcprom auto-registers (via an init function) their client metrics, since we are opting out of
// using the global prometheus registry and using our own wrapped global registry,
// we need to explicitly register these metrics to our global registry here.
// For reference: https://github.com/kubernetes/kubernetes/pull/81387
legacyregistry.RawMustRegister(grpcprom.DefaultClientMetrics)
}
func newETCD3HealthCheck(c storagebackend.Config) (func() error, error) {
// constructing the etcd v3 client blocks and times out if etcd is not available.
// retry in a loop in the background until we successfully create the client, storing the client or error encountered
clientValue := &atomic.Value{}
clientErrMsg := &atomic.Value{}
clientErrMsg.Store("etcd client connection not yet established")
go wait.PollUntil(time.Second, func() (bool, error) {
client, err := newETCD3Client(c.Transport)
if err != nil {
clientErrMsg.Store(err.Error())
return false, nil
}
clientValue.Store(client)
clientErrMsg.Store("")
return true, nil
}, wait.NeverStop)
return func() error {
if errMsg := clientErrMsg.Load().(string); len(errMsg) > 0 {
return fmt.Errorf(errMsg)
}
client := clientValue.Load().(*clientv3.Client)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
// See https://github.com/etcd-io/etcd/blob/c57f8b3af865d1b531b979889c602ba14377420e/etcdctl/ctlv3/command/ep_command.go#L118
_, err := client.Get(ctx, path.Join("/", c.Prefix, "health"))
if err == nil {
return nil
}
return fmt.Errorf("error getting data from etcd: %v", err)
}, nil
}
func newETCD3Client(c storagebackend.TransportConfig) (*clientv3.Client, error) {
tlsInfo := transport.TLSInfo{
CertFile: c.CertFile,
KeyFile: c.KeyFile,
TrustedCAFile: c.TrustedCAFile,
}
tlsConfig, err := tlsInfo.ClientConfig()
if err != nil {
return nil, err
}
// NOTE: Client relies on nil tlsConfig
// for non-secure connections, update the implicit variable
if len(c.CertFile) == 0 && len(c.KeyFile) == 0 && len(c.TrustedCAFile) == 0 {
tlsConfig = nil
}
networkContext := egressselector.Etcd.AsNetworkContext()
var egressDialer utilnet.DialFunc
if c.EgressLookup != nil {
egressDialer, err = c.EgressLookup(networkContext)
if err != nil {
return nil, err
}
}
dialOptions := []grpc.DialOption{
grpc.WithBlock(), // block until the underlying connection is up
grpc.WithUnaryInterceptor(grpcprom.UnaryClientInterceptor),
grpc.WithStreamInterceptor(grpcprom.StreamClientInterceptor),
}
if egressDialer != nil {
dialer := func(ctx context.Context, addr string) (net.Conn, error) {
u, err := url.Parse(addr)
if err != nil {
return nil, err
}
return egressDialer(ctx, "tcp", u.Host)
}
dialOptions = append(dialOptions, grpc.WithContextDialer(dialer))
}
cfg := clientv3.Config{
DialTimeout: dialTimeout,
DialKeepAliveTime: keepaliveTime,
DialKeepAliveTimeout: keepaliveTimeout,
DialOptions: dialOptions,
Endpoints: c.ServerList,
TLS: tlsConfig,
}
return clientv3.New(cfg)
}
type runningCompactor struct {
interval time.Duration
cancel context.CancelFunc
client *clientv3.Client
refs int
}
var (
lock sync.Mutex
compactors = map[string]*runningCompactor{}
)
// startCompactorOnce start one compactor per transport. If the interval get smaller on repeated calls, the
// compactor is replaced. A destroy func is returned. If all destroy funcs with the same transport are called,
// the compactor is stopped.
func startCompactorOnce(c storagebackend.TransportConfig, interval time.Duration) (func(), error) {
lock.Lock()
defer lock.Unlock()
key := fmt.Sprintf("%v", c) // gives: {[server1 server2] keyFile certFile caFile}
if compactor, foundBefore := compactors[key]; !foundBefore || compactor.interval > interval {
compactorClient, err := newETCD3Client(c)
if err != nil {
return nil, err
}
if foundBefore {
// replace compactor
compactor.cancel()
compactor.client.Close()
} else {
// start new compactor
compactor = &runningCompactor{}
compactors[key] = compactor
}
ctx, cancel := context.WithCancel(context.Background())
compactor.interval = interval
compactor.cancel = cancel
compactor.client = compactorClient
etcd3.StartCompactor(ctx, compactorClient, interval)
}
compactors[key].refs++
return func() {
lock.Lock()
defer lock.Unlock()
compactor := compactors[key]
compactor.refs--
if compactor.refs == 0 {
compactor.cancel()
compactor.client.Close()
delete(compactors, key)
}
}, nil
}
func newETCD3Storage(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
stopCompactor, err := startCompactorOnce(c.Transport, c.CompactionInterval)
if err != nil {
return nil, nil, err
}
client, err := newETCD3Client(c.Transport)
if err != nil {
stopCompactor()
return nil, nil, err
}
var once sync.Once
destroyFunc := func() {
// we know that storage destroy funcs are called multiple times (due to reuse in subresources).
// Hence, we only destroy once.
// TODO: fix duplicated storage destroy calls higher level
once.Do(func() {
stopCompactor()
client.Close()
})
}
transformer := c.Transformer
if transformer == nil {
transformer = value.IdentityTransformer
}
return etcd3.New(client, c.Codec, c.Prefix, transformer, c.Paging), destroyFunc, nil
}
|
{
"pile_set_name": "Github"
}
|
#ifndef CAFFE_DATA_LAYER_HPP_
#define CAFFE_DATA_LAYER_HPP_
#include <string>
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/data_reader.hpp"
#include "caffe/data_transformer.hpp"
#include "caffe/internal_thread.hpp"
#include "caffe/layer.hpp"
#include "caffe/layers/base_data_layer.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/db.hpp"
namespace caffe {
template <typename Dtype>
class AnnotatedDataLayer : public BasePrefetchingDataLayer<Dtype> {
public:
explicit AnnotatedDataLayer(const LayerParameter& param);
virtual ~AnnotatedDataLayer();
virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
// AnnotatedDataLayer uses DataReader instead for sharing for parallelism
virtual inline bool ShareInParallel() const { return false; }
virtual inline const char* type() const { return "AnnotatedData"; }
virtual inline int ExactNumBottomBlobs() const { return 0; }
virtual inline int MinTopBlobs() const { return 1; }
protected:
virtual void load_batch(Batch<Dtype>* batch);
DataReader<AnnotatedDatum> reader_;
bool has_anno_type_;
AnnotatedDatum_AnnotationType anno_type_;
vector<BatchSampler> batch_samplers_;
string label_map_file_;
};
} // namespace caffe
#endif // CAFFE_DATA_LAYER_HPP_
|
{
"pile_set_name": "Github"
}
|
{
"name": "Xilinx Max_No Test",
"description": "HLS case",
"flow": "hls",
"platform_whitelist": [
"u200",
"zcu102",
"zcu104",
"zc706"
],
"platform_blacklist": [],
"part_whitelist": [],
"part_blacklist": [],
"project": "arithm",
"solution": "sol1",
"clock": "3.3",
"topfunction": "arithm_accel",
"top": {
"source": [
"${XF_PROJ_ROOT}/L1/examples/arithm/xf_arithm_accel.cpp"
],
"cflags": "-I${XF_PROJ_ROOT}/L1/include -I ./ -D__SDSVHLS__ -std=c++0x",
"csimflags": "-I${XF_PROJ_ROOT}/L1/include -I ./ -D__SDSVHLS__ -std=c++0x"
},
"testbench": {
"source": [
"${XF_PROJ_ROOT}/L1/examples/arithm/xf_arithm_tb.cpp"
],
"cflags": "-I${OPENCV_INCLUDE} -I${XF_PROJ_ROOT}/L1/include -I ./ -D__SDSVHLS__ -std=c++0x",
"ldflags": "-L ${OPENCV_LIB} -lopencv_imgcodecs -lopencv_imgproc -lopencv_core -lopencv_highgui -lopencv_flann -lopencv_features2d",
"argv": {
"hls_csim": " ${XF_PROJ_ROOT}/data/128x128_1.png ${XF_PROJ_ROOT}/data/128x128_2.png ",
"hls_cosim": " ${XF_PROJ_ROOT}/data/128x128_1.png ${XF_PROJ_ROOT}/data/128x128_2.png "
},
"stdmath": false,
"csimflags": "-I${XF_PROJ_ROOT}/L1/include -I ./ -D__SDSVHLS__ -std=c++0x"
},
"testinfo": {
"disable": false,
"jobs": [
{
"index": 0,
"dependency": [],
"env": "",
"cmd": "",
"max_memory_MB": 16384,
"max_time_min": {
"hls_vivado_syn": 300,
"hls_csim": 60,
"hls_cosim": 300,
"hls_vivado_impl": 300,
"hls_csynth": 60
}
}
],
"targets": [
"hls_csim",
"hls_csynth",
"hls_cosim",
"hls_vivado_syn",
"hls_vivado_impl"
],
"category": "full"
}
}
|
{
"pile_set_name": "Github"
}
|
# © 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Generated using tools/cldr/cldr-to-icu/build-icu-data.xml
#
# File: Mlym_Taml.txt
# Generated from CLDR
#
::[ം-ഃഅ-ഌഎ-ഐഒ-നപ-ഹാ-\u0D43െ-ൈൊ-\u0D4Dൗൠ-ൡ൦-൯];
::NFD;
::Malayalam-InterIndic;
::InterIndic-Tamil;
::NFC;
|
{
"pile_set_name": "Github"
}
|
// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>
// 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)
/** @file timer.hpp
*
* This header provides the @c timer class, which provides access to
* the MPI timers.
*/
#ifndef BOOST_MPI_TIMER_HPP
#define BOOST_MPI_TIMER_HPP
#include <boost/mpi/config.hpp>
#include <boost/limits.hpp>
namespace boost { namespace mpi {
/** @brief A simple timer that provides access to the MPI timing
* facilities.
*
* The @c timer class is a simple wrapper around the MPI timing
* facilities that mimics the interface of the Boost Timer library.
*/
class BOOST_MPI_DECL timer {
public:
/** Initializes the timer
*
* @post @c elapsed() == 0
*/
timer();
/** Restart the timer.
*
* @post @c elapsed() == 0
*/
void restart();
/** Return the amount of time that has elapsed since the last
* construction or reset, in seconds.
*/
double elapsed() const;
/** Return an estimate of the maximum possible value of
* elapsed(). Note that this routine may return too high a value on
* some systems.
*/
double elapsed_max() const;
/** Returns the minimum non-zero value that @c elapsed() may
* return. This is the resolution of the timer.
*/
double elapsed_min() const;
/** Determines whether the elapsed time values are global times or
local processor times. */
static bool time_is_global();
private:
double start_time;
}; // timer
inline timer::timer()
{
restart();
}
inline void timer::restart()
{
start_time = MPI_Wtime();
}
inline double timer::elapsed() const
{
return MPI_Wtime() - start_time;
}
inline double timer::elapsed_max() const
{
return (std::numeric_limits<double>::max)();
}
inline double timer::elapsed_min() const
{
return MPI_Wtick();
}
} } // end namespace boost::mpi
#endif // BOOST_MPI_TIMER_HPP
|
{
"pile_set_name": "Github"
}
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: agent.proto for package 'FastlaneCI.Proto'
# Original file comments:
# *
# proto definitions for auto-generated client, server, and messages to pass using grpc.
#
# if you make any changes to this file, run
# `rake generate_protos`
# to regenerate the ruby code.
#
require 'grpc'
require 'agent_pb'
module FastlaneCI
module Proto
module Agent
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'FastlaneCI.Proto.Agent'
rpc :RunFastlane, InvocationRequest, stream(InvocationResponse)
end
Stub = Service.rpc_stub_class
end
end
end
|
{
"pile_set_name": "Github"
}
|
//
// TCEditMemoViewController.m
// SecurityNote
//
// Created by HTC on 14-9-30.
// Copyright (c) 2014年 JoonSheng. All rights reserved.
//
#import "TCEditMemoViewController.h"
#import "TCDatePickerView.h"
#import "TCMemo.h"
#import "MBProgressHUD+MJ.h"
#import "TCYearPickerView.h"
#import "DHDeviceUtil.h"
@interface TCEditMemoViewController ()<TCDatePickerViewDelegate,TCYearPickerViewDelegate,UIPickerViewDelegate,UIPickerViewDataSource,UITextViewDelegate,UIScrollViewDelegate>
@property (nonatomic, weak) UITextField * titleField;
@property (nonatomic, weak) UITextView * detailView;
@property (nonatomic, weak) UITextField * memotypeF;
@property (nonatomic, weak) UILabel * yearL;
@property (nonatomic, weak) UILabel * timeL;
@property (nonatomic, strong) TCMemo * editNote;
@property (nonatomic, strong) TCDatePickerView * pickerView;
@property (nonatomic, strong) TCYearPickerView * yearPickerV;
@property (nonatomic, strong) NSMutableArray * yearArray;
@end
@implementation TCEditMemoViewController
-(TCMemo *)editNote
{
if (_editNote == nil)
{
_editNote = [[TCMemo alloc]init];
}
return _editNote;
}
//自定义年份picker
-(NSMutableArray *)yearArray
{
if (_yearArray == nil)
{
_yearArray = [NSMutableArray array];
for (int j = 0; j < 100; j ++)
{
NSString * yearStr = [NSString stringWithFormat:@"2%03d年",j];
[self.yearArray addObject:yearStr];
}
}
return _yearArray;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
CGFloat top = 70 + (MACRO_IS_IPHONE_X ? 24 : 0);
UITextField * titleField = [[UITextField alloc]initWithFrame:CGRectMake(10, top, self.view.frame.size.width - 20, 35)];
titleField.font = [UIFont boldSystemFontOfSize:23];
titleField.textAlignment = NSTextAlignmentCenter;
titleField.clearButtonMode = UITextFieldViewModeWhileEditing;
self.titleField = titleField;
UITextView * detailView =[[UITextView alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(self.titleField.frame) +5, self.view.frame.size.width - 20, self.view.frame.size.height - 110)];
detailView.font = [UIFont systemFontOfSize:18];
detailView.layer.borderWidth = 1.5;
detailView.layer.borderColor = [[UIColor colorWithRed:0/255.0 green:122/255.0 blue:252/255.0 alpha:1] CGColor];
detailView.layer.cornerRadius = 4.0f;
detailView.layer.masksToBounds = YES;
detailView.alwaysBounceVertical = YES;
self.detailView = detailView;
self.detailView.delegate = self;
UIBarButtonItem * rightItem = [[UIBarButtonItem alloc]initWithTitle:@"修改" style:UIBarButtonItemStylePlain target:self action:@selector(beginEdit:)];
rightItem.tintColor = [UIColor whiteColor];
[self.navigationItem setRightBarButtonItem:rightItem];
//时间标签
[self showTime];
self.timeL.hidden = YES;
//年份标签
[self showYear];
self.yearL.hidden = YES;
//备忘类型标签
[self showMemoType];
self.memotypeF.hidden = YES;
//放这里,盖住时间、天气、心情,使文档在最上面
[self.view addSubview:titleField];
[self.view addSubview:detailView];
//时间选择器 !!!必须放在最后,点击时,可以显示出来
self.pickerView = [TCDatePickerView initWithPicker:self.view.frame];
self.pickerView.delegate = self;
[self.view addSubview:self.pickerView];
self.yearPickerV = [TCYearPickerView initWithPicker:self.view.frame];
//TCYearPickerView的代理
self.yearPickerV.delegate = self;
[self.view addSubview:self.yearPickerV];
//pickerView的代理
self.yearPickerV.yearPickers.delegate = self;
self.yearPickerV.yearPickers.dataSource = self;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
if (@available(iOS 11.0, *)) {
self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
}
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
self.editNote = [self.editNote queryOneNote:self.ids];
self.titleField.text = self.editNote.title;
self.detailView.text = self.editNote.content;
self.titleField.enabled = NO;
self.detailView.editable = NO;
}
-(void)beginEdit:(id)sender
{
//进入编辑模式
if ([[sender title] isEqualToString:@"修改"])
{
[UIImageView animateWithDuration:0.3 animations:^{
self.detailView.frame = CGRectMake(10, CGRectGetMaxY(self.titleField.frame) +30, self.view.frame.size.width - 20, self.view.frame.size.height - 135);
self.timeL.text = self.editNote.time;
self.yearL.text = self.editNote.year;
self.memotypeF.text = self.editNote.memotype;
self.timeL.hidden = NO;
self.yearL.hidden = NO;
self.memotypeF.hidden = NO;
} completion:^(BOOL finished)
{
self.titleField.enabled = YES;
self.detailView.editable = YES;
[self.titleField becomeFirstResponder];
self.navigationItem.rightBarButtonItem.title = @"保存";
}];
}
else //保存
{
//标题不能空
if ([self.titleField.text length] == 0)
{
[MBProgressHUD showError:@"密官!标题不能空啊😱😱"];
return ;
}
[UIImageView animateWithDuration:0.3 animations:^{
self.timeL.hidden = YES;
self.yearL.hidden = YES;
self.memotypeF.hidden = YES;
self.detailView.frame = CGRectMake(10, CGRectGetMaxY(self.titleField.frame) +5, self.view.frame.size.width - 20, self.view.frame.size.height - 110);
//隐藏时间选择器
[self.pickerView hiddenDatePickerView];
[self.yearPickerV hiddenYearPickerView];
[self.view endEditing:YES];
} completion:^(BOOL finished)
{
self.titleField.enabled = NO;
self.detailView.editable = NO;
self.navigationItem.rightBarButtonItem.title = @"修改";
self.editNote.title = self.titleField.text;
self.editNote.content = self.detailView.text;
//self.editNote.time = self.timeL.text;
self.editNote.memotype = self.memotypeF.text;
//self.editNote.year = self.yearL.text;
//保存到数据库中
[self.editNote updataNote:self.editNote];
}];
}
}
//年份标签
-(void)showYear
{
UILabel * yearL = [[UILabel alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(self.titleField.frame) +3, 60, 15)];
yearL.font = [UIFont systemFontOfSize:16];
yearL.textAlignment = NSTextAlignmentCenter;
self.yearL = yearL;
[self.view addSubview:yearL];
//提供点击显示时间选择器
UIButton * touchYearL = [[UIButton alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(self.titleField.frame) +3, 60, 15)];
[touchYearL addTarget:self action:@selector(showYearPicker) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:touchYearL];
}
//年份选择器
-(void)showYearPicker
{
//隐藏时间选择器,显示年份选择器
[self.pickerView hiddenDatePickerView];
[self.yearPickerV popYearPickerView];
//默认选中原来备忘的年份
NSRange oldYear;
oldYear.length = 2;
oldYear.location = 2;
[self.yearPickerV.yearPickers selectRow:[[self.editNote.year substringWithRange:oldYear] intValue] inComponent:0 animated:YES];
[self.view endEditing:YES];
}
//时间标签
-(void)showTime
{
UILabel * timeL =[[UILabel alloc]initWithFrame:CGRectMake(70, CGRectGetMaxY(self.titleField.frame) +3, 120, 15)];
timeL.font = [UIFont systemFontOfSize:16];
// dateLabel.userInteractionEnabled = YES;
self.timeL = timeL;
[self.view addSubview:timeL];
//提供点击显示时间选择器
UIButton * touchLabel = [[UIButton alloc]initWithFrame:CGRectMake(70, CGRectGetMaxY(self.titleField.frame) +3, 120, 15)];
[touchLabel addTarget:self action:@selector(showPicker) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:touchLabel];
}
//时间选择器
-(void)showPicker
{
//隐藏年份选择器,显示时间选择器
[self.yearPickerV hiddenYearPickerView];
[self.pickerView popDatePickerView];
[self.pickerView popDatePickerView];
//点击DateLable时,归零(到现在的时间)
[self.pickerView resetToZero];
[self.view endEditing:YES];
}
//备忘类型标签
-(void)showMemoType
{
UITextField * memotypeF = [[UITextField alloc]initWithFrame:CGRectMake(190, CGRectGetMaxY(self.titleField.frame) +3, self.view.frame.size.width - 190, 20)];
memotypeF.font = [UIFont systemFontOfSize:16];
memotypeF.placeholder = @"备忘类型";
memotypeF.textAlignment = NSTextAlignmentCenter;
memotypeF.clearButtonMode = UITextFieldViewModeWhileEditing;
self.memotypeF = memotypeF;
[self.view addSubview:memotypeF];
}
//取消时间选择器
-(void)didCancelSelectDate
{
self.timeL.text = self.editNote.time;
}
//保存时间选择
-(void)didSaveDate
{
self.editNote.time = self.timeL.text;
}
//改变时间选择
-(void)didDateChangeTo
{
self.timeL.text = [self.pickerView getNowDatePicker:@"M月d日 HH:mm"];
}
//取消年份选择器
-(void)didCancelSelectYear
{
self.yearL.text = self.editNote.year;
}
//保存年份选择
-(void)didSaveYear
{
self.editNote.year = self.yearL.text;
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//隐藏键盘
[self.view endEditing:YES];
//隐藏时间选择器
[self.pickerView hiddenDatePickerView];
}
//设置代理后,点击return,响应
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
return YES;
}
//包含多少列
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
//包含多少个列表项
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return self.yearArray.count;
}
//指定列表和列表项的标题文本
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
return [self.yearArray objectAtIndex:row];
}
//选中列表时,激发
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
self.yearL.text = [self.yearArray objectAtIndex:row];
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
[self.view endEditing:YES];
//隐藏时间选择器
[self.pickerView hiddenDatePickerView];
[self.yearPickerV hiddenYearPickerView];
}
@end
|
{
"pile_set_name": "Github"
}
|
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Michiel D. Nauta
#
# 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.
#
"""
Provide merge capabilities for media objects.
"""
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
from ..lib import Person, Family, Event, Source, Citation, Place
from ..db import DbTxn
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.sgettext
from ..errors import MergeError
#-------------------------------------------------------------------------
#
# MergeMediaQuery
#
#-------------------------------------------------------------------------
class MergeMediaQuery:
"""
Create datqabase query to merge two media objects.
"""
def __init__(self, dbstate, phoenix, titanic):
self.database = dbstate.db
self.phoenix = phoenix
self.titanic = titanic
def execute(self):
"""
Merges two media objects into a single object.
"""
new_handle = self.phoenix.get_handle()
old_handle = self.titanic.get_handle()
self.phoenix.merge(self.titanic)
with DbTxn(_("Merge Media Objects"), self.database) as trans:
self.database.commit_media(self.phoenix, trans)
for (class_name, handle) in self.database.find_backlink_handles(
old_handle):
if class_name == Person.__name__:
person = self.database.get_person_from_handle(handle)
assert(person.has_media_reference(old_handle))
person.replace_media_references(old_handle, new_handle)
self.database.commit_person(person, trans)
elif class_name == Family.__name__:
family = self.database.get_family_from_handle(handle)
assert(family.has_media_reference(old_handle))
family.replace_media_references(old_handle, new_handle)
self.database.commit_family(family, trans)
elif class_name == Event.__name__:
event = self.database.get_event_from_handle(handle)
assert(event.has_media_reference(old_handle))
event.replace_media_references(old_handle, new_handle)
self.database.commit_event(event, trans)
elif class_name == Source.__name__:
source = self.database.get_source_from_handle(handle)
assert(source.has_media_reference(old_handle))
source.replace_media_references(old_handle, new_handle)
self.database.commit_source(source, trans)
elif class_name == Citation.__name__:
citation = self.database.get_citation_from_handle(handle)
assert(citation.has_media_reference(old_handle))
citation.replace_media_references(old_handle, new_handle)
self.database.commit_citation(citation, trans)
elif class_name == Place.__name__:
place = self.database.get_place_from_handle(handle)
assert(place.has_media_reference(old_handle))
place.replace_media_references(old_handle, new_handle)
self.database.commit_place(place, trans)
else:
raise MergeError("Encounter an object of type % s that has "
"a media object reference." % class_name)
self.database.remove_media(old_handle, trans)
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Created by PhpStorm.
* User: John
* Date: 1/12/15
* Time: 18:54
*/
/**
* moeSS
*
* moeSS is an open source Shadowsocks frontend for PHP 5.4 or newer
* Copyright (C) 2015 wzxjohn
*
* This file is part of moeSS.
*
* moeSS 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.
*
* moeSS 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 moeSS. If not, see <http://www.gnu.org/licenses/>.
*
* @package moeSS
* @author wzxjohn
* @copyright Copyright (c) 2015, wzxjohn (https://maoxian.de/)
* @license http://www.gnu.org/licenses/ GPLv3 License
* @link http://github.com/wzxjohn/moeSS
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
?><!-- header logo: style can be found in header.less -->
<header class="header">
<a href="<?php echo site_url('admin');?>" class="logo">
<!-- Add the class icon to your logo image or logo icon to add the margining -->
<?php echo SITE_NAME; ?>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="navbar-right">
<ul class="nav navbar-nav">
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="glyphicon glyphicon-user"></i>
<span><?php echo $user_name;?> <i class="caret"></i></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header bg-light-blue">
<img src="<?php echo $gravatar;?>" class="img-circle" alt="User Image" />
<p>
<?php echo $user_name;?>
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="<?php echo site_url('admin/my_info'); ?>" class="btn btn-default btn-flat">我的信息</a>
</div>
<div class="pull-right">
<a href="<?php echo site_url('admin/logout');?>" class="btn btn-default btn-flat">退出</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="script/common.css">
<script src="script/common.js"></script>
<script>
function patch_date(f){
var NativeDate = window.Date;
var date = function date(y,m,d,h,i,s,j){
switch(arguments.length){
case 0: return date.now ? new NativeDate(date.now) : new NativeDate();
case 1: return new NativeDate(y);
case 2: return new NativeDate(y,m);
case 3: return new NativeDate(y,m,d);
case 4: return new NativeDate(y,m,d,h);
case 5: return new NativeDate(y,m,d,h,i);
case 6: return new NativeDate(y,m,d,h,i,s);
case 7: return new NativeDate(y,y,m,d,h,i,s,j);
}
};
date.UTC = NativeDate.UTC;
return function(){
Array.prototype.push.call(arguments, date);
window.Date = date;
f.apply(this, arguments);
window.Date = NativeDate;
};
}
var setup = patch_date(function(Date){
Date.now = new Date(2013, 2, 18);
$('input').datepicker({
todayHighlight: true
});
});
</script>
</head>
<body data-capture="input, .datepicker">
<div class="row">
<div class="col-sm-3">
<input type="text" class="form-control" value="03/03/2013">
</div>
<div class="col-sm-offset-2 col-sm-3">
<input type="text" class="form-control" value="03/18/2013">
</div>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
'use strict';
var helpers = require('../helpers');
module.exports = {
'name': 'property-units',
'defaults': {
'per-property': {},
'global': []
},
'detect': function (ast, parser) {
var result = [],
unitsAllowedGlobally = parser.options.global,
unitsAllowedPerProperty = parser.options['per-property'];
ast.traverseByType('declaration', function (declaration) {
var property = declaration.first('property'),
ident = property ? property.first('ident') : null,
propertyName = ident ? ident.content : null,
valueNode = declaration.first('value'),
hasDimension = valueNode ? !!valueNode.first('dimension') : null;
if (propertyName && hasDimension) {
// properties such as box-shadow may have multiple dimensions defined so enumerate through them
valueNode.forEach('dimension', function (dimension) {
var dimensionIdent = dimension ? dimension.first('ident') : null,
unitType = dimensionIdent ? dimensionIdent.content : null,
unitsAllowed = unitsAllowedPerProperty[propertyName];
// If a property is defined in unitsAllowed, then it will only validate those unit types
if (unitType && unitsAllowed) {
if (unitsAllowed.indexOf(unitType) === -1) {
result = helpers.addUnique(result, {
'ruleId': parser.rule.name,
'severity': parser.severity,
'line': dimension.start.line,
'column': dimension.start.column,
'message': 'Values for property \'' + propertyName + '\' may not use ' + unitType + ' units'
});
}
}
// If no units are defined in unitsAllowedGlobally, then allow all of them
// Otherwise, verify the given unit is in the unitsAllowedGlobally list.
else if (unitType && unitsAllowedGlobally.length && unitsAllowedGlobally.indexOf(unitType) === -1) {
result = helpers.addUnique(result, {
'ruleId': parser.rule.name,
'severity': parser.severity,
'line': dimension.start.line,
'column': dimension.start.column,
'message': 'Values for property \'' + propertyName + '\' may not use ' + unitType + ' units'
});
}
});
}
});
return result;
}
};
|
{
"pile_set_name": "Github"
}
|
import redis
import time
import click
import multiprocessing
import sys
def worker_func(args):
host, port, start_ts, tsrange, pipeline_size, key_index, key_format, check_only = args
redis_client = redis.Redis(host, port, decode_responses=True)
if check_only:
res = redis_client.execute_command('TS.RANGE', key_format.format(index=key_index), 0, start_ts + tsrange)
if len(res) != tsrange:
return -1
expected = [[int(start_ts + i), str(i)] for i in range(tsrange)]
if expected != res:
return -1
else:
pipe = redis_client.pipeline(tsrange)
for i in range(tsrange):
if tsrange % pipeline_size:
pipe.execute()
pipe.execute_command("ts.add", key_format.format(index=key_index), start_ts + i, i)
pipe.execute()
return tsrange
def create_compacted_key(redis, i, source, agg, bucket):
dest = '%s_%s_%s' % (source, agg, bucket)
redis.delete(dest)
redis.execute_command('ts.create', dest, 'RETENTION', 0, 'CHUNK_SIZE', 360,
'LABELS', 'index', i, "aggregation", agg, "bucket", bucket)
redis.execute_command('ts.createrule', source, dest, 'AGGREGATION', agg, bucket, )
@click.command()
@click.option('--host', default="localhost", help='redis host.')
@click.option('--port', type=click.INT, default=6379, help='redis port.')
@click.option('--key-count', type=click.INT, default=50, help='Number of Keys.')
@click.option('--samples', type=click.INT, default=2000, help='Number of samples per key.')
@click.option('--pool-size', type=click.INT, default=20, help='Number of workers.')
@click.option('--pipeline-size', type=click.INT, default=100, help='Number of workers.')
@click.option('--create-keys', type=click.BOOL, default=True, help='Create the keys before inserting')
@click.option('--with-compaction', type=click.BOOL, default=True, help='Create the compactions keys before inserting')
@click.option('--start-timestamp', type=click.INT, default=1551347864, help='Base timestamp for all samples')
@click.option('--key-format', type=click.STRING, default="test{{{index}}}",
help='base key format, will be compiled with an index parameter')
@click.option('--check-only', type=click.BOOL, default=False, help='test if all keys are correcly exists in the database')
def run(host, port, key_count, samples, pool_size, create_keys, pipeline_size, with_compaction, start_timestamp,
key_format, check_only):
r = redis.Redis(host, port, decode_responses=True)
print("from %s to %s" % (start_timestamp, start_timestamp + samples))
if create_keys and not check_only:
for i in range(key_count):
keyname = key_format.format(index=i)
r.delete(keyname)
r.execute_command('ts.create', keyname, 'RETENTION', 0, 'CHUNK_SIZE', 360, 'LABELS', 'index', i)
if with_compaction:
create_compacted_key(r, i, keyname, 'avg', 10)
create_compacted_key(r, i, keyname, 'avg', 60)
create_compacted_key(r, i, keyname, 'count', 10)
pool = multiprocessing.Pool(pool_size)
s = time.time()
result = pool.map(worker_func,
[(host, port, start_timestamp, int(samples), pipeline_size, key_index, key_format, check_only)
for key_index in range(key_count)])
e = time.time()
insert_time = e - s
if(check_only):
for r in result:
if r == -1:
print("# failed!!! not all items exists in the database")
sys.exit(1)
print("# pass, all items exists in the database")
else:
print("# items inserted %s:" % sum(result))
print("took %s to insert sec, average insert time %s" % (insert_time, insert_time * 1000 / sum(result)))
if __name__ == '__main__':
run()
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2020 The KubeVirt Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1alpha1 "kubevirt.io/client-go/generated/kubevirt/clientset/versioned/typed/snapshot/v1alpha1"
)
type FakeSnapshotV1alpha1 struct {
*testing.Fake
}
func (c *FakeSnapshotV1alpha1) VirtualMachineRestores(namespace string) v1alpha1.VirtualMachineRestoreInterface {
return &FakeVirtualMachineRestores{c, namespace}
}
func (c *FakeSnapshotV1alpha1) VirtualMachineSnapshots(namespace string) v1alpha1.VirtualMachineSnapshotInterface {
return &FakeVirtualMachineSnapshots{c, namespace}
}
func (c *FakeSnapshotV1alpha1) VirtualMachineSnapshotContents(namespace string) v1alpha1.VirtualMachineSnapshotContentInterface {
return &FakeVirtualMachineSnapshotContents{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeSnapshotV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}
|
{
"pile_set_name": "Github"
}
|
* Add options to open temp and output directories.
- Add options to right-click menu
- Add options to toolbar?
* Customize the right-click menu based on APP_STATE
|
{
"pile_set_name": "Github"
}
|
modifyLineBreaks:
environments:
DBSStartsOnOwnLine: 0
|
{
"pile_set_name": "Github"
}
|
/*
* An rtc driver for the Dallas DS1553
*
* Copyright (C) 2006 Atsushi Nemoto <anemo@mba.ocn.ne.jp>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/bcd.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/gfp.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/interrupt.h>
#include <linux/rtc.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/module.h>
#define RTC_REG_SIZE 0x2000
#define RTC_OFFSET 0x1ff0
#define RTC_FLAGS (RTC_OFFSET + 0)
#define RTC_SECONDS_ALARM (RTC_OFFSET + 2)
#define RTC_MINUTES_ALARM (RTC_OFFSET + 3)
#define RTC_HOURS_ALARM (RTC_OFFSET + 4)
#define RTC_DATE_ALARM (RTC_OFFSET + 5)
#define RTC_INTERRUPTS (RTC_OFFSET + 6)
#define RTC_WATCHDOG (RTC_OFFSET + 7)
#define RTC_CONTROL (RTC_OFFSET + 8)
#define RTC_CENTURY (RTC_OFFSET + 8)
#define RTC_SECONDS (RTC_OFFSET + 9)
#define RTC_MINUTES (RTC_OFFSET + 10)
#define RTC_HOURS (RTC_OFFSET + 11)
#define RTC_DAY (RTC_OFFSET + 12)
#define RTC_DATE (RTC_OFFSET + 13)
#define RTC_MONTH (RTC_OFFSET + 14)
#define RTC_YEAR (RTC_OFFSET + 15)
#define RTC_CENTURY_MASK 0x3f
#define RTC_SECONDS_MASK 0x7f
#define RTC_DAY_MASK 0x07
/* Bits in the Control/Century register */
#define RTC_WRITE 0x80
#define RTC_READ 0x40
/* Bits in the Seconds register */
#define RTC_STOP 0x80
/* Bits in the Flags register */
#define RTC_FLAGS_AF 0x40
#define RTC_FLAGS_BLF 0x10
/* Bits in the Interrupts register */
#define RTC_INTS_AE 0x80
struct rtc_plat_data {
struct rtc_device *rtc;
void __iomem *ioaddr;
unsigned long last_jiffies;
int irq;
unsigned int irqen;
int alrm_sec;
int alrm_min;
int alrm_hour;
int alrm_mday;
spinlock_t lock;
};
static int ds1553_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
void __iomem *ioaddr = pdata->ioaddr;
u8 century;
century = bin2bcd((tm->tm_year + 1900) / 100);
writeb(RTC_WRITE, pdata->ioaddr + RTC_CONTROL);
writeb(bin2bcd(tm->tm_year % 100), ioaddr + RTC_YEAR);
writeb(bin2bcd(tm->tm_mon + 1), ioaddr + RTC_MONTH);
writeb(bin2bcd(tm->tm_wday) & RTC_DAY_MASK, ioaddr + RTC_DAY);
writeb(bin2bcd(tm->tm_mday), ioaddr + RTC_DATE);
writeb(bin2bcd(tm->tm_hour), ioaddr + RTC_HOURS);
writeb(bin2bcd(tm->tm_min), ioaddr + RTC_MINUTES);
writeb(bin2bcd(tm->tm_sec) & RTC_SECONDS_MASK, ioaddr + RTC_SECONDS);
/* RTC_CENTURY and RTC_CONTROL share same register */
writeb(RTC_WRITE | (century & RTC_CENTURY_MASK), ioaddr + RTC_CENTURY);
writeb(century & RTC_CENTURY_MASK, ioaddr + RTC_CONTROL);
return 0;
}
static int ds1553_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
void __iomem *ioaddr = pdata->ioaddr;
unsigned int year, month, day, hour, minute, second, week;
unsigned int century;
/* give enough time to update RTC in case of continuous read */
if (pdata->last_jiffies == jiffies)
msleep(1);
pdata->last_jiffies = jiffies;
writeb(RTC_READ, ioaddr + RTC_CONTROL);
second = readb(ioaddr + RTC_SECONDS) & RTC_SECONDS_MASK;
minute = readb(ioaddr + RTC_MINUTES);
hour = readb(ioaddr + RTC_HOURS);
day = readb(ioaddr + RTC_DATE);
week = readb(ioaddr + RTC_DAY) & RTC_DAY_MASK;
month = readb(ioaddr + RTC_MONTH);
year = readb(ioaddr + RTC_YEAR);
century = readb(ioaddr + RTC_CENTURY) & RTC_CENTURY_MASK;
writeb(0, ioaddr + RTC_CONTROL);
tm->tm_sec = bcd2bin(second);
tm->tm_min = bcd2bin(minute);
tm->tm_hour = bcd2bin(hour);
tm->tm_mday = bcd2bin(day);
tm->tm_wday = bcd2bin(week);
tm->tm_mon = bcd2bin(month) - 1;
/* year is 1900 + tm->tm_year */
tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900;
return 0;
}
static void ds1553_rtc_update_alarm(struct rtc_plat_data *pdata)
{
void __iomem *ioaddr = pdata->ioaddr;
unsigned long flags;
spin_lock_irqsave(&pdata->lock, flags);
writeb(pdata->alrm_mday < 0 || (pdata->irqen & RTC_UF) ?
0x80 : bin2bcd(pdata->alrm_mday),
ioaddr + RTC_DATE_ALARM);
writeb(pdata->alrm_hour < 0 || (pdata->irqen & RTC_UF) ?
0x80 : bin2bcd(pdata->alrm_hour),
ioaddr + RTC_HOURS_ALARM);
writeb(pdata->alrm_min < 0 || (pdata->irqen & RTC_UF) ?
0x80 : bin2bcd(pdata->alrm_min),
ioaddr + RTC_MINUTES_ALARM);
writeb(pdata->alrm_sec < 0 || (pdata->irqen & RTC_UF) ?
0x80 : bin2bcd(pdata->alrm_sec),
ioaddr + RTC_SECONDS_ALARM);
writeb(pdata->irqen ? RTC_INTS_AE : 0, ioaddr + RTC_INTERRUPTS);
readb(ioaddr + RTC_FLAGS); /* clear interrupts */
spin_unlock_irqrestore(&pdata->lock, flags);
}
static int ds1553_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
if (pdata->irq <= 0)
return -EINVAL;
pdata->alrm_mday = alrm->time.tm_mday;
pdata->alrm_hour = alrm->time.tm_hour;
pdata->alrm_min = alrm->time.tm_min;
pdata->alrm_sec = alrm->time.tm_sec;
if (alrm->enabled)
pdata->irqen |= RTC_AF;
ds1553_rtc_update_alarm(pdata);
return 0;
}
static int ds1553_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
if (pdata->irq <= 0)
return -EINVAL;
alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday;
alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour;
alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min;
alrm->time.tm_sec = pdata->alrm_sec < 0 ? 0 : pdata->alrm_sec;
alrm->enabled = (pdata->irqen & RTC_AF) ? 1 : 0;
return 0;
}
static irqreturn_t ds1553_rtc_interrupt(int irq, void *dev_id)
{
struct platform_device *pdev = dev_id;
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr;
unsigned long events = 0;
spin_lock(&pdata->lock);
/* read and clear interrupt */
if (readb(ioaddr + RTC_FLAGS) & RTC_FLAGS_AF) {
events = RTC_IRQF;
if (readb(ioaddr + RTC_SECONDS_ALARM) & 0x80)
events |= RTC_UF;
else
events |= RTC_AF;
rtc_update_irq(pdata->rtc, 1, events);
}
spin_unlock(&pdata->lock);
return events ? IRQ_HANDLED : IRQ_NONE;
}
static int ds1553_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
{
struct rtc_plat_data *pdata = dev_get_drvdata(dev);
if (pdata->irq <= 0)
return -EINVAL;
if (enabled)
pdata->irqen |= RTC_AF;
else
pdata->irqen &= ~RTC_AF;
ds1553_rtc_update_alarm(pdata);
return 0;
}
static const struct rtc_class_ops ds1553_rtc_ops = {
.read_time = ds1553_rtc_read_time,
.set_time = ds1553_rtc_set_time,
.read_alarm = ds1553_rtc_read_alarm,
.set_alarm = ds1553_rtc_set_alarm,
.alarm_irq_enable = ds1553_rtc_alarm_irq_enable,
};
static int ds1553_nvram_read(void *priv, unsigned int pos, void *val,
size_t bytes)
{
struct platform_device *pdev = priv;
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr;
u8 *buf = val;
for (; bytes; bytes--)
*buf++ = readb(ioaddr + pos++);
return 0;
}
static int ds1553_nvram_write(void *priv, unsigned int pos, void *val,
size_t bytes)
{
struct platform_device *pdev = priv;
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr;
u8 *buf = val;
for (; bytes; bytes--)
writeb(*buf++, ioaddr + pos++);
return 0;
}
static int ds1553_rtc_probe(struct platform_device *pdev)
{
struct resource *res;
unsigned int cen, sec;
struct rtc_plat_data *pdata;
void __iomem *ioaddr;
int ret = 0;
struct nvmem_config nvmem_cfg = {
.name = "ds1553_nvram",
.word_size = 1,
.stride = 1,
.size = RTC_OFFSET,
.reg_read = ds1553_nvram_read,
.reg_write = ds1553_nvram_write,
.priv = pdev,
};
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ioaddr = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(ioaddr))
return PTR_ERR(ioaddr);
pdata->ioaddr = ioaddr;
pdata->irq = platform_get_irq(pdev, 0);
/* turn RTC on if it was not on */
sec = readb(ioaddr + RTC_SECONDS);
if (sec & RTC_STOP) {
sec &= RTC_SECONDS_MASK;
cen = readb(ioaddr + RTC_CENTURY) & RTC_CENTURY_MASK;
writeb(RTC_WRITE, ioaddr + RTC_CONTROL);
writeb(sec, ioaddr + RTC_SECONDS);
writeb(cen & RTC_CENTURY_MASK, ioaddr + RTC_CONTROL);
}
if (readb(ioaddr + RTC_FLAGS) & RTC_FLAGS_BLF)
dev_warn(&pdev->dev, "voltage-low detected.\n");
spin_lock_init(&pdata->lock);
pdata->last_jiffies = jiffies;
platform_set_drvdata(pdev, pdata);
pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(pdata->rtc))
return PTR_ERR(pdata->rtc);
pdata->rtc->ops = &ds1553_rtc_ops;
pdata->rtc->nvram_old_abi = true;
ret = rtc_register_device(pdata->rtc);
if (ret)
return ret;
if (pdata->irq > 0) {
writeb(0, ioaddr + RTC_INTERRUPTS);
if (devm_request_irq(&pdev->dev, pdata->irq,
ds1553_rtc_interrupt,
0, pdev->name, pdev) < 0) {
dev_warn(&pdev->dev, "interrupt not available.\n");
pdata->irq = 0;
}
}
if (rtc_nvmem_register(pdata->rtc, &nvmem_cfg))
dev_err(&pdev->dev, "unable to register nvmem\n");
return 0;
}
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:rtc-ds1553");
static struct platform_driver ds1553_rtc_driver = {
.probe = ds1553_rtc_probe,
.driver = {
.name = "rtc-ds1553",
},
};
module_platform_driver(ds1553_rtc_driver);
MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
MODULE_DESCRIPTION("Dallas DS1553 RTC driver");
MODULE_LICENSE("GPL");
|
{
"pile_set_name": "Github"
}
|
using System;
using dnlib.DotNet;
using dnlib.DotNet.Emit;
/*
This example shows how to create an assembly from scratch and create two
instances by calling their constructors. One default constructor and another
one taking two arguments.
ILSpy output of created file:
using System;
namespace Ctor.Test
{
internal class BaseClass
{
public BaseClass()
{
Console.WriteLine("BaseClass: Default .ctor called", null);
}
}
internal class Main : BaseClass
{
public static void Main()
{
new Main();
new Main(12345, null);
}
public Main()
{
Console.WriteLine("Default .ctor called", null);
}
public Main(int count, string name)
{
Console.WriteLine(".ctor(Int32) called with arg {0}", count);
}
}
}
peverify output:
C:\>peverify ctor-test.exe /IL /MD
Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
All Classes and Methods in ctor-test.exe Verified.
Output of program:
C:\>ctor-test.exe
BaseClass: Default .ctor called
Default .ctor called
BaseClass: Default .ctor called
.ctor(Int32) called with arg 12345
*/
namespace dnlib.Examples {
public class Example4 {
public static void Run() {
// This is the file that will be created
string newFileName = @"C:\ctor-test.exe";
// Create the module
var mod = new ModuleDefUser("ctor-test", Guid.NewGuid(),
new AssemblyRefUser(new AssemblyNameInfo(typeof(int).Assembly.GetName().FullName)));
// It's a console app
mod.Kind = ModuleKind.Console;
// Create the assembly and add the created module to it
new AssemblyDefUser("ctor-test", new Version(1, 2, 3, 4)).Modules.Add(mod);
// Create System.Console type reference
var systemConsole = mod.CorLibTypes.GetTypeRef("System", "Console");
// Create 'void System.Console.WriteLine(string,object)' method reference
var writeLine2 = new MemberRefUser(mod, "WriteLine",
MethodSig.CreateStatic(mod.CorLibTypes.Void, mod.CorLibTypes.String,
mod.CorLibTypes.Object),
systemConsole);
// Create System.Object::.ctor method reference. This is the default constructor
var objectCtor = new MemberRefUser(mod, ".ctor",
MethodSig.CreateInstance(mod.CorLibTypes.Void),
mod.CorLibTypes.Object.TypeDefOrRef);
CilBody body;
// Create the base class
var bclass = new TypeDefUser("Ctor.Test", "BaseClass", mod.CorLibTypes.Object.TypeDefOrRef);
// Add it to the module
mod.Types.Add(bclass);
// Create Ctor.Test.BaseClass constructor: BaseClass()
var bctor = new MethodDefUser(".ctor", MethodSig.CreateInstance(mod.CorLibTypes.Void),
MethodImplAttributes.IL | MethodImplAttributes.Managed,
MethodAttributes.Public |
MethodAttributes.SpecialName | MethodAttributes.RTSpecialName);
// Add the method to BaseClass
bclass.Methods.Add(bctor);
// Create method body and add a few instructions
bctor.Body = body = new CilBody();
// Make sure we call the base class' constructor
body.Instructions.Add(OpCodes.Ldarg_0.ToInstruction());
body.Instructions.Add(OpCodes.Call.ToInstruction(objectCtor));
body.Instructions.Add(OpCodes.Ldstr.ToInstruction("BaseClass: Default .ctor called"));
body.Instructions.Add(OpCodes.Ldnull.ToInstruction());
body.Instructions.Add(OpCodes.Call.ToInstruction(writeLine2));
body.Instructions.Add(OpCodes.Ret.ToInstruction());
// Create the Ctor.Test.Main type which derives from Ctor.Test.BaseClass
var main = new TypeDefUser("Ctor.Test", "Main", bclass);
// Add it to the module
mod.Types.Add(main);
// Create the static 'void Main()' method
var entryPoint = new MethodDefUser("Main", MethodSig.CreateStatic(mod.CorLibTypes.Void),
MethodImplAttributes.IL | MethodImplAttributes.Managed,
MethodAttributes.Public | MethodAttributes.Static);
// Set entry point to entryPoint and add it as a Ctor.Test.Main method
mod.EntryPoint = entryPoint;
main.Methods.Add(entryPoint);
// Create first Ctor.Test.Main constructor: Main()
var ctor0 = new MethodDefUser(".ctor", MethodSig.CreateInstance(mod.CorLibTypes.Void),
MethodImplAttributes.IL | MethodImplAttributes.Managed,
MethodAttributes.Public |
MethodAttributes.SpecialName | MethodAttributes.RTSpecialName);
// Add the method to Main
main.Methods.Add(ctor0);
// Create method body and add a few instructions
ctor0.Body = body = new CilBody();
// Make sure we call the base class' constructor
body.Instructions.Add(OpCodes.Ldarg_0.ToInstruction());
body.Instructions.Add(OpCodes.Call.ToInstruction(bctor));
body.Instructions.Add(OpCodes.Ldstr.ToInstruction("Default .ctor called"));
body.Instructions.Add(OpCodes.Ldnull.ToInstruction());
body.Instructions.Add(OpCodes.Call.ToInstruction(writeLine2));
body.Instructions.Add(OpCodes.Ret.ToInstruction());
// Create second Ctor.Test.Main constructor: Main(int,string)
var ctor1 = new MethodDefUser(".ctor", MethodSig.CreateInstance(mod.CorLibTypes.Void, mod.CorLibTypes.Int32, mod.CorLibTypes.String),
MethodImplAttributes.IL | MethodImplAttributes.Managed,
MethodAttributes.Public |
MethodAttributes.SpecialName | MethodAttributes.RTSpecialName);
// Add the method to Main
main.Methods.Add(ctor1);
// Create names for the arguments. This is optional. Since this is an instance method
// (it's a constructor), the first arg is the 'this' pointer. The normal arguments
// begin at index 1.
ctor1.Parameters[1].CreateParamDef();
ctor1.Parameters[1].ParamDef.Name = "count";
ctor1.Parameters[2].CreateParamDef();
ctor1.Parameters[2].ParamDef.Name = "name";
// Create method body and add a few instructions
ctor1.Body = body = new CilBody();
// Make sure we call the base class' constructor
body.Instructions.Add(OpCodes.Ldarg_0.ToInstruction());
body.Instructions.Add(OpCodes.Call.ToInstruction(bctor));
body.Instructions.Add(OpCodes.Ldstr.ToInstruction(".ctor(Int32) called with arg {0}"));
body.Instructions.Add(OpCodes.Ldarg_1.ToInstruction());
body.Instructions.Add(OpCodes.Box.ToInstruction(mod.CorLibTypes.Int32));
body.Instructions.Add(OpCodes.Call.ToInstruction(writeLine2));
body.Instructions.Add(OpCodes.Ret.ToInstruction());
// Create the entry point method body and add instructions to allocate a new Main()
// object and call the two created ctors.
entryPoint.Body = body = new CilBody();
body.Instructions.Add(OpCodes.Newobj.ToInstruction(ctor0));
body.Instructions.Add(OpCodes.Pop.ToInstruction());
body.Instructions.Add(OpCodes.Ldc_I4.ToInstruction(12345));
body.Instructions.Add(OpCodes.Ldnull.ToInstruction());
body.Instructions.Add(OpCodes.Newobj.ToInstruction(ctor1));
body.Instructions.Add(OpCodes.Pop.ToInstruction());
body.Instructions.Add(OpCodes.Ret.ToInstruction());
// Save the assembly
mod.Write(newFileName);
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce<br />
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: DrByte 2020 Jun 07 Modified in v1.5.7 $
*/
require('includes/application_top.php');
// Check if session has timed out
if (!isset($_SESSION['admin_id'])) {
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
// note the current user so they cannot change their own profile nor delete themselves
$currentUser = $_SESSION['admin_id'];
// determine whether an action has been requested
if (isset($_POST['action']) && in_array($_POST['action'], ['insert', 'update', 'reset'])) {
$action = $_POST['action'];
} elseif (isset($_GET['action']) && in_array($_GET['action'], ['add', 'edit', 'password', 'delete', 'delete_confirm'])) {
$action = $_GET['action'];
} else {
$action = '';
}
// check for a valid user id (not for add)
if (($action == 'update' || $action == 'reset') && isset($_POST['user'])) {
$user = $_POST['user'];
} elseif (($action == 'edit' || $action == 'password') && isset($_GET['user'])) {
$user = $_GET['user'];
} elseif (($action == 'delete' || $action == 'delete_confirm') && isset($_POST['user'])) {
$user = $_POST['user'];
} elseif (in_array($action, ['edit', 'password', 'delete', 'delete_confirm', 'update', 'reset'])) {
$messageStack->add_session(ERROR_NO_USER_DEFINED, 'error');
zen_redirect(zen_href_link(FILENAME_USERS));
}
//set form action based on button selection
switch ($action) {
case 'add': // display unpopulated form for adding a new user
$formAction = 'insert';
$profilesList = array_merge([['id' => null, 'text' => TEXT_CHOOSE_PROFILE]], zen_get_profiles());
break;
case 'edit': // display populated form for editing existing user Name/Email/Profile
$formAction = 'update';
$profilesList = array_merge([['id' => null, 'text' => TEXT_CHOOSE_PROFILE]], zen_get_profiles());
break;
case 'password': // display form input fields for resetting existing user's Password
$formAction = 'reset';
break;
case 'delete_confirm': // remove existing user from database
if (isset($_POST['user'])) {
zen_delete_user($_POST['user']);
}
break;
case 'insert': // insert new user into database. Post data is prep'd for db in the first function call
$errors = zen_insert_user($_POST['name'], $_POST['email'], $_POST['password'], $_POST['confirm'], $_POST['profile']);
if (count($errors) > 0) {
foreach ($errors as $error) {
$messageStack->add($error, 'error');
}
$action = 'add';
$formAction = 'insert';
$profilesList = array_merge([['id' => null, 'text' => TEXT_CHOOSE_PROFILE]], zen_get_profiles());
} else {
$action = '';
$messageStack->add(sprintf(SUCCESS_NEW_USER_ADDED, zen_output_string_protected($_POST['name'])), 'success');
}
break;
case 'update': // update existing user's details in database. Post data is prep'd for db in the first function call
$errors = zen_update_user($_POST['name'], $_POST['email'], $_POST['id'], $_POST['profile']);
if (count($errors) > 0) {
foreach ($errors as $error) {
$messageStack->add($error, 'error');
}
$action = 'edit';
$formAction = 'update';
$profilesList = array_merge([['id' => null, 'text' => TEXT_CHOOSE_PROFILE]], zen_get_profiles());
} else {
$action = '';
$messageStack->add(SUCCESS_USER_DETAILS_UPDATED, 'success');
}
break;
case 'reset': // reset existing user's password in database. Post data is prep'd for db in the first function call
$errors = zen_reset_password($_POST['user'], $_POST['password'], $_POST['confirm']);
if (count($errors) > 0) {
foreach ($errors as $error) {
$messageStack->add($error, 'error');
}
$action = 'password';
$formAction = 'reset';
} else {
$action = '';
$messageStack->add(SUCCESS_PASSWORD_UPDATED, 'success');
}
break;
default: // no action, simply drop through and display existing users
}
// list of users
$userList = zen_get_users();
?>
<!doctype html>
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php require DIR_WS_INCLUDES . 'admin_html_head.php'; ?>
<link rel="stylesheet" href="includes/css/admin_access.css">
</head>
<body>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<div class="container-fluid" id="pageWrapper">
<h1><?php echo HEADING_TITLE ?></h1>
<?php if (($action != '') && $action != 'delete') { // Hide this form when delete selected
echo zen_draw_form('users', FILENAME_USERS);
if (isset($formAction)) {
echo zen_draw_hidden_field('action', $formAction);
}
}
if ($action == 'edit' || $action == 'password') {
echo zen_draw_hidden_field('user', $user);
} ?>
<table class="table table-striped">
<thead>
<tr class="headingRow">
<th class="id"><?php echo TEXT_ID ?></th>
<th class="name"><?php echo TEXT_ADMIN_NAME ?></th>
<th class="email"><?php echo TEXT_EMAIL ?></th>
<th class="profile"><?php echo TEXT_ADMIN_PROFILE ?></th>
<?php if ($action == 'add' || $action == 'password') { ?>
<th class="password"><?php echo TEXT_PASSWORD ?></th>
<th class="password"><?php echo TEXT_CONFIRM_PASSWORD ?></th>
<?php } ?>
<th class="actions"> </th>
</tr>
</thead>
<tbody>
<?php if ($action == 'add') { ?>
<tr>
<td class="id"> </td>
<td class="name"><?php echo zen_draw_input_field('name', isset($_POST['name']) ? $_POST['name'] : '', 'class="form-control" autofocus autocomplete="off"', true, 'text', true) ?></td>
<td class="email"><?php echo zen_draw_input_field('email', isset($_POST['email']) ? $_POST['email'] : '', 'class="form-control" autocomplete="off"', true, 'email', true) ?></td>
<td class="profile"><?php echo zen_draw_pull_down_menu('profile', $profilesList, isset($_POST['profile']) ? $_POST['profile'] : '', 'class="form-control"', true) ?></td>
<td class="password"><?php echo zen_draw_input_field('password', isset($_POST['password']) ? $_POST['password'] : '', 'class="form-control" autocomplete="off"', true, 'password'); ?></td>
<td class="confirm"><?php echo zen_draw_input_field('confirm', isset($_POST['confirm']) ? $_POST['confirm'] : '', 'class="form-control" autocomplete="off"', true, 'password'); ?></td>
<td class="actions">
<button type="submit" class="btn btn-primary"><?php echo IMAGE_INSERT; ?></button>
<a href="<?php echo zen_href_link(FILENAME_USERS) ?>" class="btn btn-default" role="button"><?php echo IMAGE_CANCEL; ?></a></td>
</tr>
<?php } ?>
<?php if (count($userList) > 0) { ?>
<?php foreach ($userList as $userDetails) { ?>
<tr>
<?php if (($action == 'edit' || $action == 'password') && $user == $userDetails['id']) { ?>
<td class="id"><?php echo $userDetails['id'] ?><?php echo zen_draw_hidden_field('id', $userDetails['id']) ?></td>
<?php } else { ?>
<td class="id"><?php echo $userDetails['id'] ?></td>
<?php } ?>
<?php if ($action == 'edit' && $user == $userDetails['id']) { ?>
<td class="name"><?php echo zen_draw_input_field('name', $userDetails['name'], 'class="form-control"') ?></td>
<td class="email"><?php echo zen_draw_input_field('email', $userDetails['email'], 'class="form-control"', false, 'email') ?></td>
<?php } else { ?>
<td class="name"><?php echo $userDetails['name'] ?></td>
<td class="email"><?php echo $userDetails['email'] ?></td>
<?php } ?>
<?php if ($action == 'edit' && $user == $userDetails['id'] && $user != $currentUser) { // do not allow current user to change profile ?>
<td class="profile"><?php echo zen_draw_pull_down_menu('profile', $profilesList, $userDetails['profile'], 'class="form-control"') ?></td>
<?php } else { ?>
<td class="profile"><?php echo $userDetails['profileName'] ?></td>
<?php } ?>
<?php if ($action == 'password' && $user == $userDetails['id']) { ?>
<td class="password"><?php echo zen_draw_input_field('password', '', 'class="form-control"', true, 'password', true) ?></td>
<td class="confirm"><?php echo zen_draw_input_field('confirm', '', 'class="form-control"', true, 'password', true) ?></td>
<?php } elseif ($action == 'add' || $action == 'password') { ?>
<td class="password"> </td>
<td class="confirm"> </td>
<?php } ?>
<?php if ($action == 'add' || $action == 'edit' || $action == 'password') { ?>
<?php if ($action != 'add' && $user == $userDetails['id']) { ?>
<td class="actions">
<button type="submit" class="btn btn-primary"><?php echo IMAGE_UPDATE; ?></button>
<a href="<?php echo zen_href_link(FILENAME_USERS) ?>" class="btn btn-default" role="button"><?php echo IMAGE_CANCEL; ?></a>
</td>
<?php } else { ?>
<td class="actions"> </td>
<?php } ?>
<?php } elseif ($action != 'add') { ?>
<td class="actions">
<?php if ($action != 'delete') { ?>
<a href="<?php echo zen_href_link(FILENAME_USERS, 'action=edit&user=' . $userDetails['id']) ?>" class="btn btn-primary" role="button"><?php echo IMAGE_EDIT; ?></a>
<a href="<?php echo zen_href_link(FILENAME_USERS, 'action=password&user=' . $userDetails['id']) ?>" class="btn btn-primary"><?php echo IMAGE_RESET_PWD; ?></a>
<?php } ?>
<?php
if ($userDetails['id'] != $currentUser) {
$btn_class = '';
if ($action == 'delete' && $userDetails['id'] == $user) {
$btn_class = 'btn btn-danger';
} elseif ($action != 'delete') {
$btn_class = 'btn btn-warning';
}
?>
<?php echo zen_draw_form('delete_user', FILENAME_USERS, 'action=' . ($action == 'delete' ? 'delete_confirm' : 'delete')); ?>
<?php echo zen_draw_hidden_field('user', $userDetails['id']); ?>
<?php echo ($action == 'delete' && $userDetails['id'] == $user ? TEXT_CONFIRM_DELETE : '') . ($btn_class == '' ? '' : '<button class="' . $btn_class . '">' . IMAGE_DELETE . '</button>') ?>
<?php if ($action == 'delete' && $userDetails['id'] == $user) { ?>
<a href="<?php echo zen_href_link(FILENAME_USERS) ?>" class="btn btn-default" role="button"><?php echo IMAGE_CANCEL; ?></a>
<?php } ?>
<?php echo '</form>'; ?>
<?php } ?>
</td>
</tr>
<?php
}
}
} else {
?>
<tr>
<td colspan="5"><?php echo TEXT_NO_USERS_FOUND ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if ($action == '' || $action == 'delete_confirm') { ?>
<div><a href="<?php echo zen_href_link(FILENAME_USERS, 'action=add'); ?>" class="btn btn-primary" role="button"><?php echo IMAGE_ADD_USER; ?></a></div>
<?php }
if ($action != '' && $action != 'delete') {
echo '</form>';
} ?>
</div>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
|
{
"pile_set_name": "Github"
}
|
version https://git-lfs.github.com/spec/v1
oid sha256:22d7568c637c6725ec44e4aa2c150b53c2858148d516cd59ceb9b425907d3917
size 99984
|
{
"pile_set_name": "Github"
}
|
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at udacimak@tutanota.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
|
{
"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.hadoop.yarn.security.client;
import javax.crypto.SecretKey;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.security.token.SecretManager;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
/**
* A base {@link SecretManager} for AMs to extend and validate Client-RM tokens
* issued to clients by the RM using the underlying master-key shared by RM to
* the AMs on their launch. All the methods are called by either Hadoop RPC or
* YARN, so this class is strictly for the purpose of inherit/extend and
* register with Hadoop RPC.
*/
@Public
@Evolving
public abstract class BaseClientToAMTokenSecretManager extends
SecretManager<ClientToAMTokenIdentifier> {
@Private
public abstract SecretKey getMasterKey(
ApplicationAttemptId applicationAttemptId);
@Private
@Override
public synchronized byte[] createPassword(
ClientToAMTokenIdentifier identifier) {
return createPassword(identifier.getBytes(),
getMasterKey(identifier.getApplicationAttemptID()));
}
@Private
@Override
public byte[] retrievePassword(ClientToAMTokenIdentifier identifier)
throws SecretManager.InvalidToken {
SecretKey masterKey = getMasterKey(identifier.getApplicationAttemptID());
if (masterKey == null) {
throw new SecretManager.InvalidToken("Illegal client-token!");
}
return createPassword(identifier.getBytes(), masterKey);
}
@Private
@Override
public ClientToAMTokenIdentifier createIdentifier() {
return new ClientToAMTokenIdentifier();
}
}
|
{
"pile_set_name": "Github"
}
|
define( [
"../core",
"../var/document",
"../ajax"
], function( jQuery, document ) {
"use strict";
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) {
if ( s.crossDomain ) {
s.contents.script = false;
}
} );
// Install script dataType
jQuery.ajaxSetup( {
accepts: {
script: "text/javascript, application/javascript, " +
"application/ecmascript, application/x-ecmascript"
},
contents: {
script: /\b(?:java|ecma)script\b/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
} );
// Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
}
} );
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script, callback;
return {
send: function( _, complete ) {
script = jQuery( "<script>" ).prop( {
charset: s.scriptCharset,
src: s.url
} ).on(
"load error",
callback = function( evt ) {
script.remove();
callback = null;
if ( evt ) {
complete( evt.type === "error" ? 404 : 200, evt.type );
}
}
);
// Use native DOM manipulation to avoid our domManip AJAX trickery
document.head.appendChild( script[ 0 ] );
},
abort: function() {
if ( callback ) {
callback();
}
}
};
}
} );
} );
|
{
"pile_set_name": "Github"
}
|
opam-version: "2.0"
maintainer: "https://github.com/ocaml/opam-repository/issues"
description: """
Unix library distributed with the OCaml compiler
"""
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Units of Measurement
</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="keilw">
<meta name="description" content="Static blog generated with JBake">
<!-- Style -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link rel="stylesheet" href="/css/base.css">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="/js/html5shiv.js"></script>
<![endif]-->
<!-- Fav icon -->
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="/img/favicon.ico" type="image/x-icon">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top " role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Units of Measurement</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="/pages/about.html">About</a></li>
<!--li><a href="/pages/contact.html">Contact</a></li-->
<li><a href="/pages/calendar.html">Calendar</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Links <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="nav-header">JSR 385</li>
<li><a href="https://docs.google.com/document/d/12KhosAFriGCczBs6gwtJJDfg_QlANT92_lhxUWO2gCY">Specification</a></li>
<li><a href="http://unitsofmeasurement.github.io/unit-api">API</a></li>
<li><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/index.html">JavaDoc (API)</a></li>
<li class="divider"></li>
<li><a href="https://github.com/unitsofmeasurement/unit-ri">Reference Implementation</a></li>
<li><a href="https://unitsofmeasurement.gitbooks.io/unit-ri-userguide/content/">RI User Guide</a></li>
<li><a href="https://github.com/unitsofmeasurement/unit-tck">TCK (Technical Compatibility Kit)</a></li>
<li class="divider"></li>
<li class="nav-header">Extensions</li>
<li><a href="https://github.com/unitsofmeasurement/unit-lib">Units Libraries</a></li>
<li><a href="http://uom.si">SI Units</a></li>
<!--- li class="nav-header">Sandbox</li>
<li><a href="sandbox.html">Sandbox</a></li -->
<li class="divider"></li>
<li class="nav-header">Additional Information</li>
<li><a href="http://jcp.org/en/jsr/detail?id=385">JSR 385 Detail Page</a></li>
<li><a href="http://unitsofmeasurement.github.io/unit-api/site">Maven Site</a></li>
<li><a href="https://bintray.com/unitsofmeasurement">Units of Measurement on Bintray</a></li>
<li><a href="http://jcp.org/en/jsr/detail?id=363">JSR 363 Detail Page</a></li>
<li><a href="https://github.com/unitsofmeasurement/uom-legacy">Unit API 0.6</a></li></li>
</ul>
</li>
</ul>
<!-- Right navigation -->
<ul class="nav navbar-nav navbar-right">
<li><a href="/archive.html"><i class="fa fa-list"></i> Archive</a></li>
<li><a href="/feed.xml" title="Rss"><i class="fa fa-rss"></i> Feed</a></li>
</ul>
<!-- Right navigation end -->
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav><!-- /.navbar -->
<!-- Begin page content -->
<div class="container">
<div class="row">
<div class="col-md-9">
<article>
<h2>Tag #antwerp</h2>
<hr>
<h4 class="well well-sm tag-month">November 2015</h4>
<ul>
<li>
<p>15 - <a href="2015/devoxxbe15.html">DevoXX BE 2015</a></p>
</li>
</ul>
</article>
</div> <!-- /.col-md -->
<div id="sidebar" class="col-md-3">
<aside>
<section>
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-users fa-lg panel-title"> Social</i>
</div>
<div class="list-group sidebar-list">
<a href="https://github.com/unitsofmeasurement" target="_blank" class="list-group-item sidebar-list-item">
<i class="fa fa-github-square fa-2x social-icon"></i> github
</a>
<a href="https://twitter.com/UnitAPI" target="_blank" class="list-group-item sidebar-list-item">
<i class="fa fa-twitter-square fa-2x social-icon"></i> twitter
</a>
</div>
</div>
</section>
</aside>
</div>
</div> <!-- /.row -->
</div><!-- /.container -->
<footer>
<div class="container">
<hr>
<div class="row">
<div class="col-xs-10">
<p class="text-muted credit">© Units of Measurement project 2017 | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> | Baked with <a href="http://jbake.org">JBake v2.5.0</a> | <i title="Linux" class="fa fa-linux"></i></p>
</div>
<div class="col-xs-2 gotop">
<a href="#"><i class="fa fa-arrow-circle-up"> top</i></a>
</div>
</div>
</div>
</footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/gist-embed/1.6/gist-embed.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
<script type="text/javascript">
<!-- load prettify only when needed -->
$(document).ready(function(){
var prettify = false;
var classToAdd = 'prettyprint snippet';
$("pre > code").each(function() {
$("pre > code").parent().addClass(classToAdd);
prettify = true;
});
if(prettify) {
prettyPrint();
}
});
</script>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
# reveal.js [](https://travis-ci.org/hakimel/reveal.js)
A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://lab.hakim.se/reveal-js/).
reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). It's best viewed in a browser with support for CSS 3D transforms but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere.
#### More reading:
- [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer.
- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history.
- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own!
- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks.
## Online Editor
Presentations are written using HTML or markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [http://slid.es](http://slid.es).
## Instructions
### Markup
Markup hierarchy needs to be ``<div class="reveal"> <div class="slides"> <section>`` where the ``<section>`` represents one slide and can be repeated indefinitely. If you place multiple ``<section>``'s inside of another ``<section>`` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and it will be included in the horizontal sequence. For example:
```html
<div class="reveal">
<div class="slides">
<section>Single Horizontal Slide</section>
<section>
<section>Vertical Slide 1</section>
<section>Vertical Slide 2</section>
</section>
</div>
</div>
```
### Markdown
It's possible to write your slides using Markdown. To enable Markdown, add the ```data-markdown``` attribute to your ```<section>``` elements and wrap the contents in a ```<script type="text/template">``` like the example below.
This is based on [data-markdown](https://gist.github.com/1343518) from [Paul Irish](https://github.com/paulirish) modified to use [marked](https://github.com/chjj/marked) to support [Github Flavoured Markdown](https://help.github.com/articles/github-flavored-markdown). Sensitive to indentation (avoid mixing tabs and spaces) and line breaks (avoid consecutive breaks).
```html
<section data-markdown>
<script type="text/template">
## Page title
A paragraph with some text and a [link](http://hakim.se).
</script>
</section>
```
#### External Markdown
You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file. The ```data-charset``` attribute is optional and specifies which charset to use when loading the external file.
When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
```html
<section data-markdown="example.md"
data-separator="^\n\n\n"
data-vertical="^\n\n"
data-notes="^Note:"
data-charset="iso-8859-15">
</section>
```
#### Element Attributes
Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things.
```html
<section data-markdown>
<script type="text/template">
- Item 1 <!-- .element: class="fragment" data-fragment-index="2" -->
- Item 2 <!-- .element: class="fragment" data-fragment-index="1" -->
</script>
</section>
```
#### Slide Attributes
Special syntax (in html comment) is available for adding attributes to the slide `<section>` elements generated by your Markdown.
```html
<section data-markdown>
<script type="text/template">
<!-- .slide: data-background="#ff0000" -->
Markdown content
</script>
</section>
```
### Configuration
At the end of your page you need to initialize reveal by running the following code. Note that all config values are optional and will default as specified below.
```javascript
Reveal.initialize({
// Display controls in the bottom right corner
controls: true,
// Display a presentation progress bar
progress: true,
// Display the page number of the current slide
slideNumber: false,
// Push each slide change to the browser history
history: false,
// Enable keyboard shortcuts for navigation
keyboard: true,
// Enable the slide overview mode
overview: true,
// Vertical centering of slides
center: true,
// Enables touch navigation on devices with touch input
touch: true,
// Loop the presentation
loop: false,
// Change the presentation direction to be RTL
rtl: false,
// Turns fragments on and off globally
fragments: true,
// Flags if the presentation is running in an embedded mode,
// i.e. contained within a limited portion of the screen
embedded: false,
// Number of milliseconds between automatically proceeding to the
// next slide, disabled when set to 0, this value can be overwritten
// by using a data-autoslide attribute on your slides
autoSlide: 0,
// Stop auto-sliding after user input
autoSlideStoppable: true,
// Enable slide navigation via mouse wheel
mouseWheel: false,
// Hides the address bar on mobile devices
hideAddressBar: true,
// Opens links in an iframe preview overlay
previewLinks: false,
// Transition style
transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
// Transition speed
transitionSpeed: 'default', // default/fast/slow
// Transition style for full page slide backgrounds
backgroundTransition: 'default', // default/none/slide/concave/convex/zoom
// Number of slides away from the current that are visible
viewDistance: 3,
// Parallax background image
parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
// Parallax background size
parallaxBackgroundSize: '' // CSS syntax, e.g. "2100px 900px"
});
```
Note that the new default vertical centering option will break compatibility with slides that were using transitions with backgrounds (`cube` and `page`). To restore the previous behavior, set `center` to `false`.
The configuration can be updated after initialization using the ```configure``` method:
```javascript
// Turn autoSlide off
Reveal.configure({ autoSlide: 0 });
// Start auto-sliding every 5s
Reveal.configure({ autoSlide: 5000 });
```
### Dependencies
Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example:
```javascript
Reveal.initialize({
dependencies: [
// Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
// Interpret Markdown in <section> elements
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
// Syntax highlight for <code> elements
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
// Zoom in and out with Alt+click
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
// Speaker notes
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// Remote control your reveal.js presentation using a touch device
{ src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } },
// MathJax
{ src: 'plugin/math/math.js', async: true }
]
});
```
You can add your own extensions using the same syntax. The following properties are available for each dependency object:
- **src**: Path to the script to load
- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false
- **callback**: [optional] Function to execute when the script has loaded
- **condition**: [optional] Function which must return true for the script to be loaded
### Presentation Size
All presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport.
See below for a list of configuration options related to sizing, including default values:
```javascript
Reveal.initialize({
...
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 960,
height: 700,
// Factor of the display size that should remain empty around the content
margin: 0.1,
// Bounds for smallest/largest possible scale to apply to content
minScale: 0.2,
maxScale: 1.0
});
```
### Auto-sliding
Presentations can be configure to progress through slides automatically, without any user input. To enable this you will need to tell the framework how many milliseconds it should wait between slides:
```javascript
// Slide every five seconds
Reveal.configure({
autoSlide: 5000
});
```
When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Sliding is also paused automatically as soon as the user starts navigating. You can disable these controls by specifying ```autoSlideStoppable: false``` in your reveal.js config.
You can also override the slide duration for individual slides by using the ```data-autoslide``` attribute on individual sections:
```html
<section data-autoslide="10000">This will remain on screen for 10 seconds</section>
```
### Keyboard Bindings
If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option:
```javascript
Reveal.configure({
keyboard: {
13: 'next', // go to the next slide when the ENTER key is pressed
27: function() {}, // do something custom when ESC is pressed
32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding)
}
});
```
### API
The ``Reveal`` class provides a JavaScript API for controlling navigation and reading state:
```javascript
// Navigation
Reveal.slide( indexh, indexv, indexf );
Reveal.left();
Reveal.right();
Reveal.up();
Reveal.down();
Reveal.prev();
Reveal.next();
Reveal.prevFragment();
Reveal.nextFragment();
Reveal.toggleOverview();
Reveal.togglePause();
// Retrieves the previous and current slide elements
Reveal.getPreviousSlide();
Reveal.getCurrentSlide();
Reveal.getIndices(); // { h: 0, v: 0 } }
// State checks
Reveal.isFirstSlide();
Reveal.isLastSlide();
Reveal.isOverview();
Reveal.isPaused();
```
### Ready Event
The 'ready' event is fired when reveal.js has loaded all (synchronous) dependencies and is ready to start navigating.
```javascript
Reveal.addEventListener( 'ready', function( event ) {
// event.currentSlide, event.indexh, event.indexv
} );
```
### Slide Changed Event
An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes.
Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback.
```javascript
Reveal.addEventListener( 'slidechanged', function( event ) {
// event.previousSlide, event.currentSlide, event.indexh, event.indexv
} );
```
### States
If you set ``data-state="somestate"`` on a slide ``<section>``, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide.
Furthermore you can also listen to these changes in state via JavaScript:
```javascript
Reveal.addEventListener( 'somestate', function() {
// TODO: Sprinkle magic
}, false );
```
### Slide Backgrounds
Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page background colors or images by applying a ```data-background``` attribute to your ```<section>``` elements. Below are a few examples.
```html
<section data-background="#ff0000">
<h2>All CSS color formats are supported, like rgba() or hsl().</h2>
</section>
<section data-background="http://example.com/image.png">
<h2>This slide will have a full-size background image.</h2>
</section>
<section data-background="http://example.com/image.png" data-background-size="100px" data-background-repeat="repeat">
<h2>This background image will be sized to 100px and repeated.</h2>
</section>
```
Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing ```backgroundTransition: 'slide'``` to the ```Reveal.initialize()``` call. Alternatively you can set ```data-background-transition``` on any section with a background to override that specific transition.
### Parallax Background
If you want to use a parallax scrolling background, set the two following config properties when initializing reveal.js (the third one is optional).
```javascript
Reveal.initialize({
// Parallax background image
parallaxBackgroundImage: '', // e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg"
// Parallax background size
parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto)
// This slide transition gives best results:
transition: linear
});
```
Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://lab.hakim.se/reveal-js/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px).
### Slide Transitions
The global presentation transition is set using the ```transition``` config value. You can override the global transition for a specific slide by using the ```data-transition``` attribute:
```html
<section data-transition="zoom">
<h2>This slide will override the presentation transition and zoom!</h2>
</section>
<section data-transition-speed="fast">
<h2>Choose from three transition speeds: default, fast or slow!</h2>
</section>
```
Note that this does not work with the page and cube transitions.
### Internal links
It's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (```<section id="some-slide">```):
```html
<a href="#/2/2">Link</a>
<a href="#/some-slide">Link</a>
```
You can also add relative navigation links, similar to the built in reveal.js controls, by appending one of the following classes on any element. Note that each element is automatically given an ```enabled``` class when it's a valid navigation route based on the current slide.
```html
<a href="#" class="navigate-left">
<a href="#" class="navigate-right">
<a href="#" class="navigate-up">
<a href="#" class="navigate-down">
<a href="#" class="navigate-prev"> <!-- Previous vertical or horizontal slide -->
<a href="#" class="navigate-next"> <!-- Next vertical or horizontal slide -->
```
### Fragments
Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/fragments
The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment:
```html
<section>
<p class="fragment grow">grow</p>
<p class="fragment shrink">shrink</p>
<p class="fragment roll-in">roll-in</p>
<p class="fragment fade-out">fade-out</p>
<p class="fragment current-visible">visible only once</p>
<p class="fragment highlight-current-blue">blue only once</p>
<p class="fragment highlight-red">highlight-red</p>
<p class="fragment highlight-green">highlight-green</p>
<p class="fragment highlight-blue">highlight-blue</p>
</section>
```
Multiple fragments can be applied to the same element sequentially by wrapping it, this will fade in the text on the first step and fade it back out on the second.
```html
<section>
<span class="fragment fade-in">
<span class="fragment fade-out">I'll fade in, then out</span>
</span>
</section>
```
The display order of fragments can be controlled using the ```data-fragment-index``` attribute.
```html
<section>
<p class="fragment" data-fragment-index="3">Appears last</p>
<p class="fragment" data-fragment-index="1">Appears first</p>
<p class="fragment" data-fragment-index="2">Appears second</p>
</section>
```
### Fragment events
When a slide fragment is either shown or hidden reveal.js will dispatch an event.
Some libraries, like MathJax (see #505), get confused by the initially hidden fragment elements. Often times this can be fixed by calling their update or render function from this callback.
```javascript
Reveal.addEventListener( 'fragmentshown', function( event ) {
// event.fragment = the fragment DOM element
} );
Reveal.addEventListener( 'fragmenthidden', function( event ) {
// event.fragment = the fragment DOM element
} );
```
### Code syntax highlighting
By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present surrounding whitespace is automatically removed.
```html
<section>
<pre><code data-trim>
(def lazy-fib
(concat
[0 1]
((fn rfib [a b]
(lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
</code></pre>
</section>
```
### Slide number
If you would like to display the page number of the current slide you can do so using the ```slideNumber``` configuration value.
```javascript
Reveal.configure({ slideNumber: true });
```
### Overview mode
Press "Esc" or "o" keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides,
as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks:
```javascript
Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } );
Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } );
// Toggle the overview mode programmatically
Reveal.toggleOverview();
```
### Fullscreen mode
Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode.
### Embedded media
Embedded HTML5 `<video>`/`<audio>` and YouTube iframes are automatically paused when you navigate away from a slide. This can be disabled by decorating your element with a `data-ignore` attribute.
Add `data-autoplay` to your media element if you want it to automatically start playing when the slide is shown:
```html
<video data-autoplay src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
```
Additionally the framework automatically pushes two [post messages](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) to all iframes, ```slide:start``` when the slide containing the iframe is made visible and ```slide:stop``` when it is hidden.
### Stretching elements
Sometimes it's desirable to have an element, like an image or video, stretch to consume as much space as possible within a given slide. This can be done by adding the ```.stretch``` class to an element as seen below:
```html
<section>
<h2>This video will use up the remaining space on the slide</h2>
<video class="stretch" src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
</section>
```
Limitations:
- Only direct descendants of a slide section can be stretched
- Only one descendant per slide section can be stretched
## PDF Export
Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use [Google Chrome](http://google.com/chrome).
Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-13872948.
1. Open your presentation with [css/print/pdf.css](https://github.com/hakimel/reveal.js/blob/master/css/print/pdf.css) included on the page. The default index HTML lets you add *print-pdf* anywhere in the query to include the stylesheet, for example: [lab.hakim.se/reveal-js?print-pdf](http://lab.hakim.se/reveal-js?print-pdf).
2. Open the in-browser print dialog (CMD+P).
3. Change the **Destination** setting to **Save as PDF**.
4. Change the **Layout** to **Landscape**.
5. Change the **Margins** to **None**.
6. Click **Save**.

## Theming
The framework comes with a few different themes included:
- default: Gray background, white text, blue links
- beige: Beige background, dark text, brown links
- sky: Blue background, thin white text, blue links
- night: Black background, thick white text, orange links
- serif: Cappuccino background, gray text, brown links
- simple: White background, black text, blue links
- solarized: Cream-colored background, dark green text, blue links
Each theme is available as a separate stylesheet. To change theme you will need to replace **default** below with your desired theme name in index.html:
```html
<link rel="stylesheet" href="css/theme/default.css" id="theme">
```
If you want to add a theme of your own see the instructions here: [/css/theme/README.md](https://github.com/hakimel/reveal.js/blob/master/css/theme/README.md).
## Speaker Notes
reveal.js comes with a speaker notes plugin which can be used to present per-slide notes in a separate browser window. The notes window also gives you a preview of the next upcoming slide so it may be helpful even if you haven't written any notes. Press the 's' key on your keyboard to open the notes window.
Notes are defined by appending an ```<aside>``` element to a slide as seen below. You can add the ```data-markdown``` attribute to the aside element if you prefer writing notes using Markdown.
When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup).
```html
<section>
<h2>Some Slide</h2>
<aside class="notes">
Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).
</aside>
</section>
```
If you're using the external Markdown plugin, you can add notes with the help of a special delimiter:
```html
<section data-markdown="example.md" data-separator="^\n\n\n" data-vertical="^\n\n" data-notes="^Note:"></section>
# Title
## Sub-title
Here is some content...
Note:
This will only display in the notes window.
```
## Server Side Speaker Notes
In some cases it can be desirable to run notes on a separate device from the one you're presenting on. The Node.js-based notes plugin lets you do this using the same note definitions as its client side counterpart. Include the required scripts by adding the following dependencies:
```javascript
Reveal.initialize({
...
dependencies: [
{ src: 'socket.io/socket.io.js', async: true },
{ src: 'plugin/notes-server/client.js', async: true }
]
});
```
Then:
1. Install [Node.js](http://nodejs.org/)
2. Run ```npm install```
3. Run ```node plugin/notes-server```
## Multiplexing
The multiplex plugin allows your audience to view the slides of the presentation you are controlling on their own phone, tablet or laptop. As the master presentation navigates the slides, all client presentations will update in real time. See a demo at [http://revealjs.jit.su/](http://revealjs.jit.su).
The multiplex plugin needs the following 3 things to operate:
1. Master presentation that has control
2. Client presentations that follow the master
3. Socket.io server to broadcast events from the master to the clients
More details:
#### Master presentation
Served from a static file server accessible (preferably) only to the presenter. This need only be on your (the presenter's) computer. (It's safer to run the master presentation from your own computer, so if the venue's Internet goes down it doesn't stop the show.) An example would be to execute the following commands in the directory of your master presentation:
1. ```npm install node-static```
2. ```static```
If you want to use the speaker notes plugin with your master presentation then make sure you have the speaker notes plugin configured correctly along with the configuration shown below, then execute ```node plugin/notes-server``` in the directory of your master presentation. The configuration below will cause it to connect to the socket.io server as a master, as well as launch your speaker-notes/static-file server.
You can then access your master presentation at ```http://localhost:1947```
Example configuration:
```javascript
Reveal.initialize({
// other options...
multiplex: {
// Example values. To generate your own, see the socket.io server instructions.
secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
id: '1ea875674b17ca76', // Obtained from socket.io server
url: 'revealjs.jit.su:80' // Location of socket.io server
},
// Don't forget to add the dependencies
dependencies: [
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
{ src: 'plugin/multiplex/master.js', async: true },
// and if you want speaker notes
{ src: 'plugin/notes-server/client.js', async: true }
// other dependencies...
]
});
```
#### Client presentation
Served from a publicly accessible static file server. Examples include: GitHub Pages, Amazon S3, Dreamhost, Akamai, etc. The more reliable, the better. Your audience can then access the client presentation via ```http://example.com/path/to/presentation/client/index.html```, with the configuration below causing them to connect to the socket.io server as clients.
Example configuration:
```javascript
Reveal.initialize({
// other options...
multiplex: {
// Example values. To generate your own, see the socket.io server instructions.
secret: null, // null so the clients do not have control of the master presentation
id: '1ea875674b17ca76', // id, obtained from socket.io server
url: 'revealjs.jit.su:80' // Location of socket.io server
},
// Don't forget to add the dependencies
dependencies: [
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
{ src: 'plugin/multiplex/client.js', async: true }
// other dependencies...
]
});
```
#### Socket.io server
Server that receives the slideChanged events from the master presentation and broadcasts them out to the connected client presentations. This needs to be publicly accessible. You can run your own socket.io server with the commands:
1. ```npm install```
2. ```node plugin/multiplex```
Or you use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su).
You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit ```http://example.com/token```, where ```http://example.com``` is the location of your socket.io server. Or if you're going to use the socket.io server at [http://revealjs.jit.su](http://revealjs.jit.su), visit [http://revealjs.jit.su/token](http://revealjs.jit.su/token).
You are very welcome to point your presentations at the Socket.io server running at [http://revealjs.jit.su](http://revealjs.jit.su), but availability and stability are not guaranteed. For anything mission critical I recommend you run your own server. It is simple to deploy to nodejitsu, heroku, your own environment, etc.
##### socket.io server as file static server
The socket.io server can play the role of static file server for your client presentation, as in the example at [http://revealjs.jit.su](http://revealjs.jit.su). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match.)
Example configuration:
```javascript
Reveal.initialize({
// other options...
multiplex: {
// Example values. To generate your own, see the socket.io server instructions.
secret: null, // null so the clients do not have control of the master presentation
id: '1ea875674b17ca76', // id, obtained from socket.io server
url: 'example.com:80' // Location of your socket.io server
},
// Don't forget to add the dependencies
dependencies: [
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
{ src: 'plugin/multiplex/client.js', async: true }
// other dependencies...
]
```
It can also play the role of static file server for your master presentation and client presentations at the same time (as long as you don't want to use speaker notes). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match. Navigate through the slides on the second, and the first will update to match.) This is probably not desirable, because you don't want your audience to mess with your slides while you're presenting. ;)
Example configuration:
```javascript
Reveal.initialize({
// other options...
multiplex: {
// Example values. To generate your own, see the socket.io server instructions.
secret: '13652805320794272084', // Obtained from the socket.io server. Gives this (the master) control of the presentation
id: '1ea875674b17ca76', // Obtained from socket.io server
url: 'example.com:80' // Location of your socket.io server
},
// Don't forget to add the dependencies
dependencies: [
{ src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
{ src: 'plugin/multiplex/master.js', async: true },
{ src: 'plugin/multiplex/client.js', async: true }
// other dependencies...
]
});
```
## Leap Motion
The Leap Motion plugin lets you utilize your [Leap Motion](https://www.leapmotion.com/) device to control basic navigation of your presentation. The gestures currently supported are:
##### 1 to 2 fingers
Pointer — Point to anything on screen. Move your finger past the device to expand the pointer.
##### 1 hand + 3 or more fingers (left/right/up/down)
Navigate through your slides. See config options to invert movements.
##### 2 hands upwards
Toggle the overview mode. Do it a second time to exit the overview.
#### Config Options
You can edit the following options:
| Property | Default | Description
| ----------------- |:-----------------:| :-------------
| autoCenter | true | Center the pointer based on where you put your finger into the leap motions detection field.
| gestureDelay | 500 | How long to delay between gestures in milliseconds.
| naturalSwipe | true | Swipe as though you were touching a touch screen. Set to false to invert.
| pointerColor | #00aaff | The color of the pointer.
| pointerOpacity | 0.7 | The opacity of the pointer.
| pointerSize | 15 | The minimum height and width of the pointer.
| pointerTolerance | 120 | Bigger = slower pointer.
Example configuration:
```js
Reveal.initialize({
// other options...
leap: {
naturalSwipe : false, // Invert swipe gestures
pointerOpacity : 0.5, // Set pointer opacity to 0.5
pointerColor : '#d80000' // Red pointer
},
dependencies: [
{ src: 'plugin/leap/leap.js', async: true }
]
});
```
## MathJax
If you want to display math equations in your presentation you can easily do so by including this plugin. The plugin is a very thin wrapper around the [MathJax](http://www.mathjax.org/) library. To use it you'll need to include it as a reveal.js dependency, [find our more about dependencies here](#dependencies).
The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the ```math``` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the ```mathjax``` configuration value.
Below is an example of how the plugin can be configured. If you don't intend to change these values you do not need to include the ```math``` config object at all.
```js
Reveal.initialize({
// other options ...
math: {
mathjax: 'http://cdn.mathjax.org/mathjax/latest/MathJax.js',
config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html
},
dependencies: [
{ src: 'plugin/math/math.js', async: true }
]
});
```
Read MathJax's documentation if you need [HTTPS delivery](http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn) or serving of [specific versions](http://docs.mathjax.org/en/latest/configuration.html#loading-mathjax-from-the-cdn) for stability.
## Installation
The **basic setup** is for authoring presentations only. The **full setup** gives you access to all reveal.js features and plugins such as speaker notes as well as the development tasks needed to make changes to the source.
### Basic setup
The core of reveal.js is very easy to install. You'll simply need to download a copy of this repository and open the index.html file directly in your browser.
1. Download the latest version of reveal.js from <https://github.com/hakimel/reveal.js/releases>
2. Unzip and replace the example contents in index.html with your own
3. Open index.html in a browser to view it
### Full setup
Some reveal.js features, like external markdown and speaker notes, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code.
1. Install [Node.js](http://nodejs.org/)
2. Install [Grunt](http://gruntjs.com/getting-started#installing-the-cli)
4. Clone the reveal.js repository
```sh
$ git clone https://github.com/hakimel/reveal.js.git
```
5. Navigate to the reveal.js folder
```sh
$ cd reveal.js
```
6. Install dependencies
```sh
$ npm install
```
7. Serve the presentation and monitor source files for changes
```sh
$ grunt serve
```
8. Open <http://localhost:8000> to view your presentation
You can change the port by using `grunt serve --port 8001`.
### Folder Structure
- **css/** Core styles without which the project does not function
- **js/** Like above but for JavaScript
- **plugin/** Components that have been developed as extensions to reveal.js
- **lib/** All other third party assets (JavaScript, CSS, fonts)
### Contributing
Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. If you are reporting a bug make sure to include information about which browser and operating system you are using as well as the necessary steps to reproduce the issue.
If you have personal support questions use [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js).
#### Pull requests
- Should follow the coding style of the file you work in, most importantly:
- Tabs to indent
- Single-quoted strings
- Should be made towards the **dev branch**
- Should be submitted from a feature/topic branch (not your master)
- Should not include the minified **reveal.min.js** file
## License
MIT licensed
Copyright (C) 2014 Hakim El Hattab, http://hakim.se
|
{
"pile_set_name": "Github"
}
|
import index, { Carousel, Slide } from '../../src/index.js';
import { createLocalVue } from '@vue/test-utils';
describe('index', () => {
it('should export a slide component', () => {
expect(Slide).toBeDefined()
})
it('should export a Carousel component', () => {
expect(Carousel).toBeDefined();
});
it('Installs the defauly export as a plugin', () => {
const vue = createLocalVue();
vue.use(index);
expect(vue.options.components.carousel).toBeDefined();
expect(vue.options.components.slide).toBeDefined();
})
});
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright © 2017 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "nir_builder.h"
#include "util/format_rgb9e5.h"
static inline nir_ssa_def *
nir_shift(nir_builder *b, nir_ssa_def *value, int left_shift)
{
if (left_shift > 0)
return nir_ishl(b, value, nir_imm_int(b, left_shift));
else if (left_shift < 0)
return nir_ushr(b, value, nir_imm_int(b, -left_shift));
else
return value;
}
static inline nir_ssa_def *
nir_mask_shift(struct nir_builder *b, nir_ssa_def *src,
uint32_t mask, int left_shift)
{
return nir_shift(b, nir_iand(b, src, nir_imm_int(b, mask)), left_shift);
}
static inline nir_ssa_def *
nir_mask_shift_or(struct nir_builder *b, nir_ssa_def *dst, nir_ssa_def *src,
uint32_t src_mask, int src_left_shift)
{
return nir_ior(b, nir_mask_shift(b, src, src_mask, src_left_shift), dst);
}
static inline nir_ssa_def *
nir_format_unpack_uint(nir_builder *b, nir_ssa_def *packed,
const unsigned *bits, unsigned num_components)
{
assert(num_components >= 1 && num_components <= 4);
nir_ssa_def *comps[4];
if (bits[0] >= packed->bit_size) {
assert(bits[0] == packed->bit_size);
assert(num_components == 1);
return packed;
}
unsigned offset = 0;
for (unsigned i = 0; i < num_components; i++) {
assert(bits[i] < 32);
nir_ssa_def *mask = nir_imm_int(b, (1u << bits[i]) - 1);
comps[i] = nir_iand(b, nir_shift(b, packed, -offset), mask);
offset += bits[i];
}
assert(offset <= packed->bit_size);
return nir_vec(b, comps, num_components);
}
static inline nir_ssa_def *
nir_format_pack_uint_unmasked(nir_builder *b, nir_ssa_def *color,
const unsigned *bits, unsigned num_components)
{
assert(num_components >= 1 && num_components <= 4);
nir_ssa_def *packed = nir_imm_int(b, 0);
unsigned offset = 0;
for (unsigned i = 0; i < num_components; i++) {
packed = nir_ior(b, packed, nir_shift(b, nir_channel(b, color, i),
offset));
offset += bits[i];
}
assert(offset <= packed->bit_size);
return packed;
}
static inline nir_ssa_def *
nir_format_pack_uint(nir_builder *b, nir_ssa_def *color,
const unsigned *bits, unsigned num_components)
{
nir_const_value mask;
for (unsigned i = 0; i < num_components; i++) {
assert(bits[i] < 32);
mask.u32[i] = (1u << bits[i]) - 1;
}
nir_ssa_def *mask_imm = nir_build_imm(b, num_components, 32, mask);
return nir_format_pack_uint_unmasked(b, nir_iand(b, color, mask_imm),
bits, num_components);
}
static inline nir_ssa_def *
nir_format_bitcast_uint_vec_unmasked(nir_builder *b, nir_ssa_def *src,
unsigned src_bits, unsigned dst_bits)
{
assert(src_bits == 8 || src_bits == 16 || src_bits == 32);
assert(dst_bits == 8 || dst_bits == 16 || dst_bits == 32);
if (src_bits == dst_bits)
return src;
const unsigned dst_components =
DIV_ROUND_UP(src->num_components * src_bits, dst_bits);
assert(dst_components <= 4);
nir_ssa_def *dst_chan[4] = {0};
if (dst_bits > src_bits) {
unsigned shift = 0;
unsigned dst_idx = 0;
for (unsigned i = 0; i < src->num_components; i++) {
nir_ssa_def *shifted = nir_ishl(b, nir_channel(b, src, i),
nir_imm_int(b, shift));
if (shift == 0) {
dst_chan[dst_idx] = shifted;
} else {
dst_chan[dst_idx] = nir_ior(b, dst_chan[dst_idx], shifted);
}
shift += src_bits;
if (shift >= dst_bits) {
dst_idx++;
shift = 0;
}
}
} else {
nir_ssa_def *mask = nir_imm_int(b, ~0u >> (32 - dst_bits));
unsigned src_idx = 0;
unsigned shift = 0;
for (unsigned i = 0; i < dst_components; i++) {
dst_chan[i] = nir_iand(b, nir_ushr(b, nir_channel(b, src, src_idx),
nir_imm_int(b, shift)),
mask);
shift += dst_bits;
if (shift >= src_bits) {
src_idx++;
shift = 0;
}
}
}
return nir_vec(b, dst_chan, dst_components);
}
static inline nir_ssa_def *
nir_format_linear_to_srgb(nir_builder *b, nir_ssa_def *c)
{
nir_ssa_def *linear = nir_fmul(b, c, nir_imm_float(b, 12.92f));
nir_ssa_def *curved =
nir_fsub(b, nir_fmul(b, nir_imm_float(b, 1.055f),
nir_fpow(b, c, nir_imm_float(b, 1.0 / 2.4))),
nir_imm_float(b, 0.055f));
return nir_fsat(b, nir_bcsel(b, nir_flt(b, c, nir_imm_float(b, 0.0031308f)),
linear, curved));
}
static inline nir_ssa_def *
nir_format_srgb_to_linear(nir_builder *b, nir_ssa_def *c)
{
nir_ssa_def *linear = nir_fdiv(b, c, nir_imm_float(b, 12.92f));
nir_ssa_def *curved =
nir_fpow(b, nir_fdiv(b, nir_fadd(b, c, nir_imm_float(b, 0.055f)),
nir_imm_float(b, 1.055f)),
nir_imm_float(b, 2.4f));
return nir_fsat(b, nir_bcsel(b, nir_fge(b, nir_imm_float(b, 0.04045f), c),
linear, curved));
}
static inline nir_ssa_def *
nir_format_unpack_11f11f10f(nir_builder *b, nir_ssa_def *packed)
{
nir_ssa_def *chans[3];
chans[0] = nir_mask_shift(b, packed, 0x000007ff, 4);
chans[1] = nir_mask_shift(b, packed, 0x003ff100, -7);
chans[2] = nir_mask_shift(b, packed, 0xffc00000, -17);
for (unsigned i = 0; i < 3; i++)
chans[i] = nir_unpack_half_2x16_split_x(b, chans[i]);
return nir_vec(b, chans, 3);
}
static inline nir_ssa_def *
nir_format_pack_r11g11b10f(nir_builder *b, nir_ssa_def *color)
{
/* 10 and 11-bit floats are unsigned. Clamp to non-negative */
nir_ssa_def *clamped = nir_fmax(b, color, nir_imm_float(b, 0));
nir_ssa_def *undef = nir_ssa_undef(b, 1, color->bit_size);
nir_ssa_def *p1 = nir_pack_half_2x16_split(b, nir_channel(b, clamped, 0),
nir_channel(b, clamped, 1));
nir_ssa_def *p2 = nir_pack_half_2x16_split(b, nir_channel(b, clamped, 2),
undef);
/* A 10 or 11-bit float has the same exponent as a 16-bit float but with
* fewer mantissa bits and no sign bit. All we have to do is throw away
* the sign bit and the bottom mantissa bits and shift it into place.
*/
nir_ssa_def *packed = nir_imm_int(b, 0);
packed = nir_mask_shift_or(b, packed, p1, 0x00007ff0, -4);
packed = nir_mask_shift_or(b, packed, p1, 0x7ff00000, -9);
packed = nir_mask_shift_or(b, packed, p2, 0x00007fe0, 17);
return packed;
}
static inline nir_ssa_def *
nir_format_pack_r9g9b9e5(nir_builder *b, nir_ssa_def *color)
{
/* See also float3_to_rgb9e5 */
/* First, we need to clamp it to range. */
nir_ssa_def *clamped = nir_fmin(b, color, nir_imm_float(b, MAX_RGB9E5));
/* Get rid of negatives and NaN */
clamped = nir_bcsel(b, nir_ult(b, nir_imm_int(b, 0x7f800000), color),
nir_imm_float(b, 0), clamped);
/* maxrgb.u = MAX3(rc.u, gc.u, bc.u); */
nir_ssa_def *maxu = nir_umax(b, nir_channel(b, clamped, 0),
nir_umax(b, nir_channel(b, clamped, 1),
nir_channel(b, clamped, 2)));
/* maxrgb.u += maxrgb.u & (1 << (23-9)); */
maxu = nir_iadd(b, maxu, nir_iand(b, maxu, nir_imm_int(b, 1 << 14)));
/* exp_shared = MAX2((maxrgb.u >> 23), -RGB9E5_EXP_BIAS - 1 + 127) +
* 1 + RGB9E5_EXP_BIAS - 127;
*/
nir_ssa_def *exp_shared =
nir_iadd(b, nir_umax(b, nir_ushr(b, maxu, nir_imm_int(b, 23)),
nir_imm_int(b, -RGB9E5_EXP_BIAS - 1 + 127)),
nir_imm_int(b, 1 + RGB9E5_EXP_BIAS - 127));
/* revdenom_biasedexp = 127 - (exp_shared - RGB9E5_EXP_BIAS -
* RGB9E5_MANTISSA_BITS) + 1;
*/
nir_ssa_def *revdenom_biasedexp =
nir_isub(b, nir_imm_int(b, 127 + RGB9E5_EXP_BIAS +
RGB9E5_MANTISSA_BITS + 1),
exp_shared);
/* revdenom.u = revdenom_biasedexp << 23; */
nir_ssa_def *revdenom =
nir_ishl(b, revdenom_biasedexp, nir_imm_int(b, 23));
/* rm = (int) (rc.f * revdenom.f);
* gm = (int) (gc.f * revdenom.f);
* bm = (int) (bc.f * revdenom.f);
*/
nir_ssa_def *mantissa =
nir_f2i32(b, nir_fmul(b, clamped, revdenom));
/* rm = (rm & 1) + (rm >> 1);
* gm = (gm & 1) + (gm >> 1);
* bm = (bm & 1) + (bm >> 1);
*/
mantissa = nir_iadd(b, nir_iand(b, mantissa, nir_imm_int(b, 1)),
nir_ushr(b, mantissa, nir_imm_int(b, 1)));
nir_ssa_def *packed = nir_channel(b, mantissa, 0);
packed = nir_mask_shift_or(b, packed, nir_channel(b, mantissa, 1), ~0, 9);
packed = nir_mask_shift_or(b, packed, nir_channel(b, mantissa, 2), ~0, 18);
packed = nir_mask_shift_or(b, packed, exp_shared, ~0, 27);
return packed;
}
|
{
"pile_set_name": "Github"
}
|
define(function (require) {
var RibbonPath = require('./Ribbon');
var graphic = require('../../util/graphic');
return require('../../echarts').extendChartView({
type: 'chord',
init: function (option) {
},
render: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var graph = seriesModel.getGraph();
var edgeData = seriesModel.getEdgeData();
var group = this.group;
group.removeAll();
data.each(function (idx) {
var layout = data.getItemLayout(idx);
var sector = new graphic.Sector({
shape: {
cx: layout.cx,
cy: layout.cy,
clockwise: layout.clockwise,
r0: layout.r0,
r: layout.r,
startAngle: layout.startAngle,
endAngle: layout.endAngle
}
});
sector.setStyle({
fill: data.getItemVisual(idx, 'color')
});
data.setItemLayout(idx);
group.add(sector);
});
var edgeRendered = {};
edgeData.each(function (idx) {
if (edgeRendered[idx]) {
return;
}
var layout = edgeData.getItemLayout(idx);
var edge = graph.getEdgeByIndex(idx);
var otherEdge = graph.getEdge(edge.node2, edge.node1);
var otherEdgeLayout = otherEdge.getLayout();
edgeRendered[idx] = edgeRendered[otherEdge.dataIndex] = true;
var ribbon = new RibbonPath({
shape: {
cx: layout.cx,
cy: layout.cy,
r: layout.r,
s0: layout.startAngle,
s1: layout.endAngle,
t0: otherEdgeLayout.startAngle,
t1: otherEdgeLayout.endAngle,
clockwise: layout.clockwise
}
});
ribbon.setStyle({
// Use color of source
fill: edge.node1.getVisual('color'),
opacity: 0.5
});
group.add(ribbon);
});
}
});
});
|
{
"pile_set_name": "Github"
}
|
---
layout: recipe
title: Backend Integration with Node Express
chapter: backend-integration-with-node-express
intro: true
---
In this chapter we will have a look into solving common problems when combining Angular.js with the Node.js [Express](http://expressjs.com/) framework. The examples used in this chapter are based on a Contacts app to manage a list of contacts. As an extra we use MongoDB as a backend for our contacts since it requires further customization to make it work in conjunction with Angular's `$resource` service.
<h2>Table of Contents</h2>
<ol>
{% sorted_for page in site.pages | sort_by:order %}
{% if page.chapter == "backend-integration-with-node-express" %}
<li>
<a href="{{ site.baseurl }}{{page.url}}">{{page.title}}</a>
</li>
{% endif %}
{% endsorted_for %}
</ol>
|
{
"pile_set_name": "Github"
}
|
3085 Clan Hell's Horses Assault Mech Second Line
Warhammer IIC 4,1
Naga Prime,2
Mad Cat Mk II Enhanced,3
Annihilator ANH-4A,4
Thunder Stallion 2 'Fire Stallion',5
Thunder Stallion (Standard),6
Cygnus (Standard),5
Behemoth (Stone Rhino) 3,4
Thunder Stallion 3,3
Cygnus 3,2
Hellstar 2,1
|
{
"pile_set_name": "Github"
}
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="global" source-language="en" target-language="hu" datatype="plaintext">
<header />
<body>
<trans-unit id="i-am-homepage">
<source><![CDATA[/^(?:|I )am on (?:|the )homepage$/]]></source>
<target><![CDATA[/^a címlapon (vagyok|van)$/]]></target>
</trans-unit>
<trans-unit id="i-go-to-homepage">
<source><![CDATA[/^(?:|I )go to (?:|the )homepage$/]]></source>
<target><![CDATA[/^(ellátogat|ellátogatok) a címlapra$/]]></target>
</trans-unit>
<trans-unit id="i-am-on-page">
<source><![CDATA[/^(?:|I )am on "(?P<page>[^"]+)"$/]]></source>
<target><![CDATA[/^az? "(?P<page>[^"]+)" oldalon (vagyok|van)$/]]></target>
</trans-unit>
<trans-unit id="i-go-to-page">
<source><![CDATA[/^(?:|I )go to "(?P<page>[^"]+)"$/]]></source>
<target><![CDATA[/^(ellátogat|ellátogatok) az? "(?P<page>[^"]+) oldalra"$/]]></target>
</trans-unit>
<trans-unit id="reload-the-page">
<source><![CDATA[/^(?:|I )reload the page$/]]></source>
<target><![CDATA[/^(újratöltöm|újratölti) az oldalt$/]]></target>
</trans-unit>
<trans-unit id="move-backward-one-page">
<source><![CDATA[/^(?:|I )move backward one page$/]]></source>
<target><![CDATA[/^az előző oldalra (látogatok|látogat)$/]]></target>
</trans-unit>
<trans-unit id="move-forward-one-page">
<source><![CDATA[/^(?:|I )move forward one page$/]]></source>
<target><![CDATA[/^a következő oldalra (látogatok|látogat)$/]]></target>
</trans-unit>
<trans-unit id="i-press-button">
<source><![CDATA[/^(?:|I )press "(?P<button>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(megnyomom|megnyomja|lenyomom|lenyomja) az? "(?P<button>(?:[^"]|\\")*)" gombot$/]]></target>
</trans-unit>
<trans-unit id="i-follow-link">
<source><![CDATA[/^(?:|I )follow "(?P<link>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(követem|követi) az? "(?P<link>(?:[^"]|\\")*)" linket$/]]></target>
</trans-unit>
<trans-unit id="i-fill-in-field-with-value">
<source><![CDATA[/^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(kitöltöm|kitölti) az? "(?P<field>(?:[^"]|\\")*)" mezőt "(?P<value>(?:[^"]|\\")*)" értékkel$/]]></target>
</trans-unit>
<trans-unit id="i-fill-in-field-with">
<source><![CDATA[/^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with:$/]]></source>
<target><![CDATA[/^(kitöltöm|kitölti) az? "(?P<field>(?:[^"]|\\")*)" mezőt a következő értékekkel:$/]]></target>
</trans-unit>
<trans-unit id="i-fill-in-value-for-field">
<source><![CDATA[/^(?:|I )fill in "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^az? "(?P<value>(?:[^"]|\\")*)" értékkel (kitöltöm|kitölti) az? "(?P<field>(?:[^"]|\\")*)" mezőt$/]]></target>
</trans-unit>
<trans-unit id="i-fill-in-the-following">
<source><![CDATA[/^(?:|I )fill in the following:$/]]></source>
<target><![CDATA[/^Amennyiben (kitöltöm|kitölti) a következőket:$/]]></target>
</trans-unit>
<trans-unit id="i-select-option-from-select">
<source><![CDATA[/^(?:|I )select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(kiválasztom|kiválasztja) az? "(?P<option>(?:[^"]|\\")*)" leheőséget az? "(?P<select>(?:[^"]|\\")*)" legördülő listából$/]]></target>
</trans-unit>
<trans-unit id="i-additionally-select-option-from-select">
<source><![CDATA[/^(?:|I )additionally select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(kiválasztom|kiválasztja) a "(?P<option>(?:[^"]|\\")*)" további lehetőséget az? "(?P<select>(?:[^"]|\\")*)" legördülő listából$/]]></target>
</trans-unit>
<trans-unit id="i-check-option">
<source><![CDATA[/^(?:|I )check "(?P<option>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(kiválasztom|kiválasztja) az? "(?P<option>(?:[^"]|\\")*) opciót"$/]]></target>
</trans-unit>
<trans-unit id="i-uncheck-option">
<source><![CDATA[/^(?:|I )uncheck "(?P<option>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(törlöm|törli) az? "(?P<option>(?:[^"]|\\")*)" opciót$/]]></target>
</trans-unit>
<trans-unit id="i-attach-the-file-to-field">
<source><![CDATA[/^(?:|I )attach the file "(?P<path>[^"]*)" to "(?P<field>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^(csatolom|csatolja) az? "(?P<path>[^"]*)" fájlt az? "(?P<field>(?:[^"]|\\")*)" mezőhöz$/]]></target>
</trans-unit>
<trans-unit id="i-should-see-text">
<source><![CDATA[/^(?:|I )should see "(?P<text>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^az? "(?P<text>(?:[^"]|\\")*)" szöveget kell (látnom|látnia)$/]]></target>
</trans-unit>
<trans-unit id="i-should-see-text-matching">
<source><![CDATA[/^(?:|I )should see text matching (?P<pattern>"(?:[^"]|\\")*")$/]]></source>
<target><![CDATA[/^az? (?P<pattern>"(?:[^"]|\\")*") mintára illeszkedő szöveget (látnom|látnia) kell$/]]></target>
</trans-unit>
<trans-unit id="i-should-not-see-text-matching">
<source><![CDATA[/^(?:|I )should not see text matching (?P<pattern>"(?:[^"]|\\")*")$/]]></source>
<target><![CDATA[/^az? (?P<pattern>"(?:[^"]|\\")*") mintára illeszkedő szöveget nem szabad (látnom|látnia)$/]]></target>
</trans-unit>
<trans-unit id="the-response-should-contain">
<source><![CDATA[/^the response should contain "(?P<text>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^a válasznak tartalmaznia kell a következőt: "(?P<text>(?:[^"]|\\")*)"$/]]></target>
</trans-unit>
<trans-unit id="i-should-not-see-text">
<source><![CDATA[/^(?:|I )should not see "(?P<text>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^az? "(?P<text>(?:[^"]|\\")*)" szöveget nem szabad (látnom|látnia)$/]]></target>
</trans-unit>
<trans-unit id="the-response-should-not-contain">
<source><![CDATA[/^the response should not contain "(?P<text>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^a válasznak nem szabad tartalmaznia "(?P<text>(?:[^"]|\\")*)"$/]]></target>
</trans-unit>
<trans-unit id="the-field-should-contain-value">
<source><![CDATA[/^the "(?P<field>(?:[^"]|\\")*)" field should contain "(?P<value>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^az? "(?P<field>(?:[^"]|\\")*)" mezőnek tartalmaznia kell a következő értéket: "(?P<value>(?:[^"]|\\")*)"$/]]></target>
</trans-unit>
<trans-unit id="the-field-should-not-contain-value">
<source><![CDATA[/^the "(?P<field>(?:[^"]|\\")*)" field should not contain "(?P<value>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^az? "(?P<field>(?:[^"]|\\")*)" mezőnek nem szabad tartalmaznia a következő értéket: "(?P<value>(?:[^"]|\\")*)"$/]]></target>
</trans-unit>
<trans-unit id="the-checkbox-should-be-checked">
<source><![CDATA[/^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should be checked$/]]></source>
<target><![CDATA[/^az? "(?P<checkbox>(?:[^"]|\\")*)" jelölőnégyzetnek be kell jelölve lennie$/]]></target>
</trans-unit>
<trans-unit id="the-checkbox-should-is-checked">
<source><![CDATA[/^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" (?:is|should be) checked$/]]></source>
<target><![CDATA[/^az? "(?P<checkbox>(?:[^"]|\\")*)" jelölőnégyzetnek be kell lennie jelölve$/]]></target>
</trans-unit>
<trans-unit id="the-checkbox-should-be-unchecked">
<source><![CDATA[/^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" should (?:be unchecked|not be checked)$/]]></source>
<target><![CDATA[/^az? "(?P<checkbox>(?:[^"]|\\")*)" jelölőnégyzetnek törölve kell lennie$/]]></target>
</trans-unit>
<trans-unit id="the-checkbox-is-unchecked">
<source><![CDATA[/^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" is (?:unchecked|not checked)$/]]></source>
<target><![CDATA[/^az? "(?P<checkbox>(?:[^"]|\\")*)" jelölőnégyzet törölve van$/]]></target>
</trans-unit>
<trans-unit id="i-should-be-on-page">
<source><![CDATA[/^(?:|I )should be on "(?P<page>[^"]+)"$/]]></source>
<target><![CDATA[/^a? "(?P<page>[^"]+)" oldalon kell (lennem|lennie)$/]]></target>
</trans-unit>
<trans-unit id="i-should-be-on-homepage">
<source><![CDATA[/^(?:|I )should be on (?:|the )homepage$/]]></source>
<target><![CDATA[/^a címlapon kell (lennem|lennie)/]]></target>
</trans-unit>
<trans-unit id="the-url-should-match">
<source><![CDATA[/^the (?i)url(?-i) should match (?P<pattern>"([^"]|\\")*")$/]]></source>
<target><![CDATA[/^az? (url|webcím) illeszkedik a következő mintára: (?P<pattern>"([^"]|\\")*")$/]]></target>
</trans-unit>
<trans-unit id="the-element-should-contain">
<source><![CDATA[/^the "(?P<element>[^"]*)" element should contain "(?P<value>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^az? "(?P<element>[^"]*)" tartalmaznia kell a következő értéket: "(?P<value>(?:[^"]|\\")*)"$/]]></target>
</trans-unit>
<trans-unit id="the-element-should-not-contain">
<source><![CDATA[/^the "(?P<element>[^"]*)" element should not contain "(?P<value>(?:[^"]|\\")*)"$/]]></source>
<target><![CDATA[/^az? "(?P<element>[^"]*)" nem szabad tartalmaznia a következő értéket: "(?P<value>(?:[^"]|\\")*)"$/]]></target>
</trans-unit>
<trans-unit id="i-should-see-text-in-element">
<source><![CDATA[/^(?:|I )should see "(?P<text>(?:[^"]|\\")*)" in the "(?P<element>[^"]*)" element$/]]></source>
<target><![CDATA[/^az? "(?P<text>(?:[^"]|\\")*)" szöveget (látnom|látnia) kell az? "(?P<element>[^"]*)" elemben$/]]></target>
</trans-unit>
<trans-unit id="i-should-not-see-text-in-element">
<source><![CDATA[/^(?:|I )should not see "(?P<text>(?:[^"]|\\")*)" in the "(?P<element>[^"]*)" element$/]]></source>
<target><![CDATA[/^az? "(?P<text>(?:[^"]|\\")*)" szöveget nem szabad (látnom|látnia) az? "(?P<element>[^"]*)" elemben$/]]></target>
</trans-unit>
<trans-unit id="i-should-see-element">
<source><![CDATA[/^(?:|I )should see an? "(?P<element>[^"]*)" element$/]]></source>
<target><![CDATA[/^az? "(?P<element>[^"]*)" elemet (látnom|látnia) kell$/]]></target>
</trans-unit>
<trans-unit id="i-should-not-see-element">
<source><![CDATA[/^(?:|I )should not see an? "(?P<element>[^"]*)" element$/]]></source>
<target><![CDATA[/^az? "(?P<element>[^"]*)" elemet nem szabad látnia$/]]></target>
</trans-unit>
<trans-unit id="i-should-see-num-elements">
<source><![CDATA[/^(?:|I )should see (?P<num>\d+) "(?P<element>[^"]*)" elements?$/]]></source>
<target><![CDATA[/^(?P<num>\d+) darab "(?P<element>[^"]*)" elemet kell (látnom|látnia)$/]]></target>
</trans-unit>
<trans-unit id="the-response-status-code-should-be">
<source><![CDATA[/^the response status code should be (?P<code>\d+)$/]]></source>
<target><![CDATA[/^a válaszüzenet kódjának a következőnek kell lennie: (?P<code>\d+)$/]]></target>
</trans-unit>
<trans-unit id="the-response-status-code-should-not-be">
<source><![CDATA[/^the response status code should not be (?P<code>\d+)$/]]></source>
<target><![CDATA[/^a válaszüzenet kódja nem lehet a következő: (?P<code>\d+)$/]]></target>
</trans-unit>
<trans-unit id="print-current-URL">
<source><![CDATA[/^print current URL$/]]></source>
<target><![CDATA[/^nyomtassa ki az aktuális URL-t$/]]></target>
</trans-unit>
<trans-unit id="print-last-response">
<source><![CDATA[/^print last response$/]]></source>
<target><![CDATA[/^nyomtassa ki a legutóbbi választ$/]]></target>
</trans-unit>
<trans-unit id="show-last-response">
<source><![CDATA[/^show last response$/]]></source>
<target><![CDATA[/^mutassa a legutóbi választ$/]]></target>
</trans-unit>
</body>
</file>
</xliff>
|
{
"pile_set_name": "Github"
}
|
// The MIT License (MIT)
//
// Copyright (c) 2015-2020 Rasmus Mikkelsen
// Copyright (c) 2015-2020 eBay Software Foundation
// https://github.com/eventflow/EventFlow
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json;
namespace EventFlow.ValueObjects
{
public class SingleValueObjectConverter : JsonConverter
{
private static readonly ConcurrentDictionary<Type, Type> ConstructorArgumentTypes = new ConcurrentDictionary<Type, Type>();
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
if (!(value is ISingleValueObject singleValueObject))
{
return;
}
serializer.Serialize(writer, singleValueObject.GetValue());
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
if (reader.Value == null)
{
return null;
}
var parameterType = ConstructorArgumentTypes.GetOrAdd(
objectType,
t =>
{
var constructorInfo = objectType.GetTypeInfo().GetConstructors(BindingFlags.Public | BindingFlags.Instance).Single();
var parameterInfo = constructorInfo.GetParameters().Single();
return parameterInfo.ParameterType;
});
var value = serializer.Deserialize(reader, parameterType);
return Activator.CreateInstance(objectType, value);
}
public override bool CanConvert(Type objectType)
{
return typeof(ISingleValueObject).GetTypeInfo().IsAssignableFrom(objectType);
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2004, 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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.
*/
#include "config.h"
#include "KURL.h"
#include <wtf/RetainPtr.h>
#include <CoreFoundation/CFURL.h>
using namespace std;
namespace WebCore {
KURL::KURL(CFURLRef url)
{
if (!url) {
parse(0, 0);
return;
}
CFIndex bytesLength = CFURLGetBytes(url, 0, 0);
Vector<char, 512> buffer(bytesLength + 6); // 5 for "file:", 1 for null character to end C string
char* bytes = &buffer[5];
CFURLGetBytes(url, reinterpret_cast<UInt8*>(bytes), bytesLength);
bytes[bytesLength] = '\0';
if (bytes[0] != '/') {
parse(bytes, 0);
return;
}
buffer[0] = 'f';
buffer[1] = 'i';
buffer[2] = 'l';
buffer[3] = 'e';
buffer[4] = ':';
parse(buffer.data(), 0);
}
CFURLRef KURL::createCFURL() const
{
// FIXME: What should this return for invalid URLs?
// Currently it throws away the high bytes of the characters in the string in that case,
// which is clearly wrong.
Vector<char, 512> buffer;
copyToBuffer(buffer);
// NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components
// (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which
// could either be a malformed string or bytes in a different encoding, like Shift-JIS, so we fall back
// onto using ISO Latin-1 in those cases.
CFURLRef result = CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast<const UInt8*>(buffer.data()), buffer.size(), kCFStringEncodingUTF8, 0, true);
if (!result)
result = CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast<const UInt8*>(buffer.data()), buffer.size(), kCFStringEncodingISOLatin1, 0, true);
return result;
}
#if !(PLATFORM(QT) && USE(QTKIT))
String KURL::fileSystemPath() const
{
RetainPtr<CFURLRef> cfURL(AdoptCF, createCFURL());
if (!cfURL)
return String();
#if PLATFORM(WIN)
CFURLPathStyle pathStyle = kCFURLWindowsPathStyle;
#else
CFURLPathStyle pathStyle = kCFURLPOSIXPathStyle;
#endif
return RetainPtr<CFStringRef>(AdoptCF, CFURLCopyFileSystemPath(cfURL.get(), pathStyle)).get();
}
#endif
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<string name="app_name">10-init_render_pass</string>
</resources>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2018 Schibsted Marketplaces Products & Technology As
//
// 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.schibsted.spt.data.jslt.impl;
import com.fasterxml.jackson.databind.JsonNode;
import com.schibsted.spt.data.jslt.JsltException;
public class VariableExpression extends AbstractNode {
private String variable;
private int slot;
private VariableInfo info;
public VariableExpression(String variable, Location location) {
super(location);
this.variable = variable;
this.slot = ScopeManager.UNFOUND;
}
public String getVariable() {
return variable;
}
public JsonNode apply(Scope scope, JsonNode input) {
JsonNode value = scope.getValue(slot);
if (value == null)
throw new JsltException("No such variable '" + variable + "'",
location);
return value;
}
public void dump(int level) {
System.out.println(NodeUtils.indent(level) + this);
}
public void prepare(PreparationContext ctx) {
info = ctx.scope.resolveVariable(this);
slot = info.getSlot();
info.incrementUsageCount();
}
public ExpressionNode optimize() {
// if the variable is assigned to a literal then there's no point
// in actually having a variable. we can just insert the literal
// in the expression tree and be done with it.
ExpressionNode declaration = info.getDeclaration();
// will be null if the variable is a parameter
if (declaration != null && (declaration instanceof LiteralExpression))
return declaration;
else
return this;
}
public String toString() {
return "$" + variable;
}
}
|
{
"pile_set_name": "Github"
}
|
edb605f597928b60362ec9b8f0857b3b40ea2d0c
|
{
"pile_set_name": "Github"
}
|
#! FIELDS time phi psi metad1.bias metad2.bias metad3.bias metad4.bias metad5.bias metad6.bias metad1.transbias metad2.transbias metad3.transbias metad4.transbias metad5.transbias metad6.transbias
#! SET min_phi -pi
#! SET max_phi pi
0.000000 -1.2379 1.9470 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.4000 0.6000 0.6000 0.6000 0.6000 0.4000
1.000000 -1.4839 1.9381 1.0000 1.0000 0.8511 0.7916 1.0000 1.0000 0.4000 0.6000 0.6551 0.6000 0.6000 0.4000
2.000000 -1.3243 1.9663 1.7837 1.7837 1.7676 1.7612 1.7837 1.7837 0.4000 0.6000 0.6768 0.6000 0.6000 0.4000
3.000000 -1.3340 1.9885 2.9434 2.9434 2.9227 2.9146 2.9434 2.9434 0.4000 0.6000 0.7004 0.6000 0.6000 0.4000
4.000000 -1.4613 1.8901 3.8047 3.8047 3.6802 3.6304 3.8047 3.8047 0.4000 0.6000 0.8277 0.6277 0.6000 0.4000
5.000000 -1.2202 2.0306 3.8725 3.8725 3.8725 3.8725 3.8725 3.8725 0.4000 0.6000 0.8314 0.6314 0.6000 0.4000
6.000000 -1.3883 1.8776 5.6213 5.6213 5.5645 5.5418 5.6213 5.6213 0.4000 0.6000 0.8863 0.6863 0.6000 0.4000
7.000000 -1.5481 1.9488 5.5961 5.5961 5.3757 5.2888 5.5961 5.5961 0.4000 0.6000 1.0000 0.9624 0.6000 0.4000
8.000000 -1.8429 1.9025 2.0232 2.0232 1.5305 1.3337 2.0232 2.0232 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
9.000000 -2.2424 1.9813 1.2186 1.2186 1.0123 0.9279 1.2186 1.2186 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
10.000000 -1.1482 1.9684 5.2099 5.2099 5.2099 5.2099 5.2099 5.2099 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
11.000000 -1.7580 1.9807 4.1813 4.1813 3.7408 3.5658 4.1813 4.1813 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
12.000000 -1.3186 1.9486 8.6178 8.6178 8.6047 8.5995 8.6178 8.6178 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
13.000000 -2.9911 1.9547 0.9878 0.9878 0.9878 0.9878 0.9878 0.9878 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
14.000000 -1.4112 2.0415 8.9808 8.9808 8.9106 8.8834 8.9808 8.9808 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
15.000000 -2.5995 1.9166 1.4342 1.4342 1.4342 1.4342 1.4342 1.4342 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
16.000000 -1.4608 1.9433 10.6386 10.6386 10.5186 10.4711 10.6386 10.6386 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
17.000000 -1.3791 2.0625 10.4796 10.4796 10.4350 10.4179 10.4796 10.4796 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
18.000000 -1.6771 1.9433 8.3031 8.3031 7.9412 7.7976 8.3031 8.3031 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
19.000000 -1.5241 1.9642 12.2554 12.2554 12.0724 12.0004 12.2554 12.2554 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
20.000000 -1.1997 1.9296 10.2734 10.2734 10.2734 10.2734 10.2734 10.2734 0.4000 0.6000 1.0000 1.0000 0.6000 0.4000
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
set -e
extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')"
cd "$extDir"
usage() {
echo "usage: $0 [options] module-name [module-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo " $0 --ini-name 0-apc.ini apcu apc"
echo
echo 'Possible values for module-name:'
find -maxdepth 1 \
-type f \
-name '*.so' \
-exec basename '{}' ';' \
| sort \
| xargs
echo
echo 'Some of the above modules are already compiled into PHP; please check'
echo 'the output of "php -i" to see which modules are already loaded.'
}
opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })"
eval set -- "$opts"
iniName=
while true; do
flag="$1"
shift
case "$flag" in
--help|-h|'-?') usage && exit 0 ;;
--ini-name) iniName="$1" && shift ;;
--) break ;;
*)
{
echo "error: unknown flag: $flag"
usage
} >&2
exit 1
;;
esac
done
modules=
for module; do
if [ -z "$module" ]; then
continue
fi
if [ -f "$module.so" ] && ! [ -f "$module" ]; then
# allow ".so" to be optional
module="$module.so"
fi
if ! [ -f "$module" ]; then
echo >&2 "error: '$module' does not exist"
echo >&2
usage >&2
exit 1
fi
modules="$modules $module"
done
if [ -z "$modules" ]; then
usage >&2
exit 1
fi
pm='unknown'
if [ -e /lib/apk/db/installed ]; then
pm='apk'
fi
apkDel=
if [ "$pm" = 'apk' ]; then
if \
[ -n "$PHPIZE_DEPS" ] \
&& ! apk info --installed .phpize-deps > /dev/null \
&& ! apk info --installed .phpize-deps-configure > /dev/null \
; then
apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils
apkDel='.docker-php-ext-enable-deps'
fi
fi
for module in $modules; do
if readelf --wide --syms "$module" | grep -q ' zend_extension_entry$'; then
# https://wiki.php.net/internals/extensions#loading_zend_extensions
absModule="$(readlink -f "$module")"
line="zend_extension=$absModule"
else
line="extension=$module"
fi
ext="$(basename "$module")"
ext="${ext%.*}"
if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then
# this isn't perfect, but it's better than nothing
# (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache')
echo >&2
echo >&2 "warning: $ext ($module) is already loaded!"
echo >&2
continue
fi
case "$iniName" in
/*)
# allow an absolute path
ini="$iniName"
;;
*)
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
;;
esac
if ! grep -q "$line" "$ini" 2>/dev/null; then
echo "$line" >> "$ini"
fi
done
if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then
apk del --no-network $apkDel
fi
|
{
"pile_set_name": "Github"
}
|
Test
- Injection of a no-interface bean in a request-scoped model via @Inject
and @EJB and invocation of methods defined in the EJB class and
in a super-class of the EJB
- glassfish issue 13040
|
{
"pile_set_name": "Github"
}
|
---
title: StackOverflowInfo 结构
ms.date: 03/30/2017
api_name:
- StackOverflowInfo
api_location:
- mscoree.dll
api_type:
- COM
f1_keywords:
- StackOverflowInfo
helpviewer_keywords:
- StackOverflowInfo structure [.NET Framework hosting]
ms.assetid: 519389f2-0217-436c-99d4-93a76ebce5b5
topic_type:
- apiref
ms.openlocfilehash: 941093b9a0856c2b716ba359c854473f3c9ea26a
ms.sourcegitcommit: 03fec33630b46e78d5e81e91b40518f32c4bd7b5
ms.translationtype: MT
ms.contentlocale: zh-CN
ms.lasthandoff: 05/27/2020
ms.locfileid: "84006514"
---
# <a name="stackoverflowinfo-structure"></a>StackOverflowInfo 结构
存储发生的溢出的类型以及因溢出而引发的异常的信息。
## <a name="syntax"></a>语法
```cpp
typedef struct _StackOverflowInfo {
StackOverflowType soType;
EXCEPTION_POINTERS *pExceptionInfo;
} StackOverflowInfo;
```
## <a name="members"></a>成员
|成员|描述|
|------------|-----------------|
|`soType`|指定溢出类型的[StackOverflowType](stackoverflowtype-enumeration.md)枚举的值。|
|`pExceptionInfo`|一个指向 Win32 对象的指针 `EXCEPTION_POINTERS` ,该对象包含一个异常记录,其中包含与计算机无关的异常说明和一个上下文记录,其中包含发生异常时的处理器上下文的依赖于计算机的说明。|
## <a name="remarks"></a>备注
`StackOverflowInfo`对象将传递到事件的[IActionOnCLREvent:: OnEvent](iactiononclrevent-onevent-method.md)方法 `Event_StackOverflow` 。
## <a name="requirements"></a>要求
**平台:** 请参阅[系统要求](../../get-started/system-requirements.md)。
**标头:** Mscoree.dll
**库:** 作为资源包括在 Mscoree.dll 中
**.NET Framework 版本:**[!INCLUDE[net_current_v20plus](../../../../includes/net-current-v20plus-md.md)]
## <a name="see-also"></a>另请参阅
- [承载结构](hosting-structures.md)
|
{
"pile_set_name": "Github"
}
|
{
"RIDE":{
"STARTTIME":"2013\/05\/27 07:56:35 UTC",
"RECINTSECS":1,
"DEVICETYPE":"PowerTap",
"IDENTIFIER":"",
"TAGS":{
"Athlete":"Mark Liversedge",
"Calendar Text":"An incredibly short ride to test bugs in array offset processing in GC\nTest Bugs in GC\n",
"Change History":"Changes on Mon May 27 08:57:42 2013:\n",
"Data":"TDSPHC------",
"Device":"PowerTap",
"Device Info":"Generated in train mode",
"File Format":"PowerTap CSV (csv)",
"Filename":"2013_05_27_08_56_35.csv",
"Month":"May",
"Notes":"An incredibly short ride to test bugs in array offset processing in GC",
"Objective":"Test Bugs in GC",
"Sport":"Bike",
"Weekday":"Mon",
"Workout Code":"Short",
"Year":"2013"
},
"SAMPLES":[
{ "SECS":1.003, "KM":0.00427778, "WATTS":95, "CAD":84, "KPH":27, "HR":143 },
{ "SECS":2.003, "KM":0.0112778, "WATTS":65, "CAD":84, "KPH":25, "HR":144 },
{ "SECS":3.003, "KM":0.0181111, "WATTS":59, "CAD":82, "KPH":25, "HR":143 },
{ "SECS":4.003, "KM":0.0250556, "WATTS":77, "CAD":82, "KPH":27, "HR":144 },
{ "SECS":5.003, "KM":0.0321111, "WATTS":55, "CAD":81, "KPH":23, "HR":145 },
{ "SECS":6.003, "KM":0.0386667, "WATTS":57, "CAD":84, "KPH":27, "HR":145 },
{ "SECS":7.00302, "KM":0.0458889, "WATTS":57, "CAD":81, "KPH":26, "HR":144 },
{ "SECS":8.00298, "KM":0.0529444, "WATTS":77, "CAD":87, "KPH":27, "HR":143 },
{ "SECS":9.003, "KM":0.06, "WATTS":55, "CAD":81, "KPH":26, "HR":144 },
{ "SECS":10.003, "KM":0.0671667, "WATTS":70, "CAD":82, "KPH":23, "HR":145 },
{ "SECS":11.003, "KM":0.0741667, "WATTS":72, "CAD":88, "KPH":23, "HR":143 },
{ "SECS":12.003, "KM":0.0809444, "WATTS":79, "CAD":86, "KPH":25, "HR":144 }
]
}
}
|
{
"pile_set_name": "Github"
}
|
do --- traceback
local co = coroutine.create(function()
local x = nil
local y = x.x
end)
assert(coroutine.resume(co) == false)
debug.traceback(co)
end
|
{
"pile_set_name": "Github"
}
|
<a {{ with .Get "href"}} href="{{.}}" target="_blank" {{ end }} class="btn btn-default">
{{ $icon := .Get "icon" }}
{{ $iconposition := .Get "icon-position" }}
{{ if ($icon) }}
{{ if or (not ($iconposition)) (eq $iconposition "left") }}
<i class="{{$icon}}"></i>
{{ end }}
{{ end }}
{{ .Inner }}
{{ if and ($icon) (eq $iconposition "right")}}
<i class="{{$icon}}"></i>
{{ end }}
</a>
|
{
"pile_set_name": "Github"
}
|
# Topics
This is a list of links to topics that may be helpful in learning or researching data structures and algorithms.
## Links:
- https://en.wikipedia.org/wiki/Data_deduplication
- https://searchstorage.techtarget.com/definition/data-deduplication
- https://docs.gitlab.com/ce/development/architecture.html
- https://stackoverflow.com/questions/35390533/actual-difference-between-data-compression-and-data-deduplication
- https://stackoverflow.com/questions/40200413/sessions-vs-token-based-authentication
- https://stackoverflow.com/questions/15678406/when-to-use-myisam-and-innodb
|
{
"pile_set_name": "Github"
}
|
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="{{ absolute_url('/') }}">Doom Project</a>
<div class="nav-collapse">
<ul class="nav">
<li {% if active_tab == "workers" %}class="active"{% end %}><a href="{{ absolute_url('/workers') }}">Workers</a></li>
<li {% if active_tab == "tasks" %}class="active"{% end %}><a href="{{ absolute_url('/tasks?limit=100') }}">Tasks</a></li>
<li {% if active_tab == "broker" %}class="active"{% end %}><a href="{{ absolute_url('/broker') }}">Broker</a></li>
<li {% if active_tab == "monitor" %}class="active"{% end %}><a href="{{ absolute_url('/monitor') }}">Monitor</a></li>
<li><a href="http://flower.readthedocs.org" target="_blank">Docs</a></li>
<li><a href="http://l137.cnblogs.com/" target="_blank">About</a></li>
</ul>
</div>
</div>
</div>
</div>
|
{
"pile_set_name": "Github"
}
|
s = "n02084071"
probas_1 = forward_pass_resize("dog.jpg", (200, 320))
heatmap_1 = build_heatmap(probas_1, synset=s)
display_img_and_heatmap("dog.jpg", heatmap_1)
probas_2 = forward_pass_resize("dog.jpg", (400, 640))
heatmap_2 = build_heatmap(probas_2, synset=s)
display_img_and_heatmap("dog.jpg", heatmap_2)
probas_3 = forward_pass_resize("dog.jpg", (800, 1280))
heatmap_3 = build_heatmap(probas_3, synset=s)
display_img_and_heatmap("dog.jpg", heatmap_3)
# We observe that heatmap_1 and heatmap_2 gave coarser
# segmentations than heatmap_3. However, heatmap_3
# has small artifacts outside of the dog area
# heatmap_3 encodes more local, texture level information
# about the dog, while lower resolutions will encode more
# semantic information about the full object
# combining them is probably a good idea!
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
# Don't add /* trace */ messages to --print queries becuase they
# contain non-determinstic info like user, etc.
$ENV{PT_TEST_NO_TRACE} = 1;
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-table-sync";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $slave1_dbh = $sb->get_dbh_for('slave1');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
elsif ( !$slave1_dbh ) {
plan skip_all => 'Cannot connect to sandbox slave1';
}
my $master_dsn = $sb->dsn_for('master');
my $slave1_dsn = $sb->dsn_for('slave1');
my $output;
my $sample = "t/pt-table-sync/samples";
# #############################################################################
# --replicate tests
# #############################################################################
# #############################################################################
# Bug 918056: pt-table-sync false-positive error "Cannot nibble table because
# MySQL chose no index instead of the PRIMARY index"
# https://bugs.launchpad.net/percona-toolkit/+bug/918056
# #############################################################################
# The slave has 49 extra rows on the low end, e.g. master has rows 50+
# but slave has rows 1-49 and 50+. This tests syncing the lower oob chunk.
$sb->create_dbs($master_dbh, [qw(bug918056)]);
$sb->load_file('master', "$sample/bug-918056-master.sql", "bug918056");
$sb->load_file('slave1', "$sample/bug-918056-slave.sql", "bug918056");
ok(
no_diff(
sub {
pt_table_sync::main($master_dsn, qw(--replicate percona.checksums),
qw(--print))
},
"$sample/bug-918056-print.txt",
stderr => 1,
),
"Sync lower oob (bug 918056)"
);
# Test syncing the upper oob chunk.
$sb->load_file('master', "$sample/upper-oob-master.sql");
$sb->load_file('slave1', "$sample/upper-oob-slave.sql");
ok(
no_diff(
sub {
pt_table_sync::main($master_dsn, qw(--replicate percona.checksums),
qw(--print))
},
"$sample/upper-oob-print.txt",
stderr => 1,
),
"Sync upper oob (bug 918056)"
);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($master_dbh);
$sb->wipe_clean($slave1_dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;
|
{
"pile_set_name": "Github"
}
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QNETWORKCONFIGMANAGER_P_H
#define QNETWORKCONFIGMANAGER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtNetwork/private/qtnetworkglobal_p.h>
#include "qnetworkconfigmanager.h"
#include "qnetworkconfiguration_p.h"
#include <QtCore/private/qfactoryloader_p.h>
#include <QtCore/qmutex.h>
#include <QtCore/qset.h>
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
class QBearerEngine;
class QTimer;
class Q_NETWORK_EXPORT QNetworkConfigurationManagerPrivate : public QObject
{
Q_OBJECT
public:
QNetworkConfigurationManagerPrivate();
virtual ~QNetworkConfigurationManagerPrivate();
QNetworkConfiguration defaultConfiguration() const;
QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags filter) const;
QNetworkConfiguration configurationFromIdentifier(const QString &identifier) const;
bool isOnline() const;
QNetworkConfigurationManager::Capabilities capabilities() const;
void performAsyncConfigurationUpdate();
QList<QBearerEngine *> engines() const;
void enablePolling();
void disablePolling();
void initialize();
void cleanup();
public Q_SLOTS:
void updateConfigurations();
static void addPreAndPostRoutine();
Q_SIGNALS:
void configurationAdded(const QNetworkConfiguration &config);
void configurationRemoved(const QNetworkConfiguration &config);
void configurationChanged(const QNetworkConfiguration &config);
void configurationUpdateComplete();
void onlineStateChanged(bool isOnline);
private Q_SLOTS:
void configurationAdded(QNetworkConfigurationPrivatePointer ptr);
void configurationRemoved(QNetworkConfigurationPrivatePointer ptr);
void configurationChanged(QNetworkConfigurationPrivatePointer ptr);
void pollEngines();
private:
Q_INVOKABLE void startPolling();
QTimer *pollTimer;
QThread *bearerThread;
private:
mutable QMutex mutex;
QFactoryLoader loader;
QList<QBearerEngine *> sessionEngines;
QSet<QString> onlineConfigurations;
QSet<QBearerEngine *> pollingEngines;
QSet<QBearerEngine *> updatingEngines;
int forcedPolling;
bool updating;
bool firstUpdate;
};
Q_NETWORK_EXPORT QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate();
QT_END_NAMESPACE
#endif // QT_NO_BEARERMANAGEMENT
#endif // QNETWORKCONFMANAGER_P_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.pulsar.io.hdfs2.sink;
import java.io.IOException;
import java.util.concurrent.BlockingQueue;
import org.apache.commons.collections.CollectionUtils;
import org.apache.hadoop.fs.Syncable;
import org.apache.pulsar.functions.api.Record;
/**
* A thread that runs in the background and acknowledges Records
* after they have been written to disk.
*
* @param <V>
*/
public class HdfsSyncThread<V> extends Thread {
private final Syncable stream;
private final BlockingQueue<Record<V>> unackedRecords;
private final long syncInterval;
private boolean keepRunning = true;
public HdfsSyncThread(Syncable stream, BlockingQueue<Record<V>> unackedRecords, long syncInterval) {
this.stream = stream;
this.unackedRecords = unackedRecords;
this.syncInterval = syncInterval;
}
@Override
public void run() {
while (keepRunning) {
try {
Thread.sleep(syncInterval);
ackRecords();
} catch (InterruptedException e) {
return;
} catch (IOException e) {
e.printStackTrace();
}
}
}
public final void halt() throws IOException, InterruptedException {
keepRunning = false;
ackRecords();
}
private void ackRecords() throws IOException, InterruptedException {
if (CollectionUtils.isEmpty(unackedRecords)) {
return;
}
synchronized (stream) {
stream.hsync();
}
while (!unackedRecords.isEmpty()) {
unackedRecords.take().ack();
}
}
}
|
{
"pile_set_name": "Github"
}
|
-- GHDL Run Time (GRT) - signals management.
-- Copyright (C) 2002 - 2014 Tristan Gingold
--
-- GHDL is free software; you can redistribute it and/or modify it under
-- the terms of the GNU General Public License as published by the Free
-- Software Foundation; either version 2, or (at your option) any later
-- version.
--
-- GHDL 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 GCC; see the file COPYING. If not, write to the Free
-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-- 02111-1307, USA.
--
-- As a special exception, if other files instantiate generics from this
-- unit, or you link this unit with other files to produce an executable,
-- this unit does not by itself cause the resulting executable to be
-- covered by the GNU General Public License. This exception does not
-- however invalidate any other reasons why the executable file might be
-- covered by the GNU Public License.
with System;
with Ada.Unchecked_Conversion;
with Grt.Table;
with Grt.Types; use Grt.Types;
with Grt.Rtis; use Grt.Rtis;
limited with Grt.Processes;
pragma Elaborate_All (Grt.Table);
package Grt.Signals is
pragma Suppress (All_Checks);
-- Kind of a signal.
type Kind_Signal_Type is
(Kind_Signal_No, Kind_Signal_Register, Kind_Signal_Bus);
-- Kind of transaction.
type Transaction_Kind is
(
-- Normal transaction, with a value.
Trans_Value,
-- Normal transaction, with a pointer to a value (direct assignment).
Trans_Direct,
-- Null transaction.
Trans_Null,
-- Like a normal transaction, but without a value due to check error.
Trans_Error
);
type Transaction;
type Transaction_Acc is access Transaction;
type Transaction (Kind : Transaction_Kind) is record
-- Line for error. Put here to compact the record.
Line : Ghdl_I32;
Next : Transaction_Acc;
Time : Std_Time;
case Kind is
when Trans_Value =>
Val : aliased Value_Union;
when Trans_Direct =>
Val_Ptr : Ghdl_Value_Ptr;
when Trans_Null =>
null;
when Trans_Error =>
-- Filename for error.
File : Ghdl_C_String;
end case;
end record;
type Process_Acc is access Grt.Processes.Process_Type;
-- A driver is bound to a process (PROC) and contains a list of
-- transactions.
type Driver_Type is record
First_Trans : Transaction_Acc;
Last_Trans : Transaction_Acc;
Proc : Process_Acc;
end record;
type Driver_Acc is access all Driver_Type;
type Driver_Fat_Array is array (Ghdl_Index_Type) of aliased Driver_Type;
type Driver_Arr_Ptr is access Driver_Fat_Array;
-- Function access type used to evaluate the guard expression.
type Guard_Func_Acc is access function (This : System.Address)
return Ghdl_B1;
pragma Convention (C, Guard_Func_Acc);
-- Simply linked list of processes to be resumed in case of events.
type Ghdl_Signal;
type Ghdl_Signal_Ptr is access Ghdl_Signal;
function To_Ghdl_Signal_Ptr is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Ghdl_Signal_Ptr);
type Signal_Fat_Array is array (Ghdl_Index_Type) of Ghdl_Signal_Ptr;
type Signal_Arr_Ptr is access Signal_Fat_Array;
function To_Signal_Arr_Ptr is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Signal_Arr_Ptr);
-- List of processes to wake-up in case of event on the signal.
type Action_List;
type Action_List_Acc is access Action_List;
type Action_List (Dynamic : Boolean) is record
-- Next action for the current signal.
Next : Action_List_Acc;
-- Process to wake-up.
Proc : Process_Acc;
case Dynamic is
when True =>
-- For a non-sensitized process. Action_List elements are put
-- in two lists: the Event_List of signals (so that the process
-- can be resumed in case of event on the signal), and the
-- Sensitivity list of the process (so that the chain can be
-- removed once the process is resumed).
-- Components Next and Prev are for the Event_List of signal Sig.
-- Component Chain is for the Sensitivity list of process Proc.
-- Previous action (to speed-up removing from the chain).
Prev : Action_List_Acc;
-- Signal (to remove this record from the signal event list).
Sig : Ghdl_Signal_Ptr;
-- Chain of signals for the process.
Chain : Action_List_Acc;
when False =>
null;
end case;
end record;
-- Resolution function.
-- There is a wrapper around resolution functions to simplify the call
-- from GRT.
-- INSTANCE is the opaque parameter given when the resolver is
-- registers (RESOLV_INST).
-- VAL is the signal (which may be composite).
-- BOOL_VEC is an array of NBR_DRV booleans (bytes) and indicates
-- non-null drivers. There are VEC_LEN non-null drivers. So the number
-- of values is VEC_LEN + NBR_PORTS. This number of values is the length
-- of the array for the resolution function.
type Resolver_Acc is access procedure
(Instance : System.Address;
Val : System.Address;
Bool_Vec : System.Address;
Vec_Len : Ghdl_Index_Type;
Nbr_Drv : Ghdl_Index_Type;
Nbr_Ports : Ghdl_Index_Type);
-- On some platforms, GNAT use a descriptor (instead of a trampoline) for
-- nested subprograms. This descriptor contains the address of the
-- subprogram and the address of the chain. An unaligned pointer to this
-- descriptor (address + 1) is then used for 'Access, and every indirect
-- call check for unaligned address.
--
-- Disable this feature (as a resolver is never a nested subprogram), so
-- code generated by ghdl is compatible with ghdl runtimes built with
-- gnat.
pragma Convention (C, Resolver_Acc);
-- How to compute resolved signal.
type Resolved_Signal_Type is record
Resolv_Proc : Resolver_Acc;
Resolv_Inst : System.Address;
Resolv_Ptr : System.Address;
Sig_Range : Sig_Table_Range;
Disconnect_Time : Std_Time;
end record;
type Resolved_Signal_Acc is access Resolved_Signal_Type;
type Conversion_Func_Acc is access procedure (Instance : System.Address);
pragma Convention (C, Conversion_Func_Acc);
function To_Conversion_Func_Acc is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Conversion_Func_Acc);
-- Signal conversion data.
type Sig_Conversion_Type is record
-- Function which performs the conversion.
Func : System.Address;
Instance : System.Address;
Src : Sig_Table_Range;
Dest : Sig_Table_Range;
end record;
type Sig_Conversion_Acc is access Sig_Conversion_Type;
type Forward_Build_Type is record
Src : Ghdl_Signal_Ptr;
Targ : Ghdl_Signal_Ptr;
end record;
type Forward_Build_Acc is access Forward_Build_Type;
-- Used to order the signals for the propagation of signals values.
type Propag_Order_Flag is
(
-- The signal was not yet ordered.
Propag_None,
-- The signal is being ordered for driving value.
-- This stage is used to catch loop (which can not occur).
Propag_Being_Driving,
-- The signal has been ordered for driving value.
Propag_Driving,
-- The signal is being ordered for effective value.
Propag_Being_Effective,
-- The signal has completly been ordered.
Propag_Done);
-- Each signal belongs to a signal_net.
-- Signals on the same net must be updated in order.
-- Signals on different nets have no direct relation-ship, and thus may
-- be updated without order.
-- Net NO_SIGNAL_NET is special: it groups all lonely signals.
type Signal_Net_Type is new Integer range -3 .. Integer'Last;
subtype Signal_Net_Defined is Signal_Net_Type
range 1 .. Signal_Net_Type'Last;
-- No propagation for the signals on these nets:
No_Signal_Net : constant Signal_Net_Type := 0;
Net_One_Driver : constant Signal_Net_Type := -1;
Net_One_Direct : constant Signal_Net_Type := -2;
Net_One_Resolved : constant Signal_Net_Type := -3;
type Ghdl_Signal_Data (Mode_Sig : Mode_Signal_Type := Mode_Signal)
is record
case Mode_Sig is
when Mode_Signal_User =>
Nbr_Drivers : Ghdl_Index_Type;
Drivers : Driver_Arr_Ptr;
-- Signal which defines the effective value of this signal,
-- if any.
Effective : Ghdl_Signal_Ptr;
-- Null if not resolved.
Resolv : Resolved_Signal_Acc;
when Mode_Conv_In
| Mode_Conv_Out =>
-- Conversion paramaters for conv_in, conv_out.
Conv : Sig_Conversion_Acc;
when Mode_Stable
| Mode_Quiet
| Mode_Delayed =>
-- Time parameter for 'stable, 'quiet or 'delayed
Time : Std_Time;
Attr_Trans : Transaction_Acc;
when Mode_Guard =>
-- Guard function and instance used to compute the
-- guard expression.
Guard_Func : Guard_Func_Acc;
Guard_Instance : System.Address;
when Mode_Transaction
| Mode_End =>
null;
end case;
end record;
pragma Suppress (Discriminant_Check, On => Ghdl_Signal_Data);
type Ghdl_Signal_Flags is record
-- Status of the ordering.
Propag : Propag_Order_Flag;
-- Kind of the signal (none, bus or register).
Sig_Kind : Kind_Signal_Type;
-- If set, the signal has an active direct driver.
Is_Direct_Active : Boolean;
-- If set, the signal is dumped in a GHW file.
Is_Dumped : Boolean;
-- Set when an event occurred.
-- Only reset by GHW file dumper.
RO_Event : Boolean;
-- True if the signal is being forced.
-- Set by force, cleared by release unless Is_Force_Scheduled is set.
Is_Drv_Forced : Boolean;
Is_Eff_Forced : Boolean;
-- True if a force is being scheduled for the current cycle.
-- This flag is set when a force is applied and cleared when all force
-- are applied. The purpose of it is to discard release for the same
-- cycle as force have the priority over release.
Is_Drv_Force_Scheduled : Boolean;
Is_Eff_Force_Scheduled : Boolean;
-- Set only on an implicit signal when the signal will stay active on
-- the next cycle. For example, 'Quiet(0ns) or 'Stable(0ns) are
-- generally active for 2 cycles, as they are first False and then True.
Implicit_Active_Next : Boolean;
-- Set if the signal has already been visited. When outside of the
-- algorithm that use it, it must be cleared.
Seen : Boolean;
end record;
pragma Pack (Ghdl_Signal_Flags);
type Ghdl_Signal is record
-- Fields known by the compilers.
Driving_Value : aliased Value_Union;
Last_Value : Value_Union;
Last_Event : Std_Time;
Last_Active : Std_Time;
Value_Ptr : Ghdl_Value_Ptr;
Event : Boolean;
Active : Boolean;
-- If set, the activity of the signal is required by the user.
Has_Active : Boolean;
-- Internal fields.
-- NOTE: keep above fields (components) in sync with translation.
-- Values mode of this signal.
Mode : Mode_Type;
-- Misc flags.
Flags : Ghdl_Signal_Flags;
-- Net of the signal.
Net : Signal_Net_Type;
-- Chain of signals that will be active in the next delta-cycle.
-- (Also used to build nets).
Link : Ghdl_Signal_Ptr;
-- Chain of signals whose active flag was set. Used to clear the active
-- flag at the end of the delta cycle.
Alink : Ghdl_Signal_Ptr;
-- Chain of signals that have a projected waveform in the real future.
Flink : Ghdl_Signal_Ptr;
-- List of processes to resume when there is an event on
-- this signal.
Event_List : Action_List_Acc;
-- For user signals: the sources of a signals are drivers
-- and connected ports.
-- For implicit signals: PORTS is used as dependence list.
Nbr_Ports : Ghdl_Index_Type;
Ports : Signal_Arr_Ptr;
-- Mode of the signal (in, out ...)
--Mode_Signal : Mode_Signal_Type;
S : Ghdl_Signal_Data;
end record;
-- Each simple signal declared can be accessed by SIG_TABLE.
package Sig_Table is new Grt.Table
(Table_Component_Type => Ghdl_Signal_Ptr,
Table_Index_Type => Sig_Table_Index,
Table_Low_Bound => 0,
Table_Initial => 128);
-- Read the value pointed by VALUE_PTR. It cannot be simply deferred as
-- pointer alignment may not be correct.
function Read_Value (Value_Ptr : Ghdl_Value_Ptr; Mode : Mode_Type)
return Value_Union;
-- Elementary propagation computation.
-- See LRM 12.6.2 and 12.6.3
type Propagation_Kind_Type is
(
-- How to compute driving value:
-- Default value.
Drv_Error,
-- One source, a driver and not resolved:
-- the driving value is the driver.
Drv_One_Driver,
-- Same as previous, and the effective value is the driving value.
Eff_One_Driver,
-- One source, a port and not resolved:
-- the driving value is the driving value of the port.
-- Dependence.
Drv_One_Port,
-- Same as previous, and the effective value is the driving value.
Eff_One_Port,
-- Several sources or resolved:
-- signal is not composite.
Drv_One_Resolved,
Eff_One_Resolved,
-- Use the resolution function, signal is composite.
Drv_Multiple,
-- Same as previous, but the effective value is the previous value.
Eff_Multiple,
-- The effective value is the actual associated.
Eff_Actual,
-- Sig must be updated but does not belong to the same net.
-- Forward is needed because an implicit signal may be active or not
-- if one of its source is.
Imp_Forward,
Imp_Forward_Build,
-- Implicit guard signal.
-- Its value must be evaluated after the effective value of its
-- dependences.
Imp_Guard,
-- Implicit stable.
-- Its value must be evaluated after the effective value of its
-- dependences.
Imp_Stable,
-- Implicit quiet.
-- Its value must be evaluated after the driving value of its
-- dependences.
Imp_Quiet,
-- Implicit transaction.
-- Its value must be evaluated after the driving value of its
-- dependences.
Imp_Transaction,
-- Implicit delayed
-- Its value must be evaluated after the driving value of its
-- dependences.
Imp_Delayed,
-- in_conversion.
-- Pseudo-signal which is set by conversion function.
In_Conversion,
Out_Conversion,
-- End of propagation.
Prop_End
);
type Propagation_Type (Kind : Propagation_Kind_Type := Drv_Error) is record
case Kind is
when Drv_Error =>
null;
when Drv_One_Driver
| Eff_One_Driver
| Drv_One_Port
| Eff_One_Port
| Imp_Forward
| Imp_Guard
| Imp_Quiet
| Imp_Transaction
| Imp_Stable
| Imp_Delayed
| Eff_Actual
| Eff_One_Resolved
| Drv_One_Resolved =>
Sig : Ghdl_Signal_Ptr;
when Drv_Multiple
| Eff_Multiple =>
Resolv : Resolved_Signal_Acc;
when In_Conversion
| Out_Conversion =>
Conv : Sig_Conversion_Acc;
when Imp_Forward_Build =>
Forward : Forward_Build_Acc;
when Prop_End =>
Updated : Boolean;
end case;
end record;
package Propagation is new Grt.Table
(Table_Component_Type => Propagation_Type,
Table_Index_Type => Signal_Net_Type,
Table_Low_Bound => 1,
Table_Initial => 128);
-- Get the signal index of PTR.
function Signal_Ptr_To_Index (Ptr : Ghdl_Signal_Ptr) return Sig_Table_Index;
-- Compute propagation order of signals.
procedure Order_All_Signals;
-- Initialize the package (mainly the lists).
procedure Init;
-- Initialize all signals.
procedure Init_Signals;
-- Return the next time at which a driver becomes active.
-- SIDE EFFECT: this function updates the ghdl_signal_active_chain.
-- Note: the ghdl_signal_active_chain must be emptied before running
-- processes as they assume that if signals are on a list, they are on the
-- ghdl_signal_active_chain.
function Find_Next_Time (Tn : Std_Time) return Std_Time;
-- Empty the next_signal_active_chain.
procedure Flush_Active_Chain;
-- Update all active signals.
procedure Update_Signals;
-- Set the effective value of signal SIG to VAL.
-- If the value is different from the previous one, resume processes.
procedure Set_Effective_Value (Sig : Ghdl_Signal_Ptr; Val : Ghdl_Value_Ptr);
-- Add PROC in the list of processes to be resumed in case of event on
-- SIG.
procedure Resume_Process_If_Event
(Sig : Ghdl_Signal_Ptr; Proc : Process_Acc);
-- Creating a signal:
-- 1a) call Ghdl_Signal_Name_Rti (CTXT and ADDR are unused) to register
-- the RTI for the whole signal (in particular the mode and the
-- has_active flag)
-- or
-- 1b) call Ghdl_Signal_Set_Mode to register the mode and the has_active
-- flag. In that case, the signal has no name.
--
-- 2) call Ghdl_Create_Signal_XXX for each non-composite element
procedure Ghdl_Signal_Name_Rti (Sig : Ghdl_Rti_Access;
Ctxt : Ghdl_Rti_Access;
Addr : System.Address);
procedure Ghdl_Signal_Set_Mode (Mode : Mode_Signal_Type;
Kind : Kind_Signal_Type;
Has_Active : Boolean);
-- FIXME: document.
-- Merge RTI with SIG: adjust the has_active flag of SIG according to RTI.
procedure Ghdl_Signal_Merge_Rti (Sig : Ghdl_Signal_Ptr;
Rti : Ghdl_Rti_Access);
-- Assigning a waveform to a signal:
--
-- For simple waveform (sig <= val), the short form can be used:
-- Ghdl_Signal_Simple_Assign_XX (Sig, Val);
-- For all other forms
-- SIG <= reject R inertial V1 after T1, V2 after T2, ...:
-- Ghdl_Signal_Start_Assign_XX (SIG, R, V1, T1);
-- Ghdl_Signal_Next_Assign_XX (SIG, V2, T2);
-- ...
-- If the delay mechanism is transport, they R = 0,
-- if there is no rejection time, the mechanism is internal and R = T1.
-- Performs some internal checks on signals (transaction order).
-- Internal_error is called in case of error.
procedure Ghdl_Signal_Internal_Checks;
procedure Ghdl_Signal_Simple_Assign_Error (Sign : Ghdl_Signal_Ptr;
File : Ghdl_C_String;
Line : Ghdl_I32);
procedure Ghdl_Signal_Start_Assign_Error (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
After : Std_Time;
File : Ghdl_C_String;
Line : Ghdl_I32);
procedure Ghdl_Signal_Next_Assign_Error (Sign : Ghdl_Signal_Ptr;
After : Std_Time;
File : Ghdl_C_String;
Line : Ghdl_I32);
procedure Ghdl_Signal_Direct_Assign (Sign : Ghdl_Signal_Ptr);
procedure Ghdl_Signal_Set_Disconnect (Sign : Ghdl_Signal_Ptr;
Time : Std_Time);
procedure Ghdl_Signal_Disconnect (Sign : Ghdl_Signal_Ptr);
procedure Ghdl_Signal_Release_Eff (Sig : Ghdl_Signal_Ptr);
procedure Ghdl_Signal_Release_Drv (Sig : Ghdl_Signal_Ptr);
procedure Ghdl_Signal_Start_Assign_Null (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
After : Std_Time);
function Ghdl_Signal_Driving (Sig : Ghdl_Signal_Ptr) return Ghdl_B1;
function Ghdl_Create_Signal_B1 (Val_Ptr : Ghdl_Value_Ptr;
Resolv_Func : Resolver_Acc;
Resolv_Inst : System.Address)
return Ghdl_Signal_Ptr;
procedure Ghdl_Signal_Init_B1 (Sig : Ghdl_Signal_Ptr; Init_Val : Ghdl_B1);
procedure Ghdl_Signal_Associate_B1 (Sig : Ghdl_Signal_Ptr; Val : Ghdl_B1);
procedure Ghdl_Signal_Simple_Assign_B1 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_B1);
procedure Ghdl_Signal_Start_Assign_B1 (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
Val : Ghdl_B1;
After : Std_Time);
procedure Ghdl_Signal_Next_Assign_B1 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_B1;
After : Std_Time);
procedure Ghdl_Signal_Add_Port_Driver_B1 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_B1);
function Ghdl_Signal_Driving_Value_B1 (Sig : Ghdl_Signal_Ptr)
return Ghdl_B1;
procedure Ghdl_Signal_Force_Driving_B1 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_B1);
procedure Ghdl_Signal_Force_Effective_B1 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_B1);
function Ghdl_Create_Signal_E8 (Val_Ptr : Ghdl_Value_Ptr;
Resolv_Func : Resolver_Acc;
Resolv_Inst : System.Address)
return Ghdl_Signal_Ptr;
procedure Ghdl_Signal_Init_E8 (Sig : Ghdl_Signal_Ptr; Init_Val : Ghdl_E8);
procedure Ghdl_Signal_Associate_E8 (Sig : Ghdl_Signal_Ptr; Val : Ghdl_E8);
procedure Ghdl_Signal_Simple_Assign_E8 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_E8);
procedure Ghdl_Signal_Start_Assign_E8 (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
Val : Ghdl_E8;
After : Std_Time);
procedure Ghdl_Signal_Next_Assign_E8 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_E8;
After : Std_Time);
procedure Ghdl_Signal_Add_Port_Driver_E8 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_E8);
function Ghdl_Signal_Driving_Value_E8 (Sig : Ghdl_Signal_Ptr)
return Ghdl_E8;
procedure Ghdl_Signal_Force_Driving_E8 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_E8);
procedure Ghdl_Signal_Force_Effective_E8 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_E8);
function Ghdl_Create_Signal_E32 (Val_Ptr : Ghdl_Value_Ptr;
Resolv_Func : Resolver_Acc;
Resolv_Inst : System.Address)
return Ghdl_Signal_Ptr;
procedure Ghdl_Signal_Init_E32 (Sig : Ghdl_Signal_Ptr; Init_Val : Ghdl_E32);
procedure Ghdl_Signal_Associate_E32 (Sig : Ghdl_Signal_Ptr; Val : Ghdl_E32);
procedure Ghdl_Signal_Simple_Assign_E32 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_E32);
procedure Ghdl_Signal_Start_Assign_E32 (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
Val : Ghdl_E32;
After : Std_Time);
procedure Ghdl_Signal_Next_Assign_E32 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_E32;
After : Std_Time);
procedure Ghdl_Signal_Add_Port_Driver_E32 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_E32);
function Ghdl_Signal_Driving_Value_E32 (Sig : Ghdl_Signal_Ptr)
return Ghdl_E32;
procedure Ghdl_Signal_Force_Driving_E32 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_E32);
procedure Ghdl_Signal_Force_Effective_E32 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_E32);
function Ghdl_Create_Signal_I32 (Val_Ptr : Ghdl_Value_Ptr;
Resolv_Func : Resolver_Acc;
Resolv_Inst : System.Address)
return Ghdl_Signal_Ptr;
procedure Ghdl_Signal_Init_I32 (Sig : Ghdl_Signal_Ptr; Init_Val : Ghdl_I32);
procedure Ghdl_Signal_Associate_I32 (Sig : Ghdl_Signal_Ptr; Val : Ghdl_I32);
procedure Ghdl_Signal_Simple_Assign_I32 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_I32);
procedure Ghdl_Signal_Start_Assign_I32 (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
Val : Ghdl_I32;
After : Std_Time);
procedure Ghdl_Signal_Next_Assign_I32 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_I32;
After : Std_Time);
procedure Ghdl_Signal_Add_Port_Driver_I32 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_I32);
function Ghdl_Signal_Driving_Value_I32 (Sig : Ghdl_Signal_Ptr)
return Ghdl_I32;
procedure Ghdl_Signal_Force_Driving_I32 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_I32);
procedure Ghdl_Signal_Force_Effective_I32 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_I32);
function Ghdl_Create_Signal_I64 (Val_Ptr : Ghdl_Value_Ptr;
Resolv_Func : Resolver_Acc;
Resolv_Inst : System.Address)
return Ghdl_Signal_Ptr;
procedure Ghdl_Signal_Init_I64 (Sig : Ghdl_Signal_Ptr; Init_Val : Ghdl_I64);
procedure Ghdl_Signal_Associate_I64 (Sig : Ghdl_Signal_Ptr; Val : Ghdl_I64);
procedure Ghdl_Signal_Simple_Assign_I64 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_I64);
procedure Ghdl_Signal_Start_Assign_I64 (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
Val : Ghdl_I64;
After : Std_Time);
procedure Ghdl_Signal_Next_Assign_I64 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_I64;
After : Std_Time);
procedure Ghdl_Signal_Add_Port_Driver_I64 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_I64);
function Ghdl_Signal_Driving_Value_I64 (Sig : Ghdl_Signal_Ptr)
return Ghdl_I64;
procedure Ghdl_Signal_Force_Driving_I64 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_I64);
procedure Ghdl_Signal_Force_Effective_I64 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_I64);
function Ghdl_Create_Signal_F64 (Val_Ptr : Ghdl_Value_Ptr;
Resolv_Func : Resolver_Acc;
Resolv_Inst : System.Address)
return Ghdl_Signal_Ptr;
procedure Ghdl_Signal_Init_F64 (Sig : Ghdl_Signal_Ptr; Init_Val : Ghdl_F64);
procedure Ghdl_Signal_Associate_F64 (Sig : Ghdl_Signal_Ptr; Val : Ghdl_F64);
procedure Ghdl_Signal_Simple_Assign_F64 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_F64);
procedure Ghdl_Signal_Start_Assign_F64 (Sign : Ghdl_Signal_Ptr;
Rej : Std_Time;
Val : Ghdl_F64;
After : Std_Time);
procedure Ghdl_Signal_Next_Assign_F64 (Sign : Ghdl_Signal_Ptr;
Val : Ghdl_F64;
After : Std_Time);
procedure Ghdl_Signal_Add_Port_Driver_F64 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_F64);
function Ghdl_Signal_Driving_Value_F64 (Sig : Ghdl_Signal_Ptr)
return Ghdl_F64;
procedure Ghdl_Signal_Force_Driving_F64 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_F64);
procedure Ghdl_Signal_Force_Effective_F64 (Sig : Ghdl_Signal_Ptr;
Val : Ghdl_F64);
-- Add a driver to SIGN for the current process.
procedure Ghdl_Process_Add_Driver (Sign : Ghdl_Signal_Ptr);
-- Add a direct driver for the current process. This is an optimization
-- that could be used when a driver has no projected waveforms.
--
-- Assignment using direct driver:
-- * the driver value is set
-- * put the signal on the signal_active_chain, if the signal will
-- be active and if not already on the chain.
procedure Ghdl_Signal_Add_Direct_Driver (Sign : Ghdl_Signal_Ptr;
Drv : Ghdl_Value_Ptr);
-- Used for connexions:
-- SRC is a source for TARG.
procedure Ghdl_Signal_Add_Source (Targ : Ghdl_Signal_Ptr;
Src : Ghdl_Signal_Ptr);
-- The effective value of TARG is the effective value of SRC.
procedure Ghdl_Signal_Effective_Value (Targ : Ghdl_Signal_Ptr;
Src : Ghdl_Signal_Ptr);
-- Conversions. In order to do conversion from A to B, an intermediate
-- signal T must be created. The flow is A -> T -> B.
-- The link from A -> T is a conversion, added by one of the two
-- following procedures. The type of A and T is different.
-- The link from T -> B is a normal connection: either an effective
-- one (for in conversion) or a source (for out conversion).
-- Add an in conversion (from SRC to DEST using function FUNC).
-- The effective value can be read and writen directly.
procedure Ghdl_Signal_In_Conversion (Func : System.Address;
Instance : System.Address;
Src : Ghdl_Signal_Ptr;
Src_Len : Ghdl_Index_Type;
Dst : Ghdl_Signal_Ptr;
Dst_Len : Ghdl_Index_Type);
-- Add an out conversion.
-- The driving value can be read and writen directly.
procedure Ghdl_Signal_Out_Conversion (Func : System.Address;
Instance : System.Address;
Src : Ghdl_Signal_Ptr;
Src_Len : Ghdl_Index_Type;
Dst : Ghdl_Signal_Ptr;
Dst_Len : Ghdl_Index_Type);
-- Mark the next (and not yet created) NBR_SIG signals as resolved.
procedure Ghdl_Signal_Create_Resolution (Proc : Resolver_Acc;
Instance : System.Address;
Sig : System.Address;
Nbr_Sig : Ghdl_Index_Type);
-- Create a new 'stable (VAL) signal. The prefixes are set by
-- ghdl_signal_attribute_register_prefix.
function Ghdl_Create_Stable_Signal
(Val_Ptr : Ghdl_Value_Ptr; Val : Std_Time) return Ghdl_Signal_Ptr;
-- Create a new 'quiet (VAL) signal. The prefixes are set by
-- ghdl_signal_attribute_register_prefix.
function Ghdl_Create_Quiet_Signal
(Val_Ptr : Ghdl_Value_Ptr; Val : Std_Time) return Ghdl_Signal_Ptr;
-- Create a new 'transaction signal. The prefixes are set by
-- ghdl_signal_attribute_register_prefix.
function Ghdl_Create_Transaction_Signal
(Val_Ptr : Ghdl_Value_Ptr) return Ghdl_Signal_Ptr;
-- Create a new SIG'delayed (VAL) signal (for a scalar signal).
function Ghdl_Create_Delayed_Signal
(Sig : Ghdl_Signal_Ptr; Val_Ptr : Ghdl_Value_Ptr; Val : Std_Time)
return Ghdl_Signal_Ptr;
-- Add SIG in the set of prefix for the last created signal.
procedure Ghdl_Signal_Attribute_Register_Prefix (Sig : Ghdl_Signal_Ptr);
-- Create a new implicitly defined GUARD signal.
function Ghdl_Signal_Create_Guard
(Val_Ptr : Ghdl_Value_Ptr; This : System.Address; Proc : Guard_Func_Acc)
return Ghdl_Signal_Ptr;
-- Add SIG to the list of referenced signals that appear in the guard
-- expression.
procedure Ghdl_Signal_Guard_Dependence (Sig : Ghdl_Signal_Ptr);
-- Return number of ports/drivers.
function Ghdl_Signal_Get_Nbr_Ports (Sig : Ghdl_Signal_Ptr)
return Ghdl_Index_Type;
function Ghdl_Signal_Get_Nbr_Drivers (Sig : Ghdl_Signal_Ptr)
return Ghdl_Index_Type;
-- Read a source (port or driver) from a signal. This is used by
-- resolution functions.
function Ghdl_Signal_Read_Port
(Sig : Ghdl_Signal_Ptr; Index : Ghdl_Index_Type)
return Ghdl_Value_Ptr;
function Ghdl_Signal_Read_Driver
(Sig : Ghdl_Signal_Ptr; Index : Ghdl_Index_Type)
return Ghdl_Value_Ptr;
-- Statistics.
Nbr_Active : Ghdl_I32;
Nbr_Events: Ghdl_I32;
function Get_Nbr_Future return Ghdl_I32;
private
pragma Export (C, Ghdl_Signal_Name_Rti,
"__ghdl_signal_name_rti");
pragma Export (C, Ghdl_Signal_Merge_Rti,
"__ghdl_signal_merge_rti");
pragma Export (C, Ghdl_Signal_Simple_Assign_Error,
"__ghdl_signal_simple_assign_error");
pragma Export (C, Ghdl_Signal_Start_Assign_Error,
"__ghdl_signal_start_assign_error");
pragma Export (C, Ghdl_Signal_Next_Assign_Error,
"__ghdl_signal_next_assign_error");
pragma Export (C, Ghdl_Signal_Start_Assign_Null,
"__ghdl_signal_start_assign_null");
pragma Export (C, Ghdl_Signal_Direct_Assign,
"__ghdl_signal_direct_assign");
pragma Export (C, Ghdl_Signal_Set_Disconnect,
"__ghdl_signal_set_disconnect");
pragma Export (C, Ghdl_Signal_Disconnect,
"__ghdl_signal_disconnect");
pragma Export (Ada, Ghdl_Signal_Driving,
"__ghdl_signal_driving");
pragma Export (C, Ghdl_Signal_Release_Eff,
"__ghdl_signal_release_eff");
pragma Export (C, Ghdl_Signal_Release_Drv,
"__ghdl_signal_release_drv");
pragma Export (Ada, Ghdl_Create_Signal_B1,
"__ghdl_create_signal_b1");
pragma Export (Ada, Ghdl_Signal_Init_B1,
"__ghdl_signal_init_b1");
pragma Export (Ada, Ghdl_Signal_Associate_B1,
"__ghdl_signal_associate_b1");
pragma Export (Ada, Ghdl_Signal_Simple_Assign_B1,
"__ghdl_signal_simple_assign_b1");
pragma Export (Ada, Ghdl_Signal_Start_Assign_B1,
"__ghdl_signal_start_assign_b1");
pragma Export (Ada, Ghdl_Signal_Next_Assign_B1,
"__ghdl_signal_next_assign_b1");
pragma Export (Ada, Ghdl_Signal_Add_Port_Driver_B1,
"__ghdl_signal_add_port_driver_b1");
pragma Export (Ada, Ghdl_Signal_Driving_Value_B1,
"__ghdl_signal_driving_value_b1");
pragma Export (Ada, Ghdl_Signal_Force_Driving_B1,
"__ghdl_signal_force_drv_b1");
pragma Export (Ada, Ghdl_Signal_Force_Effective_B1,
"__ghdl_signal_force_eff_b1");
pragma Export (C, Ghdl_Create_Signal_E8,
"__ghdl_create_signal_e8");
pragma Export (C, Ghdl_Signal_Init_E8,
"__ghdl_signal_init_e8");
pragma Export (C, Ghdl_Signal_Associate_E8,
"__ghdl_signal_associate_e8");
pragma Export (C, Ghdl_Signal_Simple_Assign_E8,
"__ghdl_signal_simple_assign_e8");
pragma Export (C, Ghdl_Signal_Start_Assign_E8,
"__ghdl_signal_start_assign_e8");
pragma Export (C, Ghdl_Signal_Next_Assign_E8,
"__ghdl_signal_next_assign_e8");
pragma Export (C, Ghdl_Signal_Add_Port_Driver_E8,
"__ghdl_signal_add_port_driver_e8");
pragma Export (C, Ghdl_Signal_Driving_Value_E8,
"__ghdl_signal_driving_value_e8");
pragma Export (C, Ghdl_Signal_Force_Driving_E8,
"__ghdl_signal_force_drv_e8");
pragma Export (C, Ghdl_Signal_Force_Effective_E8,
"__ghdl_signal_force_eff_e8");
pragma Export (C, Ghdl_Create_Signal_E32,
"__ghdl_create_signal_e32");
pragma Export (C, Ghdl_Signal_Init_E32,
"__ghdl_signal_init_e32");
pragma Export (C, Ghdl_Signal_Associate_E32,
"__ghdl_signal_associate_e32");
pragma Export (C, Ghdl_Signal_Simple_Assign_E32,
"__ghdl_signal_simple_assign_e32");
pragma Export (C, Ghdl_Signal_Start_Assign_E32,
"__ghdl_signal_start_assign_e32");
pragma Export (C, Ghdl_Signal_Next_Assign_E32,
"__ghdl_signal_next_assign_e32");
pragma Export (C, Ghdl_Signal_Add_Port_Driver_E32,
"__ghdl_signal_add_port_driver_e32");
pragma Export (C, Ghdl_Signal_Driving_Value_E32,
"__ghdl_signal_driving_value_e32");
pragma Export (C, Ghdl_Signal_Force_Driving_E32,
"__ghdl_signal_force_drv_e32");
pragma Export (C, Ghdl_Signal_Force_Effective_E32,
"__ghdl_signal_force_eff_e32");
pragma Export (C, Ghdl_Create_Signal_I32,
"__ghdl_create_signal_i32");
pragma Export (C, Ghdl_Signal_Init_I32,
"__ghdl_signal_init_i32");
pragma Export (C, Ghdl_Signal_Associate_I32,
"__ghdl_signal_associate_i32");
pragma Export (C, Ghdl_Signal_Simple_Assign_I32,
"__ghdl_signal_simple_assign_i32");
pragma Export (C, Ghdl_Signal_Start_Assign_I32,
"__ghdl_signal_start_assign_i32");
pragma Export (C, Ghdl_Signal_Next_Assign_I32,
"__ghdl_signal_next_assign_i32");
pragma Export (C, Ghdl_Signal_Add_Port_Driver_I32,
"__ghdl_signal_add_port_driver_i32");
pragma Export (C, Ghdl_Signal_Driving_Value_I32,
"__ghdl_signal_driving_value_i32");
pragma Export (C, Ghdl_Signal_Force_Driving_I32,
"__ghdl_signal_force_drv_i32");
pragma Export (C, Ghdl_Signal_Force_Effective_I32,
"__ghdl_signal_force_eff_i32");
pragma Export (C, Ghdl_Create_Signal_I64,
"__ghdl_create_signal_i64");
pragma Export (C, Ghdl_Signal_Init_I64,
"__ghdl_signal_init_i64");
pragma Export (C, Ghdl_Signal_Associate_I64,
"__ghdl_signal_associate_i64");
pragma Export (C, Ghdl_Signal_Simple_Assign_I64,
"__ghdl_signal_simple_assign_i64");
pragma Export (C, Ghdl_Signal_Start_Assign_I64,
"__ghdl_signal_start_assign_i64");
pragma Export (C, Ghdl_Signal_Next_Assign_I64,
"__ghdl_signal_next_assign_i64");
pragma Export (C, Ghdl_Signal_Add_Port_Driver_I64,
"__ghdl_signal_add_port_driver_i64");
pragma Export (C, Ghdl_Signal_Driving_Value_I64,
"__ghdl_signal_driving_value_i64");
pragma Export (C, Ghdl_Signal_Force_Driving_I64,
"__ghdl_signal_force_drv_i64");
pragma Export (C, Ghdl_Signal_Force_Effective_I64,
"__ghdl_signal_force_eff_i64");
pragma Export (C, Ghdl_Create_Signal_F64,
"__ghdl_create_signal_f64");
pragma Export (C, Ghdl_Signal_Init_F64,
"__ghdl_signal_init_f64");
pragma Export (C, Ghdl_Signal_Associate_F64,
"__ghdl_signal_associate_f64");
pragma Export (C, Ghdl_Signal_Simple_Assign_F64,
"__ghdl_signal_simple_assign_f64");
pragma Export (C, Ghdl_Signal_Start_Assign_F64,
"__ghdl_signal_start_assign_f64");
pragma Export (C, Ghdl_Signal_Next_Assign_F64,
"__ghdl_signal_next_assign_f64");
pragma Export (C, Ghdl_Signal_Add_Port_Driver_F64,
"__ghdl_signal_add_port_driver_f64");
pragma Export (C, Ghdl_Signal_Driving_Value_F64,
"__ghdl_signal_driving_value_f64");
pragma Export (C, Ghdl_Signal_Force_Driving_F64,
"__ghdl_signal_force_drv_f64");
pragma Export (C, Ghdl_Signal_Force_Effective_F64,
"__ghdl_signal_force_eff_f64");
pragma Export (C, Ghdl_Process_Add_Driver,
"__ghdl_process_add_driver");
pragma Export (C, Ghdl_Signal_Add_Direct_Driver,
"__ghdl_signal_add_direct_driver");
pragma Export (C, Ghdl_Signal_Add_Source,
"__ghdl_signal_add_source");
pragma Export (C, Ghdl_Signal_Effective_Value,
"__ghdl_signal_effective_value");
pragma Export (C, Ghdl_Signal_In_Conversion,
"__ghdl_signal_in_conversion");
pragma Export (C, Ghdl_Signal_Out_Conversion,
"__ghdl_signal_out_conversion");
pragma Export (C, Ghdl_Signal_Create_Resolution,
"__ghdl_signal_create_resolution");
pragma Export (C, Ghdl_Create_Stable_Signal,
"__ghdl_create_stable_signal");
pragma Export (C, Ghdl_Create_Quiet_Signal,
"__ghdl_create_quiet_signal");
pragma Export (C, Ghdl_Create_Transaction_Signal,
"__ghdl_create_transaction_signal");
pragma Export (C, Ghdl_Signal_Attribute_Register_Prefix,
"__ghdl_signal_attribute_register_prefix");
pragma Export (C, Ghdl_Create_Delayed_Signal,
"__ghdl_create_delayed_signal");
pragma Export (Ada, Ghdl_Signal_Create_Guard,
"__ghdl_signal_create_guard");
pragma Export (C, Ghdl_Signal_Guard_Dependence,
"__ghdl_signal_guard_dependence");
pragma Export (C, Ghdl_Signal_Get_Nbr_Ports,
"__ghdl_signal_get_nbr_ports");
pragma Export (C, Ghdl_Signal_Get_Nbr_Drivers,
"__ghdl_signal_get_nbr_drivers");
pragma Export (C, Ghdl_Signal_Read_Port,
"__ghdl_signal_read_port");
pragma Export (C, Ghdl_Signal_Read_Driver,
"__ghdl_signal_read_driver");
end Grt.Signals;
|
{
"pile_set_name": "Github"
}
|
\section{src/gov/nasa/jpl/componentaction/isfxmlwriter/\+Isf\+Port\+Xml\+Writer.java File Reference}
\label{_isf_port_xml_writer_8java}\index{src/gov/nasa/jpl/componentaction/isfxmlwriter/\+Isf\+Port\+Xml\+Writer.\+java@{src/gov/nasa/jpl/componentaction/isfxmlwriter/\+Isf\+Port\+Xml\+Writer.\+java}}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item
class {\bf gov.\+nasa.\+jpl.\+componentaction.\+isfxmlwriter.\+Isf\+Port\+Xml\+Writer}
\end{DoxyCompactItemize}
\subsection*{Packages}
\begin{DoxyCompactItemize}
\item
package {\bf gov.\+nasa.\+jpl.\+componentaction.\+isfxmlwriter}
\end{DoxyCompactItemize}
|
{
"pile_set_name": "Github"
}
|
/**
* A specialized version of `_.reduceRight` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the last element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
var length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[--length];
}
while (length--) {
accumulator = iteratee(accumulator, array[length], length, array);
}
return accumulator;
}
module.exports = arrayReduceRight;
|
{
"pile_set_name": "Github"
}
|
// Copyright 2018 Klaus Post. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
// Package fse provides Finite State Entropy encoding and decoding.
//
// Finite State Entropy encoding provides a fast near-optimal symbol encoding/decoding
// for byte blocks as implemented in zstd.
//
// See https://github.com/klauspost/compress/tree/master/fse for more information.
package fse
import (
"errors"
"fmt"
"math/bits"
)
const (
/*!MEMORY_USAGE :
* Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
* Increasing memory usage improves compression ratio
* Reduced memory usage can improve speed, due to cache effect
* Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */
maxMemoryUsage = 14
defaultMemoryUsage = 13
maxTableLog = maxMemoryUsage - 2
maxTablesize = 1 << maxTableLog
defaultTablelog = defaultMemoryUsage - 2
minTablelog = 5
maxSymbolValue = 255
)
var (
// ErrIncompressible is returned when input is judged to be too hard to compress.
ErrIncompressible = errors.New("input is not compressible")
// ErrUseRLE is returned from the compressor when the input is a single byte value repeated.
ErrUseRLE = errors.New("input is single value repeated")
)
// Scratch provides temporary storage for compression and decompression.
type Scratch struct {
// Private
count [maxSymbolValue + 1]uint32
norm [maxSymbolValue + 1]int16
symbolLen uint16 // Length of active part of the symbol table.
actualTableLog uint8 // Selected tablelog.
br byteReader
bits bitReader
bw bitWriter
ct cTable // Compression tables.
decTable []decSymbol // Decompression table.
zeroBits bool // no bits has prob > 50%.
clearCount bool // clear count
maxCount int // count of the most probable symbol
// Per block parameters.
// These can be used to override compression parameters of the block.
// Do not touch, unless you know what you are doing.
// Out is output buffer.
// If the scratch is re-used before the caller is done processing the output,
// set this field to nil.
// Otherwise the output buffer will be re-used for next Compression/Decompression step
// and allocation will be avoided.
Out []byte
// MaxSymbolValue will override the maximum symbol value of the next block.
MaxSymbolValue uint8
// TableLog will attempt to override the tablelog for the next block.
TableLog uint8
// DecompressLimit limits the maximum decoded size acceptable.
// If > 0 decompression will stop when approximately this many bytes
// has been decoded.
// If 0, maximum size will be 2GB.
DecompressLimit int
}
// Histogram allows to populate the histogram and skip that step in the compression,
// It otherwise allows to inspect the histogram when compression is done.
// To indicate that you have populated the histogram call HistogramFinished
// with the value of the highest populated symbol, as well as the number of entries
// in the most populated entry. These are accepted at face value.
// The returned slice will always be length 256.
func (s *Scratch) Histogram() []uint32 {
return s.count[:]
}
// HistogramFinished can be called to indicate that the histogram has been populated.
// maxSymbol is the index of the highest set symbol of the next data segment.
// maxCount is the number of entries in the most populated entry.
// These are accepted at face value.
func (s *Scratch) HistogramFinished(maxSymbol uint8, maxCount int) {
s.maxCount = maxCount
s.symbolLen = uint16(maxSymbol) + 1
s.clearCount = maxCount != 0
}
// prepare will prepare and allocate scratch tables used for both compression and decompression.
func (s *Scratch) prepare(in []byte) (*Scratch, error) {
if s == nil {
s = &Scratch{}
}
if s.MaxSymbolValue == 0 {
s.MaxSymbolValue = 255
}
if s.TableLog == 0 {
s.TableLog = defaultTablelog
}
if s.TableLog > maxTableLog {
return nil, fmt.Errorf("tableLog (%d) > maxTableLog (%d)", s.TableLog, maxTableLog)
}
if cap(s.Out) == 0 {
s.Out = make([]byte, 0, len(in))
}
if s.clearCount && s.maxCount == 0 {
for i := range s.count {
s.count[i] = 0
}
s.clearCount = false
}
s.br.init(in)
if s.DecompressLimit == 0 {
// Max size 2GB.
s.DecompressLimit = (2 << 30) - 1
}
return s, nil
}
// tableStep returns the next table index.
func tableStep(tableSize uint32) uint32 {
return (tableSize >> 1) + (tableSize >> 3) + 3
}
func highBits(val uint32) (n uint32) {
return uint32(bits.Len32(val) - 1)
}
|
{
"pile_set_name": "Github"
}
|
pragma SPARK_Mode(On);
with Ada.Characters.Latin_1;
package body Bounded_Strings is
procedure Append(Target : in out Bounded_String; Item : in Character) is
begin
Target.Text(Target.Length + 1) := Item;
Target.Length := Target.Length + 1;
end Append;
procedure Clear(Target : out Bounded_String) is
begin
Target.Text := (others => Ada.Characters.Latin_1.Nul);
Target.Length := 0;
end Clear;
end Bounded_Strings;
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2020 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.thoughtworks.go.config.registry;
import java.util.List;
/**
* @understands
*/
public interface ConfigElementRegistry {
<T> List<Class<? extends T>> implementersOf(Class<T> type);
}
|
{
"pile_set_name": "Github"
}
|
.form-common{padding: 48rpx;}
.formc-cnt{padding: 16rpx 0; display: flex;border-bottom: 1px solid #eee;margin: 16rpx 0}
.form-common button,.btnhover{margin-top: 48rpx;display: block;background-color: #d43c33;height: 2.4em;padding: 0;line-height: 2.4;border-radius: 5rpx;
font-size: 32rpx}
.formc-cnt text{text-align: left}
.formc-cnt input{flex: 1;display: block}
|
{
"pile_set_name": "Github"
}
|
/**
* This file is part of ORB-SLAM2.
* 回环检测线程
*/
#ifndef LOOPCLOSING_H
#define LOOPCLOSING_H
#include "KeyFrame.h"
#include "LocalMapping.h"
#include "Map.h"
#include "ORBVocabulary.h"
#include "Tracking.h"
#include "KeyFrameDatabase.h"
#include <thread>
#include <mutex>
#include "Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h"
namespace ORB_SLAM2
{
class Tracking;
class LocalMapping;
class KeyFrameDatabase;
class LoopClosing
{
public:
typedef pair<set<KeyFrame*>,int> ConsistentGroup; // 具有关联性的候选帧
typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;// 帧 对应的 sim3位姿
public:
LoopClosing(Map* pMap, KeyFrameDatabase* pDB, ORBVocabulary* pVoc,const bool bFixScale);
void SetTracker(Tracking* pTracker);
void SetLocalMapper(LocalMapping* pLocalMapper);
// Main function 线程 主函数===============
void Run();
void InsertKeyFrame(KeyFrame *pKF);
void RequestReset();
// This function will run in a separate thread 全局优化
void RunGlobalBundleAdjustment(unsigned long nLoopKF);
bool isRunningGBA(){
unique_lock<std::mutex> lock(mMutexGBA);
return mbRunningGBA;
}
bool isFinishedGBA(){
unique_lock<std::mutex> lock(mMutexGBA);
return mbFinishedGBA;
}
void RequestFinish();
bool isFinished();
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
protected:
bool CheckNewKeyFrames();
bool DetectLoop();// 关键帧数据库 闭环检测====
bool ComputeSim3();// 计算闭环处的 相似变换===
void SearchAndFuse(const KeyFrameAndPose &CorrectedPosesMap);
void CorrectLoop();
void ResetIfRequested();
bool mbResetRequested;
std::mutex mMutexReset;
bool CheckFinish();
void SetFinish();
bool mbFinishRequested;
bool mbFinished;
std::mutex mMutexFinish;
Map* mpMap;
Tracking* mpTracker;
KeyFrameDatabase* mpKeyFrameDB;
ORBVocabulary* mpORBVocabulary;
LocalMapping *mpLocalMapper;
std::list<KeyFrame*> mlpLoopKeyFrameQueue;
std::mutex mMutexLoopQueue;
// Loop detector parameters 闭环检测参数===
float mnCovisibilityConsistencyTh;
// Loop detector variables 闭环检测变量====
KeyFrame* mpCurrentKF;
KeyFrame* mpMatchedKF;
std::vector<ConsistentGroup> mvConsistentGroups;// 具有连续性的候选帧 群组
std::vector<KeyFrame*> mvpEnoughConsistentCandidates;
std::vector<KeyFrame*> mvpCurrentConnectedKFs;
std::vector<MapPoint*> mvpCurrentMatchedPoints;//当前帧 闭环检测得到的 匹配地图点
std::vector<MapPoint*> mvpLoopMapPoints;// 当前帧 相邻关键帧上的 地图点 闭环处的地图点
cv::Mat mScw;
g2o::Sim3 mg2oScw;
long unsigned int mLastLoopKFid;
// Variables related to Global Bundle Adjustment
bool mbRunningGBA;
bool mbFinishedGBA;
bool mbStopGBA;
std::mutex mMutexGBA;
std::thread* mpThreadGBA;
// Fix scale in the stereo/RGB-D case
bool mbFixScale;// 双目/深度 固定的 空间尺度
bool mnFullBAIdx;
};
} //namespace ORB_SLAM
#endif // LOOPCLOSING_H
|
{
"pile_set_name": "Github"
}
|
// Copyright 2009 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.
// Fork, exec, wait, etc.
package windows
// EscapeArg rewrites command line argument s as prescribed
// in http://msdn.microsoft.com/en-us/library/ms880421.
// This function returns "" (2 double quotes) if s is empty.
// Alternatively, these transformations are done:
// - every back slash (\) is doubled, but only if immediately
// followed by double quote (");
// - every double quote (") is escaped by back slash (\);
// - finally, s is wrapped with double quotes (arg -> "arg"),
// but only if there is space or tab inside s.
func EscapeArg(s string) string {
if len(s) == 0 {
return "\"\""
}
n := len(s)
hasSpace := false
for i := 0; i < len(s); i++ {
switch s[i] {
case '"', '\\':
n++
case ' ', '\t':
hasSpace = true
}
}
if hasSpace {
n += 2
}
if n == len(s) {
return s
}
qs := make([]byte, n)
j := 0
if hasSpace {
qs[j] = '"'
j++
}
slashes := 0
for i := 0; i < len(s); i++ {
switch s[i] {
default:
slashes = 0
qs[j] = s[i]
case '\\':
slashes++
qs[j] = s[i]
case '"':
for ; slashes > 0; slashes-- {
qs[j] = '\\'
j++
}
qs[j] = '\\'
j++
qs[j] = s[i]
}
j++
}
if hasSpace {
for ; slashes > 0; slashes-- {
qs[j] = '\\'
j++
}
qs[j] = '"'
j++
}
return string(qs[:j])
}
func CloseOnExec(fd Handle) {
SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0)
}
// FullPath retrieves the full path of the specified file.
func FullPath(name string) (path string, err error) {
p, err := UTF16PtrFromString(name)
if err != nil {
return "", err
}
n := uint32(100)
for {
buf := make([]uint16, n)
n, err = GetFullPathName(p, uint32(len(buf)), &buf[0], nil)
if err != nil {
return "", err
}
if n <= uint32(len(buf)) {
return UTF16ToString(buf[:n]), nil
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ivs/model/ImportPlaybackKeyPairRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IVS::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
ImportPlaybackKeyPairRequest::ImportPlaybackKeyPairRequest() :
m_publicKeyMaterialHasBeenSet(false),
m_nameHasBeenSet(false),
m_tagsHasBeenSet(false)
{
}
Aws::String ImportPlaybackKeyPairRequest::SerializePayload() const
{
JsonValue payload;
if(m_publicKeyMaterialHasBeenSet)
{
payload.WithString("publicKeyMaterial", m_publicKeyMaterial);
}
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_tagsHasBeenSet)
{
JsonValue tagsJsonMap;
for(auto& tagsItem : m_tags)
{
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
}
payload.WithObject("tags", std::move(tagsJsonMap));
}
return payload.View().WriteReadable();
}
|
{
"pile_set_name": "Github"
}
|
/*
* Linux ARCnet driver - COM20020 PCI support
* Contemporary Controls PCI20 and SOHARD SH-ARC PCI
*
* Written 1994-1999 by Avery Pennarun,
* based on an ISA version by David Woodhouse.
* Written 1999-2000 by Martin Mares <mj@ucw.cz>.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
* for sponsoring the further development of this driver.
*
* **********************
*
* The original copyright of skeleton.c was as follows:
*
* skeleton.c Written 1993 by Donald Becker.
* Copyright 1993 United States Government as represented by the
* Director, National Security Agency. This software may only be used
* and distributed according to the terms of the GNU General Public License as
* modified by SRC, incorporated herein by reference.
*
* **********************
*
* For more details, see drivers/net/arcnet.c
*
* **********************
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/arcdevice.h>
#include <linux/com20020.h>
#include <asm/io.h>
#define VERSION "arcnet: COM20020 PCI support\n"
/* Module parameters */
static int node;
static char device[9]; /* use eg. device="arc1" to change name */
static int timeout = 3;
static int backplane;
static int clockp;
static int clockm;
module_param(node, int, 0);
module_param_string(device, device, sizeof(device), 0);
module_param(timeout, int, 0);
module_param(backplane, int, 0);
module_param(clockp, int, 0);
module_param(clockm, int, 0);
MODULE_LICENSE("GPL");
static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct net_device *dev;
struct arcnet_local *lp;
int ioaddr, err;
if (pci_enable_device(pdev))
return -EIO;
dev = alloc_arcdev(device);
if (!dev)
return -ENOMEM;
dev->netdev_ops = &com20020_netdev_ops;
lp = netdev_priv(dev);
pci_set_drvdata(pdev, dev);
// SOHARD needs PCI base addr 4
if (pdev->vendor==0x10B5) {
BUGMSG(D_NORMAL, "SOHARD\n");
ioaddr = pci_resource_start(pdev, 4);
}
else {
BUGMSG(D_NORMAL, "Contemporary Controls\n");
ioaddr = pci_resource_start(pdev, 2);
}
if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com20020-pci")) {
BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
err = -EBUSY;
goto out_dev;
}
// Dummy access after Reset
// ARCNET controller needs this access to detect bustype
outb(0x00,ioaddr+1);
inb(ioaddr+1);
dev->base_addr = ioaddr;
dev->irq = pdev->irq;
dev->dev_addr[0] = node;
lp->card_name = "PCI COM20020";
lp->card_flags = id->driver_data;
lp->backplane = backplane;
lp->clockp = clockp & 7;
lp->clockm = clockm & 3;
lp->timeout = timeout;
lp->hw.owner = THIS_MODULE;
if (ASTATUS() == 0xFF) {
BUGMSG(D_NORMAL, "IO address %Xh was reported by PCI BIOS, "
"but seems empty!\n", ioaddr);
err = -EIO;
goto out_port;
}
if (com20020_check(dev)) {
err = -EIO;
goto out_port;
}
if ((err = com20020_found(dev, IRQF_SHARED)) != 0)
goto out_port;
return 0;
out_port:
release_region(ioaddr, ARCNET_TOTAL_SIZE);
out_dev:
free_netdev(dev);
return err;
}
static void __devexit com20020pci_remove(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
unregister_netdev(dev);
free_irq(dev->irq, dev);
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
free_netdev(dev);
}
static DEFINE_PCI_DEVICE_TABLE(com20020pci_id_table) = {
{ 0x1571, 0xa001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0x1571, 0xa009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
{ 0x1571, 0xa00a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
{ 0x1571, 0xa00b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
{ 0x1571, 0xa00c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
{ 0x1571, 0xa00d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
{ 0x1571, 0xa00e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
{ 0x1571, 0xa201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa202, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa203, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x10B5, 0x9030, 0x10B5, 0x2978, 0, 0, ARC_CAN_10MBIT },
{ 0x10B5, 0x9050, 0x10B5, 0x2273, 0, 0, ARC_CAN_10MBIT },
{ 0x14BA, 0x6000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x10B5, 0x2200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{0,}
};
MODULE_DEVICE_TABLE(pci, com20020pci_id_table);
static struct pci_driver com20020pci_driver = {
.name = "com20020",
.id_table = com20020pci_id_table,
.probe = com20020pci_probe,
.remove = __devexit_p(com20020pci_remove),
};
static int __init com20020pci_init(void)
{
BUGLVL(D_NORMAL) printk(VERSION);
return pci_register_driver(&com20020pci_driver);
}
static void __exit com20020pci_cleanup(void)
{
pci_unregister_driver(&com20020pci_driver);
}
module_init(com20020pci_init)
module_exit(com20020pci_cleanup)
|
{
"pile_set_name": "Github"
}
|
class OpenWebPageEvent{
String url;
OpenWebPageEvent(this.url);
}
|
{
"pile_set_name": "Github"
}
|
/* eslint strict:0 */
var modules = Object.create(null);
var inGuard = false;
function define(id, factory) {
modules[id] = {
factory,
module: {exports: {}},
isInitialized: false,
hasError: false,
};
if (__DEV__) { // HMR
Object.assign(modules[id].module, {
hot: {
acceptCallback: null,
accept: function(callback) {
modules[id].module.hot.acceptCallback = callback;
}
}
});
}
}
function require(id) {
var mod = modules[id];
if (mod && mod.isInitialized) {
return mod.module.exports;
}
return requireImpl(id);
}
function requireImpl(id) {
if (global.ErrorUtils && !inGuard) {
inGuard = true;
var returnValue;
try {
returnValue = requireImpl.apply(this, arguments);
} catch (e) {
global.ErrorUtils.reportFatalError(e);
}
inGuard = false;
return returnValue;
}
var mod = modules[id];
if (!mod) {
var msg = 'Requiring unknown module "' + id + '"';
if (__DEV__) {
msg += '. If you are sure the module is there, try restarting the packager.';
}
throw new Error(msg);
}
if (mod.hasError) {
throw new Error(
'Requiring module "' + id + '" which threw an exception'
);
}
try {
// We must optimistically mark mod as initialized before running the factory to keep any
// require cycles inside the factory from causing an infinite require loop.
mod.isInitialized = true;
__DEV__ && Systrace().beginEvent('JS_require_' + id);
// keep args in sync with with defineModuleCode in
// packager/react-packager/src/Resolver/index.js
mod.factory.call(global, global, require, mod.module, mod.module.exports);
__DEV__ && Systrace().endEvent();
} catch (e) {
mod.hasError = true;
mod.isInitialized = false;
throw e;
}
return mod.module.exports;
}
const Systrace = __DEV__ && (() => {
var _Systrace;
try {
_Systrace = require('Systrace');
} catch (e) {}
return _Systrace && _Systrace.beginEvent ?
_Systrace : { beginEvent: () => {}, endEvent: () => {} };
});
global.__d = define;
global.require = require;
if (__DEV__) { // HMR
function accept(id, factory) {
var mod = modules[id];
if (!mod) {
define(id, factory);
return; // new modules don't need to be accepted
}
if (!mod.module.hot) {
console.warn(
'Cannot accept module because Hot Module Replacement ' +
'API was not installed.'
);
return;
}
if (mod.module.hot.acceptCallback) {
mod.factory = factory;
mod.isInitialized = false;
require(id);
mod.module.hot.acceptCallback();
} else {
console.warn(
'[HMR] Module `' + id + '` can\'t be hot reloaded because it ' +
'doesn\'t provide accept callback hook. Reload the app to get the updates.'
);
}
}
global.__accept = accept;
}
|
{
"pile_set_name": "Github"
}
|
{
"modexp_37120_37111_97_20500" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.6.0-alpha.0-11+commit.978e68d2",
"lllcversion" : "Version: 0.5.0-develop.2018.11.9+commit.9709dfe0.Linux.g++",
"source" : "src/GeneralStateTestsFiller/stPreCompiledContracts/modexp_37120_37111_97_20500Filler.json",
"sourceHash" : "59b1b6bc891f3c64a736a1be595bef66bcfb4104c2299df8026775a9a2586184"
},
"env" : {
"currentCoinbase" : "0x3535353535353535353535353535353535353535",
"currentDifficulty" : "0x020000",
"currentGasLimit" : "0x5f5e100",
"currentNumber" : "0x01",
"currentTimestamp" : "0x03e8",
"previousHash" : "0xc6745cf3cada515bbfb9573261c82547e0b8f9e3d5dd382e464704a84e47b5ad"
},
"post" : {
"Byzantium" : [
{
"hash" : "0x52671cca402f6ea20c1f17b4854d7bc9deb29b7f38a2ae3528685f903eabc35d",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x708237ca0dfceaafb51bf7f9cb5efdebf0b109f7b60dad55d54f0284b5febed7",
"indexes" : {
"data" : 0,
"gas" : 1,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x66f21cbe1a60badc0952992953e337df1c6cd4441cc8ded116bf5c18e0a67db7",
"indexes" : {
"data" : 0,
"gas" : 2,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x72f619093124570ae3abd9b4662ae2dce7e752392fd74cd7ccf8f6e551a3e3aa",
"indexes" : {
"data" : 0,
"gas" : 3,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"Constantinople" : [
{
"hash" : "0x52671cca402f6ea20c1f17b4854d7bc9deb29b7f38a2ae3528685f903eabc35d",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x708237ca0dfceaafb51bf7f9cb5efdebf0b109f7b60dad55d54f0284b5febed7",
"indexes" : {
"data" : 0,
"gas" : 1,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x66f21cbe1a60badc0952992953e337df1c6cd4441cc8ded116bf5c18e0a67db7",
"indexes" : {
"data" : 0,
"gas" : 2,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x72f619093124570ae3abd9b4662ae2dce7e752392fd74cd7ccf8f6e551a3e3aa",
"indexes" : {
"data" : 0,
"gas" : 3,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
],
"ConstantinopleFix" : [
{
"hash" : "0x52671cca402f6ea20c1f17b4854d7bc9deb29b7f38a2ae3528685f903eabc35d",
"indexes" : {
"data" : 0,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x708237ca0dfceaafb51bf7f9cb5efdebf0b109f7b60dad55d54f0284b5febed7",
"indexes" : {
"data" : 0,
"gas" : 1,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x66f21cbe1a60badc0952992953e337df1c6cd4441cc8ded116bf5c18e0a67db7",
"indexes" : {
"data" : 0,
"gas" : 2,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"hash" : "0x72f619093124570ae3abd9b4662ae2dce7e752392fd74cd7ccf8f6e551a3e3aa",
"indexes" : {
"data" : 0,
"gas" : 3,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
"pre" : {
"0x0000000000000000000000000000000000000001" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x0000000000000000000000000000000000000002" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x0000000000000000000000000000000000000003" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x0000000000000000000000000000000000000004" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x0000000000000000000000000000000000000005" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x0000000000000000000000000000000000000006" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x0000000000000000000000000000000000000007" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x0000000000000000000000000000000000000008" : {
"balance" : "0x01",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x3535353535353535353535353535353535353535" : {
"balance" : "0x0202fa",
"code" : "",
"nonce" : "0x00",
"storage" : {
}
},
"0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1" : {
"balance" : "0x0de0b6b3a761fd06",
"code" : "",
"nonce" : "0x01",
"storage" : {
}
},
"0xc305c901078781c232a2a521c2af7980f8385ee9" : {
"balance" : "0x00",
"code" : "0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012c576101856004356004013511151558576004356004013560200160043560040161014037600161034061014051610160600060056305f5e0fff11558576001610320526103206021806103808284600060046015f150505061038080516020820120905060005561038060206020820352604081510160206001820306601f820103905060208203f350005b",
"nonce" : "0x01",
"storage" : {
}
}
},
"transaction" : {
"data" : [
"0x30c8d1da00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000161000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff976100000000000000000000000000000000000000000000000000000000000000"
],
"gasLimit" : [
"0xebec",
"0x015f90",
"0x01adb0",
"0x030d40"
],
"gasPrice" : "0x01",
"nonce" : "0x01",
"secretKey" : "0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d",
"to" : "0xc305c901078781c232a2a521c2af7980f8385ee9",
"value" : [
"0x"
]
}
}
}
|
{
"pile_set_name": "Github"
}
|
# SYS.DUMP_STACKS
Writes thread stacks, locks, and transaction states to the SnappyData log file. You can write stack information either for the current SnappyData member or for all SnappyData members in the distributed system.
<!--See also [print-stacks](../command_line_utilities/store-print-stacks.md) for information about writing thread stacks to standard out or to a specified file.--->
## Syntax
```pre
SYS.DUMP_STACKS (
IN ALL BOOLEAN
)
```
**ALL**
Specifies boolean value: **true** to log stack trace information for all SnappyData members, or **false** to log information only for the local SnappyData member.
## Example
This command writes thread stack information only for the local SnappyData member. The stack information is written to the SnappyData log file (by default snappyserver.log in the member startup directory):
```pre
snappy> call sys.dump_stacks('false');
```
**Also see:**
* [Built-in System Procedures and Built-in Functions](system-procedures.md)
|
{
"pile_set_name": "Github"
}
|
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#ifndef I_TIM_H
#define I_TIM_H
#include <thrift/c_glib/processor/thrift_dispatch_processor.h>
#include "tim_types.h"
/* ITim service interface */
typedef struct _ITimIf ITimIf; /* dummy object */
struct _ITimIfInterface
{
GTypeInterface parent;
gboolean (*tim_stream) (ITimIf *iface, const TimParam * param, GError **error);
gboolean (*tim_starttls) (ITimIf *iface, GError **error);
gboolean (*tim_login) (ITimIf *iface, const Tid * tid, const gchar * pwd, GError **error);
gboolean (*tim_ack) (ITimIf *iface, const TimAckBean * ab, GError **error);
gboolean (*tim_presence) (ITimIf *iface, const TimPBean * pbean, GError **error);
gboolean (*tim_message) (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean (*tim_ping) (ITimIf *iface, const gchar * threadId, GError **error);
gboolean (*tim_error) (ITimIf *iface, const TimError * e, GError **error);
gboolean (*tim_logout) (ITimIf *iface, GError **error);
gboolean (*tim_regist) (ITimIf *iface, const Tid * tid, const gchar * auth, GError **error);
gboolean (*tim_roser) (ITimIf *iface, const TimRoster * roster, GError **error);
gboolean (*tim_message_list) (ITimIf *iface, const TimMBeanList * mbeanList, GError **error);
gboolean (*tim_presence_list) (ITimIf *iface, const TimPBeanList * pbeanList, GError **error);
gboolean (*tim_message_iq) (ITimIf *iface, const TimMessageIq * timMsgIq, const gchar * iqType, GError **error);
gboolean (*tim_message_result) (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean (*tim_property) (ITimIf *iface, const TimPropertyBean * tpb, GError **error);
gboolean (*tim_remote_user_auth) (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const gchar * pwd, const TimAuth * auth, GError **error);
gboolean (*tim_remote_user_get) (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimAuth * auth, GError **error);
gboolean (*tim_remote_user_edit) (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimUserBean * ub, const TimAuth * auth, GError **error);
gboolean (*tim_response_presence) (ITimIf *iface, TimResponseBean ** _return, const TimPBean * pbean, const TimAuth * auth, GError **error);
gboolean (*tim_response_message) (ITimIf *iface, TimResponseBean ** _return, const TimMBean * mbean, const TimAuth * auth, GError **error);
gboolean (*tim_response_message_iq) (ITimIf *iface, TimMBeanList ** _return, const TimMessageIq * timMsgIq, const gchar * iqType, const TimAuth * auth, GError **error);
gboolean (*tim_response_presence_list) (ITimIf *iface, TimResponseBean ** _return, const TimPBeanList * pbeanList, const TimAuth * auth, GError **error);
gboolean (*tim_response_message_list) (ITimIf *iface, TimResponseBean ** _return, const TimMBeanList * mbeanList, const TimAuth * auth, GError **error);
};
typedef struct _ITimIfInterface ITimIfInterface;
GType i_tim_if_get_type (void);
#define TYPE_I_TIM_IF (i_tim_if_get_type())
#define I_TIM_IF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_I_TIM_IF, ITimIf))
#define IS_I_TIM_IF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_I_TIM_IF))
#define I_TIM_IF_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), TYPE_I_TIM_IF, ITimIfInterface))
gboolean i_tim_if_tim_stream (ITimIf *iface, const TimParam * param, GError **error);
gboolean i_tim_if_tim_starttls (ITimIf *iface, GError **error);
gboolean i_tim_if_tim_login (ITimIf *iface, const Tid * tid, const gchar * pwd, GError **error);
gboolean i_tim_if_tim_ack (ITimIf *iface, const TimAckBean * ab, GError **error);
gboolean i_tim_if_tim_presence (ITimIf *iface, const TimPBean * pbean, GError **error);
gboolean i_tim_if_tim_message (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean i_tim_if_tim_ping (ITimIf *iface, const gchar * threadId, GError **error);
gboolean i_tim_if_tim_error (ITimIf *iface, const TimError * e, GError **error);
gboolean i_tim_if_tim_logout (ITimIf *iface, GError **error);
gboolean i_tim_if_tim_regist (ITimIf *iface, const Tid * tid, const gchar * auth, GError **error);
gboolean i_tim_if_tim_roser (ITimIf *iface, const TimRoster * roster, GError **error);
gboolean i_tim_if_tim_message_list (ITimIf *iface, const TimMBeanList * mbeanList, GError **error);
gboolean i_tim_if_tim_presence_list (ITimIf *iface, const TimPBeanList * pbeanList, GError **error);
gboolean i_tim_if_tim_message_iq (ITimIf *iface, const TimMessageIq * timMsgIq, const gchar * iqType, GError **error);
gboolean i_tim_if_tim_message_result (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean i_tim_if_tim_property (ITimIf *iface, const TimPropertyBean * tpb, GError **error);
gboolean i_tim_if_tim_remote_user_auth (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const gchar * pwd, const TimAuth * auth, GError **error);
gboolean i_tim_if_tim_remote_user_get (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimAuth * auth, GError **error);
gboolean i_tim_if_tim_remote_user_edit (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimUserBean * ub, const TimAuth * auth, GError **error);
gboolean i_tim_if_tim_response_presence (ITimIf *iface, TimResponseBean ** _return, const TimPBean * pbean, const TimAuth * auth, GError **error);
gboolean i_tim_if_tim_response_message (ITimIf *iface, TimResponseBean ** _return, const TimMBean * mbean, const TimAuth * auth, GError **error);
gboolean i_tim_if_tim_response_message_iq (ITimIf *iface, TimMBeanList ** _return, const TimMessageIq * timMsgIq, const gchar * iqType, const TimAuth * auth, GError **error);
gboolean i_tim_if_tim_response_presence_list (ITimIf *iface, TimResponseBean ** _return, const TimPBeanList * pbeanList, const TimAuth * auth, GError **error);
gboolean i_tim_if_tim_response_message_list (ITimIf *iface, TimResponseBean ** _return, const TimMBeanList * mbeanList, const TimAuth * auth, GError **error);
/* ITim service client */
struct _ITimClient
{
GObject parent;
ThriftProtocol *input_protocol;
ThriftProtocol *output_protocol;
};
typedef struct _ITimClient ITimClient;
struct _ITimClientClass
{
GObjectClass parent;
};
typedef struct _ITimClientClass ITimClientClass;
GType i_tim_client_get_type (void);
#define TYPE_I_TIM_CLIENT (i_tim_client_get_type())
#define I_TIM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_I_TIM_CLIENT, ITimClient))
#define I_TIM_CLIENT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TYPE_I_TIM_CLIENT, ITimClientClass))
#define I_TIM_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_I_TIM_CLIENT))
#define I_TIM_IS_CLIENT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TYPE_I_TIM_CLIENT))
#define I_TIM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_I_TIM_CLIENT, ITimClientClass))
gboolean i_tim_client_tim_stream (ITimIf * iface, const TimParam * param, GError ** error);
gboolean i_tim_client_send_tim_stream (ITimIf * iface, const TimParam * param, GError ** error);
gboolean i_tim_client_tim_starttls (ITimIf * iface, GError ** error);
gboolean i_tim_client_send_tim_starttls (ITimIf * iface, GError ** error);
gboolean i_tim_client_tim_login (ITimIf * iface, const Tid * tid, const gchar * pwd, GError ** error);
gboolean i_tim_client_send_tim_login (ITimIf * iface, const Tid * tid, const gchar * pwd, GError ** error);
gboolean i_tim_client_tim_ack (ITimIf * iface, const TimAckBean * ab, GError ** error);
gboolean i_tim_client_send_tim_ack (ITimIf * iface, const TimAckBean * ab, GError ** error);
gboolean i_tim_client_tim_presence (ITimIf * iface, const TimPBean * pbean, GError ** error);
gboolean i_tim_client_send_tim_presence (ITimIf * iface, const TimPBean * pbean, GError ** error);
gboolean i_tim_client_tim_message (ITimIf * iface, const TimMBean * mbean, GError ** error);
gboolean i_tim_client_send_tim_message (ITimIf * iface, const TimMBean * mbean, GError ** error);
gboolean i_tim_client_tim_ping (ITimIf * iface, const gchar * threadId, GError ** error);
gboolean i_tim_client_send_tim_ping (ITimIf * iface, const gchar * threadId, GError ** error);
gboolean i_tim_client_tim_error (ITimIf * iface, const TimError * e, GError ** error);
gboolean i_tim_client_send_tim_error (ITimIf * iface, const TimError * e, GError ** error);
gboolean i_tim_client_tim_logout (ITimIf * iface, GError ** error);
gboolean i_tim_client_send_tim_logout (ITimIf * iface, GError ** error);
gboolean i_tim_client_tim_regist (ITimIf * iface, const Tid * tid, const gchar * auth, GError ** error);
gboolean i_tim_client_send_tim_regist (ITimIf * iface, const Tid * tid, const gchar * auth, GError ** error);
gboolean i_tim_client_tim_roser (ITimIf * iface, const TimRoster * roster, GError ** error);
gboolean i_tim_client_send_tim_roser (ITimIf * iface, const TimRoster * roster, GError ** error);
gboolean i_tim_client_tim_message_list (ITimIf * iface, const TimMBeanList * mbeanList, GError ** error);
gboolean i_tim_client_send_tim_message_list (ITimIf * iface, const TimMBeanList * mbeanList, GError ** error);
gboolean i_tim_client_tim_presence_list (ITimIf * iface, const TimPBeanList * pbeanList, GError ** error);
gboolean i_tim_client_send_tim_presence_list (ITimIf * iface, const TimPBeanList * pbeanList, GError ** error);
gboolean i_tim_client_tim_message_iq (ITimIf * iface, const TimMessageIq * timMsgIq, const gchar * iqType, GError ** error);
gboolean i_tim_client_send_tim_message_iq (ITimIf * iface, const TimMessageIq * timMsgIq, const gchar * iqType, GError ** error);
gboolean i_tim_client_tim_message_result (ITimIf * iface, const TimMBean * mbean, GError ** error);
gboolean i_tim_client_send_tim_message_result (ITimIf * iface, const TimMBean * mbean, GError ** error);
gboolean i_tim_client_tim_property (ITimIf * iface, const TimPropertyBean * tpb, GError ** error);
gboolean i_tim_client_send_tim_property (ITimIf * iface, const TimPropertyBean * tpb, GError ** error);
gboolean i_tim_client_tim_remote_user_auth (ITimIf * iface, TimRemoteUserBean ** _return, const Tid * tid, const gchar * pwd, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_remote_user_auth (ITimIf * iface, const Tid * tid, const gchar * pwd, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_remote_user_auth (ITimIf * iface, TimRemoteUserBean ** _return, GError ** error);
gboolean i_tim_client_tim_remote_user_get (ITimIf * iface, TimRemoteUserBean ** _return, const Tid * tid, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_remote_user_get (ITimIf * iface, const Tid * tid, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_remote_user_get (ITimIf * iface, TimRemoteUserBean ** _return, GError ** error);
gboolean i_tim_client_tim_remote_user_edit (ITimIf * iface, TimRemoteUserBean ** _return, const Tid * tid, const TimUserBean * ub, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_remote_user_edit (ITimIf * iface, const Tid * tid, const TimUserBean * ub, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_remote_user_edit (ITimIf * iface, TimRemoteUserBean ** _return, GError ** error);
gboolean i_tim_client_tim_response_presence (ITimIf * iface, TimResponseBean ** _return, const TimPBean * pbean, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_response_presence (ITimIf * iface, const TimPBean * pbean, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_response_presence (ITimIf * iface, TimResponseBean ** _return, GError ** error);
gboolean i_tim_client_tim_response_message (ITimIf * iface, TimResponseBean ** _return, const TimMBean * mbean, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_response_message (ITimIf * iface, const TimMBean * mbean, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_response_message (ITimIf * iface, TimResponseBean ** _return, GError ** error);
gboolean i_tim_client_tim_response_message_iq (ITimIf * iface, TimMBeanList ** _return, const TimMessageIq * timMsgIq, const gchar * iqType, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_response_message_iq (ITimIf * iface, const TimMessageIq * timMsgIq, const gchar * iqType, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_response_message_iq (ITimIf * iface, TimMBeanList ** _return, GError ** error);
gboolean i_tim_client_tim_response_presence_list (ITimIf * iface, TimResponseBean ** _return, const TimPBeanList * pbeanList, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_response_presence_list (ITimIf * iface, const TimPBeanList * pbeanList, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_response_presence_list (ITimIf * iface, TimResponseBean ** _return, GError ** error);
gboolean i_tim_client_tim_response_message_list (ITimIf * iface, TimResponseBean ** _return, const TimMBeanList * mbeanList, const TimAuth * auth, GError ** error);
gboolean i_tim_client_send_tim_response_message_list (ITimIf * iface, const TimMBeanList * mbeanList, const TimAuth * auth, GError ** error);
gboolean i_tim_client_recv_tim_response_message_list (ITimIf * iface, TimResponseBean ** _return, GError ** error);
void i_tim_client_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
void i_tim_client_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
/* ITim handler (abstract base class) */
struct _ITimHandler
{
GObject parent;
};
typedef struct _ITimHandler ITimHandler;
struct _ITimHandlerClass
{
GObjectClass parent;
gboolean (*tim_stream) (ITimIf *iface, const TimParam * param, GError **error);
gboolean (*tim_starttls) (ITimIf *iface, GError **error);
gboolean (*tim_login) (ITimIf *iface, const Tid * tid, const gchar * pwd, GError **error);
gboolean (*tim_ack) (ITimIf *iface, const TimAckBean * ab, GError **error);
gboolean (*tim_presence) (ITimIf *iface, const TimPBean * pbean, GError **error);
gboolean (*tim_message) (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean (*tim_ping) (ITimIf *iface, const gchar * threadId, GError **error);
gboolean (*tim_error) (ITimIf *iface, const TimError * e, GError **error);
gboolean (*tim_logout) (ITimIf *iface, GError **error);
gboolean (*tim_regist) (ITimIf *iface, const Tid * tid, const gchar * auth, GError **error);
gboolean (*tim_roser) (ITimIf *iface, const TimRoster * roster, GError **error);
gboolean (*tim_message_list) (ITimIf *iface, const TimMBeanList * mbeanList, GError **error);
gboolean (*tim_presence_list) (ITimIf *iface, const TimPBeanList * pbeanList, GError **error);
gboolean (*tim_message_iq) (ITimIf *iface, const TimMessageIq * timMsgIq, const gchar * iqType, GError **error);
gboolean (*tim_message_result) (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean (*tim_property) (ITimIf *iface, const TimPropertyBean * tpb, GError **error);
gboolean (*tim_remote_user_auth) (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const gchar * pwd, const TimAuth * auth, GError **error);
gboolean (*tim_remote_user_get) (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimAuth * auth, GError **error);
gboolean (*tim_remote_user_edit) (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimUserBean * ub, const TimAuth * auth, GError **error);
gboolean (*tim_response_presence) (ITimIf *iface, TimResponseBean ** _return, const TimPBean * pbean, const TimAuth * auth, GError **error);
gboolean (*tim_response_message) (ITimIf *iface, TimResponseBean ** _return, const TimMBean * mbean, const TimAuth * auth, GError **error);
gboolean (*tim_response_message_iq) (ITimIf *iface, TimMBeanList ** _return, const TimMessageIq * timMsgIq, const gchar * iqType, const TimAuth * auth, GError **error);
gboolean (*tim_response_presence_list) (ITimIf *iface, TimResponseBean ** _return, const TimPBeanList * pbeanList, const TimAuth * auth, GError **error);
gboolean (*tim_response_message_list) (ITimIf *iface, TimResponseBean ** _return, const TimMBeanList * mbeanList, const TimAuth * auth, GError **error);
};
typedef struct _ITimHandlerClass ITimHandlerClass;
GType i_tim_handler_get_type (void);
#define TYPE_I_TIM_HANDLER (i_tim_handler_get_type())
#define I_TIM_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_I_TIM_HANDLER, ITimHandler))
#define IS_I_TIM_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_I_TIM_HANDLER))
#define I_TIM_HANDLER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TYPE_I_TIM_HANDLER, ITimHandlerClass))
#define IS_I_TIM_HANDLER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TYPE_I_TIM_HANDLER))
#define I_TIM_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_I_TIM_HANDLER, ITimHandlerClass))
gboolean i_tim_handler_tim_stream (ITimIf *iface, const TimParam * param, GError **error);
gboolean i_tim_handler_tim_starttls (ITimIf *iface, GError **error);
gboolean i_tim_handler_tim_login (ITimIf *iface, const Tid * tid, const gchar * pwd, GError **error);
gboolean i_tim_handler_tim_ack (ITimIf *iface, const TimAckBean * ab, GError **error);
gboolean i_tim_handler_tim_presence (ITimIf *iface, const TimPBean * pbean, GError **error);
gboolean i_tim_handler_tim_message (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean i_tim_handler_tim_ping (ITimIf *iface, const gchar * threadId, GError **error);
gboolean i_tim_handler_tim_error (ITimIf *iface, const TimError * e, GError **error);
gboolean i_tim_handler_tim_logout (ITimIf *iface, GError **error);
gboolean i_tim_handler_tim_regist (ITimIf *iface, const Tid * tid, const gchar * auth, GError **error);
gboolean i_tim_handler_tim_roser (ITimIf *iface, const TimRoster * roster, GError **error);
gboolean i_tim_handler_tim_message_list (ITimIf *iface, const TimMBeanList * mbeanList, GError **error);
gboolean i_tim_handler_tim_presence_list (ITimIf *iface, const TimPBeanList * pbeanList, GError **error);
gboolean i_tim_handler_tim_message_iq (ITimIf *iface, const TimMessageIq * timMsgIq, const gchar * iqType, GError **error);
gboolean i_tim_handler_tim_message_result (ITimIf *iface, const TimMBean * mbean, GError **error);
gboolean i_tim_handler_tim_property (ITimIf *iface, const TimPropertyBean * tpb, GError **error);
gboolean i_tim_handler_tim_remote_user_auth (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const gchar * pwd, const TimAuth * auth, GError **error);
gboolean i_tim_handler_tim_remote_user_get (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimAuth * auth, GError **error);
gboolean i_tim_handler_tim_remote_user_edit (ITimIf *iface, TimRemoteUserBean ** _return, const Tid * tid, const TimUserBean * ub, const TimAuth * auth, GError **error);
gboolean i_tim_handler_tim_response_presence (ITimIf *iface, TimResponseBean ** _return, const TimPBean * pbean, const TimAuth * auth, GError **error);
gboolean i_tim_handler_tim_response_message (ITimIf *iface, TimResponseBean ** _return, const TimMBean * mbean, const TimAuth * auth, GError **error);
gboolean i_tim_handler_tim_response_message_iq (ITimIf *iface, TimMBeanList ** _return, const TimMessageIq * timMsgIq, const gchar * iqType, const TimAuth * auth, GError **error);
gboolean i_tim_handler_tim_response_presence_list (ITimIf *iface, TimResponseBean ** _return, const TimPBeanList * pbeanList, const TimAuth * auth, GError **error);
gboolean i_tim_handler_tim_response_message_list (ITimIf *iface, TimResponseBean ** _return, const TimMBeanList * mbeanList, const TimAuth * auth, GError **error);
/* ITim processor */
struct _ITimProcessor
{
ThriftDispatchProcessor parent;
/* protected */
ITimHandler *handler;
GHashTable *process_map;
};
typedef struct _ITimProcessor ITimProcessor;
struct _ITimProcessorClass
{
ThriftDispatchProcessorClass parent;
/* protected */
gboolean (*dispatch_call) (ThriftDispatchProcessor *processor,
ThriftProtocol *in,
ThriftProtocol *out,
gchar *fname,
gint32 seqid,
GError **error);
};
typedef struct _ITimProcessorClass ITimProcessorClass;
GType i_tim_processor_get_type (void);
#define TYPE_I_TIM_PROCESSOR (i_tim_processor_get_type())
#define I_TIM_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_I_TIM_PROCESSOR, ITimProcessor))
#define IS_I_TIM_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_I_TIM_PROCESSOR))
#define I_TIM_PROCESSOR_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TYPE_I_TIM_PROCESSOR, ITimProcessorClass))
#define IS_I_TIM_PROCESSOR_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), TYPE_I_TIM_PROCESSOR))
#define I_TIM_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_I_TIM_PROCESSOR, ITimProcessorClass))
#endif /* I_TIM_H */
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\Framework\Filter\DirectiveProcessor;
use Magento\Framework\DataObject;
use Magento\Framework\Filter\DirectiveProcessorInterface;
use Magento\Framework\Filter\Template;
use Magento\Framework\Filter\VariableResolverInterface;
/**
* Allows a a directive to iterate content with the value of variables
*
* @example syntax {{for item in order.items}} name: {{var item.name}} {{/for}} order items collection.
* @example syntax {{for thing in things}} {{var thing.whatever}} {{/for}} e.g.:custom collection.
*/
class ForDirective implements DirectiveProcessorInterface
{
/**
* @var VariableResolverInterface
*/
private $variableResolver;
/**
* @param VariableResolverInterface $variableResolver
*/
public function __construct(
VariableResolverInterface $variableResolver
) {
$this->variableResolver = $variableResolver;
}
/**
* Filter the string as template.
*
* @param array $construction
* @param Template $filter
* @param array $templateVariables
* @return string
*/
public function process(array $construction, Template $filter, array $templateVariables): string
{
if (!$this->isValidLoop($construction)) {
return $construction[0];
}
$loopData = $this->variableResolver->resolve($construction['loopData'], $filter, $templateVariables);
$loopTextToReplace = $construction['loopBody'];
$loopItemVariableName = preg_replace('/\s+/', '', $construction['loopItem']);
if (is_array($loopData) || $loopData instanceof \Traversable) {
return $this->getLoopReplacementText(
$loopData,
$loopItemVariableName,
$loopTextToReplace,
$filter,
$templateVariables
);
}
return $construction[0];
}
/**
* Check if the matched construction is valid.
*
* @param array $construction
* @return bool
*/
private function isValidLoop(array $construction)
{
$requiredFields = ['loopBody', 'loopItem', 'loopData'];
$validFields = array_filter(
$requiredFields,
function ($field) use ($construction) {
return isset($construction[$field]) && strlen(trim($construction[$field]));
}
);
return count($requiredFields) == count($validFields);
}
/**
* Process loop text to replace.
*
* @param array $loopData
* @param string $loopItemVariableName
* @param string $loopTextToReplace
* @param Template $filter
* @param array $templateVariables
* @return string
*/
private function getLoopReplacementText(
array $loopData,
string $loopItemVariableName,
string $loopTextToReplace,
Template $filter,
array $templateVariables
): string {
$loopText = [];
$loopIndex = 0;
$loopDataObject = new DataObject();
foreach ($loopData as $loopItemDataObject) {
// Loop item can be an array or DataObject.
// If loop item is an array, convert it to DataObject
// to have unified interface if the collection
if (!$loopItemDataObject instanceof DataObject) {
if (!is_array($loopItemDataObject)) {
continue;
}
$loopItemDataObject = new DataObject($loopItemDataObject);
}
$loopDataObject->setData('index', $loopIndex++);
$templateVariables['loop'] = $loopDataObject;
$templateVariables[$loopItemVariableName] = $loopItemDataObject;
// Current structure prohibits recursively calling template filter inside "for" directives
if (preg_match_all(
Template::CONSTRUCTION_PATTERN,
$loopTextToReplace,
$attributes,
PREG_SET_ORDER
)
) {
$subText = $loopTextToReplace;
foreach ($attributes as $attribute) {
$text = $this->variableResolver->resolve($attribute[2], $filter, $templateVariables);
$subText = str_replace($attribute[0], $text, $subText);
}
$loopText[] = $subText;
}
unset($templateVariables[$loopItemVariableName]);
}
$replaceText = implode('', $loopText);
return $replaceText;
}
/**
* @inheritdoc
*/
public function getRegularExpression(): string
{
return Template::LOOP_PATTERN;
}
}
|
{
"pile_set_name": "Github"
}
|
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */
/*<!--match-->*/
.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949 }
.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67; !important }
/*<!--activeline-->*/
.cm-s-midnight .activeline {background: #253540 !important;}
.cm-s-midnight.CodeMirror {
background: #0F192A;
color: #D1EDFF;
}
.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}
.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}
.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;}
.cm-s-midnight .CodeMirror-cursor {
border-left: 1px solid #F8F8F0 !important;
}
.cm-s-midnight span.cm-comment {color: #428BDD;}
.cm-s-midnight span.cm-atom {color: #AE81FF;}
.cm-s-midnight span.cm-number {color: #D1EDFF;}
.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;}
.cm-s-midnight span.cm-keyword {color: #E83737;}
.cm-s-midnight span.cm-string {color: #1DC116;}
.cm-s-midnight span.cm-variable {color: #FFAA3E;}
.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;}
.cm-s-midnight span.cm-def {color: #4DD;}
.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}
.cm-s-midnight span.cm-bracket {color: #D1EDFF;}
.cm-s-midnight span.cm-tag {color: #008;}
.cm-s-midnight span.cm-link {color: #AE81FF;}
.cm-s-midnight .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
|
{
"pile_set_name": "Github"
}
|
# OpenMessaging Domain Architecture
## Overview

Above is the domain architecture of Open Messaging, see JavaDoc for details.
OpenMessaging has released first alpha version recently, Apache RocketMQ has provided a partial implementation for OpenMessaging-0.1.0-alpha.
## Namespace
**Namespace** likes a cgroup namespace, to create an isolated space with security guarantee. Each namespace has its own set of producer, consumer, topic, queue and so on. OpenMessaging uses **MessagingAccessPoint** to access/read/write the **resources** of a specified Namespace.
## Producer
OpenMessaging defines two kinds of Producer: **Producer** and **SequenceProducer**.
* Producer, provides various send methods to send a message to a specified destination, Topic or Queue. Three ways are supported: synchronous, asynchronous and oneway.
* SequenceProducer, focuses on speed, the implementation can adopt the batch way, send many messages and then commit at once.
## Consumer
OpenMessaging defines two kinds of Consumer: **PullConsumer**, **PushConsumer** and **StreamingConsumer**. Each consumer only supports consume messages from the **Queue**.
* **PullConsumer**, pulls messages from the specified queue, supports submit the consume result by acknowledgement at any time. One PullConsumer only can pull messages from one fixed queue.
* **PushConsumer**, receives messages from multiple queues, these messages are pushed from the MOM server. PushConsumer can attach to multiple queues with separate MessageListener and submit consume result through **ReceivedMessageContext** at any time.
## Topic Queue and Routing
These three concepts are closely connected, although **Topic** and **Queue** have different responsibilities, they are confusing.
### Topic
Topic, the carrier of origin messages, is responsibility for holding messages. The distribution and sequential of messages in Topic is undefined.
### Routing
The messages in Topic are original, waiting for processing, which always can't arouse the interests of consumers. In a word, the messages in Topic is producer-oriented, not consumer--oriented.
So the Routing is in charge of processing the original messages in Topic, and routing to Queue. Each Routing has a operator pipeline, consists of a series of operators. The messages will flow through the operator pipeline from Topic and Queue.
A **operator** is used to handle the flowing messages in Routing. There are many kinds of operator, expression operator, deduplicator operator, joiner operator, filter operator, rpc operator, and so on.
What’s more? Routing can cross the network, message can be routed from a network partition to another partition.
## Queue
The messages have been routed to **Queue**, now can be consumed by consumers.
It is noteworthy that a Queue should be divided into **partitions**, a message will be routed to a specified partition by MessageHeader#SHARDING_KEY.
Queue also accepts messages from Producer directly, sometimes, we want to the shortest path from Producer to Consumer, for performance.
## Topic vs. Queue
* Both Topic and Queue are the carrier of messages.
* Topic is producer-oriented, while Queue is consumer-oriented.
* Messages in Topic are from Producer, while messages in Queue is from Topic or Producer.
* Queue is divided into partitions, while the arch of Topic is undefined.
* Queue is a little sub set of a Topic in most cases.
* Create or destroy a Queue is easy and producer irrelevant.
|
{
"pile_set_name": "Github"
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using MS.Internal;
namespace System.Windows.Controls.Primitives
{
/// <summary>
/// A control that will be responsible for generating cells.
/// This control is meant to be specified within the template of a DataGridRow.
/// The APIs from ItemsControl do not match up nicely with the meaning of a
/// row, which is why this is being factored out.
///
/// The data item for the row is added n times to the Items collection,
/// where n is the number of columns in the DataGrid. This is implemented
/// using a special collection to avoid keeping multiple references to the
/// same object.
/// </summary>
public class DataGridCellsPresenter : ItemsControl
{
#region Constructors
/// <summary>
/// Instantiates global information.
/// </summary>
static DataGridCellsPresenter()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DataGridCellsPresenter), new FrameworkPropertyMetadata(typeof(DataGridCellsPresenter)));
ItemsPanelProperty.OverrideMetadata(typeof(DataGridCellsPresenter), new FrameworkPropertyMetadata(new ItemsPanelTemplate(new FrameworkElementFactory(typeof(DataGridCellsPanel)))));
FocusableProperty.OverrideMetadata(typeof(DataGridCellsPresenter), new FrameworkPropertyMetadata(false));
HeightProperty.OverrideMetadata(typeof(DataGridCellsPresenter), new FrameworkPropertyMetadata(OnNotifyHeightPropertyChanged, OnCoerceHeight));
MinHeightProperty.OverrideMetadata(typeof(DataGridCellsPresenter), new FrameworkPropertyMetadata(OnNotifyHeightPropertyChanged, OnCoerceMinHeight));
VirtualizingPanel.IsVirtualizingProperty.OverrideMetadata(
typeof(DataGridCellsPresenter),
new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnIsVirtualizingPropertyChanged), new CoerceValueCallback(OnCoerceIsVirtualizingProperty)));
VirtualizingPanel.VirtualizationModeProperty.OverrideMetadata(typeof(DataGridCellsPresenter), new FrameworkPropertyMetadata(VirtualizationMode.Recycling));
}
/// <summary>
/// Instantiates a new instance of this class.
/// </summary>
public DataGridCellsPresenter()
{
}
#endregion
#region Row Communication
/// <summary>
/// Tells the row owner about this element.
/// </summary>
public override void OnApplyTemplate()
{
// If a new template has just been generated then
// be sure to clear any stale ItemsHost references
if (InternalItemsHost != null && !this.IsAncestorOf(InternalItemsHost))
{
InternalItemsHost = null;
}
#if BindingGroups
if (ItemBindingGroup == null)
{
ItemBindingGroup = new BindingGroup();
}
#endif
base.OnApplyTemplate();
DataGridRow owningRow = DataGridRowOwner;
if (owningRow != null)
{
owningRow.CellsPresenter = this;
Item = owningRow.Item;
}
// At the time that a Row is prepared we can't Sync because the CellsPresenter isn't created yet.
// Doing it here ensures that the CellsPresenter is in the visual tree.
SyncProperties(false);
}
/// <summary>
/// Update all properties that get a value from the DataGrid
/// </summary>
/// <remarks>
/// See comment on DataGridRow.SyncProperties
/// </remarks>
internal void SyncProperties(bool forcePrepareCells)
{
var dataGridOwner = DataGridOwner;
if (dataGridOwner == null)
{
return;
}
DataGridHelper.TransferProperty(this, HeightProperty);
DataGridHelper.TransferProperty(this, MinHeightProperty);
DataGridHelper.TransferProperty(this, VirtualizingPanel.IsVirtualizingProperty);
// This is a convenient way to walk through all cells and force them to call CoerceValue(StyleProperty)
NotifyPropertyChanged(this, new DependencyPropertyChangedEventArgs(DataGrid.CellStyleProperty, null, null), DataGridNotificationTarget.Cells);
// We may have missed an Add / Remove of a column from the grid (DataGridRow.OnColumnsChanged)
// Sync the MultipleCopiesCollection count and update the Column on changed cells
MultipleCopiesCollection cellItems = ItemsSource as MultipleCopiesCollection;
if (cellItems != null)
{
DataGridCell cell;
ObservableCollection<DataGridColumn> columns = dataGridOwner.Columns;
int newColumnCount = columns.Count;
int oldColumnCount = cellItems.Count;
int dirtyCount = 0;
bool measureAndArrangeInvalidated = false;
if (newColumnCount != oldColumnCount)
{
cellItems.SyncToCount(newColumnCount);
// Newly added or removed containers will be updated by the generator via PrepareContainer.
// All others may have a different column
dirtyCount = Math.Min(newColumnCount, oldColumnCount);
}
else if (forcePrepareCells)
{
dirtyCount = newColumnCount;
}
// if the DataGridCellsPanel missed out on some column virtualization
// activity while the row was virtualized, it needs to be measured
DataGridCellsPanel cellsPanel = InternalItemsHost as DataGridCellsPanel;
if (cellsPanel != null)
{
if (cellsPanel.HasCorrectRealizedColumns)
{
// This operation is performed when a DataGridRow is being prepared. So if we are working
// with a recycled DataGridRow we need to make sure to re-arrange it so that it picks up the
// correct CellsPanelHorizontalOffset.
cellsPanel.InvalidateArrange();
}
else
{
InvalidateDataGridCellsPanelMeasureAndArrange();
measureAndArrangeInvalidated = true;
}
}
DataGridRow row = DataGridRowOwner;
// Prepare the cells until dirtyCount is reached. Also invalidate the cells panel's measure
// and arrange if there is a mismatch between cell.ActualWidth and Column.Width.DisplayValue
for (int i = 0; i < dirtyCount; i++)
{
cell = (DataGridCell)ItemContainerGenerator.ContainerFromIndex(i);
if (cell != null)
{
cell.PrepareCell(row.Item, this, row);
if (!measureAndArrangeInvalidated && !DoubleUtil.AreClose(cell.ActualWidth, columns[i].Width.DisplayValue))
{
InvalidateDataGridCellsPanelMeasureAndArrange();
measureAndArrangeInvalidated = true;
}
}
}
// Keep searching for the mismatch between cell.ActualWidth
// and Column.Width.DisplayValue
if (!measureAndArrangeInvalidated)
{
for (int i = dirtyCount; i < newColumnCount; i++)
{
cell = (DataGridCell)ItemContainerGenerator.ContainerFromIndex(i);
if (cell != null)
{
if (!DoubleUtil.AreClose(cell.ActualWidth, columns[i].Width.DisplayValue))
{
InvalidateDataGridCellsPanelMeasureAndArrange();
break;
}
}
}
}
}
}
private static object OnCoerceHeight(DependencyObject d, object baseValue)
{
var cellsPresenter = d as DataGridCellsPresenter;
return DataGridHelper.GetCoercedTransferPropertyValue(
cellsPresenter,
baseValue,
HeightProperty,
cellsPresenter.DataGridOwner,
DataGrid.RowHeightProperty);
}
private static object OnCoerceMinHeight(DependencyObject d, object baseValue)
{
var cellsPresenter = d as DataGridCellsPresenter;
return DataGridHelper.GetCoercedTransferPropertyValue(
cellsPresenter,
baseValue,
MinHeightProperty,
cellsPresenter.DataGridOwner,
DataGrid.MinRowHeightProperty);
}
#endregion
#region Data Item
/// <summary>
/// The item that the row represents. This item is an entry in the list of items from the DataGrid.
/// From this item, cells are generated for each column in the DataGrid.
/// </summary>
public object Item
{
get
{
return _item;
}
internal set
{
if (_item != value)
{
object oldItem = _item;
_item = value;
OnItemChanged(oldItem, _item);
}
}
}
/// <summary>
/// Called when the value of the Item property changes.
/// </summary>
/// <param name="oldItem">The old value of Item.</param>
/// <param name="newItem">The new value of Item.</param>
protected virtual void OnItemChanged(object oldItem, object newItem)
{
ObservableCollection<DataGridColumn> columns = Columns;
if (columns != null)
{
// Either update or create a collection that will return the row's data item
// n number of times, where n is the number of columns.
MultipleCopiesCollection cellItems = ItemsSource as MultipleCopiesCollection;
if (cellItems == null)
{
cellItems = new MultipleCopiesCollection(newItem, columns.Count);
ItemsSource = cellItems;
}
else
{
cellItems.CopiedItem = newItem;
}
}
}
#endregion
#region Cell Container Generation
/// <summary>
/// Determines if an item is its own container.
/// </summary>
/// <param name="item">The item to test.</param>
/// <returns>true if the item is a DataGridCell, false otherwise.</returns>
protected override bool IsItemItsOwnContainerOverride(object item)
{
return item is DataGridCell;
}
/// <summary>
/// Method which returns the result of IsItemItsOwnContainerOverride to be used internally
/// </summary>
internal bool IsItemItsOwnContainerInternal(object item)
{
return IsItemItsOwnContainerOverride(item);
}
/// <summary>
/// Instantiates an instance of a container.
/// </summary>
/// <returns>A new DataGridCell.</returns>
protected override DependencyObject GetContainerForItemOverride()
{
return new DataGridCell();
}
/// <summary>
/// Prepares a new container for a given item.
/// </summary>
/// <param name="element">The new container.</param>
/// <param name="item">The item that the container represents.</param>
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
{
DataGridCell cell = (DataGridCell)element;
DataGridRow rowOwner = DataGridRowOwner;
if (cell.RowOwner != rowOwner)
{
cell.Tracker.StartTracking(ref _cellTrackingRoot);
}
cell.PrepareCell(item, this, rowOwner);
}
/// <summary>
/// Clears a container of references.
/// </summary>
/// <param name="element">The container being cleared.</param>
/// <param name="item">The data item that the container represented.</param>
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
{
DataGridCell cell = (DataGridCell)element;
DataGridRow rowOwner = DataGridRowOwner;
if (cell.RowOwner == rowOwner)
{
cell.Tracker.StopTracking(ref _cellTrackingRoot);
}
cell.ClearCell(rowOwner);
}
/// <summary>
/// Notification from the DataGrid that the columns collection has changed.
/// </summary>
/// <param name="columns">The columns collection.</param>
/// <param name="e">The event arguments from the collection's change event.</param>
protected internal virtual void OnColumnsChanged(ObservableCollection<DataGridColumn> columns, NotifyCollectionChangedEventArgs e)
{
// Update the ItemsSource for the cells
MultipleCopiesCollection cellItems = ItemsSource as MultipleCopiesCollection;
if (cellItems != null)
{
cellItems.MirrorCollectionChange(e);
}
// For a reset event the only thing the MultipleCopiesCollection can do is set its count to 0.
Debug.Assert(
e.Action != NotifyCollectionChangedAction.Reset || columns.Count == 0,
"A Reset event should only be fired for a Clear event from the columns collection");
}
#endregion
#region Notification Propagation
/// <summary>
/// Notification of Height & MinHeight changes.
/// </summary>
private static void OnNotifyHeightPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((DataGridCellsPresenter)d).NotifyPropertyChanged(d, e, DataGridNotificationTarget.CellsPresenter);
}
/// <summary>
/// General notification for DependencyProperty changes from the grid or from columns.
/// </summary>
internal void NotifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e, DataGridNotificationTarget target)
{
NotifyPropertyChanged(d, string.Empty, e, target);
}
/// <summary>
/// General notification for DependencyProperty changes from the grid or from columns.
/// </summary>
internal void NotifyPropertyChanged(DependencyObject d, string propertyName, DependencyPropertyChangedEventArgs e, DataGridNotificationTarget target)
{
if (DataGridHelper.ShouldNotifyCellsPresenter(target))
{
if (e.Property == DataGridColumn.WidthProperty ||
e.Property == DataGridColumn.DisplayIndexProperty)
{
if (((DataGridColumn)d).IsVisible)
{
InvalidateDataGridCellsPanelMeasureAndArrangeImpl((e.Property == DataGridColumn.WidthProperty)/*invalidateMeasureUptoRowsPresenter*/);
}
}
else if (e.Property == DataGrid.FrozenColumnCountProperty ||
e.Property == DataGridColumn.VisibilityProperty ||
e.Property == DataGrid.CellsPanelHorizontalOffsetProperty ||
e.Property == DataGrid.HorizontalScrollOffsetProperty ||
string.Compare(propertyName, "ViewportWidth", StringComparison.Ordinal) == 0 ||
string.Compare(propertyName, "DelayedColumnWidthComputation", StringComparison.Ordinal) == 0)
{
InvalidateDataGridCellsPanelMeasureAndArrange();
}
else if (string.Compare(propertyName, "RealizedColumnsBlockListForNonVirtualizedRows", StringComparison.Ordinal) == 0)
{
InvalidateDataGridCellsPanelMeasureAndArrange(/* withColumnVirtualization */ false);
}
else if (string.Compare(propertyName, "RealizedColumnsBlockListForVirtualizedRows", StringComparison.Ordinal) == 0)
{
InvalidateDataGridCellsPanelMeasureAndArrange(/* withColumnVirtualization */ true);
}
else if (e.Property == DataGrid.RowHeightProperty || e.Property == HeightProperty)
{
DataGridHelper.TransferProperty(this, HeightProperty);
}
else if (e.Property == DataGrid.MinRowHeightProperty || e.Property == MinHeightProperty)
{
DataGridHelper.TransferProperty(this, MinHeightProperty);
}
else if (e.Property == DataGrid.EnableColumnVirtualizationProperty)
{
DataGridHelper.TransferProperty(this, VirtualizingPanel.IsVirtualizingProperty);
}
}
if (DataGridHelper.ShouldNotifyCells(target) ||
DataGridHelper.ShouldRefreshCellContent(target))
{
ContainerTracking<DataGridCell> tracker = _cellTrackingRoot;
while (tracker != null)
{
tracker.Container.NotifyPropertyChanged(d, propertyName, e, target);
tracker = tracker.Next;
}
}
}
#endregion
#region GridLines
// Different parts of the DataGrid draw different pieces of the GridLines.
// Rows draw a single horizontal line on the bottom. The DataGridDetailsPresenter is the element that handles it.
/// <summary>
/// Measure. This is overridden so that the row can extend its size to account for a grid line on the bottom.
/// </summary>
/// <param name="availableSize"></param>
/// <returns></returns>
protected override Size MeasureOverride(Size availableSize)
{
return base.MeasureOverride(availableSize);
}
/// <summary>
/// Arrange. This is overriden so that the row can position its content to account for a grid line on the bottom.
/// </summary>
/// <param name="finalSize">Arrange size</param>
protected override Size ArrangeOverride(Size finalSize)
{
return base.ArrangeOverride(finalSize);
}
/// <summary>
/// OnRender. Overriden to draw a horizontal line underneath the content.
/// </summary>
/// <param name="drawingContext"></param>
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
var row = DataGridRowOwner;
if (row == null)
{
return;
}
var dataGrid = row.DataGridOwner;
if (dataGrid == null)
{
return;
}
if (DataGridHelper.IsGridLineVisible(dataGrid, /*isHorizontal = */ true))
{
double thickness = dataGrid.HorizontalGridLineThickness;
Rect rect = new Rect(new Size(RenderSize.Width, thickness));
rect.Y = RenderSize.Height - thickness;
drawingContext.DrawRectangle(dataGrid.HorizontalGridLinesBrush, null, rect);
}
}
#endregion
#region Column Virtualization
/// <summary>
/// Property changed callback for VirtualizingStackPanel.IsVirtualizing property
/// </summary>
private static void OnIsVirtualizingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DataGridCellsPresenter cellsPresenter = (DataGridCellsPresenter)d;
DataGridHelper.TransferProperty(cellsPresenter, VirtualizingPanel.IsVirtualizingProperty);
if (e.OldValue != cellsPresenter.GetValue(VirtualizingPanel.IsVirtualizingProperty))
{
cellsPresenter.InvalidateDataGridCellsPanelMeasureAndArrange();
}
}
/// <summary>
/// Coercion callback for VirtualizingStackPanel.IsVirtualizing property
/// </summary>
private static object OnCoerceIsVirtualizingProperty(DependencyObject d, object baseValue)
{
var cellsPresenter = d as DataGridCellsPresenter;
return DataGridHelper.GetCoercedTransferPropertyValue(
cellsPresenter,
baseValue,
VirtualizingPanel.IsVirtualizingProperty,
cellsPresenter.DataGridOwner,
DataGrid.EnableColumnVirtualizationProperty);
}
/// <summary>
/// Helper method which invalidate the underlying itemshost's measure and arrange
/// </summary>
internal void InvalidateDataGridCellsPanelMeasureAndArrange()
{
InvalidateDataGridCellsPanelMeasureAndArrangeImpl(false);
}
/// <summary>
/// Helper method which invalidate the underlying itemshost's measure and arrange
/// </summary>
private void InvalidateDataGridCellsPanelMeasureAndArrangeImpl(bool invalidateMeasureUptoRowsPresenter)
{
if (_internalItemsHost != null)
{
_internalItemsHost.InvalidateMeasure();
_internalItemsHost.InvalidateArrange();
if(invalidateMeasureUptoRowsPresenter)
{
DataGrid dataGrid = DataGridOwner;
if(dataGrid != null && dataGrid.InternalItemsHost != null)
{
Helper.InvalidateMeasureOnPath(_internalItemsHost, dataGrid.InternalItemsHost, false/*duringMeasure*/, true/*includePathEnd*/);
}
}
}
}
/// <summary>
/// Helper method which invalidate the underlying itemshost's measure and arrange
/// </summary>
/// <param name="withColumnVirtualization">
/// True to invalidate only when virtualization is on.
/// False to invalidate only when virtualization is off.
/// </param>
private void InvalidateDataGridCellsPanelMeasureAndArrange(bool withColumnVirtualization)
{
// Invalidates measure and arrange if the flag and the virtualization
// are either both true or both false.
if (withColumnVirtualization == VirtualizingPanel.GetIsVirtualizing(this))
{
InvalidateDataGridCellsPanelMeasureAndArrange();
}
}
/// <summary>
/// Workaround for not being able to access the panel instance of
/// itemscontrol directly
/// </summary>
internal Panel InternalItemsHost
{
get { return _internalItemsHost; }
set { _internalItemsHost = value; }
}
/// <summary>
/// Method which tries to scroll a cell for given index into the scroll view
/// </summary>
/// <param name="index"></param>
internal void ScrollCellIntoView(int index)
{
DataGridCellsPanel itemsHost = InternalItemsHost as DataGridCellsPanel;
if (itemsHost != null)
{
itemsHost.InternalBringIndexIntoView(index);
return;
}
}
#endregion
#region Helpers
/// <summary>
/// The DataGrid that owns this control
/// </summary>
internal DataGrid DataGridOwner
{
get
{
DataGridRow parent = DataGridRowOwner;
if (parent != null)
{
return parent.DataGridOwner;
}
return null;
}
}
/// <summary>
/// The DataGridRow that owns this control.
/// </summary>
internal DataGridRow DataGridRowOwner
{
get { return DataGridHelper.FindParent<DataGridRow>(this); }
}
private ObservableCollection<DataGridColumn> Columns
{
get
{
DataGridRow owningRow = DataGridRowOwner;
DataGrid owningDataGrid = (owningRow != null) ? owningRow.DataGridOwner : null;
return (owningDataGrid != null) ? owningDataGrid.Columns : null;
}
}
internal ContainerTracking<DataGridCell> CellTrackingRoot
{
get { return _cellTrackingRoot; }
}
#endregion
#region Data
private object _item;
private ContainerTracking<DataGridCell> _cellTrackingRoot; // Root of a linked list of active cell containers
private Panel _internalItemsHost;
#endregion
}
}
|
{
"pile_set_name": "Github"
}
|
Initializing a Network
=======================
In nimblenet, a neural network is configured according to a dict of parameters specified upon initialization.
.. code:: python
from nimblenet.neuralnet import NeuralNet
network = NeuralNet({
"n_inputs" : 2,
"layers" : [ (1, sigmoid_function) ],
})
.. important::
The final tuple in the layers list always describe the number of output signals.
Parameters
------------
The two dict keys ``n_inputs`` and ``layers`` are required. However, the network is further customizable through specifying any of the following dict parameters:
* ``n_inputs`` the number of input signals
* ``layers`` the topology of the network
* ``initial_bias_value`` the input signal from the bias node will be initialized to this value
* ``weights_low`` the lower bound on weight value during the random initialization
* ``weights_high`` the upper bound on weight value during the random initialization
Example
---------
.. code:: python
from nimblenet.neuralnet import NeuralNet
settings = {
# Required settings
"n_inputs" : 2, # Number of network input signals
"layers" : [ (3, sigmoid_function), (1, sigmoid_function) ],
# [ (number_of_neurons, activation_function) ]
# The last pair in the list dictate the number of output signals
# Optional settings
"initial_bias_value" : 0.0,
"weights_low" : -0.1, # Lower bound on the initial weight value
"weights_high" : 0.1, # Upper bound on the initial weight value
}
network = NeuralNet( settings )
|
{
"pile_set_name": "Github"
}
|
ICY4
conn:
|
{
"pile_set_name": "Github"
}
|
/* GENERATED SOURCE. DO NOT MODIFY. */
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
/*
*******************************************************************************
* Copyright (C) 2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package android.icu.dev.test.bidi;
import org.junit.Test;
import android.icu.text.Bidi;
/**
* Regression test for the Arabic Mathematical Alphabetic Symbols.
*
* Ported from C by Ramy Said
*/
public class TestReorderArabicMathSymbols extends BidiFmwk {
private static final String[] logicalOrder = {
/* Arabic mathematical Symbols "\u1EE00 - "\u1EE1B */
"\uD83B\uDE00\uD83B\uDE01\uD83B\uDE02\uD83B\uDE03\u0020" +
"\uD83B\uDE24\uD83B\uDE05\uD83B\uDE06\u0020" +
"\uD83B\uDE07\uD83B\uDE08\uD83B\uDE09\u0020" +
"\uD83B\uDE0A\uD83B\uDE0B\uD83B\uDE0C\uD83B\uDE0D\u0020" +
"\uD83B\uDE0E\uD83B\uDE0F\uD83B\uDE10\uD83B\uDE11\u0020" +
"\uD83B\uDE12\uD83B\uDE13\uD83B\uDE14\uD83B\uDE15\u0020" +
"\uD83B\uDE16\uD83B\uDE17\uD83B\uDE18\u0020" +
"\uD83B\uDE19\uD83B\uDE1A\uD83B\uDE1B",
/* Arabic mathematical Symbols - Looped Symbols\u1EE80 - "\u1EE9B */
"\uD83B\uDE80\uD83B\uDE81\uD83B\uDE82\uD83B\uDE83\u0020" +
"\uD83B\uDE84\uD83B\uDE85\uD83B\uDE86\u0020" +
"\uD83B\uDE87\uD83B\uDE88\uD83B\uDE89\u0020" +
"\uD83B\uDE8B\uD83B\uDE8C\uD83B\uDE8D\u0020" +
"\uD83B\uDE8E\uD83B\uDE8F\uD83B\uDE90\uD83B\uDE91\u0020" +
"\uD83B\uDE92\uD83B\uDE93\uD83B\uDE94\uD83B\uDE95\u0020" +
"\uD83B\uDE96\uD83B\uDE97\uD83B\uDE98\u0020" +
"\uD83B\uDE99\uD83B\uDE9A\uD83B\uDE9B",
/* Arabic mathematical Symbols - Double-struck Symbols\u1EEA1 - "\u1EEBB */
"\uD83B\uDEA1\uD83B\uDEA2\uD83B\uDEA3\u0020" +
"\uD83B\uDEA5\uD83B\uDEA6\u0020" +
"\uD83B\uDEA7\uD83B\uDEA8\uD83B\uDEA9\u0020" +
"\uD83B\uDEAB\uD83B\uDEAC\uD83B\uDEAD\u0020" +
"\uD83B\uDEAE\uD83B\uDEAF\uD83B\uDEB0\uD83B\uDEB1\u0020" +
"\uD83B\uDEB2\uD83B\uDEB3\uD83B\uDEB4\uD83B\uDEB5\u0020" +
"\uD83B\uDEB6\uD83B\uDEB7\uD83B\uDEB8\u0020" +
"\uD83B\uDEB9\uD83B\uDEBA\uD83B\uDEBB",
/* Arabic mathematical Symbols - Initial Symbols\u1EE21 - "\u1EE3B */
"\uD83B\uDE21\uD83B\uDE22\u0020" +
"\uD83B\uDE27\uD83B\uDE29\u0020" +
"\uD83B\uDE2A\uD83B\uDE2B\uD83B\uDE2C\uD83B\uDE2D\u0020" +
"\uD83B\uDE2E\uD83B\uDE2F\uD83B\uDE30\uD83B\uDE31\u0020" +
"\uD83B\uDE32\uD83B\uDE34\uD83B\uDE35\u0020" +
"\uD83B\uDE36\uD83B\uDE37\u0020" +
"\uD83B\uDE39\uD83B\uDE3B",
/* Arabic mathematical Symbols - Tailed Symbols */
"\uD83B\uDE42\uD83B\uDE47\uD83B\uDE49\uD83B\uDE4B\u0020" +
"\uD83B\uDE4D\uD83B\uDE4E\uD83B\uDE4F\u0020" +
"\uD83B\uDE51\uD83B\uDE52\uD83B\uDE54\uD83B\uDE57\u0020" +
"\uD83B\uDE59\uD83B\uDE5B\uD83B\uDE5D\uD83B\uDE5F"
};
private static final String[] visualOrder = {
/* Arabic mathematical Symbols "\u1EE00 - "\u1EE1B */
"\uD83B\uDE1B\uD83B\uDE1A\uD83B\uDE19\u0020" +
"\uD83B\uDE18\uD83B\uDE17\uD83B\uDE16\u0020" +
"\uD83B\uDE15\uD83B\uDE14\uD83B\uDE13\uD83B\uDE12\u0020" +
"\uD83B\uDE11\uD83B\uDE10\uD83B\uDE0F\uD83B\uDE0E\u0020" +
"\uD83B\uDE0D\uD83B\uDE0C\uD83B\uDE0B\uD83B\uDE0A\u0020" +
"\uD83B\uDE09\uD83B\uDE08\uD83B\uDE07\u0020" +
"\uD83B\uDE06\uD83B\uDE05\uD83B\uDE24\u0020" +
"\uD83B\uDE03\uD83B\uDE02\uD83B\uDE01\uD83B\uDE00",
/* Arabic mathematical Symbols - Looped Symbols\u1EE80 - "\u1EE9B */
"\uD83B\uDE9B\uD83B\uDE9A\uD83B\uDE99\u0020" +
"\uD83B\uDE98\uD83B\uDE97\uD83B\uDE96\u0020" +
"\uD83B\uDE95\uD83B\uDE94\uD83B\uDE93\uD83B\uDE92\u0020" +
"\uD83B\uDE91\uD83B\uDE90\uD83B\uDE8F\uD83B\uDE8E\u0020" +
"\uD83B\uDE8D\uD83B\uDE8C\uD83B\uDE8B\u0020" +
"\uD83B\uDE89\uD83B\uDE88\uD83B\uDE87\u0020" +
"\uD83B\uDE86\uD83B\uDE85\uD83B\uDE84\u0020" +
"\uD83B\uDE83\uD83B\uDE82\uD83B\uDE81\uD83B\uDE80",
/* Arabic mathematical Symbols - Double-struck Symbols\u1EEA1 - "\u1EEBB */
"\uD83B\uDEBB\uD83B\uDEBA\uD83B\uDEB9\u0020" +
"\uD83B\uDEB8\uD83B\uDEB7\uD83B\uDEB6\u0020" +
"\uD83B\uDEB5\uD83B\uDEB4\uD83B\uDEB3\uD83B\uDEB2\u0020" +
"\uD83B\uDEB1\uD83B\uDEB0\uD83B\uDEAF\uD83B\uDEAE\u0020" +
"\uD83B\uDEAD\uD83B\uDEAC\uD83B\uDEAB\u0020" +
"\uD83B\uDEA9\uD83B\uDEA8\uD83B\uDEA7\u0020" +
"\uD83B\uDEA6\uD83B\uDEA5\u0020" +
"\uD83B\uDEA3\uD83B\uDEA2\uD83B\uDEA1",
/* Arabic mathematical Symbols - Initial Symbols\u1EE21 - "\u1EE3B */
"\uD83B\uDE3B\uD83B\uDE39\u0020" +
"\uD83B\uDE37\uD83B\uDE36\u0020" +
"\uD83B\uDE35\uD83B\uDE34\uD83B\uDE32\u0020" +
"\uD83B\uDE31\uD83B\uDE30\uD83B\uDE2F\uD83B\uDE2E\u0020" +
"\uD83B\uDE2D\uD83B\uDE2C\uD83B\uDE2B\uD83B\uDE2A\u0020" +
"\uD83B\uDE29\uD83B\uDE27\u0020" +
"\uD83B\uDE22\uD83B\uDE21",
/* Arabic mathematical Symbols - Tailed Symbols */
"\uD83B\uDE5F\uD83B\uDE5D\uD83B\uDE5B\uD83B\uDE59\u0020" +
"\uD83B\uDE57\uD83B\uDE54\uD83B\uDE52\uD83B\uDE51\u0020" +
"\uD83B\uDE4F\uD83B\uDE4E\uD83B\uDE4D\u0020" +
"\uD83B\uDE4B\uD83B\uDE49\uD83B\uDE47\uD83B\uDE42"
};
@Test
public void testReorderArabicMathSymbols() {
Bidi bidi = new Bidi();
int testNumber;
int nTests = logicalOrder.length;
String srcU16, dest = "";
logln("\nEntering TestReorderArabicMathSymbols\n");
for (testNumber = 0; testNumber < nTests; testNumber++) {
logln("Testing L2V #1 for case " + testNumber);
srcU16 = logicalOrder[testNumber];
try {
bidi.setPara(srcU16, Bidi.LEVEL_DEFAULT_LTR, null);
} catch (Exception e) {
errln("Bidi.setPara(tests[" + testNumber + "], paraLevel " +
Bidi.LEVEL_DEFAULT_LTR + " failed.");
}
try {
dest = bidi.writeReordered(Bidi.DO_MIRRORING);
} catch (Exception e) {
errln("Bidi.writeReordered(tests[" + testNumber + "], paraLevel " +
Bidi.LEVEL_DEFAULT_LTR + " failed.");
}
if (!visualOrder[testNumber].equals(dest)) {
assertEquals("Failure #1 in Bidi.writeReordered(), test number " +
testNumber, visualOrder[testNumber], dest, srcU16, null,
"Bidi.DO_MIRRORING", "Bidi.LEVEL_DEFAULT_LTR");
}
}
logln("\nExiting TestReorderArabicMathSymbols\n");
}
}
|
{
"pile_set_name": "Github"
}
|
# hashpi
> Rasberry Pi rack running clustered Hashicorp datacenter infrastructure (nomad, vault, consul)
+ [Preamble](#preamble)
+ [Hardware Buildout](#hardware-buildout)
+ [Software Deployment](#software-deployment)
## Preamble
In order to follow along with this build, you would need to have the following components and tools available to you:
### Hardware Shopping List
+ 1x [GearRobot Case](https://www.amazon.com/gp/product/B00MYFAAPO/)
+ 1x [DualComm 5-Port Switch (USB Powered)](https://www.amazon.com/gp/product/B002BSA7GG/)
+ 4x [Raspberry Pi 3 Model B Motherboard](https://www.amazon.com/gp/product/B01CD5VC92/)
+ 4x [16GB SDHC cards](https://www.amazon.com/gp/product/B004G605OA/)
+ 1x [Anker 5-Port powered USB hub](https://www.amazon.com/gp/product/B00VH8ZW02/)
+ 1x [16x2 LCD screen](https://www.adafruit.com/products/181)
+ 1x [i2c / SPI LCD backpack](https://www.adafruit.com/product/292)
+ 1x [Male to Female Jumper Wires](https://www.google.com/shopping/product/12597180957004446265)
+ 4x small Cat5e cable (typically you make these, but you can buy pre-made ones if you want)
+ 4x [USB-B to USB-micro converter](https://www.google.com/shopping/product/13932993478778087101). These are for AC power to the motherboard from the hub.
### Tools Required
+ 1x Soldering Iron
+ 1x pack of solder (leaded or lead-free, either will work)
+ 1x [Crimping Tool](https://www.amazon.com/gp/product/B002D3B97U/)
+ 1x pair of thin, long-nose pliers (these are useful for the case build)
+ 1x case of minature / precision screwdrivers (e.g. [these](http://www.homedepot.com/p/TEKTON-Precision-Screwdriver-Set-6-Piece-2985/207096248?cm_mmc=Shopping%7cTHD%7cG%7c0%7cG-BASE-PLA-D25T-HandTools%7c&gclid=CjwKEAiA94nCBRDxismumrL83icSJAAeeETQQSkzNXpnq7FmWWAG6wa_VkhktpHDJ_dErC8Cn7cvIBoC7VHw_wcB&gclsrc=aw.ds) or [these](http://www.firemountaingems.com/itemdetails/H201579TL?engine=google&campaign=[ADL]+[Non-Brand]+[PLA]+[Shopping]&adgroup=[PLA]+[Shopping]+Best+Sellers&kwid=productads-adid^113207974204-device^c-plaid^61529866819-sku^H201579TL-adType^PLA))
## Hardware Buildout
+ Assemble the motherboards with the case (instructions from the case).


+ Cut and crimp the nessicary ethernet cables needed to connect the motherboards to the switch. Choose a scheme (A or B, but stick to just one):

+ Connect the USB power cords and the network cables to the motherboards.

+ If you're having issues with the motherboard, there are two LEDs indicate status. Explanations for which can be [found here](http://raspberrypi.stackexchange.com/questions/24664/what-do-the-leds-on-the-b-mean).
+ Now its time to attach the i2pc backpack to the LCD. There's a decent tutorial [over here](https://learn.adafruit.com/i2c-spi-lcd-backpack), but you absolutely need to know how to solder and use the aforementioned tools (never a better time to learn this stuff that the present!).

## Software Deployment
These instructions assume you are running *Raspbian Lite*, Jesse or later (this requires [systemd](https://www.freedesktop.org/wiki/Software/systemd/)). You can download [Raspbian Lite from here](https://www.raspberrypi.org/downloads/raspbian/), and I would strongly recomend checking out resin.io [Ether](https://etcher.io/) for a quick and convenient way to flash your SD cards from OSX, with the vanilla Raspbian image you are downloading.
There is a set of initial setup that must be done manually to get the Pi's accessible remotely (and availalbe for automatic provisioning). I used the following steps to get the nodes going:
```
# set a new root password
$ sudo passwd root
<enter new password>
# set your the password for the `pi` user
$ sudo passwd pi
<enter new password>
$ sudo reboot
# update the system, disable avahi and bluetooth
$ sudo systemctl enable ssh && \
sudo systemctl start ssh
# optionally install a few useful utilities
$ sudo apt-get install -y htop
```
Now we have our four Pi's running SSH and have disabled the features we wont be using in this cluster build out (e.g. bluetooth). Now we are ready to deploy the bulk of the software! This repo makes use of [Ansible](https://www.ansible.com/) as its provisioning system; in order to automate the vast majority of operations we conduct on the cluster. This makes them repeatable and testable. Please checkout the Ansible documentation if you are not familiar with the tool.
#### Bootstrap Playbook
The bootstrap playbook setups up core functionality so that we can run more complicated playbooks on the Pis themselves, and also get access to the cluster nodes without having to SSH with an explicit username and password (add your key to the `user` roles `vars` file). After first turning on the cluster and enabling SSH, the following should be executed in the root of the repository:
```
./bootstrap.yml
```
This mainly kills avahai-daemon and several other processes we will not be needing, going forward.
#### Site Playbook
Once you've bootstrapped your cluster and you can SSH into the nodes with your key, then we can simply run the ansible site plays, and let it install all the nessicary gubbins.
```
./site.yml
```
Any other time you update the cluster using the `site.yml` playbook, be sure to run with the following option:
```
./site.yml --skip-tags=consul-servers,bootstrap
```
This will ensure that the consul servers used to corrdinate everything don't get screwed up during the deployment of new software.
This set of playbooks installs the following software (in order).
+ Debugging Utils (htop, nslookup, telnet etc)
+ [Consul](https://www.consul.io/) (runs on 3 nodes as a quorum)
+ [Vault](https://www.vaultproject.io/) (uses Consul as its secure backend; runs on rpi01)
+ [Nomad](https://www.nomadproject.io/) (only rpi01 has the `server` component of Nomad installed)
+ [Prometheus](https://prometheus.io) (only runs on rpi01)
+ [Grafana](http://grafana.org/)
+ [Docker](https://docker.com/)
Whilst the setup is vastly automated, there are a few manual steps. When first installing Vault, there is a set of keys that are generated which cannot be automated away, because they are required for vault initialization. The steps to first setup the vault are [documented in this blog post](https://www.vaultproject.io/intro/getting-started/deploy.html) but the TL;DR is:
```
$ ssh pi@<baron-ip>
$ export VAULT_ADDR="http://`ip -4 route get 8.8.8.8 | awk '{print $7}' | xargs echo -n`:8200"
$ vault init
# be sure to keep the generated keys in a safe place, and absolutely do not check them in anywhere!
$ vault -tls-skip-verify unseal
```
Given this is just a local raspberry pi cluster, I'm not fussing around with SSL as its a development cluster for me. I do however really, really recommend that you use SSL on this thing - or anything else for that matter - that is the best practice can self-signed certs can be easily generated and provided to vault. See the documentation for more information on that.
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<symbolBean>
<value>470uH</value>
<rotation>0</rotation>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>739</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<name>L1</name>
<category>Passiv</category>
<width>69</width>
<height>80</height>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>30</x>
<y>64</y>
</start>
<end>
<x>30</x>
<y>60</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>30</x>
<y>56</y>
</start>
<end>
<x>30</x>
<y>52</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>30</x>
<y>48</y>
</start>
<end>
<x>30</x>
<y>44</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>30</x>
<y>24</y>
</start>
<end>
<x>30</x>
<y>28</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>30</x>
<y>32</y>
</start>
<end>
<x>30</x>
<y>36</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>24</x>
<y>64</y>
</start>
<end>
<x>24</x>
<y>80</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>24</x>
<y>16</y>
</start>
<end>
<x>24</x>
<y>0</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<lines>
<xLoc>0</xLoc>
<yLoc>0</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<start>
<x>30</x>
<y>16</y>
</start>
<end>
<x>30</x>
<y>20</y>
</end>
<startType>STRAIGHT</startType>
<endType>STRAIGHT</endType>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
</lines>
<ellipses>
<xLoc>16</xLoc>
<yLoc>52</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<width>12</width>
<height>12</height>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
<style>OUTLINED</style>
<startAngle>90</startAngle>
<rotation>180</rotation>
</ellipses>
<ellipses>
<xLoc>16</xLoc>
<yLoc>16</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<width>12</width>
<height>12</height>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
<style>OUTLINED</style>
<startAngle>90</startAngle>
<rotation>180</rotation>
</ellipses>
<ellipses>
<xLoc>16</xLoc>
<yLoc>28</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<width>12</width>
<height>12</height>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
<style>OUTLINED</style>
<startAngle>90</startAngle>
<rotation>180</rotation>
</ellipses>
<ellipses>
<xLoc>16</xLoc>
<yLoc>40</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<width>12</width>
<height>12</height>
<thickness>2.0</thickness>
<dashPhase>0.0</dashPhase>
<endCap>2</endCap>
<lineJoin>0</lineJoin>
<miterLimit>10.0</miterLimit>
<style>OUTLINED</style>
<startAngle>90</startAngle>
<rotation>180</rotation>
</ellipses>
<textparts>
<xLoc>0</xLoc>
<yLoc>52</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<width>0</width>
<height>0</height>
<rotation>-90</rotation>
<text>#Name</text>
<font>Arial</font>
<fontsize>12</fontsize>
<type>NAME</type>
</textparts>
<textparts>
<xLoc>31</xLoc>
<yLoc>57</yLoc>
<index>0</index>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<layer>0</layer>
<width>0</width>
<height>0</height>
<rotation>-90</rotation>
<text>#Value</text>
<font>Arial</font>
<fontsize>12</fontsize>
<type>VALUE</type>
</textparts>
<mirrorVertical>false</mirrorVertical>
<mirrorHorizontal>false</mirrorHorizontal>
<macroMode>true</macroMode>
<connections>
<pin>
<x>24</x>
<y>0</y>
<num>1</num>
<name>1</name>
<orientation>BOTTOM_RIGHT</orientation>
</pin>
<pin>
<x>24</x>
<y>80</y>
<num>2</num>
<name>2</name>
<orientation>BOTTOM_RIGHT</orientation>
</pin>
</connections>
<customModel>false</customModel>
<type>RESISTOR</type>
<filename>L1.xml</filename>
</symbolBean>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 1999-2001 Free Software Foundation, Inc.
* This file is part of the GNU LIBICONV Library.
*
* The GNU LIBICONV Library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* The GNU LIBICONV 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with the GNU LIBICONV Library; see the file COPYING.LIB.
* If not, write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
* Unified Hangul Code part 2
*/
static const unsigned short uhc_2_2uni_main_pagea1[76] = {
0xc8a5, 0xc8d8, 0xc910, 0xc93e, 0xc971, 0xc9a5, 0xc9de, 0xca1c,
0xca47, 0xca7b, 0xcaa8, 0xcadd, 0xcb0b, 0xcb3a, 0xcb6d, 0xcb99,
0xcbc5, 0xcbf3, 0xcc25, 0xcc67, 0xcc94, 0xcccf, 0xccfe, 0xcd34,
0xcd61, 0xcd92, 0xcdc6, 0xcdf5, 0xce2c, 0xce5d, 0xce9a, 0xcecc,
0xcf02, 0xcf3b, 0xcf6d, 0xcf9e, 0xcfcc, 0xcfff, 0xd02e, 0xd064,
0xd095, 0xd0cc, 0xd105, 0xd132, 0xd16e, 0xd19b, 0xd1d0, 0xd1fd,
0xd22a, 0xd25e, 0xd28d, 0xd2c5, 0xd2fb, 0xd33e, 0xd36a, 0xd3a1,
0xd3d7, 0xd40d, 0xd438, 0xd467, 0xd49e, 0xd4c9, 0xd4fe, 0xd52e,
0xd564, 0xd59d, 0xd5ca, 0xd606, 0xd63d, 0xd677, 0xd6ab, 0xd6e2,
0xd715, 0xd74e, 0xd78d, 0xfffd,
};
static const unsigned char uhc_2_2uni_pagea1[3126] = {
/* 0xa1 */
0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x19, 0x1a,
0x1b, 0x1c, 0x1d, 0x1e, 0x20, 0x21, 0x22, 0x24,
0x25, 0x26, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x31, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1a, 0x1b, 0x1c, 0x1e, 0x1f, 0x20, 0x21, 0x22,
0x23, 0x26, 0x27, 0x29, 0x2a, 0x2b, 0x2f, 0x30,
0x31, 0x32, 0x33, 0x36,
/* 0xa2 */
0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1a, 0x1b, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22,
0x23, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x14, 0x15, 0x17, 0x18,
0x19, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
0x24, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
0x2d, 0x2f, 0x30, 0x31,
/* 0xa3 */
0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x19, 0x1a, 0x1c,
0x1d, 0x1e, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x29, 0x2b, 0x2d, 0x2e, 0x2f, 0x30, 0x31,
0x32, 0x33, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1d, 0x1e, 0x20,
0x21, 0x24, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2d,
0x2f, 0x32, 0x33, 0x36,
/* 0xa4 */
0x00, 0x01, 0x03, 0x05, 0x07, 0x08, 0x0a, 0x0b,
0x0c, 0x0d, 0x10, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1c, 0x1d, 0x1f, 0x20, 0x21, 0x23, 0x24,
0x25, 0x26, 0x27, 0x28, 0x29, 0x2c, 0x30, 0x31,
0x32, 0x33, 0x34, 0x35, 0x37, 0x38, 0x39, 0x3b,
0x3c, 0x3d, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0e,
0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2a,
/* 0xa5 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x07, 0x08, 0x0a,
0x0b, 0x0c, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,
0x14, 0x17, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31,
0x32, 0x33, 0x00, 0x01, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x2b, 0x2c,
/* 0xa6 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x16, 0x17, 0x19, 0x1a,
0x1b, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
0x26, 0x28, 0x2a, 0x2c, 0x2d, 0x2e, 0x2f, 0x32,
0x33, 0x34, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x2c, 0x2d,
/* 0xa7 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08,
0x0a, 0x0b, 0x0c, 0x0e, 0x0f, 0x10, 0x11, 0x12,
0x13, 0x14, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c,
0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24,
0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
0x2d, 0x2e, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x10,
0x11, 0x13, 0x14, 0x15, 0x17, 0x18, 0x19, 0x1a,
0x1b, 0x1c, 0x1d, 0x20, 0x21, 0x22, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2b, 0x2c, 0x2d, 0x2e,
0x2f, 0x30, 0x31, 0x32,
/* 0xa8 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
0x2a, 0x2b, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b,
/* 0xa9 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x20, 0x21,
0x23, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x1b, 0x1c, 0x1e, 0x1f, 0x20,
0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2b,
0x2c, 0x2d, 0x30, 0x31,
/* 0xaa */
0x00, 0x01, 0x05, 0x06, 0x08, 0x0a, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x15, 0x1a, 0x1b,
0x1c, 0x1d, 0x1e, 0x21, 0x22, 0x24, 0x25, 0x26,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x31,
0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3c, 0x3d,
0x3e, 0x40, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x0a, 0x0b, 0x0c, 0x0d, 0x0f, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x2b, 0x2c,
/* 0xab */
0x00, 0x01, 0x02, 0x03, 0x06, 0x07, 0x09, 0x0a,
0x0b, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,
0x16, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x22,
0x23, 0x25, 0x26, 0x27, 0x29, 0x2a, 0x2b, 0x2c,
0x2d, 0x2e, 0x2f, 0x32, 0x34, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x00, 0x02, 0x03, 0x04, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1e, 0x1f, 0x20, 0x22,
0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
0x2b, 0x2c, 0x2d, 0x2e,
/* 0xac */
0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0c, 0x0d, 0x0f, 0x10, 0x11, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1c, 0x1e, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29,
0x2b, 0x2c, 0x2d, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x00, 0x01, 0x02, 0x03, 0x04, 0x06,
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x29, 0x2a, 0x2b,
/* 0xad */
0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0d, 0x0f, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e,
0x2f, 0x30, 0x00, 0x01, 0x04, 0x05, 0x07, 0x08,
0x09, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x14, 0x16, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e,
0x2f, 0x30, 0x31, 0x33,
/* 0xae */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08,
0x09, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2b, 0x2c,
0x2d, 0x2e, 0x00, 0x01, 0x02, 0x05, 0x07, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x10, 0x11, 0x12,
0x14, 0x15, 0x16, 0x18, 0x19, 0x1a, 0x1b, 0x1c,
0x1d, 0x1e, 0x20, 0x21, 0x22, 0x23, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x2d, 0x2e, 0x30, 0x31,
0x32, 0x34, 0x35, 0x36,
/* 0xaf */
0x00, 0x01, 0x02, 0x03, 0x06, 0x08, 0x0a, 0x0b,
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
0x2e, 0x2f, 0x00, 0x01, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0d, 0x0f, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x19, 0x1a, 0x1c, 0x1d, 0x1e, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x29, 0x2b,
0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x35, 0x36,
0x38, 0x39, 0x3a, 0x3c,
/* 0xb0 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x0c,
0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x1a, 0x1b, 0x1d, 0x1e, 0x21, 0x22,
0x23, 0x24, 0x25, 0x26, 0x27, 0x2a, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33,
/* 0xb1 */
0x00, 0x01, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x10, 0x12, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1b, 0x1c, 0x1d, 0x1f,
0x20, 0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2c, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x37, 0x38, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x1b, 0x1c, 0x1e, 0x1f, 0x20,
0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2b,
0x2d, 0x2f, 0x30, 0x31,
/* 0xb2 */
0x00, 0x01, 0x02, 0x05, 0x06, 0x08, 0x09, 0x0a,
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x14,
0x15, 0x16, 0x17, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e,
0x2f, 0x30, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29,
0x2a, 0x2b, 0x2c, 0x2d,
/* 0xb3 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x16, 0x17, 0x19, 0x1a,
0x1b, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
0x26, 0x28, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x31, 0x32, 0x00, 0x02, 0x03, 0x04, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
0x2a, 0x2b, 0x2c, 0x2d,
/* 0xb4 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x09,
0x0b, 0x0c, 0x0d, 0x0f, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x18, 0x1a, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29,
0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x33,
0x34, 0x35, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x1a, 0x1b,
0x1c, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24,
0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
0x2d, 0x2e, 0x2f, 0x30,
/* 0xb5 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x11,
0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1a, 0x1b,
0x1c, 0x1d, 0x1e, 0x21, 0x23, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2d, 0x2e, 0x30, 0x31, 0x32,
0x35, 0x36, 0x00, 0x01, 0x02, 0x03, 0x06, 0x0a,
0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x12, 0x13, 0x15,
0x16, 0x17, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x1f, 0x22, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b,
0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34,
0x35, 0x36, 0x37, 0x38,
/* 0xb6 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x00, 0x01, 0x03, 0x04, 0x05, 0x07,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x10, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1c, 0x1d, 0x1f, 0x20,
0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
0x2c, 0x2e, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x37, 0x38, 0x39, 0x3b,
/* 0xb7 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0f, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x17, 0x18, 0x19,
0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22,
0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
0x2b, 0x2c, 0x00, 0x01, 0x02, 0x03, 0x04, 0x07,
0x08, 0x0a, 0x0b, 0x0c, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x17, 0x19, 0x1b, 0x1c, 0x1d,
0x1e, 0x20, 0x22, 0x23, 0x24, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
0x31, 0x32, 0x33, 0x34,
/* 0xb8 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x25, 0x26, 0x27, 0x29, 0x2a,
0x2b, 0x2c, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0b, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x2b, 0x2c,
/* 0xb9 */
0x00, 0x01, 0x04, 0x05, 0x07, 0x08, 0x09, 0x0b,
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x14, 0x16,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
0x31, 0x33, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x1f, 0x20, 0x21, 0x24, 0x25, 0x27, 0x28, 0x29,
0x2b, 0x2c, 0x2d, 0x2e,
/* 0xba */
0x00, 0x01, 0x02, 0x05, 0x06, 0x07, 0x09, 0x0a,
0x0b, 0x0c, 0x0d, 0x0e, 0x10, 0x11, 0x12, 0x14,
0x15, 0x16, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x20, 0x21, 0x22, 0x23, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2d, 0x2e, 0x30, 0x31, 0x34,
0x36, 0x37, 0x00, 0x01, 0x02, 0x05, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x10, 0x11,
0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1a, 0x1b,
0x1c, 0x1d, 0x1e, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2d, 0x2e, 0x30,
0x31, 0x32, 0x34, 0x35,
/* 0xbb */
0x00, 0x01, 0x02, 0x03, 0x04, 0x07, 0x09, 0x0b,
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x14, 0x16, 0x17,
0x18, 0x1a, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x23,
0x27, 0x28, 0x29, 0x2b, 0x2c, 0x2f, 0x30, 0x32,
0x33, 0x34, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b,
/* 0xbc */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x14, 0x15, 0x17, 0x18, 0x19, 0x1b,
0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x24, 0x28,
0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x30, 0x31, 0x33,
0x34, 0x35, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x09, 0x0b, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1a, 0x1c,
0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x25, 0x26,
0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x30, 0x31,
0x32, 0x33, 0x34, 0x35,
/* 0xbd */
0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0b, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
0x13, 0x14, 0x17, 0x18, 0x1a, 0x1b, 0x1c, 0x1e,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x27, 0x29,
0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x32, 0x33,
0x34, 0x35, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2a,
/* 0xbe */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
0x22, 0x23, 0x25, 0x26, 0x27, 0x29, 0x2a, 0x2b,
0x2d, 0x2e, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x07, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x13, 0x14, 0x16, 0x17, 0x1a, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x23, 0x25, 0x27, 0x28, 0x29,
0x2a, 0x2b, 0x2c, 0x2e, 0x2f, 0x30, 0x31, 0x32,
0x33, 0x34, 0x35, 0x36,
/* 0xbf */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06,
0x08, 0x09, 0x0a, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x11, 0x12, 0x14, 0x15, 0x17, 0x18, 0x19, 0x1a,
0x1b, 0x1c, 0x1d, 0x1e, 0x20, 0x21, 0x22, 0x24,
0x25, 0x26, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x30, 0x31, 0x33,
/* 0xc0 */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08,
0x09, 0x0b, 0x0c, 0x0d, 0x0f, 0x10, 0x11, 0x12,
0x13, 0x14, 0x15, 0x18, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x10, 0x11, 0x13, 0x14, 0x15, 0x17, 0x18, 0x19,
0x1a, 0x1b, 0x1c, 0x1d, 0x20, 0x22, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2c, 0x2d, 0x2f, 0x30,
0x31, 0x33, 0x34, 0x35,
/* 0xc1 */
0x00, 0x02, 0x03, 0x06, 0x08, 0x0a, 0x0b, 0x0c,
0x0d, 0x0e, 0x0f, 0x12, 0x13, 0x15, 0x16, 0x17,
0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x22,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2d, 0x2e,
0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
0x37, 0x38, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2a,
/* 0xc2 */
0x00, 0x01, 0x03, 0x04, 0x05, 0x07, 0x09, 0x0a,
0x0b, 0x0c, 0x0d, 0x10, 0x12, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1c, 0x1d, 0x1f, 0x20, 0x21,
0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2c,
0x2e, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x38,
0x39, 0x3b, 0x00, 0x01, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0c, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x17, 0x18, 0x19, 0x1b, 0x1c, 0x1d,
0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x34, 0x35,
/* 0xc3 */
0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x09,
0x0a, 0x0d, 0x0f, 0x11, 0x12, 0x13, 0x15, 0x16,
0x19, 0x1a, 0x1c, 0x1d, 0x1e, 0x20, 0x21, 0x22,
0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2b,
0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x35, 0x36,
0x38, 0x39, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x17, 0x18, 0x1a,
0x1b, 0x1c, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
0x24, 0x25, 0x27, 0x29, 0x2b, 0x2c, 0x2d, 0x2e,
0x2f, 0x30, 0x32, 0x33,
/* 0xc4 */
0x00, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0f, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x1b, 0x1c, 0x1e,
0x1f, 0x20, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28,
0x2a, 0x2b, 0x2d, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x36, 0x00, 0x01, 0x03, 0x04, 0x05, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0f, 0x10,
0x11, 0x12, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
0x1c, 0x1d, 0x1f, 0x20, 0x21, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x30, 0x31, 0x32,
/* 0xc5 */
0x00, 0x01, 0x02, 0x05, 0x06, 0x08, 0x09, 0x0a,
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x15,
0x17, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x21,
0x22, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x2e, 0x30, 0x31, 0x33, 0x35, 0x36,
0x37, 0x38, 0x00, 0x01, 0x04, 0x05, 0x07, 0x0c,
0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x14, 0x16, 0x18,
0x19, 0x1a, 0x1c, 0x1d, 0x1f, 0x20, 0x21, 0x23,
0x24, 0x25, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,
0x2d, 0x30, 0x31, 0x32, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3c, 0x3d,
/* 0xc6 */
0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0d, 0x0f, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16,
};
static int
uhc_2_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
{
unsigned char c1 = s[0];
if ((c1 >= 0xa1 && c1 <= 0xc6)) {
if (n >= 2) {
unsigned char c2 = s[1];
if ((c2 >= 0x41 && c2 < 0x5b) || (c2 >= 0x61 && c2 < 0x7b) || (c2 >= 0x81 && c2 < 0xa1)) {
unsigned int row = c1 - 0xa1;
unsigned int col = c2 - (c2 >= 0x81 ? 0x4d : c2 >= 0x61 ? 0x47 : 0x41);
unsigned int i = 84 * row + col;
if (i < 3126) {
*pwc = (ucs4_t) (uhc_2_2uni_main_pagea1[2*row+(col>=42?1:0)] + uhc_2_2uni_pagea1[i]);
return 2;
}
}
return RET_ILSEQ;
}
return RET_TOOFEW(0);
}
return RET_ILSEQ;
}
static const unsigned short uhc_2_2charset_main[49] = {
0xa141, 0xa18d, 0xa273, 0xa359, 0xa445, 0xa491, 0xa577, 0xa663,
0xa749, 0xa795, 0xa881, 0xa967, 0xaa4d, 0xaa99, 0xab85, 0xac6b,
0xad51, 0xad9d, 0xae89, 0xaf6f, 0xb055, 0xb141, 0xb18d, 0xb273,
0xb359, 0xb445, 0xb491, 0xb577, 0xb663, 0xb749, 0xb795, 0xb881,
0xb967, 0xba4d, 0xba99, 0xbb85, 0xbc6b, 0xbd51, 0xbd9d, 0xbe89,
0xbf6f, 0xc055, 0xc141, 0xc18d, 0xc273, 0xc359, 0xc445, 0xc491,
0xc577,
};
static const unsigned char uhc_2_2charset[3126] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0xe8, 0xe9, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0xca, 0xcb, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x38, 0x39, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe8, 0xe9, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0xe8, 0xe9, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0xca, 0xcb, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x38, 0x39, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe8, 0xe9, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
0xd0, 0xd1, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x28, 0x29, 0x2a, 0x2b,
0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0xe8, 0xe9, 0xea, 0xeb,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43,
0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0xc8, 0xc9, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5,
0x00, 0x01, 0x02, 0x03, 0x0a, 0x0b, 0x0c, 0x0d,
0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x26, 0x27, 0x28, 0x29, 0xca, 0xcb, 0xcc, 0xcd,
0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5,
0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb,
};
static const Summary16 uhc_2_uni2indx_pagec8[251] = {
/* 0xc800 */
{ 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 },
{ 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 }, { 0, 0x0000 },
{ 0, 0x0000 }, { 0, 0x0000 }, { 0, 0xfee0 }, { 10, 0xcfff },
{ 24, 0xeeef }, { 37, 0xfd4f }, { 49, 0xffec }, { 62, 0xcfdf },
/* 0xc900 */
{ 75, 0x4f8e }, { 84, 0xfefd }, { 98, 0xefff }, { 113, 0xffef },
{ 128, 0xffff }, { 144, 0xfeec }, { 156, 0xeff4 }, { 168, 0xefee },
{ 181, 0xecff }, { 194, 0xd4fe }, { 205, 0xffff }, { 221, 0xffff },
{ 237, 0xfa6c }, { 247, 0xc994 }, { 254, 0x4f6a }, { 263, 0xecfc },
/* 0xca00 */
{ 274, 0xc4fe }, { 284, 0xfeef }, { 298, 0xfdff }, { 313, 0xffff },
{ 329, 0xcfff }, { 343, 0x4fee }, { 354, 0xfefc }, { 367, 0xdfff },
{ 382, 0xffef }, { 397, 0xfeff }, { 412, 0xffff }, { 428, 0xcfff },
{ 442, 0x4fee }, { 453, 0xfcf5 }, { 465, 0xeffe }, { 479, 0xffef },
/* 0xcb00 */
{ 494, 0xfeff }, { 509, 0xfeee }, { 522, 0xfffc }, { 536, 0xffff },
{ 552, 0xecfd }, { 564, 0xdcfe }, { 576, 0xffef }, { 591, 0xfcff },
{ 605, 0xffff }, { 621, 0xefff }, { 636, 0xffff }, { 652, 0xfeff },
{ 667, 0xffff }, { 683, 0xffef }, { 698, 0xfd6f }, { 711, 0xffff },
/* 0xcc00 */
{ 727, 0xcfff }, { 741, 0xcfee }, { 753, 0xac79 }, { 762, 0x84fe },
{ 771, 0xeecf }, { 783, 0xfc4f }, { 794, 0xfeae }, { 806, 0xffde },
{ 820, 0xffff }, { 836, 0xecff }, { 849, 0xc4fe }, { 859, 0xeecf },
{ 871, 0xfd4f }, { 883, 0xffee }, { 897, 0xefef }, { 911, 0xfffe },
/* 0xcd00 */
{ 926, 0xecfd }, { 938, 0xd4fe }, { 949, 0xeeef }, { 962, 0xfdff },
{ 977, 0xffff }, { 993, 0xefff }, { 1008, 0x4fee }, { 1019, 0xfefd },
{ 1033, 0xfeff }, { 1048, 0xeecf }, { 1060, 0xfd4f }, { 1072, 0xfffe },
{ 1087, 0xefef }, { 1101, 0xfffe }, { 1116, 0xeeff }, { 1130, 0xd4fe },
/* 0xce00 */
{ 1141, 0xeeef }, { 1154, 0xfdef }, { 1168, 0xfeec }, { 1180, 0xffd4 },
{ 1192, 0xffff }, { 1208, 0x6cff }, { 1220, 0xd4fc }, { 1230, 0xeecf },
{ 1242, 0xfd4f }, { 1254, 0xfeec }, { 1266, 0xcfc4 }, { 1275, 0xffff },
{ 1291, 0xfffd }, { 1306, 0xffff }, { 1322, 0xe6cf }, { 1333, 0xfc4f },
/* 0xcf00 */
{ 1344, 0xfeec }, { 1356, 0xefd4 }, { 1367, 0x4fee }, { 1378, 0xfefc },
{ 1391, 0xffff }, { 1407, 0xeecf }, { 1419, 0xfd4f }, { 1431, 0xfeec },
{ 1443, 0xefde }, { 1456, 0xffff }, { 1472, 0xfefd }, { 1486, 0xfffe },
{ 1501, 0xffef }, { 1516, 0xffff }, { 1532, 0xfeec }, { 1544, 0xefd4 },
/* 0xd000 */
{ 1555, 0xffee }, { 1569, 0xfefd }, { 1583, 0xdfff }, { 1598, 0xeecf },
{ 1610, 0xfd4f }, { 1622, 0xfeee }, { 1635, 0xcffe }, { 1648, 0xcfee },
{ 1660, 0xfffd }, { 1675, 0xffff }, { 1691, 0xeecf }, { 1703, 0xfd4f },
{ 1715, 0xfcec }, { 1726, 0xcfc4 }, { 1735, 0x4fee }, { 1746, 0xfefc },
/* 0xd100 */
{ 1759, 0xdfff }, { 1774, 0xffff }, { 1790, 0xffff }, { 1806, 0xfaec },
{ 1817, 0xcfc4 }, { 1826, 0x4fee }, { 1837, 0xeefd }, { 1850, 0xefff },
{ 1865, 0xfeef }, { 1879, 0xffff }, { 1895, 0xfeec }, { 1907, 0xebd4 },
{ 1917, 0xfffe }, { 1932, 0xfeff }, { 1947, 0xffff }, { 1963, 0xfeef },
/* 0xd200 */
{ 1977, 0xfd7f }, { 1991, 0xfffe }, { 2006, 0xcfff }, { 2020, 0x4fee },
{ 2031, 0xfefd }, { 2045, 0xefff }, { 2060, 0xffef }, { 2075, 0xffff },
{ 2091, 0xfeec }, { 2103, 0xefdc }, { 2115, 0xefee }, { 2128, 0x6cfd },
{ 2139, 0xf4fa }, { 2150, 0xeeef }, { 2163, 0xffcf }, { 2177, 0xfeec },
/* 0xd300 */
{ 2189, 0x8fd4 }, { 2198, 0x4fae }, { 2208, 0xecdc }, { 2218, 0xc4fe },
{ 2228, 0xffcf }, { 2242, 0xffff }, { 2258, 0xffff }, { 2274, 0xcfff },
{ 2288, 0x4fee }, { 2299, 0xecfc }, { 2310, 0xd4fe }, { 2321, 0xeeef },
{ 2334, 0xfccf }, { 2346, 0xfefe }, { 2360, 0xcff5 }, { 2372, 0x4fee },
/* 0xd400 */
{ 2383, 0xfefd }, { 2397, 0xdfff }, { 2412, 0xffff }, { 2428, 0xffff },
{ 2444, 0xffee }, { 2458, 0xefff }, { 2473, 0x5fee }, { 2485, 0x6cff },
{ 2497, 0xd4fa }, { 2507, 0xffef }, { 2522, 0xfdff }, { 2537, 0xffff },
{ 2553, 0xefff }, { 2568, 0x6fee }, { 2580, 0xeeff }, { 2594, 0xd6fe },
/* 0xd500 */
{ 2606, 0xeeef }, { 2619, 0xff4f }, { 2632, 0xffff }, { 2648, 0xcfff },
{ 2662, 0x4fee }, { 2673, 0xecfd }, { 2685, 0xd4de }, { 2695, 0xeecf },
{ 2707, 0xfc4f }, { 2718, 0xfffe }, { 2733, 0xffdf }, { 2748, 0xffff },
{ 2764, 0xecff }, { 2777, 0xd4fa }, { 2787, 0xeecf }, { 2799, 0xfd4f },
/* 0xd600 */
{ 2811, 0xfeec }, { 2823, 0xefc4 }, { 2833, 0xdfee }, { 2846, 0xecff },
{ 2859, 0xd4de }, { 2869, 0xeecd }, { 2880, 0xfd7f }, { 2894, 0xffec },
{ 2907, 0xcfd7 }, { 2919, 0x5fee }, { 2931, 0xeefd }, { 2944, 0xf5fe },
{ 2957, 0xeecf }, { 2969, 0xfd6d }, { 2981, 0xfeee }, { 2994, 0xcfde },
/* 0xd700 */
{ 3006, 0xffee }, { 3020, 0xecfd }, { 3032, 0xd4fe }, { 3043, 0xeecf },
{ 3055, 0xfd6f }, { 3068, 0xfc2c }, { 3077, 0xedd4 }, { 3087, 0xcfee },
{ 3099, 0xecfd }, { 3111, 0xd4fe }, { 3122, 0x000f },
};
static int
uhc_2_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
if (n >= 2) {
if (wc >= 0xc800 && wc < 0xd7b0) {
const Summary16 *summary = &uhc_2_uni2indx_pagec8[(wc>>4)-0xc80];
unsigned short used = summary->used;
unsigned int i = wc & 0x0f;
if (used & ((unsigned short) 1 << i)) {
unsigned short c;
/* Keep in `used' only the bits 0..i-1. */
used &= ((unsigned short) 1 << i) - 1;
/* Add `summary->indx' and the number of bits set in `used'. */
used = (used & 0x5555) + ((used & 0xaaaa) >> 1);
used = (used & 0x3333) + ((used & 0xcccc) >> 2);
used = (used & 0x0f0f) + ((used & 0xf0f0) >> 4);
used = (used & 0x00ff) + (used >> 8);
used += summary->indx;
c = uhc_2_2charset_main[used>>6] + uhc_2_2charset[used];
r[0] = (c >> 8); r[1] = (c & 0xff);
return 2;
}
}
return RET_ILUNI;
}
return RET_TOOSMALL;
}
|
{
"pile_set_name": "Github"
}
|
function preInitModel( geometry, renderer, scene, object ) {
// pre-initialize buffers
renderer.initWebGLObjects( scene );
// this makes videos black
// pre-initialize shaders
var i, material;
for( i = 0; i < geometry.materials.length; i++ ) {
material = geometry.materials[ i ][ 0 ];
if ( ! ( material instanceof THREE.MeshFaceMaterial ) ) {
if( !material.program ) {
// dirty hack, otherwise some textures stay black
//setTimeout( function() { renderer.initMaterial( material, scene.lights, scene.fog, object ); }, 200 );
}
}
}
};
function preInitScene( result, renderer ) {
renderer.initWebGLObjects( result.scene );
var m, material;
for ( m in result.materials ) {
material = result.materials[ m ];
if ( ! ( material instanceof THREE.MeshFaceMaterial ) ) {
if( !material.program ) {
// dirty hack, otherwise some textures stay black
//setTimeout( function() { renderer.initMaterial( material, result.scene.lights, result.scene.fog ); }, 200 );
}
}
}
};
function preinitAnimal( animal, renderer, scene ) {
//console.log( animal );
renderer.initWebGLObjects( scene );
// this makes weird things
//var material = animal.mesh.materials[ 0 ];
//setTimeout( function() { renderer.initMaterial( material, scene.lights, scene.fog, animal.mesh ); }, 100 );
};
function initLensFlares( where, position, sx, sy ) {
var texture0 = THREE.ImageUtils.loadTexture( "files/textures/lensflare0.png" );
var texture1 = THREE.ImageUtils.loadTexture( "files/textures/lensflare2.png" );
var texture2 = THREE.ImageUtils.loadTexture( "files/textures/lensflare3.png" );
where.lensFlare = new THREE.LensFlare( texture0, 700, 0.0, THREE.AdditiveBlending );
where.lensFlare.add( texture1, 512, 0.0, THREE.AdditiveBlending );
where.lensFlare.add( texture1, 512, 0.0, THREE.AdditiveBlending );
where.lensFlare.add( texture1, 512, 0.0, THREE.AdditiveBlending );
where.lensFlare.add( texture2, 60, 0.6, THREE.AdditiveBlending );
where.lensFlare.add( texture2, 70, 0.7, THREE.AdditiveBlending );
where.lensFlare.add( texture2, 120, 0.9, THREE.AdditiveBlending );
where.lensFlare.add( texture2, 70, 1.0, THREE.AdditiveBlending );
where.lensFlare.customUpdateCallback = lensFlareUpdateCallback;
where.lensFlare.position.copy( position );
where.lensFlareRotate = new THREE.Object3D();
where.lensFlareRotate.addChild( where.lensFlare );
where.lensFlareRotate.rotation.x = sx * Math.PI / 180;
where.lensFlareRotate.rotation.y = sy * Math.PI / 180;
where.scene.addChild( where.lensFlareRotate );
};
function lensFlareUpdateCallback( object ) {
var flare, f, fl = object.lensFlares.length;
var vecX = -object.positionScreen.x * 2;
var vecY = -object.positionScreen.y * 2;
for( f = 0; f < fl; f++ ) {
flare = object.lensFlares[ f ];
flare.x = object.positionScreen.x + vecX * flare.distance;
flare.y = object.positionScreen.y + vecY * flare.distance;
flare.rotation = 0;
}
// hard coded stuff
object.lensFlares[ 2 ].y += 0.025;
object.lensFlares[ 3 ].rotation = object.positionScreen.x * 0.5 + 45 * Math.PI / 180;
};
function makeSceneStatic( scene ) {
var i, l, object;
for ( i = 0, l = scene.objects.length; i < l; i ++ ) {
object = scene.objects[ i ];
object.matrixAutoUpdate = false;
object.updateMatrix();
}
};
function hideColliders( scene ) {
var i, l, mesh;
for( i = 0, l = scene.collisions.colliders.length; i < l; i++ ) {
mesh = scene.collisions.colliders[ i ].mesh;
mesh.visible = false;
}
};
function applyMaterial( result, ids, material ) {
var i, id, n, l = ids.length;
for ( i = 0; i < l; i++ ) {
id = ids[ i ][ 0 ];
n = ids[ i ][ 1 ];
if ( result.objects[ id ] ) {
result.objects[ id ].geometry.materials[ n ][ 0 ] = material;
}
}
};
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2013-2020 GraphAware
*
* This file is part of the GraphAware Framework.
*
* GraphAware Framework is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of
* the GNU General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
package com.graphaware.runtime.metadata;
import com.graphaware.common.kv.GraphKeyValueStore;
import com.graphaware.common.kv.KeyValueStore;
import com.graphaware.common.serialize.Serializer;
import com.graphaware.runtime.config.RuntimeConfiguration;
import com.graphaware.runtime.module.RuntimeModule;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import org.neo4j.logging.Log;
import com.graphaware.common.log.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* {@link ModuleMetadataRepository} backed by a {@link org.neo4j.kernel.impl.core.GraphProperties}.
*/
public class GraphPropertiesMetadataRepository implements ModuleMetadataRepository {
private static final Log LOG = LoggerFactory.getLogger(GraphPropertiesMetadataRepository.class);
private final GraphDatabaseService database;
private final KeyValueStore keyValueStore;
private final String propertyPrefix;
/**
* Create a new repository.
*
* @param database to back the repository.
* @param configuration of the runtime.
* @param propertyPrefix String with which the property keys of properties written by this repository will be prefixed.
*/
public GraphPropertiesMetadataRepository(GraphDatabaseService database, RuntimeConfiguration configuration, String propertyPrefix) {
this.database = database;
this.propertyPrefix = configuration.createPrefix(propertyPrefix);
this.keyValueStore = new GraphKeyValueStore(database);
}
/**
* {@inheritDoc}
*/
@Override
public <M extends ModuleMetadata> M getModuleMetadata(RuntimeModule module) {
return getModuleMetadata(module.getId());
}
/**
* {@inheritDoc}
*/
@Override
public <M extends ModuleMetadata> M getModuleMetadata(String moduleId) {
final String key = moduleKey(moduleId);
Map<String, Object> internalProperties = getInternalProperties();
try {
byte[] serializedMetadata = (byte[]) internalProperties.get(key);
if (serializedMetadata == null) {
return null;
}
return Serializer.fromByteArray(serializedMetadata);
} catch (Exception e) {
removeModuleMetadata(moduleId);
LOG.error("Could not deserialize metadata for module ID " + moduleId);
throw new CorruptMetadataException(e);
}
}
/**
* {@inheritDoc}
*/
@Override
public <M extends ModuleMetadata> void persistModuleMetadata(RuntimeModule module, M metadata) {
persistModuleMetadata(module.getId(), metadata);
}
/**
* {@inheritDoc}
*/
@Override
public <M extends ModuleMetadata> void persistModuleMetadata(String moduleId, M metadata) {
try (Transaction tx = database.beginTx()) {
keyValueStore.set(moduleKey(moduleId), Serializer.toByteArray(metadata));
tx.success();
}
}
/**
* {@inheritDoc}
*/
@Override
public Set<String> getAllModuleIds() {
return getInternalProperties().keySet().stream().map(key -> key.replace(propertyPrefix, "")).collect(Collectors.toSet());
}
/**
* {@inheritDoc}
*/
@Override
public void removeModuleMetadata(String moduleId) {
try (Transaction tx = database.beginTx()) {
keyValueStore.remove(moduleKey(moduleId));
tx.success();
}
}
/**
* Get properties starting with {@link #propertyPrefix} from a {@link com.graphaware.common.kv.KeyValueStore}.
*
* @return map of properties (key-value).
*/
private Map<String, Object> getInternalProperties() {
Map<String, Object> result = new HashMap<>();
try (Transaction tx = database.beginTx()) {
for (String key : keyValueStore.getKeys()) {
if (key.startsWith(propertyPrefix)) {
result.put(key, keyValueStore.get(key));
}
}
tx.success();
}
return result;
}
/**
* Build a module key to use as a property on the metadata container for storing metadata.
*
* @param moduleId to build a key for.
* @return module key.
*/
protected final String moduleKey(String moduleId) {
return propertyPrefix + moduleId;
}
}
|
{
"pile_set_name": "Github"
}
|
# Purpose: Installs the Windows Splunk Technial Add-On
# Note: This only needs to be installed on the WEF server
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Installing the Windows TA for Splunk"
If (test-path "C:\Program Files\SplunkUniversalForwarder\etc\apps\Splunk_TA_windows\default") {
Write-Host "Windows TA is already installed. Moving on."
Exit
}
# Install Windows TA (this only needs to be done on the WEF server)
$windowstaPath = "C:\vagrant\resources\splunk_forwarder\splunk-add-on-for-microsoft-windows_500.tgz"
$inputsPath = "C:\Program Files\SplunkUniversalForwarder\etc\apps\Splunk_TA_windows\local\inputs.conf"
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Installing the Windows TA"
Start-Process -FilePath "C:\Program Files\SplunkUniversalForwarder\bin\splunk.exe" -ArgumentList "install app $windowstaPath -auth admin:changeme" -NoNewWindow
# Create local directory
New-Item -ItemType Directory -Force -Path "C:\Program Files\SplunkUniversalForwarder\etc\apps\Splunk_TA_windows\local"
Copy-Item c:\vagrant\resources\splunk_forwarder\wef_inputs.conf $inputsPath
# Add a check here to make sure the TA was installed correctly
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Sleeping for 15 seconds"
start-sleep -s 15
If (test-path "C:\Program Files\SplunkUniversalForwarder\etc\apps\Splunk_TA_windows\default") {
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Windows TA installed successfully."
} Else {
Write-Host "Something went wrong during installation."
exit 1
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.