text
stringlengths 2
100k
| meta
dict |
---|---|
"""
ldap.resiter - processing LDAP results with iterators
See http://www.python-ldap.org/ for details.
\$Id: resiter.py,v 1.6 2011/07/28 08:23:32 stroeder Exp $
Python compability note:
Requires Python 2.3+
"""
class ResultProcessor:
"""
Mix-in class used with ldap.ldapopbject.LDAPObject or derived classes.
"""
def allresults(self,msgid,timeout=-1):
"""
Generator function which returns an iterator for processing all LDAP operation
results of the given msgid retrieved with LDAPObject.result3() -> 4-tuple
"""
result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
while result_type and result_list:
# Loop over list of search results
for result_item in result_list:
yield (result_type,result_list,result_msgid,result_serverctrls)
result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
return # allresults()
| {
"pile_set_name": "Github"
} |
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PowerPointAuto", "PowerPointAuto.vbproj", "{3072B531-D1F5-4310-B6E2-7EAFA325EFAA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3072B531-D1F5-4310-B6E2-7EAFA325EFAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3072B531-D1F5-4310-B6E2-7EAFA325EFAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3072B531-D1F5-4310-B6E2-7EAFA325EFAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3072B531-D1F5-4310-B6E2-7EAFA325EFAA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
import os
import requests
import time
from .. import base
from girder import config
from girder.api import access
from girder.api.rest import Resource, iterBody
_chunks = []
os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
config.loadConfig() # Must reload config to pickup correct port
def setUpModule():
server = base.startServer(mock=False)
server.root.api.v1.stream_test = StreamTestResource()
def tearDownModule():
base.stopServer()
class StreamTestResource(Resource):
def __init__(self):
super().__init__()
self.resourceName = 'stream_test'
self.route('POST', ('input_stream',), self.inputStream)
@access.public
def inputStream(self, params):
# Read body 5 bytes at a time so we can test chunking a small body
strictLength = self.boolParam('strictLength', params, False)
for chunk in iterBody(5, strictLength=strictLength):
_chunks.append(chunk.decode())
return _chunks
class StreamTestCase(base.TestCase):
def setUp(self):
super().setUp()
global _chunks
_chunks = []
self.apiUrl = 'http://localhost:%s/api/v1' % os.environ['GIRDER_PORT']
def _genChunks(self, strictLength=False):
"""
Passing a generator to requests.request as the data argument causes
a chunked transfer encoding, where each yielded buffer is sent as
a separate chunk.
"""
for i in range(1, 4):
buf = 'chunk%d' % i
yield buf.encode()
start = time.time()
while len(_chunks) != i:
time.sleep(.1)
# Wait for server thread to read the chunk
if time.time() - start > 5:
print('ERROR: Timeout waiting for chunk %d' % i)
return
if not strictLength:
self.assertEqual(len(_chunks), i)
self.assertEqual(_chunks[-1], buf)
def testChunkedTransferEncoding(self):
"""
This test verifies that chunked transfer encoding bodies are received
as the chunks are sent, rather than waiting for the final chunk to
be sent.
"""
resp = requests.post(self.apiUrl + '/stream_test/input_stream',
data=self._genChunks(False))
if resp.status_code != 200:
print(resp.json())
raise Exception('Server returned exception status %s' %
resp.status_code)
self.assertEqual(resp.json(), ['chunk1', 'chunk2', 'chunk3'])
def testStrictLength(self):
"""
Tests the strictLength=True behavior using a chunked transfer encoding.
"""
resp = requests.post(
self.apiUrl + '/stream_test/input_stream', params={
'strictLength': True
}, data=self._genChunks(True))
if resp.status_code != 200:
print(resp.json())
raise Exception('Server returned exception status %s' %
resp.status_code)
self.assertEqual(resp.json(), ['chunk', '1chun', 'k2chu', 'nk3'])
def testKnownLengthBodyReady(self):
"""
This exercises the behavior of iterBody in the case of requests with
Content-Length passed.
"""
resp = requests.post(self.apiUrl + '/stream_test/input_stream',
data='hello world')
resp.raise_for_status()
self.assertEqual(resp.json(), ['hello', ' worl', 'd'])
| {
"pile_set_name": "Github"
} |
//
// FILE: AM2322.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.1
// PURPOSE: demo sketch for AM2322 I2C humidity & temperature sensor
//
// HISTORY:
// 0.1.0 2017-12-11 initial version
// 0.1.1 2020-05-03 updated to 0.2.0 version of lib.
//
#include <AM232X.h>
AM232X AM2322;
void setup()
{
Wire.begin();
Serial.begin(115200);
Serial.println(__FILE__);
Serial.print("LIBRARY VERSION: ");
Serial.println(AM232X_LIB_VERSION);
Serial.println();
Serial.println("Type,\tStatus,\tHumidity (%),\tTemperature (C)");
}
void loop()
{
// READ DATA
Serial.print("AM2322, \t");
int status = AM2322.read();
switch (status)
{
case AM232X_OK:
Serial.print("OK,\t");
break;
default:
Serial.print(status);
Serial.print("\t");
break;
}
// DISPLAY DATA, sensor only returns one decimal.
Serial.print(AM2322.getHumidity(), 1);
Serial.print(",\t");
Serial.println(AM2322.getTemperature(), 1);
delay(2000);
}
// -- END OF FILE --
| {
"pile_set_name": "Github"
} |
var baseKeys = require('./_baseKeys'),
getTag = require('./_getTag'),
isArguments = require('./isArguments'),
isArray = require('./isArray'),
isArrayLike = require('./isArrayLike'),
isBuffer = require('./isBuffer'),
isPrototype = require('./_isPrototype'),
isTypedArray = require('./isTypedArray');
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (isPrototype(value)) {
return !baseKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
module.exports = isEmpty;
| {
"pile_set_name": "Github"
} |
# mgptfast = MPI with its default compiler, optimizations for USER-MGPT
SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
CC = mpicxx
CCFLAGS = -O3 -msse3 -funroll-loops
SHFLAGS = -fPIC
DEPFLAGS = -M
LINK = mpicxx
LINKFLAGS = -g -O
LIB =
SIZE = size
ARCHIVE = ar
ARFLAGS = -rc
SHLIBFLAGS = -shared
# ---------------------------------------------------------------------
# LAMMPS-specific settings, all OPTIONAL
# specify settings for LAMMPS features you will use
# if you change any -D setting, do full re-compile after "make clean"
# LAMMPS ifdef settings
# see possible settings in Section 3.5 of the manual
LMP_INC = -DLAMMPS_GZIP
# MPI library
# see discussion in Section 3.4 of the manual
# MPI wrapper compiler/linker can provide this info
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library
MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1
MPI_PATH =
MPI_LIB =
# FFT library
# see discussion in Section 3.5.2 of manual
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library
FFT_INC =
FFT_PATH =
FFT_LIB =
# JPEG and/or PNG library
# see discussion in Section 3.5.4 of manual
# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC
# INC = path(s) for jpeglib.h and/or png.h
# PATH = path(s) for JPEG library and/or PNG library
# LIB = name(s) of JPEG library and/or PNG library
JPG_INC =
JPG_PATH =
JPG_LIB =
# ---------------------------------------------------------------------
# build rules and dependencies
# do not edit this section
include Makefile.package.settings
include Makefile.package
EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
EXTRA_CPP_DEPENDS = $(PKG_CPP_DEPENDS)
EXTRA_LINK_DEPENDS = $(PKG_LINK_DEPENDS)
# Path to src files
vpath %.cpp ..
vpath %.h ..
# Link target
$(EXE): main.o $(LMPLIB) $(EXTRA_LINK_DEPENDS)
$(LINK) $(LINKFLAGS) main.o $(EXTRA_PATH) $(LMPLINK) $(EXTRA_LIB) $(LIB) -o $@
$(SIZE) $@
# Library targets
$(ARLIB): $(OBJ) $(EXTRA_LINK_DEPENDS)
@rm -f ../$(ARLIB)
$(ARCHIVE) $(ARFLAGS) ../$(ARLIB) $(OBJ)
@rm -f $(ARLIB)
@ln -s ../$(ARLIB) $(ARLIB)
$(SHLIB): $(OBJ) $(EXTRA_LINK_DEPENDS)
$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o ../$(SHLIB) \
$(OBJ) $(EXTRA_LIB) $(LIB)
@rm -f $(SHLIB)
@ln -s ../$(SHLIB) $(SHLIB)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<
# Individual dependencies
depend : fastdep.exe $(SRC)
@./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1
fastdep.exe: ../DEPEND/fastdep.c
cc -O -o $@ $<
sinclude .depend
| {
"pile_set_name": "Github"
} |
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakePodTemplates implements PodTemplateInterface
type FakePodTemplates struct {
Fake *FakeCoreV1
ns string
}
var podtemplatesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "podtemplates"}
var podtemplatesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PodTemplate"}
// Get takes name of the podTemplate, and returns the corresponding podTemplate object, and an error if there is any.
func (c *FakePodTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.PodTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(podtemplatesResource, c.ns, name), &corev1.PodTemplate{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PodTemplate), err
}
// List takes label and field selectors, and returns the list of PodTemplates that match those selectors.
func (c *FakePodTemplates) List(ctx context.Context, opts v1.ListOptions) (result *corev1.PodTemplateList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podtemplatesResource, podtemplatesKind, c.ns, opts), &corev1.PodTemplateList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &corev1.PodTemplateList{ListMeta: obj.(*corev1.PodTemplateList).ListMeta}
for _, item := range obj.(*corev1.PodTemplateList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested podTemplates.
func (c *FakePodTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(podtemplatesResource, c.ns, opts))
}
// Create takes the representation of a podTemplate and creates it. Returns the server's representation of the podTemplate, and an error, if there is any.
func (c *FakePodTemplates) Create(ctx context.Context, podTemplate *corev1.PodTemplate, opts v1.CreateOptions) (result *corev1.PodTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podtemplatesResource, c.ns, podTemplate), &corev1.PodTemplate{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PodTemplate), err
}
// Update takes the representation of a podTemplate and updates it. Returns the server's representation of the podTemplate, and an error, if there is any.
func (c *FakePodTemplates) Update(ctx context.Context, podTemplate *corev1.PodTemplate, opts v1.UpdateOptions) (result *corev1.PodTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podtemplatesResource, c.ns, podTemplate), &corev1.PodTemplate{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PodTemplate), err
}
// Delete takes name of the podTemplate and deletes it. Returns an error if one occurs.
func (c *FakePodTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podtemplatesResource, c.ns, name), &corev1.PodTemplate{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podtemplatesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.PodTemplateList{})
return err
}
// Patch applies the patch and returns the patched podTemplate.
func (c *FakePodTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.PodTemplate, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, name, pt, data, subresources...), &corev1.PodTemplate{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PodTemplate), err
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
li.rogue {background: url(../access_violation.php);}
li.test {background: url(../../access_violation.php);}
| {
"pile_set_name": "Github"
} |
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by lib/unicore/mktables from the Unicode
# database, Version 6.2.0. Any changes made here will be lost!
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by core Perl only. The format and even the
# name or existence of this file are subject to change without notice. Don't
# use it directly.
return <<'END';
05BF
END
| {
"pile_set_name": "Github"
} |
//==================================================================================
// Copyright (c) 2016 , Advanced Micro Devices, Inc. All rights reserved.
//
/// \author AMD Developer Tools Team
/// \file csImagesAndBuffersMonitor.h
///
//==================================================================================
//------------------------------ csImagesAndBuffersMonitor.h ------------------------------
#ifndef __CSIMAGESANDBUFFERSMONITOR_H
#define __CSIMAGESANDBUFFERSMONITOR_H
// Infra:
#include <AMDTBaseTools/Include/gtPtrVector.h>
#include <AMDTOSWrappers/Include/osCriticalSection.h>
#include <AMDTAPIClasses/Include/apCLBuffer.h>
#include <AMDTAPIClasses/Include/apCLSubBuffer.h>
#include <AMDTAPIClasses/Include/apCLImage.h>
#include <AMDTAPIClasses/Include/apCLPipe.h>
#include <AMDTAPIClasses/Include/apTextureType.h>
// ----------------------------------------------------------------------------------
// Class Name: csImagesAndBuffersMonitor
// General Description:
// Monitors OpenCL buffers created within an OpenCL context.
//
// Author: Yaki Tebeka
// Creation Date: 18/11/2009
// ----------------------------------------------------------------------------------
class csImagesAndBuffersMonitor
{
public:
csImagesAndBuffersMonitor();
virtual ~csImagesAndBuffersMonitor();
// Events:
void onBufferCreation(cl_mem bufferMemoryHandle, cl_mem_flags flags, size_t size);
void onSubBufferCreation(cl_mem subBufferMemoryHandle, cl_mem bufferMemoryHandle, cl_mem_flags flags, cl_buffer_create_type buffer_create_type, const void* buffer_create_info);
void onBufferCreationFromGLVBO(cl_mem bufferMemoryHandle, cl_mem_flags flags, GLuint bufobj);
void onBufferCreationFromDirectX(cl_mem bufferMemoryHandle, cl_mem_flags flags);
void onPipeCreation(cl_mem pipeMemoryHandle, cl_mem_flags flags, cl_uint packetSize, cl_uint maxPackets);
void onImageCreation(cl_mem textureHandle, const cl_image_format* pCLImageFormat, cl_mem_flags flags, apTextureType textureType, gtSize_t width, gtSize_t height, gtSize_t depth);
void onImageCreation(cl_mem textureHandle, const cl_image_format* pCLImageFormat, cl_mem_flags flags, const cl_image_desc* pImageDesc);
void onImageCreationFromGLTexture(cl_mem textureHandle, cl_mem_flags flags, GLenum target, GLint miplevel, GLuint texture);
void onImageCreationFromGL2DTexture(cl_mem textureHandle, cl_mem_flags flags, apTextureType textureType, GLenum target, GLint miplevel, GLuint texture);
void onTextureCreationFromGL3DTexture(cl_mem textureHandle, cl_mem_flags flags, apTextureType textureType, GLenum target, GLint miplevel, GLuint texture);
void onTextureCreationFromGLRenderbuffer(cl_mem textureHandle, cl_mem_flags flags, apTextureType textureType, GLuint renderbuffer);
void onImageCreationFromDirectX(cl_mem textureHandle, cl_mem_flags flags, apTextureType textureType);
void onMemObjectMarkedForDeletion(cl_mem memobj);
// Reference count checking:
void checkForReleasedObjects();
// Update functions:
bool updateBufferRawData(int bufferId);
bool updateSubBufferRawData(int subBufferId);
bool updateTextureRawData(int textureId);
bool updateContextDataSnapshot();
// Spy context id:
void setSpyContextId(int spyContextId) {_spyContextId = spyContextId;};
// OpenCL Version:
void setContextOpenCLVersion(int majorVersion, int minorVersion);
// General mem object details:
const apCLMemObject* getMemObjectDetails(oaCLMemHandle memObjHandle) const;
apCLMemObject* getMemObjectDetails(oaCLMemHandle memObjHandle);
apCLMemObject* getMemObjectDetails(oaCLMemHandle memObjHandle, int& memoryObjectIndex) const ;
// Buffers details:
int amountOfBuffers() const;
const apCLBuffer* bufferDetails(int bufferId) const;
apCLBuffer* bufferDetails(int bufferId);
int bufferObjectMonitorIndex(int bufferName) const;
// Sub Buffers details:
const apCLSubBuffer* subBufferDetails(int subBufferName) const;
apCLSubBuffer* subBufferDetails(int subBufferName);
// Texture details:
int amountOfImages() const;
const apCLImage* imageDetails(int textureId) const;
apCLImage* imageDetails(int textureId);
int imageObjectMonitorIndex(int textureName) const;
// Pipes details:
int amountOfPipes() const;
const apCLPipe* pipeDetails(int pipeId) const;
apCLPipe* pipeDetails(int pipeId);
int pipeObjectMonitorIndex(int pipeName) const;
// Memory:
bool calculateBuffersMemorySize(gtUInt64& buffersMemorySize) const;
bool calculateImagesMemorySize(gtUInt64& texturesMemorySize) const;
bool calculatePipesMemorySize(gtUInt64& pipesMemorySize) const;
// OpenGL interoperability:
bool handleImageShareWithGLTexture(apCLImage* pTextureObject, int clTextureIndex, GLenum target, GLint miplevel, GLuint texture);
bool handleImageShareWithGLRenderBuffer(apCLImage* pTextureObject, int clTextureIndex, GLuint renderbuffer);
bool handleBufferShareWithGLVBO(apCLBuffer* pBufferObject, int clBufferIndex, GLuint glVBOName);
// Memory object deletion callback:
static void CL_CALLBACK onMemoryObjectDeletion(cl_mem memobj, void* user_data);
bool onMemoryObjectDeletion(cl_mem memobj);
void onMemObjectDestructorCallbackSet(oaCLMemHandle hMem, osProcedureAddress64 pfnNotify, osProcedureAddress64 userData);
private:
// Raw data file path:
void generateRawDataFilePath(int bufferId, osFilePath& bufferFilePath, bool isBuffer) const;
// Command Queue:
bool initializeCommandQueue();
bool destroyCommandQueue();
private:
// Spy context id:
int _spyContextId;
// Contains true iff our context supports clSetMemObjectDestructorCallback:
bool _isMemObjectDestructorCallbackSupported;
// Prevents objects from being accesses while other objects are deleted:
osCriticalSection _memObjectDeletionCS;
// A vector containing buffer monitors:
gtPtrVector<apCLBuffer*> _bufferMonitors;
// A vector containing buffer monitors:
gtPtrVector<apCLSubBuffer*> _subBufferMonitors;
// The first index free for buffer name:
int _nextFreeBufferName;
// The first index free for sub buffer name:
int _nextFreeSubBufferName;
// Maps buffer name to the buffer vector index:
gtMap<int, int> _bufferNameToIndexMap;
// A vector containing texture monitors:
gtPtrVector<apCLImage*> _imagesMonitors;
// The first index free for texture name:
int _nextFreeImageName;
// Maps texture name to the texture vector index:
gtMap<int, int> _imageNameToIndexMap;
// A vector containing pipe monitors:
gtPtrVector<apCLPipe*> m_pipeMonitors;
// The first index free for pipe name:
int m_nextFreePipeName;
// Maps pipe name to the pipe vector index:
gtMap<int, int> m_pipeNameToIndexMap;
// Get a command queue handle that is used for buffer reading:
oaCLCommandQueueHandle _commandQueue;
};
#endif //__CSIMAGESANDBUFFERSMONITOR_H
| {
"pile_set_name": "Github"
} |
#region LICENSE
// The contents of this file are subject to the Common Public Attribution
// License Version 1.0. (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// https://github.com/NiclasOlofsson/MiNET/blob/master/LICENSE.
// The License is based on the Mozilla Public License Version 1.1, but Sections 14
// and 15 have been added to cover use of software over a computer network and
// provide for limited attribution for the Original Developer. In addition, Exhibit A has
// been modified to be consistent with Exhibit B.
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
// the specific language governing rights and limitations under the License.
//
// The Original Code is MiNET.
//
// The Original Developer is the Initial Developer. The Initial Developer of
// the Original Code is Niclas Olofsson.
//
// All portions of the code written by Niclas Olofsson are Copyright (c) 2014-2020 Niclas Olofsson.
// All Rights Reserved.
#endregion
namespace MiNET.Items
{
public class ItemHorseArmorLeather : Item
{
public ItemHorseArmorLeather() : base("minecraft:horsearmorleather", 416)
{
MaxStackSize = 1;
ItemType = ItemType.Chestplate;
ItemMaterial = ItemMaterial.Leather;
}
}
public class ItemHorseArmorIron : Item
{
public ItemHorseArmorIron() : base("minecraft:horsearmoriron", 417)
{
MaxStackSize = 1;
ItemType = ItemType.Chestplate;
ItemMaterial = ItemMaterial.Iron;
}
}
public class ItemHorseArmorGold : Item
{
public ItemHorseArmorGold() : base("minecraft:horsearmoriron", 417)
{
MaxStackSize = 1;
ItemType = ItemType.Chestplate;
ItemMaterial = ItemMaterial.Gold;
}
}
public class ItemHorseArmorDiamond : Item
{
public ItemHorseArmorDiamond() : base("minecraft:horsearmordiamond", 419)
{
MaxStackSize = 1;
ItemType = ItemType.Chestplate;
ItemMaterial = ItemMaterial.Diamond;
}
}
} | {
"pile_set_name": "Github"
} |
const Const = x => ({
x,
map : fn => Const(x),
})
export function view(lens, target){
if (arguments.length === 1) return _target => view(lens, _target)
return lens(Const)(target).x
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.Linq;
using HA4IoT.Contracts.Areas;
using HA4IoT.Contracts.Automations;
using HA4IoT.Contracts.Components;
using HA4IoT.Contracts.Components.Exceptions;
using HA4IoT.Contracts.Settings;
namespace HA4IoT.Areas
{
public class Area : IArea
{
private readonly Dictionary<string, IComponent> _components = new Dictionary<string, IComponent>();
private readonly Dictionary<string, IAutomation> _automations = new Dictionary<string, IAutomation>();
private readonly IComponentRegistryService _componentService;
private readonly IAutomationRegistryService _automationService;
public Area(string id, IComponentRegistryService componentService, IAutomationRegistryService automationService, ISettingsService settingsService)
{
if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
_componentService = componentService ?? throw new ArgumentNullException(nameof(componentService));
_automationService = automationService ?? throw new ArgumentNullException(nameof(automationService));
Id = id;
settingsService.CreateSettingsMonitor(this, s => Settings = s.NewSettings);
}
public string Id { get; }
public AreaSettings Settings { get; private set; }
public void RegisterComponent(IComponent component)
{
if (component == null) throw new ArgumentNullException(nameof(component));
lock (_components)
{
_components.Add(component.Id, component);
}
_componentService.RegisterComponent(component);
}
public void RegisterAutomation(IAutomation automation)
{
lock (_automations)
{
_automations.Add(automation.Id, automation);
}
_automationService.AddAutomation(automation);
}
public IList<IComponent> GetComponents()
{
lock (_components)
{
return _components.Values.ToList();
}
}
public IList<TComponent> GetComponents<TComponent>() where TComponent : IComponent
{
lock (_components)
{
return _components.Values.OfType<TComponent>().ToList();
}
}
public bool ContainsComponent(string id)
{
if (id == null) throw new ArgumentNullException(nameof(id));
lock (_components)
{
return _components.ContainsKey(id);
}
}
public IComponent GetComponent(string id)
{
if (id == null) throw new ArgumentNullException(nameof(id));
lock (_components)
{
return _components[id];
}
}
public TComponent GetComponent<TComponent>(string id) where TComponent : IComponent
{
if (!ContainsComponent(id)) throw new ComponentNotFoundException(id);
lock (_components)
{
return (TComponent) _components[id];
}
}
public IList<IAutomation> GetAutomations()
{
return _automations.Values.ToList();
}
}
} | {
"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.shardingsphere.example.orchestration.raw.jdbc.config.local;
import com.google.common.collect.Lists;
import org.apache.shardingsphere.example.algorithm.PreciseModuloShardingDatabaseAlgorithm;
import org.apache.shardingsphere.example.algorithm.PreciseModuloShardingTableAlgorithm;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.api.config.masterslave.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.api.config.sharding.KeyGeneratorConfiguration;
import org.apache.shardingsphere.api.config.sharding.ShardingRuleConfiguration;
import org.apache.shardingsphere.api.config.sharding.TableRuleConfiguration;
import org.apache.shardingsphere.api.config.sharding.strategy.StandardShardingStrategyConfiguration;
import org.apache.shardingsphere.orchestration.config.OrchestrationConfiguration;
import org.apache.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration;
import org.apache.shardingsphere.shardingjdbc.orchestration.api.OrchestrationShardingDataSourceFactory;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
public final class LocalShardingMasterSlaveConfiguration implements ExampleConfiguration {
private final RegistryCenterConfiguration registryCenterConfig;
public LocalShardingMasterSlaveConfiguration(final RegistryCenterConfiguration registryCenterConfig) {
this.registryCenterConfig = registryCenterConfig;
}
@Override
public DataSource getDataSource() throws SQLException {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTableRuleConfigs().add(getOrderTableRuleConfiguration());
shardingRuleConfig.getTableRuleConfigs().add(getOrderItemTableRuleConfiguration());
shardingRuleConfig.getBindingTableGroups().add("t_order, t_order_item");
shardingRuleConfig.getBroadcastTables().add("t_address");
shardingRuleConfig.setDefaultDatabaseShardingStrategyConfig(new StandardShardingStrategyConfiguration("user_id", new PreciseModuloShardingDatabaseAlgorithm()));
shardingRuleConfig.setDefaultTableShardingStrategyConfig(new StandardShardingStrategyConfiguration("order_id", new PreciseModuloShardingTableAlgorithm()));
shardingRuleConfig.setMasterSlaveRuleConfigs(getMasterSlaveRuleConfigurations());
OrchestrationConfiguration orchestrationConfig = new OrchestrationConfiguration("orchestration-sharding-master-slave-data-source", registryCenterConfig, true);
return OrchestrationShardingDataSourceFactory.createDataSource(createDataSourceMap(), shardingRuleConfig, new Properties(), orchestrationConfig);
}
private TableRuleConfiguration getOrderTableRuleConfiguration() {
TableRuleConfiguration result = new TableRuleConfiguration("t_order", "ds_${0..1}.t_order_${[0, 1]}");
result.setKeyGeneratorConfig(getKeyGeneratorConfiguration());
return result;
}
private TableRuleConfiguration getOrderItemTableRuleConfiguration() {
return new TableRuleConfiguration("t_order_item", "ds_${0..1}.t_order_item_${[0, 1]}");
}
private List<MasterSlaveRuleConfiguration> getMasterSlaveRuleConfigurations() {
MasterSlaveRuleConfiguration masterSlaveRuleConfig1 = new MasterSlaveRuleConfiguration("ds_0", "demo_ds_master_0", Arrays.asList("demo_ds_master_0_slave_0", "demo_ds_master_0_slave_1"));
MasterSlaveRuleConfiguration masterSlaveRuleConfig2 = new MasterSlaveRuleConfiguration("ds_1", "demo_ds_master_1", Arrays.asList("demo_ds_master_1_slave_0", "demo_ds_master_1_slave_1"));
return Lists.newArrayList(masterSlaveRuleConfig1, masterSlaveRuleConfig2);
}
private Map<String, DataSource> createDataSourceMap() {
final Map<String, DataSource> result = new HashMap<>();
result.put("demo_ds_master_0", DataSourceUtil.createDataSource("demo_ds_master_0"));
result.put("demo_ds_master_0_slave_0", DataSourceUtil.createDataSource("demo_ds_master_0_slave_0"));
result.put("demo_ds_master_0_slave_1", DataSourceUtil.createDataSource("demo_ds_master_0_slave_1"));
result.put("demo_ds_master_1", DataSourceUtil.createDataSource("demo_ds_master_1"));
result.put("demo_ds_master_1_slave_0", DataSourceUtil.createDataSource("demo_ds_master_1_slave_0"));
result.put("demo_ds_master_1_slave_1", DataSourceUtil.createDataSource("demo_ds_master_1_slave_1"));
return result;
}
private static KeyGeneratorConfiguration getKeyGeneratorConfiguration() {
Properties properties = new Properties();
properties.setProperty("worker.id", "123");
return new KeyGeneratorConfiguration("SNOWFLAKE", "order_id", properties);
}
}
| {
"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
zu{
Countries{
001{"umhlaba"}
002{"i-Africa"}
003{"i-North America"}
005{"i-South America"}
009{"i-Oceania"}
011{"i-Western Africa"}
013{"i-Central America"}
014{"i-Eastern Africa"}
015{"i-Northern Africa"}
017{"i-Middle Africa"}
018{"i-Southern Africa"}
019{"i-Americas"}
021{"i-Northern America"}
029{"i-Caribbean"}
030{"i-Eastern Asia"}
034{"i-Southern Asia"}
035{"i-South-Eastern Asia"}
039{"i-Southern Europe"}
053{"i-Australasia"}
054{"i-Melanesia"}
057{"i-Micronesian Region"}
061{"i-Polynesia"}
142{"i-Asia"}
143{"i-Central Asia"}
145{"i-Western Asia"}
150{"i-Europe"}
151{"i-Eastern Europe"}
154{"i-Northern Europe"}
155{"i-Western Europe"}
202{"Sub-Saharan Africa"}
419{"i-Latin America"}
AC{"i-Ascension Island"}
AD{"i-Andorra"}
AE{"i-United Arab Emirates"}
AF{"i-Afghanistan"}
AG{"i-Antigua ne-Barbuda"}
AI{"i-Anguilla"}
AL{"i-Albania"}
AM{"i-Armenia"}
AO{"i-Angola"}
AQ{"i-Antarctica"}
AR{"i-Argentina"}
AS{"i-American Samoa"}
AT{"i-Austria"}
AU{"i-Australia"}
AW{"i-Aruba"}
AX{"i-Åland Islands"}
AZ{"i-Azerbaijan"}
BA{"i-Bosnia ne-Herzegovina"}
BB{"i-Barbados"}
BD{"i-Bangladesh"}
BE{"i-Belgium"}
BF{"i-Burkina Faso"}
BG{"i-Bulgaria"}
BH{"i-Bahrain"}
BI{"i-Burundi"}
BJ{"i-Benin"}
BL{"i-Saint Barthélemy"}
BM{"i-Bermuda"}
BN{"i-Brunei"}
BO{"i-Bolivia"}
BQ{"i-Caribbean Netherlands"}
BR{"i-Brazil"}
BS{"i-Bahamas"}
BT{"i-Bhutan"}
BV{"i-Bouvet Island"}
BW{"iBotswana"}
BY{"i-Belarus"}
BZ{"i-Belize"}
CA{"i-Canada"}
CC{"i-Cocos (Keeling) Islands"}
CD{"i-Congo - Kinshasa"}
CF{"i-Central African Republic"}
CG{"i-Congo - Brazzaville"}
CH{"i-Switzerland"}
CI{"i-Côte d’Ivoire"}
CK{"i-Cook Islands"}
CL{"i-Chile"}
CM{"i-Cameroon"}
CN{"i-China"}
CO{"i-Colombia"}
CP{"i-Clipperton Island"}
CR{"i-Costa Rica"}
CU{"i-Cuba"}
CV{"i-Cape Verde"}
CW{"i-Curaçao"}
CX{"i-Christmas Island"}
CY{"i-Cyprus"}
CZ{"i-Czechia"}
DE{"i-Germany"}
DG{"i-Diego Garcia"}
DJ{"i-Djibouti"}
DK{"i-Denmark"}
DM{"i-Dominica"}
DO{"i-Dominican Republic"}
DZ{"i-Algeria"}
EA{"i-Cueta ne-Melilla"}
EC{"i-Ecuador"}
EE{"i-Estonia"}
EG{"i-Egypt"}
EH{"i-Western Sahara"}
ER{"i-Eritrea"}
ES{"i-Spain"}
ET{"i-Ethiopia"}
EU{"i-European Union"}
EZ{"I-Eurozone"}
FI{"i-Finland"}
FJ{"i-Fiji"}
FK{"i-Falkland Islands"}
FM{"i-Micronesia"}
FO{"i-Faroe Islands"}
FR{"i-France"}
GA{"i-Gabon"}
GB{"i-United Kingdom"}
GD{"i-Grenada"}
GE{"i-Georgia"}
GF{"i-French Guiana"}
GG{"i-Guernsey"}
GH{"i-Ghana"}
GI{"i-Gibraltar"}
GL{"i-Greenland"}
GM{"i-Gambia"}
GN{"i-Guinea"}
GP{"i-Guadeloupe"}
GQ{"i-Equatorial Guinea"}
GR{"i-Greece"}
GS{"i-South Georgia ne-South Sandwich Islands"}
GT{"i-Guatemala"}
GU{"i-Guam"}
GW{"i-Guinea-Bissau"}
GY{"i-Guyana"}
HK{"i-Hong Kong SAR China"}
HM{"I-Heard & McDonald Island"}
HN{"i-Honduras"}
HR{"i-Croatia"}
HT{"i-Haiti"}
HU{"i-Hungary"}
IC{"i-Canary Islands"}
ID{"i-Indonesia"}
IE{"i-Ireland"}
IL{"kwa-Israel"}
IM{"i-Isle of Man"}
IN{"i-India"}
IO{"i-British Indian Ocean Territory"}
IQ{"i-Iraq"}
IR{"i-Iran"}
IS{"i-Iceland"}
IT{"i-Italy"}
JE{"i-Jersey"}
JM{"i-Jamaica"}
JO{"i-Jordan"}
JP{"i-Japan"}
KE{"i-Kenya"}
KG{"i-Kyrgyzstan"}
KH{"i-Cambodia"}
KI{"i-Kiribati"}
KM{"i-Comoros"}
KN{"i-Saint Kitts ne-Nevis"}
KP{"i-North Korea"}
KR{"i-South Korea"}
KW{"i-Kuwait"}
KY{"i-Cayman Islands"}
KZ{"i-Kazakhstan"}
LA{"i-Laos"}
LB{"i-Lebanon"}
LC{"i-Saint Lucia"}
LI{"i-Liechtenstein"}
LK{"i-Sri Lanka"}
LR{"i-Liberia"}
LS{"iLesotho"}
LT{"i-Lithuania"}
LU{"i-Luxembourg"}
LV{"i-Latvia"}
LY{"i-Libya"}
MA{"i-Morocco"}
MC{"i-Monaco"}
MD{"i-Moldova"}
ME{"i-Montenegro"}
MF{"i-Saint Martin"}
MG{"i-Madagascar"}
MH{"i-Marshall Islands"}
MK{"i-North Macedonia"}
ML{"iMali"}
MM{"i-Myanmar (Burma)"}
MN{"i-Mongolia"}
MO{"i-Macau SAR China"}
MP{"i-Northern Mariana Islands"}
MQ{"i-Martinique"}
MR{"i-Mauritania"}
MS{"i-Montserrat"}
MT{"i-Malta"}
MU{"i-Mauritius"}
MV{"i-Maldives"}
MW{"iMalawi"}
MX{"i-Mexico"}
MY{"i-Malaysia"}
MZ{"i-Mozambique"}
NA{"i-Namibia"}
NC{"i-New Caledonia"}
NE{"i-Niger"}
NF{"i-Norfolk Island"}
NG{"i-Nigeria"}
NI{"i-Nicaragua"}
NL{"i-Netherlands"}
NO{"i-Norway"}
NP{"i-Nepal"}
NR{"i-Nauru"}
NU{"i-Niue"}
NZ{"i-New Zealand"}
OM{"i-Oman"}
PA{"i-Panama"}
PE{"i-Peru"}
PF{"i-French Polynesia"}
PG{"i-Papua New Guinea"}
PH{"i-Philippines"}
PK{"i-Pakistan"}
PL{"i-Poland"}
PM{"i-Saint Pierre kanye ne-Miquelon"}
PN{"i-Pitcairn Islands"}
PR{"i-Puerto Rico"}
PS{"i-Palestinian Territories"}
PT{"i-Portugal"}
PW{"i-Palau"}
PY{"i-Paraguay"}
QA{"i-Qatar"}
QO{"i-Outlying Oceania"}
RE{"i-Réunion"}
RO{"i-Romania"}
RS{"i-Serbia"}
RU{"i-Russia"}
RW{"i-Rwanda"}
SA{"i-Saudi Arabia"}
SB{"i-Solomon Islands"}
SC{"i-Seychelles"}
SD{"i-Sudan"}
SE{"i-Sweden"}
SG{"i-Singapore"}
SH{"i-St. Helena"}
SI{"i-Slovenia"}
SJ{"i-Svalbard ne-Jan Mayen"}
SK{"i-Slovakia"}
SL{"i-Sierra Leone"}
SM{"i-San Marino"}
SN{"i-Senegal"}
SO{"i-Somalia"}
SR{"i-Suriname"}
SS{"i-South Sudan"}
ST{"i-São Tomé kanye ne-Príncipe"}
SV{"i-El Salvador"}
SX{"i-Sint Maarten"}
SY{"i-Syria"}
SZ{"i-Swaziland"}
TA{"i-Tristan da Cunha"}
TC{"i-Turks ne-Caicos Islands"}
TD{"i-Chad"}
TF{"i-French Southern Territories"}
TG{"i-Togo"}
TH{"i-Thailand"}
TJ{"i-Tajikistan"}
TK{"i-Tokelau"}
TL{"i-Timor-Leste"}
TM{"i-Turkmenistan"}
TN{"i-Tunisia"}
TO{"i-Tonga"}
TR{"i-Turkey"}
TT{"i-Trinidad ne-Tobago"}
TV{"i-Tuvalu"}
TW{"i-Taiwan"}
TZ{"i-Tanzania"}
UA{"i-Ukraine"}
UG{"i-Uganda"}
UM{"I-U.S. Outlying Islands"}
UN{"I-United Nations"}
US{"i-United States"}
UY{"i-Uruguay"}
UZ{"i-Uzbekistan"}
VA{"i-Vatican City"}
VC{"i-Saint Vincent ne-Grenadines"}
VE{"i-Venezuela"}
VG{"i-British Virgin Islands"}
VI{"i-U.S. Virgin Islands"}
VN{"i-Vietnam"}
VU{"i-Vanuatu"}
WF{"i-Wallis ne-Futuna"}
WS{"i-Samoa"}
XA{"Pseudo-Accents"}
XB{"Pseudo-Bidi"}
XK{"i-Kosovo"}
YE{"i-Yemen"}
YT{"i-Mayotte"}
ZA{"iNingizimu Afrika"}
ZM{"i-Zambia"}
ZW{"iZimbabwe"}
ZZ{"iSifunda esingaziwa"}
}
Countries%short{
GB{"i-U.K."}
HK{"i-Hong Kong"}
MO{"i-Macau"}
PS{"i-Palestine"}
UN{"ifulegi"}
US{"i-U.S"}
}
Countries%variant{
CD{"i-Congo (DRC)"}
CG{"i-Congo (Republic)"}
CI{"i-Ivory Coast"}
CZ{"i-Czech Republic"}
FK{"i-Falkland Islands (Islas Malvinas)"}
TL{"i-East Timor"}
}
}
| {
"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 !gccgo
#include "textflag.h"
//
// System call support for 386, OpenBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-28
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-40
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-52
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
JMP syscall·RawSyscall6(SB)
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of PHPExifTool.
*
* (c) 2012 Romain Neutron <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPExiftool\Driver\Tag\GIF;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class BitsPerPixel extends AbstractTag
{
protected $Id = '4.3';
protected $Name = 'BitsPerPixel';
protected $FullName = 'GIF::Screen';
protected $GroupName = 'GIF';
protected $g0 = 'GIF';
protected $g1 = 'GIF';
protected $g2 = 'Image';
protected $Type = 'int8u';
protected $Writable = false;
protected $Description = 'Bits Per Pixel';
}
| {
"pile_set_name": "Github"
} |
//===--- X86.h - Declare X86 target feature support -------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares X86 TargetInfo objects.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_X86_H
#define LLVM_CLANG_LIB_BASIC_TARGETS_X86_H
#include "OSTargets.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TargetOptions.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Support/Compiler.h"
namespace clang {
namespace targets {
// X86 target abstract base class; x86-32 and x86-64 are very close, so
// most of the implementation can be shared.
class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
enum X86SSEEnum {
NoSSE,
SSE1,
SSE2,
SSE3,
SSSE3,
SSE41,
SSE42,
AVX,
AVX2,
AVX512F
} SSELevel = NoSSE;
enum MMX3DNowEnum {
NoMMX3DNow,
MMX,
AMD3DNow,
AMD3DNowAthlon
} MMX3DNowLevel = NoMMX3DNow;
enum XOPEnum { NoXOP, SSE4A, FMA4, XOP } XOPLevel = NoXOP;
bool HasAES = false;
bool HasVAES = false;
bool HasPCLMUL = false;
bool HasVPCLMULQDQ = false;
bool HasGFNI = false;
bool HasLZCNT = false;
bool HasRDRND = false;
bool HasFSGSBASE = false;
bool HasBMI = false;
bool HasBMI2 = false;
bool HasPOPCNT = false;
bool HasRTM = false;
bool HasPRFCHW = false;
bool HasRDSEED = false;
bool HasADX = false;
bool HasTBM = false;
bool HasLWP = false;
bool HasFMA = false;
bool HasF16C = false;
bool HasAVX512CD = false;
bool HasAVX512VPOPCNTDQ = false;
bool HasAVX512VNNI = false;
bool HasAVX512ER = false;
bool HasAVX512PF = false;
bool HasAVX512DQ = false;
bool HasAVX512BITALG = false;
bool HasAVX512BW = false;
bool HasAVX512VL = false;
bool HasAVX512VBMI = false;
bool HasAVX512VBMI2 = false;
bool HasAVX512IFMA = false;
bool HasSHA = false;
bool HasMPX = false;
bool HasSHSTK = false;
bool HasIBT = false;
bool HasSGX = false;
bool HasCX16 = false;
bool HasFXSR = false;
bool HasXSAVE = false;
bool HasXSAVEOPT = false;
bool HasXSAVEC = false;
bool HasXSAVES = false;
bool HasMWAITX = false;
bool HasCLZERO = false;
bool HasCLDEMOTE = false;
bool HasPKU = false;
bool HasCLFLUSHOPT = false;
bool HasCLWB = false;
bool HasMOVBE = false;
bool HasPREFETCHWT1 = false;
bool HasRDPID = false;
bool HasRetpoline = false;
bool HasRetpolineExternalThunk = false;
bool HasLAHFSAHF = false;
bool HasWBNOINVD = false;
bool HasWAITPKG = false;
bool HasMOVDIRI = false;
bool HasMOVDIR64B = false;
protected:
/// \brief Enumeration of all of the X86 CPUs supported by Clang.
///
/// Each enumeration represents a particular CPU supported by Clang. These
/// loosely correspond to the options passed to '-march' or '-mtune' flags.
enum CPUKind {
CK_Generic,
#define PROC(ENUM, STRING, IS64BIT) CK_##ENUM,
#include "clang/Basic/X86Target.def"
} CPU = CK_Generic;
bool checkCPUKind(CPUKind Kind) const;
CPUKind getCPUKind(StringRef CPU) const;
std::string getCPUKindCanonicalName(CPUKind Kind) const;
enum FPMathKind { FP_Default, FP_SSE, FP_387 } FPMath = FP_Default;
public:
X86TargetInfo(const llvm::Triple &Triple, const TargetOptions &)
: TargetInfo(Triple) {
LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
}
unsigned getFloatEvalMethod() const override {
// X87 evaluates with 80 bits "long double" precision.
return SSELevel == NoSSE ? 2 : 0;
}
ArrayRef<const char *> getGCCRegNames() const override;
ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
return None;
}
ArrayRef<TargetInfo::AddlRegName> getGCCAddlRegNames() const override;
bool validateCpuSupports(StringRef Name) const override;
bool validateCpuIs(StringRef Name) const override;
bool validateAsmConstraint(const char *&Name,
TargetInfo::ConstraintInfo &info) const override;
bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,
bool &HasSizeMismatch) const override {
// esp and ebp are the only 32-bit registers the x86 backend can currently
// handle.
if (RegName.equals("esp") || RegName.equals("ebp")) {
// Check that the register size is 32-bit.
HasSizeMismatch = RegSize != 32;
return true;
}
return false;
}
bool validateOutputSize(StringRef Constraint, unsigned Size) const override;
bool validateInputSize(StringRef Constraint, unsigned Size) const override;
virtual bool
checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const override;
virtual bool
checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const override;
virtual bool validateOperandSize(StringRef Constraint, unsigned Size) const;
std::string convertConstraint(const char *&Constraint) const override;
const char *getClobbers() const override {
return "~{dirflag},~{fpsr},~{flags}";
}
StringRef getConstraintRegister(StringRef Constraint,
StringRef Expression) const override {
StringRef::iterator I, E;
for (I = Constraint.begin(), E = Constraint.end(); I != E; ++I) {
if (isalpha(*I))
break;
}
if (I == E)
return "";
switch (*I) {
// For the register constraints, return the matching register name
case 'a':
return "ax";
case 'b':
return "bx";
case 'c':
return "cx";
case 'd':
return "dx";
case 'S':
return "si";
case 'D':
return "di";
// In case the constraint is 'r' we need to return Expression
case 'r':
return Expression;
// Double letters Y<x> constraints
case 'Y':
if ((++I != E) && ((*I == '0') || (*I == 'z')))
return "xmm0";
default:
break;
}
return "";
}
bool useFP16ConversionIntrinsics() const override {
return false;
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override;
static void setSSELevel(llvm::StringMap<bool> &Features, X86SSEEnum Level,
bool Enabled);
static void setMMXLevel(llvm::StringMap<bool> &Features, MMX3DNowEnum Level,
bool Enabled);
static void setXOPLevel(llvm::StringMap<bool> &Features, XOPEnum Level,
bool Enabled);
void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
bool Enabled) const override {
setFeatureEnabledImpl(Features, Name, Enabled);
}
// This exists purely to cut down on the number of virtual calls in
// initFeatureMap which calls this repeatedly.
static void setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
StringRef Name, bool Enabled);
bool
initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
StringRef CPU,
const std::vector<std::string> &FeaturesVec) const override;
bool isValidFeatureName(StringRef Name) const override;
bool hasFeature(StringRef Feature) const override;
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override;
StringRef getABI() const override {
if (getTriple().getArch() == llvm::Triple::x86_64 && SSELevel >= AVX512F)
return "avx512";
if (getTriple().getArch() == llvm::Triple::x86_64 && SSELevel >= AVX)
return "avx";
if (getTriple().getArch() == llvm::Triple::x86 &&
MMX3DNowLevel == NoMMX3DNow)
return "no-mmx";
return "";
}
bool isValidCPUName(StringRef Name) const override {
return checkCPUKind(getCPUKind(Name));
}
void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;
bool setCPU(const std::string &Name) override {
return checkCPUKind(CPU = getCPUKind(Name));
}
bool supportsMultiVersioning() const override {
return getTriple().isOSBinFormatELF();
}
unsigned multiVersionSortPriority(StringRef Name) const override;
bool setFPMath(StringRef Name) override;
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
// Most of the non-ARM calling conventions are i386 conventions.
switch (CC) {
case CC_X86ThisCall:
case CC_X86FastCall:
case CC_X86StdCall:
case CC_X86VectorCall:
case CC_X86RegCall:
case CC_C:
case CC_PreserveMost:
case CC_Swift:
case CC_X86Pascal:
case CC_IntelOclBicc:
case CC_OpenCLKernel:
return CCCR_OK;
default:
return CCCR_Warning;
}
}
CallingConv getDefaultCallingConv(CallingConvMethodType MT) const override {
return MT == CCMT_Member ? CC_X86ThisCall : CC_C;
}
bool hasSjLjLowering() const override { return true; }
void setSupportedOpenCLOpts() override {
getSupportedOpenCLOpts().supportAll();
}
};
// X86-32 generic target
class LLVM_LIBRARY_VISIBILITY X86_32TargetInfo : public X86TargetInfo {
public:
X86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: X86TargetInfo(Triple, Opts) {
DoubleAlign = LongLongAlign = 32;
LongDoubleWidth = 96;
LongDoubleAlign = 32;
SuitableAlign = 128;
resetDataLayout("e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128");
SizeType = UnsignedInt;
PtrDiffType = SignedInt;
IntPtrType = SignedInt;
RegParmMax = 3;
// Use fpret for all types.
RealTypeUsesObjCFPRet =
((1 << TargetInfo::Float) | (1 << TargetInfo::Double) |
(1 << TargetInfo::LongDouble));
// x86-32 has atomics up to 8 bytes
CPUKind Kind = getCPUKind(Opts.CPU);
if (Kind >= CK_i586 || Kind == CK_Generic)
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
else if (Kind >= CK_i486)
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
}
BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::CharPtrBuiltinVaList;
}
int getEHDataRegisterNumber(unsigned RegNo) const override {
if (RegNo == 0)
return 0;
if (RegNo == 1)
return 2;
return -1;
}
bool validateOperandSize(StringRef Constraint, unsigned Size) const override {
switch (Constraint[0]) {
default:
break;
case 'R':
case 'q':
case 'Q':
case 'a':
case 'b':
case 'c':
case 'd':
case 'S':
case 'D':
return Size <= 32;
case 'A':
return Size <= 64;
}
return X86TargetInfo::validateOperandSize(Constraint, Size);
}
ArrayRef<Builtin::Info> getTargetBuiltins() const override;
};
class LLVM_LIBRARY_VISIBILITY NetBSDI386TargetInfo
: public NetBSDTargetInfo<X86_32TargetInfo> {
public:
NetBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: NetBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
unsigned getFloatEvalMethod() const override {
unsigned Major, Minor, Micro;
getTriple().getOSVersion(Major, Minor, Micro);
// New NetBSD uses the default rounding mode.
if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 26) || Major == 0)
return X86_32TargetInfo::getFloatEvalMethod();
// NetBSD before 6.99.26 defaults to "double" rounding.
return 1;
}
};
class LLVM_LIBRARY_VISIBILITY OpenBSDI386TargetInfo
: public OpenBSDTargetInfo<X86_32TargetInfo> {
public:
OpenBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: OpenBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {
SizeType = UnsignedLong;
IntPtrType = SignedLong;
PtrDiffType = SignedLong;
}
};
class LLVM_LIBRARY_VISIBILITY DarwinI386TargetInfo
: public DarwinTargetInfo<X86_32TargetInfo> {
public:
DarwinI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: DarwinTargetInfo<X86_32TargetInfo>(Triple, Opts) {
LongDoubleWidth = 128;
LongDoubleAlign = 128;
SuitableAlign = 128;
MaxVectorAlign = 256;
// The watchOS simulator uses the builtin bool type for Objective-C.
llvm::Triple T = llvm::Triple(Triple);
if (T.isWatchOS())
UseSignedCharForObjCBool = false;
SizeType = UnsignedLong;
IntPtrType = SignedLong;
resetDataLayout("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128");
HasAlignMac68kSupport = true;
}
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override {
if (!DarwinTargetInfo<X86_32TargetInfo>::handleTargetFeatures(Features,
Diags))
return false;
// We now know the features we have: we can decide how to align vectors.
MaxVectorAlign =
hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
return true;
}
};
// x86-32 Windows target
class LLVM_LIBRARY_VISIBILITY WindowsX86_32TargetInfo
: public WindowsTargetInfo<X86_32TargetInfo> {
public:
WindowsX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: WindowsTargetInfo<X86_32TargetInfo>(Triple, Opts) {
DoubleAlign = LongLongAlign = 64;
bool IsWinCOFF =
getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
resetDataLayout(IsWinCOFF
? "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
: "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32");
}
};
// x86-32 Windows Visual Studio target
class LLVM_LIBRARY_VISIBILITY MicrosoftX86_32TargetInfo
: public WindowsX86_32TargetInfo {
public:
MicrosoftX86_32TargetInfo(const llvm::Triple &Triple,
const TargetOptions &Opts)
: WindowsX86_32TargetInfo(Triple, Opts) {
LongDoubleWidth = LongDoubleAlign = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
WindowsX86_32TargetInfo::getTargetDefines(Opts, Builder);
WindowsX86_32TargetInfo::getVisualStudioDefines(Opts, Builder);
// The value of the following reflects processor type.
// 300=386, 400=486, 500=Pentium, 600=Blend (default)
// We lost the original triple, so we use the default.
Builder.defineMacro("_M_IX86", "600");
}
};
// x86-32 MinGW target
class LLVM_LIBRARY_VISIBILITY MinGWX86_32TargetInfo
: public WindowsX86_32TargetInfo {
public:
MinGWX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: WindowsX86_32TargetInfo(Triple, Opts) {
HasFloat128 = true;
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
WindowsX86_32TargetInfo::getTargetDefines(Opts, Builder);
Builder.defineMacro("_X86_");
}
};
// x86-32 Cygwin target
class LLVM_LIBRARY_VISIBILITY CygwinX86_32TargetInfo : public X86_32TargetInfo {
public:
CygwinX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: X86_32TargetInfo(Triple, Opts) {
this->WCharType = TargetInfo::UnsignedShort;
DoubleAlign = LongLongAlign = 64;
resetDataLayout("e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32");
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
X86_32TargetInfo::getTargetDefines(Opts, Builder);
Builder.defineMacro("_X86_");
Builder.defineMacro("__CYGWIN__");
Builder.defineMacro("__CYGWIN32__");
addCygMingDefines(Opts, Builder);
DefineStd(Builder, "unix", Opts);
if (Opts.CPlusPlus)
Builder.defineMacro("_GNU_SOURCE");
}
};
// x86-32 Haiku target
class LLVM_LIBRARY_VISIBILITY HaikuX86_32TargetInfo
: public HaikuTargetInfo<X86_32TargetInfo> {
public:
HaikuX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: HaikuTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
HaikuTargetInfo<X86_32TargetInfo>::getTargetDefines(Opts, Builder);
Builder.defineMacro("__INTEL__");
}
};
// X86-32 MCU target
class LLVM_LIBRARY_VISIBILITY MCUX86_32TargetInfo : public X86_32TargetInfo {
public:
MCUX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: X86_32TargetInfo(Triple, Opts) {
LongDoubleWidth = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
resetDataLayout("e-m:e-p:32:32-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32");
WIntType = UnsignedInt;
}
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
// On MCU we support only C calling convention.
return CC == CC_C ? CCCR_OK : CCCR_Warning;
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
X86_32TargetInfo::getTargetDefines(Opts, Builder);
Builder.defineMacro("__iamcu");
Builder.defineMacro("__iamcu__");
}
bool allowsLargerPreferedTypeAlignment() const override { return false; }
};
// x86-32 RTEMS target
class LLVM_LIBRARY_VISIBILITY RTEMSX86_32TargetInfo : public X86_32TargetInfo {
public:
RTEMSX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: X86_32TargetInfo(Triple, Opts) {
SizeType = UnsignedLong;
IntPtrType = SignedLong;
PtrDiffType = SignedLong;
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
X86_32TargetInfo::getTargetDefines(Opts, Builder);
Builder.defineMacro("__INTEL__");
Builder.defineMacro("__rtems__");
}
};
// x86-64 generic target
class LLVM_LIBRARY_VISIBILITY X86_64TargetInfo : public X86TargetInfo {
public:
X86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: X86TargetInfo(Triple, Opts) {
const bool IsX32 = getTriple().getEnvironment() == llvm::Triple::GNUX32;
bool IsWinCOFF =
getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
LongWidth = LongAlign = PointerWidth = PointerAlign = IsX32 ? 32 : 64;
LongDoubleWidth = 128;
LongDoubleAlign = 128;
LargeArrayMinWidth = 128;
LargeArrayAlign = 128;
SuitableAlign = 128;
SizeType = IsX32 ? UnsignedInt : UnsignedLong;
PtrDiffType = IsX32 ? SignedInt : SignedLong;
IntPtrType = IsX32 ? SignedInt : SignedLong;
IntMaxType = IsX32 ? SignedLongLong : SignedLong;
Int64Type = IsX32 ? SignedLongLong : SignedLong;
RegParmMax = 6;
// Pointers are 32-bit in x32.
resetDataLayout(IsX32
? "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"
: IsWinCOFF ? "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
: "e-m:e-i64:64-f80:128-n8:16:32:64-S128");
// Use fpret only for long double.
RealTypeUsesObjCFPRet = (1 << TargetInfo::LongDouble);
// Use fp2ret for _Complex long double.
ComplexLongDoubleUsesFP2Ret = true;
// Make __builtin_ms_va_list available.
HasBuiltinMSVaList = true;
// x86-64 has atomics up to 16 bytes.
MaxAtomicPromoteWidth = 128;
MaxAtomicInlineWidth = 64;
}
BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::X86_64ABIBuiltinVaList;
}
int getEHDataRegisterNumber(unsigned RegNo) const override {
if (RegNo == 0)
return 0;
if (RegNo == 1)
return 1;
return -1;
}
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
switch (CC) {
case CC_C:
case CC_Swift:
case CC_X86VectorCall:
case CC_IntelOclBicc:
case CC_Win64:
case CC_PreserveMost:
case CC_PreserveAll:
case CC_X86RegCall:
case CC_OpenCLKernel:
return CCCR_OK;
default:
return CCCR_Warning;
}
}
CallingConv getDefaultCallingConv(CallingConvMethodType MT) const override {
return CC_C;
}
// for x32 we need it here explicitly
bool hasInt128Type() const override { return true; }
unsigned getUnwindWordWidth() const override { return 64; }
unsigned getRegisterWidth() const override { return 64; }
bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,
bool &HasSizeMismatch) const override {
// rsp and rbp are the only 64-bit registers the x86 backend can currently
// handle.
if (RegName.equals("rsp") || RegName.equals("rbp")) {
// Check that the register size is 64-bit.
HasSizeMismatch = RegSize != 64;
return true;
}
// Check if the register is a 32-bit register the backend can handle.
return X86TargetInfo::validateGlobalRegisterVariable(RegName, RegSize,
HasSizeMismatch);
}
void setMaxAtomicWidth() override {
if (hasFeature("cx16"))
MaxAtomicInlineWidth = 128;
}
ArrayRef<Builtin::Info> getTargetBuiltins() const override;
};
// x86-64 Windows target
class LLVM_LIBRARY_VISIBILITY WindowsX86_64TargetInfo
: public WindowsTargetInfo<X86_64TargetInfo> {
public:
WindowsX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: WindowsTargetInfo<X86_64TargetInfo>(Triple, Opts) {
LongWidth = LongAlign = 32;
DoubleAlign = LongLongAlign = 64;
IntMaxType = SignedLongLong;
Int64Type = SignedLongLong;
SizeType = UnsignedLongLong;
PtrDiffType = SignedLongLong;
IntPtrType = SignedLongLong;
}
BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::CharPtrBuiltinVaList;
}
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
switch (CC) {
case CC_X86StdCall:
case CC_X86ThisCall:
case CC_X86FastCall:
return CCCR_Ignore;
case CC_C:
case CC_X86VectorCall:
case CC_IntelOclBicc:
case CC_PreserveMost:
case CC_PreserveAll:
case CC_X86_64SysV:
case CC_Swift:
case CC_X86RegCall:
case CC_OpenCLKernel:
return CCCR_OK;
default:
return CCCR_Warning;
}
}
};
// x86-64 Windows Visual Studio target
class LLVM_LIBRARY_VISIBILITY MicrosoftX86_64TargetInfo
: public WindowsX86_64TargetInfo {
public:
MicrosoftX86_64TargetInfo(const llvm::Triple &Triple,
const TargetOptions &Opts)
: WindowsX86_64TargetInfo(Triple, Opts) {
LongDoubleWidth = LongDoubleAlign = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
WindowsX86_64TargetInfo::getTargetDefines(Opts, Builder);
WindowsX86_64TargetInfo::getVisualStudioDefines(Opts, Builder);
Builder.defineMacro("_M_X64", "100");
Builder.defineMacro("_M_AMD64", "100");
}
TargetInfo::CallingConvKind
getCallingConvKind(bool ClangABICompat4) const override {
return CCK_MicrosoftX86_64;
}
};
// x86-64 MinGW target
class LLVM_LIBRARY_VISIBILITY MinGWX86_64TargetInfo
: public WindowsX86_64TargetInfo {
public:
MinGWX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: WindowsX86_64TargetInfo(Triple, Opts) {
// Mingw64 rounds long double size and alignment up to 16 bytes, but sticks
// with x86 FP ops. Weird.
LongDoubleWidth = LongDoubleAlign = 128;
LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
HasFloat128 = true;
}
};
// x86-64 Cygwin target
class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
public:
CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: X86_64TargetInfo(Triple, Opts) {
this->WCharType = TargetInfo::UnsignedShort;
TLSSupported = false;
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
X86_64TargetInfo::getTargetDefines(Opts, Builder);
Builder.defineMacro("__x86_64__");
Builder.defineMacro("__CYGWIN__");
Builder.defineMacro("__CYGWIN64__");
addCygMingDefines(Opts, Builder);
DefineStd(Builder, "unix", Opts);
if (Opts.CPlusPlus)
Builder.defineMacro("_GNU_SOURCE");
}
};
class LLVM_LIBRARY_VISIBILITY DarwinX86_64TargetInfo
: public DarwinTargetInfo<X86_64TargetInfo> {
public:
DarwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: DarwinTargetInfo<X86_64TargetInfo>(Triple, Opts) {
Int64Type = SignedLongLong;
// The 64-bit iOS simulator uses the builtin bool type for Objective-C.
llvm::Triple T = llvm::Triple(Triple);
if (T.isiOS())
UseSignedCharForObjCBool = false;
resetDataLayout("e-m:o-i64:64-f80:128-n8:16:32:64-S128");
}
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override {
if (!DarwinTargetInfo<X86_64TargetInfo>::handleTargetFeatures(Features,
Diags))
return false;
// We now know the features we have: we can decide how to align vectors.
MaxVectorAlign =
hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
return true;
}
};
class LLVM_LIBRARY_VISIBILITY OpenBSDX86_64TargetInfo
: public OpenBSDTargetInfo<X86_64TargetInfo> {
public:
OpenBSDX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: OpenBSDTargetInfo<X86_64TargetInfo>(Triple, Opts) {
IntMaxType = SignedLongLong;
Int64Type = SignedLongLong;
}
};
// x86_32 Android target
class LLVM_LIBRARY_VISIBILITY AndroidX86_32TargetInfo
: public LinuxTargetInfo<X86_32TargetInfo> {
public:
AndroidX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: LinuxTargetInfo<X86_32TargetInfo>(Triple, Opts) {
SuitableAlign = 32;
LongDoubleWidth = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
}
};
// x86_64 Android target
class LLVM_LIBRARY_VISIBILITY AndroidX86_64TargetInfo
: public LinuxTargetInfo<X86_64TargetInfo> {
public:
AndroidX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
: LinuxTargetInfo<X86_64TargetInfo>(Triple, Opts) {
LongDoubleFormat = &llvm::APFloat::IEEEquad();
}
bool useFloat128ManglingForLongDouble() const override { return true; }
};
} // namespace targets
} // namespace clang
#endif // LLVM_CLANG_LIB_BASIC_TARGETS_X86_H
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javafx.print;
/**
* Class to enumerate the possible duplex (two-sided) printing modes.
* @since JavaFX 8.0
*/
public enum PrintSides {
/**
* One sided printing. Duplex printing is off.
*/
ONE_SIDED,
/**
* Two sided printing where the vertical edge of the paper is to be used
* for binding such as in a book. In PORTAIT mode printing, the
* vertical edge is usally the long edge but this is reversed if
* LANDSCAPE printing is requested
*/
DUPLEX,
/**
* Two sided printing where the horizontal edge of the paper is to be used
* for binding such as in a notepad. In PORTAIT mode printing, the
* horizontal edge is usally the short edge but this is reversed if
* LANDSCAPE printing is requested
*/
TUMBLE
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
#
# Code related to ESET's Linux/Moose research
# For feedback or questions contact us at: [email protected]
# https://github.com/eset/malware-research/
#
# This code is provided to the community under the two-clause BSD license as
# follows:
#
# Copyright (C) 2015 ESET
# 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
echo "#!/usr/bin/env python" > mips_syscalls.py
echo "" >> mips_syscalls.py
echo "__NR_Linux = 4000" >> mips_syscalls.py
echo "syscall_table = dict()" >> mips_syscalls.py
# head: interested in only the mips o32 syscalls (beginning of file)
# grep: keeping good lines
# awk: search / replace building a python dict
head -380 unistd.h | egrep "^#define __NR.*\(__NR_Linux \+" \
| awk '{ print "syscall_table["$3$4$5"] = \""$2"\""}' >> mips_syscalls.py
| {
"pile_set_name": "Github"
} |
// +build !race
package mgo
const raceDetector = false
| {
"pile_set_name": "Github"
} |
{
"$schema" : "http://json-schema.org/draft-01/hyper-schema#",
"id" : "http://json-schema.org/draft-01/schema#",
"type" : "object",
"properties" : {
"type" : {
"type" : ["string", "array"],
"items" : {
"type" : ["string", {"$ref" : "#"}]
},
"optional" : true,
"default" : "any"
},
"properties" : {
"type" : "object",
"additionalProperties" : {"$ref" : "#"},
"optional" : true,
"default" : {}
},
"items" : {
"type" : [{"$ref" : "#"}, "array"],
"items" : {"$ref" : "#"},
"optional" : true,
"default" : {}
},
"optional" : {
"type" : "boolean",
"optional" : true,
"default" : false
},
"additionalProperties" : {
"type" : [{"$ref" : "#"}, "boolean"],
"optional" : true,
"default" : {}
},
"requires" : {
"type" : ["string", {"$ref" : "#"}],
"optional" : true
},
"minimum" : {
"type" : "number",
"optional" : true
},
"maximum" : {
"type" : "number",
"optional" : true
},
"minimumCanEqual" : {
"type" : "boolean",
"optional" : true,
"requires" : "minimum",
"default" : true
},
"maximumCanEqual" : {
"type" : "boolean",
"optional" : true,
"requires" : "maximum",
"default" : true
},
"minItems" : {
"type" : "integer",
"optional" : true,
"minimum" : 0,
"default" : 0
},
"maxItems" : {
"type" : "integer",
"optional" : true,
"minimum" : 0
},
"pattern" : {
"type" : "string",
"optional" : true,
"format" : "regex"
},
"minLength" : {
"type" : "integer",
"optional" : true,
"minimum" : 0,
"default" : 0
},
"maxLength" : {
"type" : "integer",
"optional" : true
},
"enum" : {
"type" : "array",
"optional" : true,
"minItems" : 1
},
"title" : {
"type" : "string",
"optional" : true
},
"description" : {
"type" : "string",
"optional" : true
},
"format" : {
"type" : "string",
"optional" : true
},
"contentEncoding" : {
"type" : "string",
"optional" : true
},
"default" : {
"type" : "any",
"optional" : true
},
"maxDecimal" : {
"type" : "integer",
"optional" : true,
"minimum" : 0
},
"disallow" : {
"type" : ["string", "array"],
"items" : {"type" : "string"},
"optional" : true
},
"extends" : {
"type" : [{"$ref" : "#"}, "array"],
"items" : {"$ref" : "#"},
"optional" : true,
"default" : {}
}
},
"optional" : true,
"default" : {}
} | {
"pile_set_name": "Github"
} |
set ansi_nulls on
go
set quoted_identifier on
go
DROP PROCEDURE IF EXISTS PredictChurnR
GO
/*
Description: This file creates the procedure to predict churn outcome based on the open source R model previously built.
*/
create procedure PredictChurnR @inquery nvarchar(max)
as
begin
declare @modelt varbinary(max) = (select top 1 model from ChurnModelR);
insert into ChurnPredictR
exec sp_execute_external_script @language = N'R',
@script = N'
mod <- unserialize(as.raw(model));
Scores <- data.frame(predict(mod, newdata = InputDataSet, type = "response"))
colnames(Scores) <- c("Score");
Scores$TagId <- as.numeric(as.character(InputDataSet$TagId))
predictROC <- rxRoc(actualVarName = c("TagId"), predVarNames = c("Score"), data = Scores, numBreaks = 100)
Auc = rxAuc(predictROC)
OutputDataSet <- data.frame(InputDataSet$UserId,InputDataSet$Tag,InputDataSet$TagId,Scores$Score, Auc)
'
,@input_data_1 = @inquery
,@output_data_1_name = N'OutputDataSet'
,@params = N'@model varbinary(max)'
,@model = @modelt;
end
go
declare @query_string nvarchar(max)
set @query_string='
select F.*, Tags.Tag, Tags.TagId from
(select a.* from Features a
left outer join
(
select * from Features
tablesample (70 percent) repeatable (98052)
)b
on a.UserId=b.UserId
where b.UserId is null) F join Tags on F.UserId=Tags.UserId
'
execute PredictChurnR @inquery = @query_string;
go
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
// expected-no-diagnostics
template<template<typename> class D> using C = D<int>;
// Substitution of the alias template transforms the TemplateSpecializationType
// 'D<int>' into the DependentTemplateSpecializationType 'T::template U<int>'.
template<typename T> void f(C<T::template U>);
| {
"pile_set_name": "Github"
} |
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file tags/support/value_type_of.hpp
/// \brief Consistent way to access the value type of a tagged or untagged type.
#ifndef BOOST_BIMAP_TAGS_SUPPORT_VALUE_TYPE_OF_HPP
#define BOOST_BIMAP_TAGS_SUPPORT_VALUE_TYPE_OF_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/tags/tagged.hpp>
/** \struct boost::bimaps::tags::support::value_type_of
\brief Metafunction to work with tagged and untagged type uniformly
\code
template< class Type >
struct value_type_of
{
typedef {UntaggedType} type;
};
\endcode
If the type is tagged this metafunction returns Type::value_type, and if it is not
tagged it return the same type. This allows to work consistenly with tagged and
untagged types.
See also tagged, tag_of.
**/
#ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
namespace boost {
namespace bimaps {
namespace tags {
namespace support {
// value_type_of metafunction
template< class Type >
struct value_type_of
{
typedef Type type;
};
template< class Type, class Tag >
struct value_type_of< tagged< Type, Tag > >
{
typedef Type type;
};
} // namespace support
} // namespace tags
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
#endif // BOOST_BIMAP_TAGS_SUPPORT_VALUE_TYPE_OF_HPP
| {
"pile_set_name": "Github"
} |
// Specific definitions for newlib -*- C++ -*-
// Copyright (C) 2000-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file bits/os_defines.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{iosfwd}
*/
#ifndef _GLIBCXX_OS_DEFINES
#define _GLIBCXX_OS_DEFINES 1
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
#ifdef __CYGWIN__
#define _GLIBCXX_GTHREAD_USE_WEAK 0
#if defined (_GLIBCXX_DLL)
#define _GLIBCXX_PSEUDO_VISIBILITY_default __attribute__ ((__dllimport__))
#else
#define _GLIBCXX_PSEUDO_VISIBILITY_default
#endif
#define _GLIBCXX_PSEUDO_VISIBILITY_hidden
#define _GLIBCXX_PSEUDO_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY_ ## V
// See libstdc++/20806.
#define _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM 1
#endif
#endif
| {
"pile_set_name": "Github"
} |
import DataLoader from 'dataloader';
import { graphql, GraphQLList, GraphQLResolveInfo } from 'graphql';
import { delegateToSchema } from '@graphql-tools/delegate';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { stitchSchemas } from '../src/stitchSchemas';
describe('dataloader', () => {
test('should work', async () => {
const taskSchema = makeExecutableSchema({
typeDefs: `
type Task {
id: ID!
text: String
userId: ID!
}
type Query {
task(id: ID!): Task
}
`,
resolvers: {
Query: {
task: (_root, { id }) => ({
id,
text: `task ${id as string}`,
userId: id,
}),
},
},
});
const userSchema = makeExecutableSchema({
typeDefs: `
type User {
id: ID!
email: String!
}
type Query {
usersByIds(ids: [ID!]!): [User]!
}
`,
resolvers: {
Query: {
usersByIds: (_root, { ids }) =>
ids.map((id: string) => ({ id, email: `${id}@tasks.com` })),
},
},
});
const schema = stitchSchemas({
schemas: [taskSchema, userSchema],
typeDefs: `
extend type Task {
user: User!
}
`,
resolvers: {
Task: {
user: {
selectionSet: '{ userId }',
resolve(task, _args, context, info) {
return context.usersLoader.load({ id: task.userId, info });
},
},
},
},
});
const usersLoader = new DataLoader(
async (keys: Array<{ id: any; info: GraphQLResolveInfo }>) => {
const users = await delegateToSchema({
schema: userSchema,
operation: 'query',
fieldName: 'usersByIds',
args: {
ids: keys.map((k: { id: any }) => k.id),
},
context: null,
info: keys[0].info,
returnType: new GraphQLList(keys[0].info.returnType),
});
expect(users).toContainEqual(
expect.objectContaining({
id: '1',
email: '[email protected]',
}),
);
return users;
},
);
const query = `{
task(id: "1") {
id
text
user {
id
email
}
}
}`;
const result = await graphql(schema, query, null, { usersLoader });
expect(result).toEqual({
data: {
task: {
id: '1',
text: 'task 1',
user: {
id: '1',
email: '[email protected]',
},
},
},
});
});
});
| {
"pile_set_name": "Github"
} |
#ifndef _ZCCONSTANTS_H_
#define _ZCCONSTANTS_H_
#define ZC_NUM_JS_INPUTS 2
#define ZC_NUM_JS_OUTPUTS 2
#define INCREMENTAL_MERKLE_TREE_DEPTH 29
#define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4
#define ZC_NOTEPLAINTEXT_LEADING 1
#define ZC_V_SIZE 8
#define ZC_RHO_SIZE 32
#define ZC_R_SIZE 32
#define ZC_MEMO_SIZE 512
#define ZC_NOTEPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE)
#endif // _ZCCONSTANTS_H_
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
int x = "milou";
bool inCheckedMode = false;
bool readXThrows() {
try {
var y = x;
return false;
} catch (e) {
inCheckedMode = true;
x = 5; // Make sure we do not throw exception a second time.
return true;
}
}
main() {
int numExceptions = 0;
for (int i = 0; i < 8; i++) {
if (readXThrows()) {
numExceptions++;
}
}
// In checked mode throw only one exception.
Expect.equals(inCheckedMode ? 1 : 0, numExceptions);
}
| {
"pile_set_name": "Github"
} |
# Created by: Pawel Pekala <[email protected]>
# $FreeBSD$
PORTNAME= ports-tools
PORTVERSION= 1.8
CATEGORIES= ports-mgmt
MAINTAINER= [email protected]
COMMENT= Collection of ports tree related scripts
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
CONFLICTS_INSTALL= popular # bin/pcheck
USE_GITHUB= yes
GH_ACCOUNT= ppekala
NO_BUILD= yes
NO_ARCH= yes
.include <bsd.port.mk>
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/net/service_providers_win.h"
#include <winsock2.h>
#include <Ws2spi.h>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
void GetWinsockNamespaceProviders(
WinsockNamespaceProviderList* namespace_list) {
// Find out how just how much memory is needed. If we get the expected error,
// the memory needed is written to size.
DWORD size = 0;
if (WSAEnumNameSpaceProviders(&size, NULL) != SOCKET_ERROR ||
GetLastError() != WSAEFAULT) {
NOTREACHED();
return;
}
scoped_array<char> namespace_provider_bytes(new char[size]);
WSANAMESPACE_INFO* namespace_providers =
reinterpret_cast<WSANAMESPACE_INFO*>(namespace_provider_bytes.get());
int num_namespace_providers = WSAEnumNameSpaceProviders(&size,
namespace_providers);
if (num_namespace_providers == SOCKET_ERROR) {
NOTREACHED();
return;
}
for (int i = 0; i < num_namespace_providers; ++i) {
WinsockNamespaceProvider provider;
provider.name = namespace_providers[i].lpszIdentifier;
provider.active = TRUE == namespace_providers[i].fActive;
provider.version = namespace_providers[i].dwVersion;
provider.type = namespace_providers[i].dwNameSpace;
namespace_list->push_back(provider);
}
}
void GetWinsockLayeredServiceProviders(
WinsockLayeredServiceProviderList* service_list) {
// Find out how just how much memory is needed. If we get the expected error,
// the memory needed is written to size.
DWORD size = 0;
int error;
if (SOCKET_ERROR != WSCEnumProtocols(NULL, NULL, &size, &error) ||
error != WSAENOBUFS) {
NOTREACHED();
return;
}
scoped_array<char> service_provider_bytes(new char[size]);
WSAPROTOCOL_INFOW* service_providers =
reinterpret_cast<WSAPROTOCOL_INFOW*>(service_provider_bytes.get());
int num_service_providers = WSCEnumProtocols(NULL, service_providers, &size,
&error);
if (num_service_providers == SOCKET_ERROR) {
NOTREACHED();
return;
}
for (int i = 0; i < num_service_providers; ++i) {
WinsockLayeredServiceProvider service_provider;
service_provider.name = service_providers[i].szProtocol;
service_provider.version = service_providers[i].iVersion;
service_provider.socket_type = service_providers[i].iSocketType;
service_provider.socket_protocol = service_providers[i].iProtocol;
service_provider.chain_length = service_providers[i].ProtocolChain.ChainLen;
// TODO(mmenke): Add categories under Vista and later.
// http://msdn.microsoft.com/en-us/library/ms742239%28v=VS.85%29.aspx
wchar_t path[MAX_PATH];
int path_length = arraysize(path);
if (0 == WSCGetProviderPath(&service_providers[i].ProviderId, path,
&path_length, &error)) {
service_provider.path = path;
}
service_list->push_back(service_provider);
}
return;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef _MACH_MACHINE_ASM_H
#define _MACH_MACHINE_ASM_H
#if defined (__ppc__) || defined (__ppc64__)
#include "mach/ppc/asm.h"
#elif defined (__i386__) || defined(__x86_64__)
#include "mach/i386/asm.h"
#elif defined (__arm__)
#include "mach/arm/asm.h"
#else
#error architecture not supported
#endif
#endif /* _MACH_MACHINE_ASM_H */
| {
"pile_set_name": "Github"
} |
(set-logic QF_LIA)
(set-info :source | SMT-COMP'06 organizers |)
(set-info :smt-lib-version 2.0)
(set-info :category "check")
(set-info :status unsat)
(set-info :notes |This benchmark is designed to check if the DP supports bignumbers.|)
(declare-fun x1 () Int)
(declare-fun x2 () Int)
(declare-fun x3 () Int)
(declare-fun x4 () Int)
(declare-fun x5 () Int)
(declare-fun x6 () Int)
(assert (and (or (>= x1 1000) (>= x1 1002))
(or (>= x2 (* 1230 x1)) (>= x2 (* 1003 x1)))
(or (>= x3 (* 1310 x2)) (>= x3 (* 1999 x2)))
(or (>= x4 (* 4000 x3)) (>= x4 (* 8000 x3)))
(or (<= x5 (* (- 4000) x4)) (<= x5 (* (- 8000) x4)))
(or (>= x6 (* (- 3) x5)) (>= x6 (* (- 2) x5))) (< x6 0)))
(check-sat)
(exit)
| {
"pile_set_name": "Github"
} |
{
"asset": {
"generator": "COLLADA2GLTF",
"version": "2.0"
},
"scene": 0,
"scenes": [
{
"nodes": [
0
]
}
],
"nodes": [
{
"children": [
1
],
"matrix": [
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
-1.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0
]
},
{
"mesh": 0
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"NORMAL": 1,
"POSITION": 2,
"TEXCOORD_0": 3
},
"indices": 0,
"mode": 4,
"material": 0
}
],
"name": "Mesh"
}
],
"accessors": [
{
"bufferView": 0,
"byteOffset": 0,
"componentType": 5123,
"count": 36,
"max": [
23
],
"min": [
0
],
"type": "SCALAR"
},
{
"bufferView": 1,
"byteOffset": 0,
"componentType": 5126,
"count": 24,
"max": [
1.0,
1.0,
1.0
],
"min": [
-1.0,
-1.0,
-1.0
],
"type": "VEC3"
},
{
"bufferView": 1,
"byteOffset": 288,
"componentType": 5126,
"count": 24,
"max": [
0.5,
0.5,
0.5
],
"min": [
-0.5,
-0.5,
-0.5
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 0,
"componentType": 5126,
"count": 24,
"max": [
6.0,
1.0
],
"min": [
0.0,
0.0
],
"type": "VEC2"
}
],
"materials": [
{
"values": {
"diffuse": [
0
],
"specular": [
0.20000000298023225,
0.20000000298023225,
0.20000000298023225,
1.0
],
"shininess": [
256.0
],
"transparency": [
1.0
]
},
"technique": 0
}
],
"textures": [
{
"sampler": 0,
"source": 0
}
],
"images": [
{
"uri": "CesiumLogoFlat.png"
}
],
"samplers": [
{
"magFilter": 9729,
"minFilter": 9986,
"wrapS": 10497,
"wrapT": 10497
}
],
"techniques": [
{
"attributes": {
"a_normal": "normal",
"a_position": "position",
"a_texcoord0": "texcoord0"
},
"parameters": {
"diffuse": {
"type": 35678
},
"modelViewMatrix": {
"semantic": "MODELVIEW",
"type": 35676
},
"normal": {
"semantic": "NORMAL",
"type": 35665
},
"normalMatrix": {
"semantic": "MODELVIEWINVERSETRANSPOSE",
"type": 35675
},
"position": {
"semantic": "POSITION",
"type": 35665
},
"projectionMatrix": {
"semantic": "PROJECTION",
"type": 35676
},
"shininess": {
"type": 5126
},
"specular": {
"type": 35666
},
"texcoord0": {
"semantic": "TEXCOORD_0",
"type": 35665
},
"transparency": {
"type": 5126
}
},
"program": 0,
"states": {
"enable": [
2884,
2929
]
},
"uniforms": {
"u_diffuse": "diffuse",
"u_modelViewMatrix": "modelViewMatrix",
"u_normalMatrix": "normalMatrix",
"u_projectionMatrix": "projectionMatrix",
"u_shininess": "shininess",
"u_specular": "specular",
"u_transparency": "transparency"
}
}
],
"programs": [
{
"attributes": [
"a_normal",
"a_position",
"a_texcoord0"
],
"fragmentShader": 1,
"vertexShader": 0
}
],
"shaders": [
{
"type": 35633,
"uri": "BoxTextured0.vert"
},
{
"type": 35632,
"uri": "BoxTextured1.frag"
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 768,
"byteLength": 72,
"target": 34963
},
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 576,
"byteStride": 12,
"target": 34962
},
{
"buffer": 0,
"byteOffset": 576,
"byteLength": 192,
"byteStride": 8,
"target": 34962
}
],
"buffers": [
{
"byteLength": 840,
"uri": "BoxTextured0.bin"
}
],
"extensionsRequired": [
"KHR_technique_webgl"
],
"extensionsUsed": [
"KHR_technique_webgl"
]
}
| {
"pile_set_name": "Github"
} |
[USER_CREDENTIAL]
ID = vuln_web
PW = vu!nweb321
WebRootPath = /var/www/html/
WebHost = http://127.0.0.1
WebLoginIDName = username
WebLoginPWName = pass
WebLoginURL = http://127.0.0.1/collabtive/manageuser.php?action=login
WebLoginPageURL = http://127.0.0.1/collabtive/index.php
WebLoginCSRFName =
WebLoginAdditionalValue =
WebLoginSuccessStr = <span>My Account
WebUploadURL = http://127.0.0.1/collabtive/manageuser.php?action=edit
WebUploadPageURL = http://127.0.0.1/collabtive/manageuser.php?action=editform&id=1
WebUploadFormAttr =
WebUploadCustomHeader =
WebUploadCSRFName =
WebUploadSuccessStr = %filename#
WebUploadAdditionalValue = address1=;address2=;admin=;company=;name=vuln_web;userfile=%filebinary#;file-avatar=;[email protected];web=;tel1=;tel2=;zip=;country=;state=;gender=;locale=;oldpass=;newpass=;repeatpass=
WebUploadedFileUrlPattern = files/standard/avatar/([0-9|a-f]{32})(_M[0-9]{1,2}[A-Z|0-9]*)+_[0-9]{5,6}.txt
WebUploadFilesURL = http://127.0.0.1/collabtive/manageuser.php?action=profile&id=1&mode=edited
WebUploadFilesParameter =
[DETECTOR_CONF]
MutationChainLimit = 99
MonitorEnable = False
MonitorHost = 127.0.0.1
MonitorPort =
| {
"pile_set_name": "Github"
} |
###
default behavior: log chat logs to file
@command top (count) (chat-lines): show group's chat ranks in (count) depends on recently (chat-lines) history.
need configs:
-
###
module.exports = (content ,send, robot, message)->
"nothing"
| {
"pile_set_name": "Github"
} |
/*-
* <<
* DBus
* ==
* Copyright (C) 2016 - 2019 Bridata
* ==
* 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.creditease.dbus.router.spout.ack;
import com.creditease.dbus.router.bean.Ack;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
/**
* Created by Administrator on 2018/6/4.
*/
public class AckWindows {
private Logger logger = LoggerFactory.getLogger(AckWindows.class);
private Map<String, Map<Long, Ack>> ackBooks = new HashMap<>();
private long time = 0;
private long baseTime = 0;
private AckCallBack callBack = null;
public AckWindows(long time, AckCallBack cb) {
this.time = time;
this.baseTime = System.currentTimeMillis();
this.callBack = cb;
}
public String obtainKey(Ack ackVo) {
return StringUtils.joinWith("_", ackVo.getTopic(), ackVo.getPartition());
}
public void add(Ack ackVo) {
ackVo.setStatus(Ack.INIT);
String key = obtainKey(ackVo);
if (ackBooks.containsKey(key)) {
ackBooks.get(key).put(ackVo.getOffset(), ackVo);
} else {
Map<Long, Ack> map = new TreeMap<>();
map.put(ackVo.getOffset(), ackVo);
ackBooks.put(key, map);
}
}
public void ack(Ack ackVo) {
logger.debug("topic:{}, partaiton:{}, offset:{}, trigger ack.", ackVo.getTopic(), ackVo.getPartition(), ackVo.getOffset());
doAckOrFail(ackVo, Ack.OK);
flush();
}
public void fail(Ack ackVo) {
logger.debug("topic:{}, partaiton:{}, offset:{}, trigger fail.", ackVo.getTopic(), ackVo.getPartition(), ackVo.getOffset());
if (StringUtils.endsWith(ackVo.getTopic(), "_ctrl"))
ackBooks.get(obtainKey(ackVo)).get(ackVo.getOffset()).setStatus(Ack.OK);
else doAckOrFail(ackVo, Ack.FAIL);
flush();
}
public int size() {
int size = 0;
for (String key : ackBooks.keySet())
size += ackBooks.get(key).size();
return size;
}
private void doAckOrFail(Ack ackVo, int status) {
Map<Long, Ack> book = ackBooks.get(obtainKey(ackVo));
if (book == null || book.isEmpty()) {
logger.debug("topic:{}, partaiton:{}, offset:{}, 发生过fail,已将队列清空,执行跳过处理.",
ackVo.getTopic(), ackVo.getPartition(), ackVo.getOffset());
return;
}
if (book.get(ackVo.getOffset()) == null) {
logger.debug("topic:{}, partaiton:{}, offset:{}, 发生过fail,已将该ack对象清空,执行跳过处理.",
ackVo.getTopic(), ackVo.getPartition(), ackVo.getOffset());
return;
}
book.get(ackVo.getOffset()).setStatus(status);
}
public void flush() {
if (System.currentTimeMillis() - baseTime >= time) {
for (String key : ackBooks.keySet()) {
Map<Long, Ack> map = ackBooks.get(key);
Ack preValue = null;
boolean isFail = false;
List<Long> okOffsetList = new ArrayList<>();
for (Map.Entry<Long, Ack> entry : map.entrySet()) {
Ack value = entry.getValue();
if (Ack.INIT == value.getStatus()) {
logger.info("topic:{}, partaiton:{}, offset:{}, status: init",
value.getTopic(), value.getPartition(), value.getOffset());
if (preValue != null) this.callBack.ack(preValue);
break;
} else if (Ack.OK == value.getStatus()) {
logger.info("topic:{}, partaiton:{}, offset:{}, status: ok",
value.getTopic(), value.getPartition(), value.getOffset());
okOffsetList.add(value.getOffset());
preValue = value;
continue;
} else if (Ack.FAIL == value.getStatus()) {
logger.info("topic:{}, partaiton:{}, offset:{}, status: fail",
value.getTopic(), value.getPartition(), value.getOffset());
this.callBack.fail(value);
isFail = true;
break;
}
}
if (isFail) {
ackBooks.get(key).clear();
} else {
for (Long offset : okOffsetList) {
ackBooks.get(key).remove(offset);
}
}
}
baseTime = System.currentTimeMillis();
}
}
public void clear() {
flush();
for (String key : ackBooks.keySet()) ackBooks.get(key).clear();
}
}
| {
"pile_set_name": "Github"
} |
TITLE by YOUR_NAME_HERE
========================================================
```{r echo=FALSE, message=FALSE, warning=FALSE, packages}
# Load all of the packages that you end up using
# in your analysis in this code chunk.
# Notice that the parameter "echo" was set to FALSE for this code chunk.
# This prevents the code from displaying in the knitted HTML output.
# You should set echo=FALSE for all code chunks in your file.
library(ggplot2)
```
```{r echo=FALSE, Load_the_Data}
# Load the Data
```
# Univariate Plots Section
```{r echo=FALSE, Univariate_Plots}
```
# Univariate Analysis
### What is the structure of your dataset?
### What is/are the main feature(s) of interest in your dataset?
### What other features in the dataset do you think will help support your investigation into your feature(s) of interest?
### Did you create any new variables from existing variables in the dataset?
### Of the features you investigated, were there any unusual distributions? Did you perform any operations on the data to tidy, adjust, or change the form of the data? If so, why did you do this?
# Bivariate Plots Section
```{r echo=FALSE, Bivariate_Plots}
```
# Bivariate Analysis
### Talk about some of the relationships you observed in this part of the investigation. How did the feature(s) of interest vary with other features in the dataset?
### Did you observe any interesting relationships between the other features (not the main feature(s) of interest)?
### What was the strongest relationship you found?
# Multivariate Plots Section
```{r echo=FALSE, Multivariate_Plots}
```
# Multivariate Analysis
### Talk about some of the relationships you observed in this part of the investigation. Were there features that strengthened each other in terms of looking at your feature(s) of interest?
### Were there any interesting or surprising interactions between features?
### OPTIONAL: Did you create any models with your dataset? Discuss the strengths and limitations of your model.
------
# Final Plots and Summary
### Plot One
```{r echo=FALSE, Plot_One}
```
### Description One
### Plot Two
```{r echo=FALSE, Plot_Two}
```
### Description Two
### Plot Three
```{r echo=FALSE, Plot_Three}
```
### Description Three
------
# Reflection
| {
"pile_set_name": "Github"
} |
import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="side", parent_name="histogram2d.colorbar.title", **kwargs
):
super(SideValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "colorbars"),
role=kwargs.pop("role", "style"),
values=kwargs.pop("values", ["right", "top", "bottom"]),
**kwargs
)
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>zh-Hans</string>
<key>CFBundleDisplayName</key>
<string>StarDict English-Latin Dictionary</string>
<key>CFBundleIdentifier</key>
<string>com.apple.dictionary.idp-eng-lat</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>English-Latin</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>DCSBuildToolVersion</key>
<integer>1</integer>
<key>DCSDictionaryCSS</key>
<string>DefaultStyle.css</string>
<key>DCSDictionaryCopyright</key>
<string>GNU General Public License</string>
<key>DCSDictionaryManufacturerName</key>
<string>stardict</string>
<key>IDXDictionaryIndexes</key>
<array>
<dict>
<key>IDXIndexAccessMethod</key>
<string>com.apple.TrieAccessMethod</string>
<key>IDXIndexBigEndian</key>
<false/>
<key>IDXIndexDataFields</key>
<dict>
<key>IDXExternalDataFields</key>
<array>
<dict>
<key>IDXDataFieldName</key>
<string>DCSExternalBodyID</string>
<key>IDXDataSize</key>
<integer>4</integer>
<key>IDXIndexName</key>
<string>DCSBodyDataIndex</string>
</dict>
</array>
<key>IDXFixedDataFields</key>
<array>
<dict>
<key>IDXDataFieldName</key>
<string>DCSPrivateFlag</string>
<key>IDXDataSize</key>
<integer>2</integer>
</dict>
</array>
<key>IDXVariableDataFields</key>
<array>
<dict>
<key>IDXDataFieldName</key>
<string>DCSKeyword</string>
<key>IDXDataSizeLength</key>
<integer>2</integer>
</dict>
<dict>
<key>IDXDataFieldName</key>
<string>DCSHeadword</string>
<key>IDXDataSizeLength</key>
<integer>2</integer>
</dict>
<dict>
<key>IDXDataFieldName</key>
<string>DCSAnchor</string>
<key>IDXDataSizeLength</key>
<integer>2</integer>
</dict>
<dict>
<key>IDXDataFieldName</key>
<string>DCSYomiWord</string>
<key>IDXDataSizeLength</key>
<integer>2</integer>
</dict>
</array>
</dict>
<key>IDXIndexDataSizeLength</key>
<integer>2</integer>
<key>IDXIndexKeyMatchingMethods</key>
<array>
<string>IDXExactMatch</string>
<string>IDXPrefixMatch</string>
<string>IDXCommonPrefixMatch</string>
<string>IDXWildcardMatch</string>
</array>
<key>IDXIndexName</key>
<string>DCSKeywordIndex</string>
<key>IDXIndexPath</key>
<string>KeyText.index</string>
<key>IDXIndexSupportDataID</key>
<false/>
<key>IDXIndexWritable</key>
<false/>
<key>TrieAuxiliaryDataFile</key>
<string>KeyText.data</string>
</dict>
<dict>
<key>IDXIndexAccessMethod</key>
<string>com.apple.TrieAccessMethod</string>
<key>IDXIndexBigEndian</key>
<false/>
<key>IDXIndexDataFields</key>
<dict>
<key>IDXExternalDataFields</key>
<array>
<dict>
<key>IDXDataFieldName</key>
<string>DCSExternalBodyID</string>
<key>IDXDataSize</key>
<integer>4</integer>
<key>IDXIndexName</key>
<string>DCSBodyDataIndex</string>
</dict>
</array>
</dict>
<key>IDXIndexDataSizeLength</key>
<integer>2</integer>
<key>IDXIndexKeyMatchingMethods</key>
<array>
<string>IDXExactMatch</string>
</array>
<key>IDXIndexName</key>
<string>DCSReferenceIndex</string>
<key>IDXIndexPath</key>
<string>EntryID.index</string>
<key>IDXIndexSupportDataID</key>
<false/>
<key>IDXIndexWritable</key>
<false/>
<key>TrieAuxiliaryDataFile</key>
<string>EntryID.data</string>
</dict>
<dict>
<key>HeapDataCompressionType</key>
<integer>1</integer>
<key>IDXIndexAccessMethod</key>
<string>com.apple.HeapAccessMethod</string>
<key>IDXIndexBigEndian</key>
<false/>
<key>IDXIndexDataFields</key>
<dict>
<key>IDXVariableDataFields</key>
<array>
<dict>
<key>IDXDataFieldName</key>
<string>DCSBodyData</string>
<key>IDXDataSizeLength</key>
<integer>4</integer>
</dict>
</array>
</dict>
<key>IDXIndexName</key>
<string>DCSBodyDataIndex</string>
<key>IDXIndexPath</key>
<string>Body.data</string>
<key>IDXIndexSupportDataID</key>
<true/>
<key>IDXIndexWritable</key>
<false/>
</dict>
</array>
<key>IDXDictionaryVersion</key>
<integer>1</integer>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
NAME MOLLWEIDE
PURPOSE: Transforms input longitude and latitude to Easting and
Northing for the MOllweide projection. The
longitude and latitude must be in radians. The Easting
and Northing values will be returned in meters.
PROGRAMMER DATE
---------- ----
D. Steinwand, EROS May, 1991; Updated Sept, 1992; Updated Feb, 1993
S. Nelson, EDC Jun, 2993; Made corrections in precision and
number of iterations.
ALGORITHM REFERENCES
1. Snyder, John P. and Voxland, Philip M., "An Album of Map Projections",
U.S. Geological Survey Professional Paper 1453 , United State Government
Printing Office, Washington D.C., 1989.
2. Snyder, John P., "Map Projections--A Working Manual", U.S. Geological
Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United
State Government Printing Office, Washington D.C., 1987.
*******************************************************************************/
Proj4js.Proj.moll = {
/* Initialize the Mollweide projection
------------------------------------*/
init: function(){
//no-op
},
/* Mollweide forward equations--mapping lat,long to x,y
----------------------------------------------------*/
forward: function(p) {
/* Forward equations
-----------------*/
var lon=p.x;
var lat=p.y;
var delta_lon = Proj4js.common.adjust_lon(lon - this.long0);
var theta = lat;
var con = Proj4js.common.PI * Math.sin(lat);
/* Iterate using the Newton-Raphson method to find theta
-----------------------------------------------------*/
for (var i=0;true;i++) {
var delta_theta = -(theta + Math.sin(theta) - con)/ (1.0 + Math.cos(theta));
theta += delta_theta;
if (Math.abs(delta_theta) < Proj4js.common.EPSLN) break;
if (i >= 50) {
Proj4js.reportError("moll:Fwd:IterationError");
//return(241);
}
}
theta /= 2.0;
/* If the latitude is 90 deg, force the x coordinate to be "0 + false easting"
this is done here because of precision problems with "cos(theta)"
--------------------------------------------------------------------------*/
if (Proj4js.common.PI/2 - Math.abs(lat) < Proj4js.common.EPSLN) delta_lon =0;
var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;
var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;
p.x=x;
p.y=y;
return p;
},
inverse: function(p){
var theta;
var arg;
/* Inverse equations
-----------------*/
p.x-= this.x0;
//~ p.y -= this.y0;
var arg = p.y / (1.4142135623731 * this.a);
/* Because of division by zero problems, 'arg' can not be 1.0. Therefore
a number very close to one is used instead.
-------------------------------------------------------------------*/
if(Math.abs(arg) > 0.999999999999) arg=0.999999999999;
var theta =Math.asin(arg);
var lon = Proj4js.common.adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));
if(lon < (-Proj4js.common.PI)) lon= -Proj4js.common.PI;
if(lon > Proj4js.common.PI) lon= Proj4js.common.PI;
arg = (2.0 * theta + Math.sin(2.0 * theta)) / Proj4js.common.PI;
if(Math.abs(arg) > 1.0)arg=1.0;
var lat = Math.asin(arg);
//return(OK);
p.x=lon;
p.y=lat;
return p;
}
};
| {
"pile_set_name": "Github"
} |
java/util/logging/Logger.config(Ljava/lang/String;)V:0
java/util/logging/Logger.entering(Ljava/lang/String;Ljava/lang/String;)V:0,1
java/util/logging/Logger.entering(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V:0,1,2
java/util/logging/Logger.entering(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V:0,1,2
java/util/logging/Logger.exiting(Ljava/lang/String;Ljava/lang/String;)V:0,1
java/util/logging/Logger.exiting(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V:0,1,2
java/util/logging/Logger.fine(Ljava/lang/String;)V:0
java/util/logging/Logger.finer(Ljava/lang/String;)V:0
java/util/logging/Logger.finest(Ljava/lang/String;)V:0
java/util/logging/Logger.info(Ljava/lang/String;)V:0
java/util/logging/Logger.log(Ljava/util/logging/Level;Ljava/lang/String;)V:0
java/util/logging/Logger.log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Object;)V:0,1
java/util/logging/Logger.log(Ljava/util/logging/Level;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
java/util/logging/Logger.log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V:1
java/util/logging/Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V:0,1,2
java/util/logging/Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V:0,1,2,3
java/util/logging/Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V:0,1,2,3
java/util/logging/Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V:1,2,3
java/util/logging/Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/util/function/Supplier;)V:1,2
java/util/logging/Logger.logp(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/function/Supplier;)V:2,3
java/util/logging/Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/util/ResourceBundle;Ljava/lang/String;[Ljava/lang/Object;)V:0,1,3,4
java/util/logging/Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/util/ResourceBundle;Ljava/lang/String;Ljava/lang/Throwable;)V:1,3,4
java/util/logging/Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V:0,2,3
java/util/logging/Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V:0,1,3,4
java/util/logging/Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V:0,1,3,4
java/util/logging/Logger.logrb(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V:1,3,4
java/util/logging/Logger.severe(Ljava/lang/String;)V:0
java/util/logging/Logger.throwing(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V:1,2
java/util/logging/Logger.warning(Ljava/lang/String;)V:0
org/apache/commons/logging/Log.debug(Ljava/lang/Object;)V:0
org/apache/commons/logging/Log.debug(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/commons/logging/Log.error(Ljava/lang/Object;)V:0
org/apache/commons/logging/Log.error(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/commons/logging/Log.fatal(Ljava/lang/Object;)V:0
org/apache/commons/logging/Log.fatal(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/commons/logging/Log.info(Ljava/lang/Object;)V:0
org/apache/commons/logging/Log.info(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/commons/logging/Log.trace(Ljava/lang/Object;)V:0
org/apache/commons/logging/Log.trace(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/commons/logging/Log.warn(Ljava/lang/Object;)V:0
org/apache/commons/logging/Log.warn(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.debug(Lorg/slf4j/Marker;Ljava/lang/String;)V:0
org/slf4j/Logger.debug(Lorg/slf4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.debug(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.debug(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.debug(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.debug(Ljava/lang/String;)V:0
org/slf4j/Logger.debug(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.debug(Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.debug(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.debug(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.error(Lorg/slf4j/Marker;Ljava/lang/String;)V:0
org/slf4j/Logger.error(Lorg/slf4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.error(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.error(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.error(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.error(Ljava/lang/String;)V:0
org/slf4j/Logger.error(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.error(Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.error(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.info(Lorg/slf4j/Marker;Ljava/lang/String;)V:0
org/slf4j/Logger.info(Lorg/slf4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.info(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.info(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.info(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.info(Ljava/lang/String;)V:0
org/slf4j/Logger.info(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.info(Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.info(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.info(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.trace(Lorg/slf4j/Marker;Ljava/lang/String;)V:0
org/slf4j/Logger.trace(Lorg/slf4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.trace(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.trace(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.trace(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.trace(Ljava/lang/String;)V:0
org/slf4j/Logger.trace(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.trace(Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.trace(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.trace(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.warn(Lorg/slf4j/Marker;Ljava/lang/String;)V:0
org/slf4j/Logger.warn(Lorg/slf4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.warn(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.warn(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.warn(Lorg/slf4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/slf4j/Logger.warn(Ljava/lang/String;)V:0
org/slf4j/Logger.warn(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/slf4j/Logger.warn(Ljava/lang/String;Ljava/lang/Object;)V:0,1
org/slf4j/Logger.warn(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V:0,1,2
org/slf4j/Logger.warn(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.debug(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.debug(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.debug(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.debug(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.debug(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.debug(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.debug(Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.debug(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.debug(Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.debug(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.debug(Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.debug(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.entry([Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.error(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.error(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.error(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.error(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.error(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.error(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.error(Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.error(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.error(Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.error(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.error(Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.error(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.fatal(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.fatal(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.fatal(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.fatal(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.fatal(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.fatal(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.fatal(Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.fatal(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.fatal(Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.fatal(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.fatal(Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.fatal(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.info(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.info(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.info(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.info(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.info(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.info(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.info(Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.info(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.info(Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.info(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.info(Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.info(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Lorg/slf4j/Marker;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Lorg/slf4j/Marker;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.log(Lorg/apache/logging/log4j/Level;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.printf(Lorg/apache/logging/log4j/Level;Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.printf(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.trace(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.trace(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.trace(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.trace(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.trace(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.trace(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.trace(Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.trace(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.trace(Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.trace(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.trace(Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.trace(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.warn(Ljava/lang/Object;)V:0
org/apache/logging/log4j/Logger.warn(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/logging/log4j/Logger.warn(Ljava/lang/String;)V:0
org/apache/logging/log4j/Logger.warn(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/apache/logging/log4j/Logger.warn(Ljava/lang/String;Lorg/apache/logging/log4j/util/Supplier;)V:1
org/apache/logging/log4j/Logger.warn(Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/log4j/Category.debug(Ljava/lang/Object;)V:0
org/apache/log4j/Category.debug(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Category.error(Ljava/lang/Object;)V:0
org/apache/log4j/Category.error(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Category.fatal(Ljava/lang/Object;)V:0
org/apache/log4j/Category.fatal(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Category.info(Ljava/lang/Object;)V:0
org/apache/log4j/Category.info(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Category.l7dlog(Lorg/apache/log4j/Priority;Ljava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V:1,2
org/apache/log4j/Category.l7dlog(Lorg/apache/log4j/Priority;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/log4j/Category.log(Lorg/apache/log4j/Priority;Ljava/lang/Object;)V:0
org/apache/log4j/Category.log(Lorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Category.log(Ljava/lang/String;Lorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V:1,3
org/apache/log4j/Category.warn(Ljava/lang/Object;)V:0
org/apache/log4j/Category.warn(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.debug(Ljava/lang/Object;)V:0
org/apache/log4j/Logger.debug(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.error(Ljava/lang/Object;)V:0
org/apache/log4j/Logger.error(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.fatal(Ljava/lang/Object;)V:0
org/apache/log4j/Logger.fatal(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.info(Ljava/lang/Object;)V:0
org/apache/log4j/Logger.info(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.l7dlog(Lorg/apache/log4j/Priority;Ljava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V:1,2
org/apache/log4j/Logger.l7dlog(Lorg/apache/log4j/Priority;Ljava/lang/String;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.log(Lorg/apache/log4j/Priority;Ljava/lang/Object;)V:0
org/apache/log4j/Logger.log(Lorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.log(Ljava/lang/String;Lorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V:1,3
org/apache/log4j/Logger.warn(Ljava/lang/Object;)V:0
org/apache/log4j/Logger.warn(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/apache/log4j/Logger.trace(Ljava/lang/Object;)V:0
org/apache/log4j/Logger.trace(Ljava/lang/Object;Ljava/lang/Throwable;)V:1
org/pmw/tinylog/Logger.debug(Ljava/lang/Object;)V:0
org/pmw/tinylog/Logger.debug(Ljava/lang/String;)V:0
org/pmw/tinylog/Logger.debug(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.debug(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.error(Ljava/lang/Object;)V:0
org/pmw/tinylog/Logger.error(Ljava/lang/String;)V:0
org/pmw/tinylog/Logger.error(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.error(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.info(Ljava/lang/Object;)V:0
org/pmw/tinylog/Logger.info(Ljava/lang/String;)V:0
org/pmw/tinylog/Logger.info(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.info(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.trace(Ljava/lang/Object;)V:0
org/pmw/tinylog/Logger.trace(Ljava/lang/String;)V:0
org/pmw/tinylog/Logger.trace(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.trace(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.warn(Ljava/lang/Object;)V:0
org/pmw/tinylog/Logger.warn(Ljava/lang/String;)V:0
org/pmw/tinylog/Logger.warn(Ljava/lang/String;[Ljava/lang/Object;)V:0,1
org/pmw/tinylog/Logger.warn(Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V:0,1
| {
"pile_set_name": "Github"
} |
{
"name": "Dreambox",
"author": "Brendan Coles <[email protected]>, Andrew Horton",
"version": "0.2",
"description": "The Dreambox is a series of Linux-powered DVB satellite, terrestrial and cable digital television receivers (set-top box), produced by German multimedia vendor Dream Multimedia. Enigma2 WebInterface - Control a DreamBox using a Browser. The Dreambox Webinterface (short WebIf) is included in all newer Images. - More info: http://en.wikipedia.org/wiki/Dreambox",
"website": null,
"matches": [
{
"url": "/web-data/img/favicon.ico",
"md5": "d9aa63661d742d5f7c7300d02ac18d69"
},
{
"search": "headers[server]",
"regexp": "(?-mix:^Enigma2 WebInterface Server ([\\d\\.]+)$)",
"offset": 1
},
{
"regexp": "(?-mix:^TwistedWeb)",
"search": "headers[server]"
},
{
"search": "headers[server]",
"regexp": "(?-mix:^TwistedWeb\\/([\\d\\.]+))",
"offset": 1
}
]
}
| {
"pile_set_name": "Github"
} |
# libvdpau-sunxi
# depends on libcedrus
# depends on libvdpau
# dev branch depends on libcsptr-dev
local package_name="libvdpau-sunxi"
local package_repo="https://github.com/linux-sunxi/libvdpau-sunxi.git"
local package_ref="branch:master"
local package_upstream_version="0.5.1"
local package_builddeps="libpixman-1-dev pkg-config"
local package_install_target="libvdpau-sunxi1"
local package_component="${release}-desktop"
package_checkbuild()
{
# we don't support running kernels < 3.13 on Stretch or Bionic
[[ $release != stretch && $release != bionic && $release != buster && $release != disco ]]
}
package_checkinstall()
{
[[ ( $LINUXFAMILY == sun*i || $LINUXFAMILY == pine64 ) && $RELEASE != stretch && $RELEASE != bionic && $BRANCH == default && $BUILD_DESKTOP == yes ]]
}
| {
"pile_set_name": "Github"
} |
<link rel="stylesheet" href="//example.com/style.min.css">
<script src="https://www.example.com/script.js"></script>
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2008 Google 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 java.util;
import static javaemul.internal.Coercions.ensureInt;
import java.io.Serializable;
/**
* Implementation of Map interface based on a hash table. <a
* href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/HashMap.html">[Sun
* docs]</a>
*
* @param <K> key type
* @param <V> value type
*/
public class HashMap<K, V> extends AbstractHashMap<K, V> implements Cloneable,
Serializable {
/**
* Ensures that RPC will consider type parameter K to be exposed. It will be
* pruned by dead code elimination.
*/
@SuppressWarnings("unused")
private K exposeKey;
/**
* Ensures that RPC will consider type parameter V to be exposed. It will be
* pruned by dead code elimination.
*/
@SuppressWarnings("unused")
private V exposeValue;
public HashMap() {
}
public HashMap(int ignored) {
super(ignored);
}
public HashMap(int ignored, float alsoIgnored) {
super(ignored, alsoIgnored);
}
public HashMap(Map<? extends K, ? extends V> toBeCopied) {
super(toBeCopied);
}
public Object clone() {
return new HashMap<K, V>(this);
}
@Override
boolean equals(Object value1, Object value2) {
return Objects.equals(value1, value2);
}
@Override
int getHashCode(Object key) {
int hashCode = key.hashCode();
// Coerce to int -- our classes all do this, but a user-written class might not.
return ensureInt(hashCode);
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2018 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 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 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.
*/
#pragma once
#include "StackAlignment.h"
#include "VMEntryRecord.h"
namespace JSC {
struct EntryFrame {
#if !ENABLE(C_LOOP) && NUMBER_OF_CALLEE_SAVES_REGISTERS > 0
static ptrdiff_t vmEntryRecordOffset()
{
EntryFrame* fakeEntryFrame = reinterpret_cast<EntryFrame*>(0x1000);
VMEntryRecord* record = vmEntryRecord(fakeEntryFrame);
return static_cast<ptrdiff_t>(
reinterpret_cast<char*>(record) - reinterpret_cast<char*>(fakeEntryFrame));
}
static ptrdiff_t calleeSaveRegistersBufferOffset()
{
return vmEntryRecordOffset() + OBJECT_OFFSETOF(VMEntryRecord, calleeSaveRegistersBuffer);
}
#endif
};
} // namespace JSC
| {
"pile_set_name": "Github"
} |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Kulouwang_show1
m_Shader: {fileID: 4800000, guid: a880737a0914e2349a5c9d5225256018, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LightTex:
m_Texture: {fileID: 2800000, guid: 669cab65a8be7434f96b856caa93f457, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 1b605e25ae51006428f48eaf3fd83f52, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTex:
m_Texture: {fileID: 2800000, guid: 1ab7d7b2b88b13e4c9c889f265ca4b0f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NoiseTex:
m_Texture: {fileID: 2800000, guid: 1eabb261fc8d3ad49bba6276d848c308, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RampMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ReflectTex:
m_Texture: {fileID: 2800000, guid: 4ee1470b54f61824aa5ec02f720a764c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _Alpha: 1
- _Blink: 0
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _MMultiplier: 18.67
- _Metallic: 0
- _Mode: 0
- _OccPower: 0.44
- _OcclusionStrength: 1
- _Parallax: 0.02
- _ReflectPower: 1.36
- _ReflectionMultiplier: 2.97
- _Scroll2X: 22
- _Scroll2Y: 3
- _Shinness: 1.1
- _SpecMultiplier: 1
- _SpecPower: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _AmbientColor: {r: 0.37678418, g: 0.41550457, b: 0.50735295, a: 1}
- _Color: {r: 0.588, g: 0.588, b: 0.588, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _MainColor: {r: 1, g: 1, b: 1, a: 1}
- _NoiseColor: {r: 1, g: 0.7626775, b: 0.33823532, a: 1}
- _OccColor: {r: 0, g: 0.58, b: 0.99, a: 1}
- _ReflectColor: {r: 1, g: 0.8264705, b: 0.5661765, a: 1}
- _SpecColor: {r: 1, g: 0.55862063, b: 0, a: 0}
| {
"pile_set_name": "Github"
} |
{
"name": "generator-jhipster-foo",
"version": "9.9.9",
"dependencies": {
"yeoman-generator": "*"
},
"peerDependencies": {
"generator-jhipster": "1.1.1"
}
}
| {
"pile_set_name": "Github"
} |
0.3.0 / 2014-09-07
==================
* Support Node.js 0.6
* Throw error when parameter format invalid on parse
0.2.0 / 2014-06-18
==================
* Add `typer.format()` to format media types
0.1.0 / 2014-06-17
==================
* Accept `req` as argument to `parse`
* Accept `res` as argument to `parse`
* Parse media type with extra LWS between type and first parameter
0.0.0 / 2014-06-13
==================
* Initial implementation
| {
"pile_set_name": "Github"
} |
---
id: version-7.0.0-babel-plugin-transform-shorthand-properties
title: @babel/plugin-transform-shorthand-properties
sidebar_label: transform-shorthand-properties
original_id: babel-plugin-transform-shorthand-properties
---
## Example
**In**
```js
var o = { a, b, c };
```
**Out**
```js
var o = { a: a, b: b, c: c };
```
**In**
```js
var cat = {
getName() {
return name;
}
};
```
**Out**
```js
var cat = {
getName: function () {
return name;
}
};
```
## Installation
```sh
npm install --save-dev @babel/plugin-transform-shorthand-properties
```
## Usage
### With a configuration file (Recommended)
```json
{
"plugins": ["@babel/plugin-transform-shorthand-properties"]
}
```
### Via CLI
```sh
babel --plugins @babel/plugin-transform-shorthand-properties script.js
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-shorthand-properties"]
});
```
| {
"pile_set_name": "Github"
} |
/*
* Generated by confdc --mib2yang-std
* Source: mgmt/dmi/model/mib/src/IPV6-FLOW-LABEL-MIB.mib
*/
/*
* This YANG module has been generated by smidump 0.5.0:
*
* smidump -f yang IPV6-FLOW-LABEL-MIB
*
* Do not edit. Edit the source file instead!
*/
module IPV6-FLOW-LABEL-MIB {
namespace "urn:ietf:params:xml:ns:yang:smiv2:IPV6-FLOW-LABEL-MIB";
prefix IPV6-FLOW-LABEL-MIB;
import ietf-yang-smiv2 {
prefix "smiv2";
}
organization
"IETF Operations and Management Area";
contact
"Bert Wijnen (Editor)
Lucent Technologies
Schagen 33
3461 GL Linschoten
Netherlands
Phone: +31 348-407-775
EMail: [email protected]
Send comments to <[email protected]>. ";
description
"This MIB module provides commonly used textual
conventions for IPv6 Flow Labels.
Copyright (C) The Internet Society (2003). This
version of this MIB module is part of RFC 3595,
see the RFC itself for full legal notices. ";
revision 2003-08-28 {
description
"Initial version, published as RFC 3595.";
}
typedef IPv6FlowLabel {
type int32 {
range "0..1048575";
}
description
"The flow identifier or Flow Label in an IPv6
packet header that may be used to discriminate
traffic flows. ";
reference
"Internet Protocol, Version 6 (IPv6) specification,
section 6. RFC 2460. ";
smiv2:display-hint "d";
}
typedef IPv6FlowLabelOrAny {
type int32 {
range "-1..1048575";
}
description
"The flow identifier or Flow Label in an IPv6
packet header that may be used to discriminate
traffic flows. The value of -1 is used to
indicate a wildcard, i.e. any value. ";
smiv2:display-hint "d";
}
smiv2:alias "ipv6FlowLabelMIB" {
smiv2:oid "1.3.6.1.2.1.103";
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2007 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.
* 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
*/
module window {
interface [
GenerateIsReachable=ImplFrame,
OmitConstructor
] Screen {
readonly attribute unsigned long height;
readonly attribute unsigned long width;
readonly attribute unsigned long colorDepth;
readonly attribute unsigned long pixelDepth;
readonly attribute long availLeft;
readonly attribute long availTop;
readonly attribute unsigned long availHeight;
readonly attribute unsigned long availWidth;
};
}
| {
"pile_set_name": "Github"
} |
--------------ofCamera parameters--------------
transformMatrix
-0.763994, 0.617901, -0.185772, 0
0.53246, 0.76639, 0.359349, 0
0.364416, 0.175625, -0.914526, 0
72.8843, 35.1243, -182.905, 1
fov
60
near
9.09327
far
9093.27
lensOffset
0, 0
isOrtho
0
--------------ofEasyCam parameters--------------
target
0, 0, 0
bEnableMouseMiddleButton
1
bMouseInputEnabled
1
drag
0.9
doTranslationKey
m
| {
"pile_set_name": "Github"
} |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.extensions;
import com.microsoft.graph.requests.extensions.IWorkbookFunctionsImRealRequest;
import com.microsoft.graph.http.IRequestBuilder;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The interface for the Workbook Functions Im Real Request Builder.
*/
public interface IWorkbookFunctionsImRealRequestBuilder extends IRequestBuilder {
/**
* Creates the IWorkbookFunctionsImRealRequest
*
* @param requestOptions the options for the request
* @return the IWorkbookFunctionsImRealRequest instance
*/
IWorkbookFunctionsImRealRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions);
/**
* Creates the IWorkbookFunctionsImRealRequest with specific options instead of the existing options
*
* @param requestOptions the options for the request
* @return the IWorkbookFunctionsImRealRequest instance
*/
IWorkbookFunctionsImRealRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions);
}
| {
"pile_set_name": "Github"
} |
// mkerrors.sh -m64
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build amd64,solaris
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs -- -m64 _const.go
package unix
import "syscall"
const (
AF_802 = 0x12
AF_APPLETALK = 0x10
AF_CCITT = 0xa
AF_CHAOS = 0x5
AF_DATAKIT = 0x9
AF_DECnet = 0xc
AF_DLI = 0xd
AF_ECMA = 0x8
AF_FILE = 0x1
AF_GOSIP = 0x16
AF_HYLINK = 0xf
AF_IMPLINK = 0x3
AF_INET = 0x2
AF_INET6 = 0x1a
AF_INET_OFFLOAD = 0x1e
AF_IPX = 0x17
AF_KEY = 0x1b
AF_LAT = 0xe
AF_LINK = 0x19
AF_LOCAL = 0x1
AF_MAX = 0x20
AF_NBS = 0x7
AF_NCA = 0x1c
AF_NIT = 0x11
AF_NS = 0x6
AF_OSI = 0x13
AF_OSINET = 0x15
AF_PACKET = 0x20
AF_POLICY = 0x1d
AF_PUP = 0x4
AF_ROUTE = 0x18
AF_SNA = 0xb
AF_TRILL = 0x1f
AF_UNIX = 0x1
AF_UNSPEC = 0x0
AF_X25 = 0x14
ARPHRD_ARCNET = 0x7
ARPHRD_ATM = 0x10
ARPHRD_AX25 = 0x3
ARPHRD_CHAOS = 0x5
ARPHRD_EETHER = 0x2
ARPHRD_ETHER = 0x1
ARPHRD_FC = 0x12
ARPHRD_FRAME = 0xf
ARPHRD_HDLC = 0x11
ARPHRD_IB = 0x20
ARPHRD_IEEE802 = 0x6
ARPHRD_IPATM = 0x13
ARPHRD_METRICOM = 0x17
ARPHRD_TUNNEL = 0x1f
B0 = 0x0
B110 = 0x3
B115200 = 0x12
B1200 = 0x9
B134 = 0x4
B150 = 0x5
B153600 = 0x13
B1800 = 0xa
B19200 = 0xe
B200 = 0x6
B230400 = 0x14
B2400 = 0xb
B300 = 0x7
B307200 = 0x15
B38400 = 0xf
B460800 = 0x16
B4800 = 0xc
B50 = 0x1
B57600 = 0x10
B600 = 0x8
B75 = 0x2
B76800 = 0x11
B921600 = 0x17
B9600 = 0xd
BIOCFLUSH = 0x20004268
BIOCGBLEN = 0x40044266
BIOCGDLT = 0x4004426a
BIOCGDLTLIST = -0x3fefbd89
BIOCGDLTLIST32 = -0x3ff7bd89
BIOCGETIF = 0x4020426b
BIOCGETLIF = 0x4078426b
BIOCGHDRCMPLT = 0x40044274
BIOCGRTIMEOUT = 0x4010427b
BIOCGRTIMEOUT32 = 0x4008427b
BIOCGSEESENT = 0x40044278
BIOCGSTATS = 0x4080426f
BIOCGSTATSOLD = 0x4008426f
BIOCIMMEDIATE = -0x7ffbbd90
BIOCPROMISC = 0x20004269
BIOCSBLEN = -0x3ffbbd9a
BIOCSDLT = -0x7ffbbd8a
BIOCSETF = -0x7fefbd99
BIOCSETF32 = -0x7ff7bd99
BIOCSETIF = -0x7fdfbd94
BIOCSETLIF = -0x7f87bd94
BIOCSHDRCMPLT = -0x7ffbbd8b
BIOCSRTIMEOUT = -0x7fefbd86
BIOCSRTIMEOUT32 = -0x7ff7bd86
BIOCSSEESENT = -0x7ffbbd87
BIOCSTCPF = -0x7fefbd8e
BIOCSUDPF = -0x7fefbd8d
BIOCVERSION = 0x40044271
BPF_A = 0x10
BPF_ABS = 0x20
BPF_ADD = 0x0
BPF_ALIGNMENT = 0x4
BPF_ALU = 0x4
BPF_AND = 0x50
BPF_B = 0x10
BPF_DFLTBUFSIZE = 0x100000
BPF_DIV = 0x30
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
BPF_JA = 0x0
BPF_JEQ = 0x10
BPF_JGE = 0x30
BPF_JGT = 0x20
BPF_JMP = 0x5
BPF_JSET = 0x40
BPF_K = 0x0
BPF_LD = 0x0
BPF_LDX = 0x1
BPF_LEN = 0x80
BPF_LSH = 0x60
BPF_MAJOR_VERSION = 0x1
BPF_MAXBUFSIZE = 0x1000000
BPF_MAXINSNS = 0x200
BPF_MEM = 0x60
BPF_MEMWORDS = 0x10
BPF_MINBUFSIZE = 0x20
BPF_MINOR_VERSION = 0x1
BPF_MISC = 0x7
BPF_MSH = 0xa0
BPF_MUL = 0x20
BPF_NEG = 0x80
BPF_OR = 0x40
BPF_RELEASE = 0x30bb6
BPF_RET = 0x6
BPF_RSH = 0x70
BPF_ST = 0x2
BPF_STX = 0x3
BPF_SUB = 0x10
BPF_TAX = 0x0
BPF_TXA = 0x80
BPF_W = 0x0
BPF_X = 0x8
BRKINT = 0x2
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
CBAUD = 0xf
CFLUSH = 0xf
CIBAUD = 0xf0000
CLOCAL = 0x800
CLOCK_HIGHRES = 0x4
CLOCK_LEVEL = 0xa
CLOCK_MONOTONIC = 0x4
CLOCK_PROCESS_CPUTIME_ID = 0x5
CLOCK_PROF = 0x2
CLOCK_REALTIME = 0x3
CLOCK_THREAD_CPUTIME_ID = 0x2
CLOCK_VIRTUAL = 0x1
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
CS5 = 0x0
CS6 = 0x10
CS7 = 0x20
CS8 = 0x30
CSIZE = 0x30
CSTART = 0x11
CSTATUS = 0x14
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
CSWTCH = 0x1a
DLT_AIRONET_HEADER = 0x78
DLT_APPLE_IP_OVER_IEEE1394 = 0x8a
DLT_ARCNET = 0x7
DLT_ARCNET_LINUX = 0x81
DLT_ATM_CLIP = 0x13
DLT_ATM_RFC1483 = 0xb
DLT_AURORA = 0x7e
DLT_AX25 = 0x3
DLT_BACNET_MS_TP = 0xa5
DLT_CHAOS = 0x5
DLT_CISCO_IOS = 0x76
DLT_C_HDLC = 0x68
DLT_DOCSIS = 0x8f
DLT_ECONET = 0x73
DLT_EN10MB = 0x1
DLT_EN3MB = 0x2
DLT_ENC = 0x6d
DLT_ERF_ETH = 0xaf
DLT_ERF_POS = 0xb0
DLT_FDDI = 0xa
DLT_FRELAY = 0x6b
DLT_GCOM_SERIAL = 0xad
DLT_GCOM_T1E1 = 0xac
DLT_GPF_F = 0xab
DLT_GPF_T = 0xaa
DLT_GPRS_LLC = 0xa9
DLT_HDLC = 0x10
DLT_HHDLC = 0x79
DLT_HIPPI = 0xf
DLT_IBM_SN = 0x92
DLT_IBM_SP = 0x91
DLT_IEEE802 = 0x6
DLT_IEEE802_11 = 0x69
DLT_IEEE802_11_RADIO = 0x7f
DLT_IEEE802_11_RADIO_AVS = 0xa3
DLT_IPNET = 0xe2
DLT_IPOIB = 0xa2
DLT_IP_OVER_FC = 0x7a
DLT_JUNIPER_ATM1 = 0x89
DLT_JUNIPER_ATM2 = 0x87
DLT_JUNIPER_CHDLC = 0xb5
DLT_JUNIPER_ES = 0x84
DLT_JUNIPER_ETHER = 0xb2
DLT_JUNIPER_FRELAY = 0xb4
DLT_JUNIPER_GGSN = 0x85
DLT_JUNIPER_MFR = 0x86
DLT_JUNIPER_MLFR = 0x83
DLT_JUNIPER_MLPPP = 0x82
DLT_JUNIPER_MONITOR = 0xa4
DLT_JUNIPER_PIC_PEER = 0xae
DLT_JUNIPER_PPP = 0xb3
DLT_JUNIPER_PPPOE = 0xa7
DLT_JUNIPER_PPPOE_ATM = 0xa8
DLT_JUNIPER_SERVICES = 0x88
DLT_LINUX_IRDA = 0x90
DLT_LINUX_LAPD = 0xb1
DLT_LINUX_SLL = 0x71
DLT_LOOP = 0x6c
DLT_LTALK = 0x72
DLT_MTP2 = 0x8c
DLT_MTP2_WITH_PHDR = 0x8b
DLT_MTP3 = 0x8d
DLT_NULL = 0x0
DLT_PCI_EXP = 0x7d
DLT_PFLOG = 0x75
DLT_PFSYNC = 0x12
DLT_PPP = 0x9
DLT_PPP_BSDOS = 0xe
DLT_PPP_PPPD = 0xa6
DLT_PRISM_HEADER = 0x77
DLT_PRONET = 0x4
DLT_RAW = 0xc
DLT_RAWAF_MASK = 0x2240000
DLT_RIO = 0x7c
DLT_SCCP = 0x8e
DLT_SLIP = 0x8
DLT_SLIP_BSDOS = 0xd
DLT_SUNATM = 0x7b
DLT_SYMANTEC_FIREWALL = 0x63
DLT_TZSP = 0x80
ECHO = 0x8
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
EMPTY_SET = 0x0
EMT_CPCOVF = 0x1
EQUALITY_CHECK = 0x0
EXTA = 0xe
EXTB = 0xf
FD_CLOEXEC = 0x1
FD_NFDBITS = 0x40
FD_SETSIZE = 0x10000
FF0 = 0x0
FF1 = 0x8000
FFDLY = 0x8000
FLUSHALL = 0x1
FLUSHDATA = 0x0
FLUSHO = 0x2000
F_ALLOCSP = 0xa
F_ALLOCSP64 = 0xa
F_BADFD = 0x2e
F_BLKSIZE = 0x13
F_BLOCKS = 0x12
F_CHKFL = 0x8
F_COMPAT = 0x8
F_DUP2FD = 0x9
F_DUP2FD_CLOEXEC = 0x24
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x25
F_FLOCK = 0x35
F_FLOCK64 = 0x35
F_FLOCKW = 0x36
F_FLOCKW64 = 0x36
F_FREESP = 0xb
F_FREESP64 = 0xb
F_GETFD = 0x1
F_GETFL = 0x3
F_GETLK = 0xe
F_GETLK64 = 0xe
F_GETOWN = 0x17
F_GETXFL = 0x2d
F_HASREMOTELOCKS = 0x1a
F_ISSTREAM = 0xd
F_MANDDNY = 0x10
F_MDACC = 0x20
F_NODNY = 0x0
F_NPRIV = 0x10
F_OFD_GETLK = 0x2f
F_OFD_GETLK64 = 0x2f
F_OFD_SETLK = 0x30
F_OFD_SETLK64 = 0x30
F_OFD_SETLKW = 0x31
F_OFD_SETLKW64 = 0x31
F_PRIV = 0xf
F_QUOTACTL = 0x11
F_RDACC = 0x1
F_RDDNY = 0x1
F_RDLCK = 0x1
F_REVOKE = 0x19
F_RMACC = 0x4
F_RMDNY = 0x4
F_RWACC = 0x3
F_RWDNY = 0x3
F_SETFD = 0x2
F_SETFL = 0x4
F_SETLK = 0x6
F_SETLK64 = 0x6
F_SETLK64_NBMAND = 0x2a
F_SETLKW = 0x7
F_SETLKW64 = 0x7
F_SETLK_NBMAND = 0x2a
F_SETOWN = 0x18
F_SHARE = 0x28
F_SHARE_NBMAND = 0x2b
F_UNLCK = 0x3
F_UNLKSYS = 0x4
F_UNSHARE = 0x29
F_WRACC = 0x2
F_WRDNY = 0x2
F_WRLCK = 0x2
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
ICRNL = 0x100
IEXTEN = 0x8000
IFF_ADDRCONF = 0x80000
IFF_ALLMULTI = 0x200
IFF_ANYCAST = 0x400000
IFF_BROADCAST = 0x2
IFF_CANTCHANGE = 0x7f203003b5a
IFF_COS_ENABLED = 0x200000000
IFF_DEBUG = 0x4
IFF_DEPRECATED = 0x40000
IFF_DHCPRUNNING = 0x4000
IFF_DUPLICATE = 0x4000000000
IFF_FAILED = 0x10000000
IFF_FIXEDMTU = 0x1000000000
IFF_INACTIVE = 0x40000000
IFF_INTELLIGENT = 0x400
IFF_IPMP = 0x8000000000
IFF_IPMP_CANTCHANGE = 0x10000000
IFF_IPMP_INVALID = 0x1ec200080
IFF_IPV4 = 0x1000000
IFF_IPV6 = 0x2000000
IFF_L3PROTECT = 0x40000000000
IFF_LOOPBACK = 0x8
IFF_MULTICAST = 0x800
IFF_MULTI_BCAST = 0x1000
IFF_NOACCEPT = 0x4000000
IFF_NOARP = 0x80
IFF_NOFAILOVER = 0x8000000
IFF_NOLINKLOCAL = 0x20000000000
IFF_NOLOCAL = 0x20000
IFF_NONUD = 0x200000
IFF_NORTEXCH = 0x800000
IFF_NOTRAILERS = 0x20
IFF_NOXMIT = 0x10000
IFF_OFFLINE = 0x80000000
IFF_POINTOPOINT = 0x10
IFF_PREFERRED = 0x400000000
IFF_PRIVATE = 0x8000
IFF_PROMISC = 0x100
IFF_ROUTER = 0x100000
IFF_RUNNING = 0x40
IFF_STANDBY = 0x20000000
IFF_TEMPORARY = 0x800000000
IFF_UNNUMBERED = 0x2000
IFF_UP = 0x1
IFF_VIRTUAL = 0x2000000000
IFF_VRRP = 0x10000000000
IFF_XRESOLV = 0x100000000
IFNAMSIZ = 0x10
IFT_1822 = 0x2
IFT_6TO4 = 0xca
IFT_AAL5 = 0x31
IFT_ARCNET = 0x23
IFT_ARCNETPLUS = 0x24
IFT_ATM = 0x25
IFT_CEPT = 0x13
IFT_DS3 = 0x1e
IFT_EON = 0x19
IFT_ETHER = 0x6
IFT_FDDI = 0xf
IFT_FRELAY = 0x20
IFT_FRELAYDCE = 0x2c
IFT_HDH1822 = 0x3
IFT_HIPPI = 0x2f
IFT_HSSI = 0x2e
IFT_HY = 0xe
IFT_IB = 0xc7
IFT_IPV4 = 0xc8
IFT_IPV6 = 0xc9
IFT_ISDNBASIC = 0x14
IFT_ISDNPRIMARY = 0x15
IFT_ISO88022LLC = 0x29
IFT_ISO88023 = 0x7
IFT_ISO88024 = 0x8
IFT_ISO88025 = 0x9
IFT_ISO88026 = 0xa
IFT_LAPB = 0x10
IFT_LOCALTALK = 0x2a
IFT_LOOP = 0x18
IFT_MIOX25 = 0x26
IFT_MODEM = 0x30
IFT_NSIP = 0x1b
IFT_OTHER = 0x1
IFT_P10 = 0xc
IFT_P80 = 0xd
IFT_PARA = 0x22
IFT_PPP = 0x17
IFT_PROPMUX = 0x36
IFT_PROPVIRTUAL = 0x35
IFT_PTPSERIAL = 0x16
IFT_RS232 = 0x21
IFT_SDLC = 0x11
IFT_SIP = 0x1f
IFT_SLIP = 0x1c
IFT_SMDSDXI = 0x2b
IFT_SMDSICIP = 0x34
IFT_SONET = 0x27
IFT_SONETPATH = 0x32
IFT_SONETVT = 0x33
IFT_STARLAN = 0xb
IFT_T1 = 0x12
IFT_ULTRA = 0x1d
IFT_V35 = 0x2d
IFT_X25 = 0x5
IFT_X25DDN = 0x4
IFT_X25PLE = 0x28
IFT_XETHER = 0x1a
IGNBRK = 0x1
IGNCR = 0x80
IGNPAR = 0x4
IMAXBEL = 0x2000
INLCR = 0x40
INPCK = 0x10
IN_AUTOCONF_MASK = 0xffff0000
IN_AUTOCONF_NET = 0xa9fe0000
IN_CLASSA_HOST = 0xffffff
IN_CLASSA_MAX = 0x80
IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 0x18
IN_CLASSB_HOST = 0xffff
IN_CLASSB_MAX = 0x10000
IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 0x10
IN_CLASSC_HOST = 0xff
IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 0x8
IN_CLASSD_HOST = 0xfffffff
IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 0x1c
IN_CLASSE_NET = 0xffffffff
IN_LOOPBACKNET = 0x7f
IN_PRIVATE12_MASK = 0xfff00000
IN_PRIVATE12_NET = 0xac100000
IN_PRIVATE16_MASK = 0xffff0000
IN_PRIVATE16_NET = 0xc0a80000
IN_PRIVATE8_MASK = 0xff000000
IN_PRIVATE8_NET = 0xa000000
IPPROTO_AH = 0x33
IPPROTO_DSTOPTS = 0x3c
IPPROTO_EGP = 0x8
IPPROTO_ENCAP = 0x4
IPPROTO_EON = 0x50
IPPROTO_ESP = 0x32
IPPROTO_FRAGMENT = 0x2c
IPPROTO_GGP = 0x3
IPPROTO_HELLO = 0x3f
IPPROTO_HOPOPTS = 0x0
IPPROTO_ICMP = 0x1
IPPROTO_ICMPV6 = 0x3a
IPPROTO_IDP = 0x16
IPPROTO_IGMP = 0x2
IPPROTO_IP = 0x0
IPPROTO_IPV6 = 0x29
IPPROTO_MAX = 0x100
IPPROTO_ND = 0x4d
IPPROTO_NONE = 0x3b
IPPROTO_OSPF = 0x59
IPPROTO_PIM = 0x67
IPPROTO_PUP = 0xc
IPPROTO_RAW = 0xff
IPPROTO_ROUTING = 0x2b
IPPROTO_RSVP = 0x2e
IPPROTO_SCTP = 0x84
IPPROTO_TCP = 0x6
IPPROTO_UDP = 0x11
IPV6_ADD_MEMBERSHIP = 0x9
IPV6_BOUND_IF = 0x41
IPV6_CHECKSUM = 0x18
IPV6_DONTFRAG = 0x21
IPV6_DROP_MEMBERSHIP = 0xa
IPV6_DSTOPTS = 0xf
IPV6_FLOWINFO_FLOWLABEL = 0xffff0f00
IPV6_FLOWINFO_TCLASS = 0xf00f
IPV6_HOPLIMIT = 0xc
IPV6_HOPOPTS = 0xe
IPV6_JOIN_GROUP = 0x9
IPV6_LEAVE_GROUP = 0xa
IPV6_MULTICAST_HOPS = 0x7
IPV6_MULTICAST_IF = 0x6
IPV6_MULTICAST_LOOP = 0x8
IPV6_NEXTHOP = 0xd
IPV6_PAD1_OPT = 0x0
IPV6_PATHMTU = 0x25
IPV6_PKTINFO = 0xb
IPV6_PREFER_SRC_CGA = 0x20
IPV6_PREFER_SRC_CGADEFAULT = 0x10
IPV6_PREFER_SRC_CGAMASK = 0x30
IPV6_PREFER_SRC_COA = 0x2
IPV6_PREFER_SRC_DEFAULT = 0x15
IPV6_PREFER_SRC_HOME = 0x1
IPV6_PREFER_SRC_MASK = 0x3f
IPV6_PREFER_SRC_MIPDEFAULT = 0x1
IPV6_PREFER_SRC_MIPMASK = 0x3
IPV6_PREFER_SRC_NONCGA = 0x10
IPV6_PREFER_SRC_PUBLIC = 0x4
IPV6_PREFER_SRC_TMP = 0x8
IPV6_PREFER_SRC_TMPDEFAULT = 0x4
IPV6_PREFER_SRC_TMPMASK = 0xc
IPV6_RECVDSTOPTS = 0x28
IPV6_RECVHOPLIMIT = 0x13
IPV6_RECVHOPOPTS = 0x14
IPV6_RECVPATHMTU = 0x24
IPV6_RECVPKTINFO = 0x12
IPV6_RECVRTHDR = 0x16
IPV6_RECVRTHDRDSTOPTS = 0x17
IPV6_RECVTCLASS = 0x19
IPV6_RTHDR = 0x10
IPV6_RTHDRDSTOPTS = 0x11
IPV6_RTHDR_TYPE_0 = 0x0
IPV6_SEC_OPT = 0x22
IPV6_SRC_PREFERENCES = 0x23
IPV6_TCLASS = 0x26
IPV6_UNICAST_HOPS = 0x5
IPV6_UNSPEC_SRC = 0x42
IPV6_USE_MIN_MTU = 0x20
IPV6_V6ONLY = 0x27
IP_ADD_MEMBERSHIP = 0x13
IP_ADD_SOURCE_MEMBERSHIP = 0x17
IP_BLOCK_SOURCE = 0x15
IP_BOUND_IF = 0x41
IP_BROADCAST = 0x106
IP_BROADCAST_TTL = 0x43
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DHCPINIT_IF = 0x45
IP_DONTFRAG = 0x1b
IP_DONTROUTE = 0x105
IP_DROP_MEMBERSHIP = 0x14
IP_DROP_SOURCE_MEMBERSHIP = 0x18
IP_HDRINCL = 0x2
IP_MAXPACKET = 0xffff
IP_MF = 0x2000
IP_MSS = 0x240
IP_MULTICAST_IF = 0x10
IP_MULTICAST_LOOP = 0x12
IP_MULTICAST_TTL = 0x11
IP_NEXTHOP = 0x19
IP_OPTIONS = 0x1
IP_PKTINFO = 0x1a
IP_RECVDSTADDR = 0x7
IP_RECVIF = 0x9
IP_RECVOPTS = 0x5
IP_RECVPKTINFO = 0x1a
IP_RECVRETOPTS = 0x6
IP_RECVSLLA = 0xa
IP_RECVTTL = 0xb
IP_RETOPTS = 0x8
IP_REUSEADDR = 0x104
IP_SEC_OPT = 0x22
IP_TOS = 0x3
IP_TTL = 0x4
IP_UNBLOCK_SOURCE = 0x16
IP_UNSPEC_SRC = 0x42
ISIG = 0x1
ISTRIP = 0x20
IUCLC = 0x200
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
LOCK_UN = 0x8
MADV_ACCESS_DEFAULT = 0x6
MADV_ACCESS_LWP = 0x7
MADV_ACCESS_MANY = 0x8
MADV_DONTNEED = 0x4
MADV_FREE = 0x5
MADV_NORMAL = 0x0
MADV_PURGE = 0x9
MADV_RANDOM = 0x1
MADV_SEQUENTIAL = 0x2
MADV_WILLNEED = 0x3
MAP_32BIT = 0x80
MAP_ALIGN = 0x200
MAP_ANON = 0x100
MAP_ANONYMOUS = 0x100
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_INITDATA = 0x800
MAP_NORESERVE = 0x40
MAP_PRIVATE = 0x2
MAP_RENAME = 0x20
MAP_SHARED = 0x1
MAP_TEXT = 0x400
MAP_TYPE = 0xf
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MSG_CTRUNC = 0x10
MSG_DONTROUTE = 0x4
MSG_DONTWAIT = 0x80
MSG_DUPCTRL = 0x800
MSG_EOR = 0x8
MSG_MAXIOVLEN = 0x10
MSG_NOTIFICATION = 0x100
MSG_OOB = 0x1
MSG_PEEK = 0x2
MSG_TRUNC = 0x20
MSG_WAITALL = 0x40
MSG_XPG4_2 = 0x8000
MS_ASYNC = 0x1
MS_INVALIDATE = 0x2
MS_OLDSYNC = 0x0
MS_SYNC = 0x4
M_FLUSH = 0x86
NAME_MAX = 0xff
NEWDEV = 0x1
NL0 = 0x0
NL1 = 0x100
NLDLY = 0x100
NOFLSH = 0x80
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
OLCUC = 0x2
OLDDEV = 0x0
ONBITSMAJOR = 0x7
ONBITSMINOR = 0x8
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
OPENFAIL = -0x1
OPOST = 0x1
O_ACCMODE = 0x600003
O_APPEND = 0x8
O_CLOEXEC = 0x800000
O_CREAT = 0x100
O_DSYNC = 0x40
O_EXCL = 0x400
O_EXEC = 0x400000
O_LARGEFILE = 0x2000
O_NDELAY = 0x4
O_NOCTTY = 0x800
O_NOFOLLOW = 0x20000
O_NOLINKS = 0x40000
O_NONBLOCK = 0x80
O_RDONLY = 0x0
O_RDWR = 0x2
O_RSYNC = 0x8000
O_SEARCH = 0x200000
O_SIOCGIFCONF = -0x3ff796ec
O_SIOCGLIFCONF = -0x3fef9688
O_SYNC = 0x10
O_TRUNC = 0x200
O_WRONLY = 0x1
O_XATTR = 0x4000
PARENB = 0x100
PAREXT = 0x100000
PARMRK = 0x8
PARODD = 0x200
PENDIN = 0x4000
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
PROT_EXEC = 0x4
PROT_NONE = 0x0
PROT_READ = 0x1
PROT_WRITE = 0x2
RLIMIT_AS = 0x6
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
RLIMIT_DATA = 0x2
RLIMIT_FSIZE = 0x1
RLIMIT_NOFILE = 0x5
RLIMIT_STACK = 0x3
RLIM_INFINITY = -0x3
RTAX_AUTHOR = 0x6
RTAX_BRD = 0x7
RTAX_DST = 0x0
RTAX_GATEWAY = 0x1
RTAX_GENMASK = 0x3
RTAX_IFA = 0x5
RTAX_IFP = 0x4
RTAX_MAX = 0x9
RTAX_NETMASK = 0x2
RTAX_SRC = 0x8
RTA_AUTHOR = 0x40
RTA_BRD = 0x80
RTA_DST = 0x1
RTA_GATEWAY = 0x2
RTA_GENMASK = 0x8
RTA_IFA = 0x20
RTA_IFP = 0x10
RTA_NETMASK = 0x4
RTA_NUMBITS = 0x9
RTA_SRC = 0x100
RTF_BLACKHOLE = 0x1000
RTF_CLONING = 0x100
RTF_DONE = 0x40
RTF_DYNAMIC = 0x10
RTF_GATEWAY = 0x2
RTF_HOST = 0x4
RTF_INDIRECT = 0x40000
RTF_KERNEL = 0x80000
RTF_LLINFO = 0x400
RTF_MASK = 0x80
RTF_MODIFIED = 0x20
RTF_MULTIRT = 0x10000
RTF_PRIVATE = 0x2000
RTF_PROTO1 = 0x8000
RTF_PROTO2 = 0x4000
RTF_REJECT = 0x8
RTF_SETSRC = 0x20000
RTF_STATIC = 0x800
RTF_UP = 0x1
RTF_XRESOLVE = 0x200
RTF_ZONE = 0x100000
RTM_ADD = 0x1
RTM_CHANGE = 0x3
RTM_CHGADDR = 0xf
RTM_DELADDR = 0xd
RTM_DELETE = 0x2
RTM_FREEADDR = 0x10
RTM_GET = 0x4
RTM_IFINFO = 0xe
RTM_LOCK = 0x8
RTM_LOSING = 0x5
RTM_MISS = 0x7
RTM_NEWADDR = 0xc
RTM_OLDADD = 0x9
RTM_OLDDEL = 0xa
RTM_REDIRECT = 0x6
RTM_RESOLVE = 0xb
RTM_VERSION = 0x3
RTV_EXPIRE = 0x4
RTV_HOPCOUNT = 0x2
RTV_MTU = 0x1
RTV_RPIPE = 0x8
RTV_RTT = 0x40
RTV_RTTVAR = 0x80
RTV_SPIPE = 0x10
RTV_SSTHRESH = 0x20
RT_AWARE = 0x1
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
SCM_RIGHTS = 0x1010
SCM_TIMESTAMP = 0x1013
SCM_UCRED = 0x1012
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
SIG2STR_MAX = 0x20
SIOCADDMULTI = -0x7fdf96cf
SIOCADDRT = -0x7fcf8df6
SIOCATMARK = 0x40047307
SIOCDARP = -0x7fdb96e0
SIOCDELMULTI = -0x7fdf96ce
SIOCDELRT = -0x7fcf8df5
SIOCDXARP = -0x7fff9658
SIOCGARP = -0x3fdb96e1
SIOCGDSTINFO = -0x3fff965c
SIOCGENADDR = -0x3fdf96ab
SIOCGENPSTATS = -0x3fdf96c7
SIOCGETLSGCNT = -0x3fef8deb
SIOCGETNAME = 0x40107334
SIOCGETPEER = 0x40107335
SIOCGETPROP = -0x3fff8f44
SIOCGETSGCNT = -0x3feb8deb
SIOCGETSYNC = -0x3fdf96d3
SIOCGETVIFCNT = -0x3feb8dec
SIOCGHIWAT = 0x40047301
SIOCGIFADDR = -0x3fdf96f3
SIOCGIFBRDADDR = -0x3fdf96e9
SIOCGIFCONF = -0x3ff796a4
SIOCGIFDSTADDR = -0x3fdf96f1
SIOCGIFFLAGS = -0x3fdf96ef
SIOCGIFHWADDR = -0x3fdf9647
SIOCGIFINDEX = -0x3fdf96a6
SIOCGIFMEM = -0x3fdf96ed
SIOCGIFMETRIC = -0x3fdf96e5
SIOCGIFMTU = -0x3fdf96ea
SIOCGIFMUXID = -0x3fdf96a8
SIOCGIFNETMASK = -0x3fdf96e7
SIOCGIFNUM = 0x40046957
SIOCGIP6ADDRPOLICY = -0x3fff965e
SIOCGIPMSFILTER = -0x3ffb964c
SIOCGLIFADDR = -0x3f87968f
SIOCGLIFBINDING = -0x3f879666
SIOCGLIFBRDADDR = -0x3f879685
SIOCGLIFCONF = -0x3fef965b
SIOCGLIFDADSTATE = -0x3f879642
SIOCGLIFDSTADDR = -0x3f87968d
SIOCGLIFFLAGS = -0x3f87968b
SIOCGLIFGROUPINFO = -0x3f4b9663
SIOCGLIFGROUPNAME = -0x3f879664
SIOCGLIFHWADDR = -0x3f879640
SIOCGLIFINDEX = -0x3f87967b
SIOCGLIFLNKINFO = -0x3f879674
SIOCGLIFMETRIC = -0x3f879681
SIOCGLIFMTU = -0x3f879686
SIOCGLIFMUXID = -0x3f87967d
SIOCGLIFNETMASK = -0x3f879683
SIOCGLIFNUM = -0x3ff3967e
SIOCGLIFSRCOF = -0x3fef964f
SIOCGLIFSUBNET = -0x3f879676
SIOCGLIFTOKEN = -0x3f879678
SIOCGLIFUSESRC = -0x3f879651
SIOCGLIFZONE = -0x3f879656
SIOCGLOWAT = 0x40047303
SIOCGMSFILTER = -0x3ffb964e
SIOCGPGRP = 0x40047309
SIOCGSTAMP = -0x3fef9646
SIOCGXARP = -0x3fff9659
SIOCIFDETACH = -0x7fdf96c8
SIOCILB = -0x3ffb9645
SIOCLIFADDIF = -0x3f879691
SIOCLIFDELND = -0x7f879673
SIOCLIFGETND = -0x3f879672
SIOCLIFREMOVEIF = -0x7f879692
SIOCLIFSETND = -0x7f879671
SIOCLOWER = -0x7fdf96d7
SIOCSARP = -0x7fdb96e2
SIOCSCTPGOPT = -0x3fef9653
SIOCSCTPPEELOFF = -0x3ffb9652
SIOCSCTPSOPT = -0x7fef9654
SIOCSENABLESDP = -0x3ffb9649
SIOCSETPROP = -0x7ffb8f43
SIOCSETSYNC = -0x7fdf96d4
SIOCSHIWAT = -0x7ffb8d00
SIOCSIFADDR = -0x7fdf96f4
SIOCSIFBRDADDR = -0x7fdf96e8
SIOCSIFDSTADDR = -0x7fdf96f2
SIOCSIFFLAGS = -0x7fdf96f0
SIOCSIFINDEX = -0x7fdf96a5
SIOCSIFMEM = -0x7fdf96ee
SIOCSIFMETRIC = -0x7fdf96e4
SIOCSIFMTU = -0x7fdf96eb
SIOCSIFMUXID = -0x7fdf96a7
SIOCSIFNAME = -0x7fdf96b7
SIOCSIFNETMASK = -0x7fdf96e6
SIOCSIP6ADDRPOLICY = -0x7fff965d
SIOCSIPMSFILTER = -0x7ffb964b
SIOCSLGETREQ = -0x3fdf96b9
SIOCSLIFADDR = -0x7f879690
SIOCSLIFBRDADDR = -0x7f879684
SIOCSLIFDSTADDR = -0x7f87968e
SIOCSLIFFLAGS = -0x7f87968c
SIOCSLIFGROUPNAME = -0x7f879665
SIOCSLIFINDEX = -0x7f87967a
SIOCSLIFLNKINFO = -0x7f879675
SIOCSLIFMETRIC = -0x7f879680
SIOCSLIFMTU = -0x7f879687
SIOCSLIFMUXID = -0x7f87967c
SIOCSLIFNAME = -0x3f87967f
SIOCSLIFNETMASK = -0x7f879682
SIOCSLIFPREFIX = -0x3f879641
SIOCSLIFSUBNET = -0x7f879677
SIOCSLIFTOKEN = -0x7f879679
SIOCSLIFUSESRC = -0x7f879650
SIOCSLIFZONE = -0x7f879655
SIOCSLOWAT = -0x7ffb8cfe
SIOCSLSTAT = -0x7fdf96b8
SIOCSMSFILTER = -0x7ffb964d
SIOCSPGRP = -0x7ffb8cf8
SIOCSPROMISC = -0x7ffb96d0
SIOCSQPTR = -0x3ffb9648
SIOCSSDSTATS = -0x3fdf96d2
SIOCSSESTATS = -0x3fdf96d1
SIOCSXARP = -0x7fff965a
SIOCTMYADDR = -0x3ff79670
SIOCTMYSITE = -0x3ff7966e
SIOCTONLINK = -0x3ff7966f
SIOCUPPER = -0x7fdf96d8
SIOCX25RCV = -0x3fdf96c4
SIOCX25TBL = -0x3fdf96c3
SIOCX25XMT = -0x3fdf96c5
SIOCXPROTO = 0x20007337
SOCK_CLOEXEC = 0x80000
SOCK_DGRAM = 0x1
SOCK_NDELAY = 0x200000
SOCK_NONBLOCK = 0x100000
SOCK_RAW = 0x4
SOCK_RDM = 0x5
SOCK_SEQPACKET = 0x6
SOCK_STREAM = 0x2
SOCK_TYPE_MASK = 0xffff
SOL_FILTER = 0xfffc
SOL_PACKET = 0xfffd
SOL_ROUTE = 0xfffe
SOL_SOCKET = 0xffff
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x2
SO_ALL = 0x3f
SO_ALLZONES = 0x1014
SO_ANON_MLP = 0x100a
SO_ATTACH_FILTER = 0x40000001
SO_BAND = 0x4000
SO_BROADCAST = 0x20
SO_COPYOPT = 0x80000
SO_DEBUG = 0x1
SO_DELIM = 0x8000
SO_DETACH_FILTER = 0x40000002
SO_DGRAM_ERRIND = 0x200
SO_DOMAIN = 0x100c
SO_DONTLINGER = -0x81
SO_DONTROUTE = 0x10
SO_ERROPT = 0x40000
SO_ERROR = 0x1007
SO_EXCLBIND = 0x1015
SO_HIWAT = 0x10
SO_ISNTTY = 0x800
SO_ISTTY = 0x400
SO_KEEPALIVE = 0x8
SO_LINGER = 0x80
SO_LOWAT = 0x20
SO_MAC_EXEMPT = 0x100b
SO_MAC_IMPLICIT = 0x1016
SO_MAXBLK = 0x100000
SO_MAXPSZ = 0x8
SO_MINPSZ = 0x4
SO_MREADOFF = 0x80
SO_MREADON = 0x40
SO_NDELOFF = 0x200
SO_NDELON = 0x100
SO_NODELIM = 0x10000
SO_OOBINLINE = 0x100
SO_PROTOTYPE = 0x1009
SO_RCVBUF = 0x1002
SO_RCVLOWAT = 0x1004
SO_RCVPSH = 0x100d
SO_RCVTIMEO = 0x1006
SO_READOPT = 0x1
SO_RECVUCRED = 0x400
SO_REUSEADDR = 0x4
SO_SECATTR = 0x1011
SO_SNDBUF = 0x1001
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_STRHOLD = 0x20000
SO_TAIL = 0x200000
SO_TIMESTAMP = 0x1013
SO_TONSTOP = 0x2000
SO_TOSTOP = 0x1000
SO_TYPE = 0x1008
SO_USELOOPBACK = 0x40
SO_VRRP = 0x1017
SO_WROFF = 0x2
S_ENFMT = 0x400
S_IAMB = 0x1ff
S_IEXEC = 0x40
S_IFBLK = 0x6000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFDOOR = 0xd000
S_IFIFO = 0x1000
S_IFLNK = 0xa000
S_IFMT = 0xf000
S_IFNAM = 0x5000
S_IFPORT = 0xe000
S_IFREG = 0x8000
S_IFSOCK = 0xc000
S_INSEM = 0x1
S_INSHD = 0x2
S_IREAD = 0x100
S_IRGRP = 0x20
S_IROTH = 0x4
S_IRUSR = 0x100
S_IRWXG = 0x38
S_IRWXO = 0x7
S_IRWXU = 0x1c0
S_ISGID = 0x400
S_ISUID = 0x800
S_ISVTX = 0x200
S_IWGRP = 0x10
S_IWOTH = 0x2
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXGRP = 0x8
S_IXOTH = 0x1
S_IXUSR = 0x40
TAB0 = 0x0
TAB1 = 0x800
TAB2 = 0x1000
TAB3 = 0x1800
TABDLY = 0x1800
TCFLSH = 0x5407
TCGETA = 0x5401
TCGETS = 0x540d
TCIFLUSH = 0x0
TCIOFF = 0x2
TCIOFLUSH = 0x2
TCION = 0x3
TCOFLUSH = 0x1
TCOOFF = 0x0
TCOON = 0x1
TCP_ABORT_THRESHOLD = 0x11
TCP_ANONPRIVBIND = 0x20
TCP_CONN_ABORT_THRESHOLD = 0x13
TCP_CONN_NOTIFY_THRESHOLD = 0x12
TCP_CORK = 0x18
TCP_EXCLBIND = 0x21
TCP_INIT_CWND = 0x15
TCP_KEEPALIVE = 0x8
TCP_KEEPALIVE_ABORT_THRESHOLD = 0x17
TCP_KEEPALIVE_THRESHOLD = 0x16
TCP_KEEPCNT = 0x23
TCP_KEEPIDLE = 0x22
TCP_KEEPINTVL = 0x24
TCP_LINGER2 = 0x1c
TCP_MAXSEG = 0x2
TCP_MSS = 0x218
TCP_NODELAY = 0x1
TCP_NOTIFY_THRESHOLD = 0x10
TCP_RECVDSTADDR = 0x14
TCP_RTO_INITIAL = 0x19
TCP_RTO_MAX = 0x1b
TCP_RTO_MIN = 0x1a
TCSAFLUSH = 0x5410
TCSBRK = 0x5405
TCSETA = 0x5402
TCSETAF = 0x5404
TCSETAW = 0x5403
TCSETS = 0x540e
TCSETSF = 0x5410
TCSETSW = 0x540f
TCXONC = 0x5406
TIOC = 0x5400
TIOCCBRK = 0x747a
TIOCCDTR = 0x7478
TIOCCILOOP = 0x746c
TIOCEXCL = 0x740d
TIOCFLUSH = 0x7410
TIOCGETC = 0x7412
TIOCGETD = 0x7400
TIOCGETP = 0x7408
TIOCGLTC = 0x7474
TIOCGPGRP = 0x7414
TIOCGPPS = 0x547d
TIOCGPPSEV = 0x547f
TIOCGSID = 0x7416
TIOCGSOFTCAR = 0x5469
TIOCGWINSZ = 0x5468
TIOCHPCL = 0x7402
TIOCKBOF = 0x5409
TIOCKBON = 0x5408
TIOCLBIC = 0x747e
TIOCLBIS = 0x747f
TIOCLGET = 0x747c
TIOCLSET = 0x747d
TIOCMBIC = 0x741c
TIOCMBIS = 0x741b
TIOCMGET = 0x741d
TIOCMSET = 0x741a
TIOCM_CAR = 0x40
TIOCM_CD = 0x40
TIOCM_CTS = 0x20
TIOCM_DSR = 0x100
TIOCM_DTR = 0x2
TIOCM_LE = 0x1
TIOCM_RI = 0x80
TIOCM_RNG = 0x80
TIOCM_RTS = 0x4
TIOCM_SR = 0x10
TIOCM_ST = 0x8
TIOCNOTTY = 0x7471
TIOCNXCL = 0x740e
TIOCOUTQ = 0x7473
TIOCREMOTE = 0x741e
TIOCSBRK = 0x747b
TIOCSCTTY = 0x7484
TIOCSDTR = 0x7479
TIOCSETC = 0x7411
TIOCSETD = 0x7401
TIOCSETN = 0x740a
TIOCSETP = 0x7409
TIOCSIGNAL = 0x741f
TIOCSILOOP = 0x746d
TIOCSLTC = 0x7475
TIOCSPGRP = 0x7415
TIOCSPPS = 0x547e
TIOCSSOFTCAR = 0x546a
TIOCSTART = 0x746e
TIOCSTI = 0x7417
TIOCSTOP = 0x746f
TIOCSWINSZ = 0x5467
TOSTOP = 0x100
UTIME_NOW = -0x1
UTIME_OMIT = -0x2
VCEOF = 0x8
VCEOL = 0x9
VDISCARD = 0xd
VDSUSP = 0xb
VEOF = 0x4
VEOL = 0x5
VEOL2 = 0x6
VERASE = 0x2
VERASE2 = 0x11
VINTR = 0x0
VKILL = 0x3
VLNEXT = 0xf
VMIN = 0x4
VQUIT = 0x1
VREPRINT = 0xc
VSTART = 0x8
VSTATUS = 0x10
VSTOP = 0x9
VSUSP = 0xa
VSWTCH = 0x7
VT0 = 0x0
VT1 = 0x4000
VTDLY = 0x4000
VTIME = 0x5
VWERASE = 0xe
WCONTFLG = 0xffff
WCONTINUED = 0x8
WCOREFLG = 0x80
WEXITED = 0x1
WNOHANG = 0x40
WNOWAIT = 0x80
WOPTMASK = 0xcf
WRAP = 0x20000
WSIGMASK = 0x7f
WSTOPFLG = 0x7f
WSTOPPED = 0x4
WTRAPPED = 0x2
WUNTRACED = 0x4
XCASE = 0x4
XTABS = 0x1800
)
// Errors
const (
E2BIG = syscall.Errno(0x7)
EACCES = syscall.Errno(0xd)
EADDRINUSE = syscall.Errno(0x7d)
EADDRNOTAVAIL = syscall.Errno(0x7e)
EADV = syscall.Errno(0x44)
EAFNOSUPPORT = syscall.Errno(0x7c)
EAGAIN = syscall.Errno(0xb)
EALREADY = syscall.Errno(0x95)
EBADE = syscall.Errno(0x32)
EBADF = syscall.Errno(0x9)
EBADFD = syscall.Errno(0x51)
EBADMSG = syscall.Errno(0x4d)
EBADR = syscall.Errno(0x33)
EBADRQC = syscall.Errno(0x36)
EBADSLT = syscall.Errno(0x37)
EBFONT = syscall.Errno(0x39)
EBUSY = syscall.Errno(0x10)
ECANCELED = syscall.Errno(0x2f)
ECHILD = syscall.Errno(0xa)
ECHRNG = syscall.Errno(0x25)
ECOMM = syscall.Errno(0x46)
ECONNABORTED = syscall.Errno(0x82)
ECONNREFUSED = syscall.Errno(0x92)
ECONNRESET = syscall.Errno(0x83)
EDEADLK = syscall.Errno(0x2d)
EDEADLOCK = syscall.Errno(0x38)
EDESTADDRREQ = syscall.Errno(0x60)
EDOM = syscall.Errno(0x21)
EDQUOT = syscall.Errno(0x31)
EEXIST = syscall.Errno(0x11)
EFAULT = syscall.Errno(0xe)
EFBIG = syscall.Errno(0x1b)
EHOSTDOWN = syscall.Errno(0x93)
EHOSTUNREACH = syscall.Errno(0x94)
EIDRM = syscall.Errno(0x24)
EILSEQ = syscall.Errno(0x58)
EINPROGRESS = syscall.Errno(0x96)
EINTR = syscall.Errno(0x4)
EINVAL = syscall.Errno(0x16)
EIO = syscall.Errno(0x5)
EISCONN = syscall.Errno(0x85)
EISDIR = syscall.Errno(0x15)
EL2HLT = syscall.Errno(0x2c)
EL2NSYNC = syscall.Errno(0x26)
EL3HLT = syscall.Errno(0x27)
EL3RST = syscall.Errno(0x28)
ELIBACC = syscall.Errno(0x53)
ELIBBAD = syscall.Errno(0x54)
ELIBEXEC = syscall.Errno(0x57)
ELIBMAX = syscall.Errno(0x56)
ELIBSCN = syscall.Errno(0x55)
ELNRNG = syscall.Errno(0x29)
ELOCKUNMAPPED = syscall.Errno(0x48)
ELOOP = syscall.Errno(0x5a)
EMFILE = syscall.Errno(0x18)
EMLINK = syscall.Errno(0x1f)
EMSGSIZE = syscall.Errno(0x61)
EMULTIHOP = syscall.Errno(0x4a)
ENAMETOOLONG = syscall.Errno(0x4e)
ENETDOWN = syscall.Errno(0x7f)
ENETRESET = syscall.Errno(0x81)
ENETUNREACH = syscall.Errno(0x80)
ENFILE = syscall.Errno(0x17)
ENOANO = syscall.Errno(0x35)
ENOBUFS = syscall.Errno(0x84)
ENOCSI = syscall.Errno(0x2b)
ENODATA = syscall.Errno(0x3d)
ENODEV = syscall.Errno(0x13)
ENOENT = syscall.Errno(0x2)
ENOEXEC = syscall.Errno(0x8)
ENOLCK = syscall.Errno(0x2e)
ENOLINK = syscall.Errno(0x43)
ENOMEM = syscall.Errno(0xc)
ENOMSG = syscall.Errno(0x23)
ENONET = syscall.Errno(0x40)
ENOPKG = syscall.Errno(0x41)
ENOPROTOOPT = syscall.Errno(0x63)
ENOSPC = syscall.Errno(0x1c)
ENOSR = syscall.Errno(0x3f)
ENOSTR = syscall.Errno(0x3c)
ENOSYS = syscall.Errno(0x59)
ENOTACTIVE = syscall.Errno(0x49)
ENOTBLK = syscall.Errno(0xf)
ENOTCONN = syscall.Errno(0x86)
ENOTDIR = syscall.Errno(0x14)
ENOTEMPTY = syscall.Errno(0x5d)
ENOTRECOVERABLE = syscall.Errno(0x3b)
ENOTSOCK = syscall.Errno(0x5f)
ENOTSUP = syscall.Errno(0x30)
ENOTTY = syscall.Errno(0x19)
ENOTUNIQ = syscall.Errno(0x50)
ENXIO = syscall.Errno(0x6)
EOPNOTSUPP = syscall.Errno(0x7a)
EOVERFLOW = syscall.Errno(0x4f)
EOWNERDEAD = syscall.Errno(0x3a)
EPERM = syscall.Errno(0x1)
EPFNOSUPPORT = syscall.Errno(0x7b)
EPIPE = syscall.Errno(0x20)
EPROTO = syscall.Errno(0x47)
EPROTONOSUPPORT = syscall.Errno(0x78)
EPROTOTYPE = syscall.Errno(0x62)
ERANGE = syscall.Errno(0x22)
EREMCHG = syscall.Errno(0x52)
EREMOTE = syscall.Errno(0x42)
ERESTART = syscall.Errno(0x5b)
EROFS = syscall.Errno(0x1e)
ESHUTDOWN = syscall.Errno(0x8f)
ESOCKTNOSUPPORT = syscall.Errno(0x79)
ESPIPE = syscall.Errno(0x1d)
ESRCH = syscall.Errno(0x3)
ESRMNT = syscall.Errno(0x45)
ESTALE = syscall.Errno(0x97)
ESTRPIPE = syscall.Errno(0x5c)
ETIME = syscall.Errno(0x3e)
ETIMEDOUT = syscall.Errno(0x91)
ETOOMANYREFS = syscall.Errno(0x90)
ETXTBSY = syscall.Errno(0x1a)
EUNATCH = syscall.Errno(0x2a)
EUSERS = syscall.Errno(0x5e)
EWOULDBLOCK = syscall.Errno(0xb)
EXDEV = syscall.Errno(0x12)
EXFULL = syscall.Errno(0x34)
)
// Signals
const (
SIGABRT = syscall.Signal(0x6)
SIGALRM = syscall.Signal(0xe)
SIGBUS = syscall.Signal(0xa)
SIGCANCEL = syscall.Signal(0x24)
SIGCHLD = syscall.Signal(0x12)
SIGCLD = syscall.Signal(0x12)
SIGCONT = syscall.Signal(0x19)
SIGEMT = syscall.Signal(0x7)
SIGFPE = syscall.Signal(0x8)
SIGFREEZE = syscall.Signal(0x22)
SIGHUP = syscall.Signal(0x1)
SIGILL = syscall.Signal(0x4)
SIGINFO = syscall.Signal(0x29)
SIGINT = syscall.Signal(0x2)
SIGIO = syscall.Signal(0x16)
SIGIOT = syscall.Signal(0x6)
SIGJVM1 = syscall.Signal(0x27)
SIGJVM2 = syscall.Signal(0x28)
SIGKILL = syscall.Signal(0x9)
SIGLOST = syscall.Signal(0x25)
SIGLWP = syscall.Signal(0x21)
SIGPIPE = syscall.Signal(0xd)
SIGPOLL = syscall.Signal(0x16)
SIGPROF = syscall.Signal(0x1d)
SIGPWR = syscall.Signal(0x13)
SIGQUIT = syscall.Signal(0x3)
SIGSEGV = syscall.Signal(0xb)
SIGSTOP = syscall.Signal(0x17)
SIGSYS = syscall.Signal(0xc)
SIGTERM = syscall.Signal(0xf)
SIGTHAW = syscall.Signal(0x23)
SIGTRAP = syscall.Signal(0x5)
SIGTSTP = syscall.Signal(0x18)
SIGTTIN = syscall.Signal(0x1a)
SIGTTOU = syscall.Signal(0x1b)
SIGURG = syscall.Signal(0x15)
SIGUSR1 = syscall.Signal(0x10)
SIGUSR2 = syscall.Signal(0x11)
SIGVTALRM = syscall.Signal(0x1c)
SIGWAITING = syscall.Signal(0x20)
SIGWINCH = syscall.Signal(0x14)
SIGXCPU = syscall.Signal(0x1e)
SIGXFSZ = syscall.Signal(0x1f)
SIGXRES = syscall.Signal(0x26)
)
// Error table
var errorList = [...]struct {
num syscall.Errno
name string
desc string
}{
{1, "EPERM", "not owner"},
{2, "ENOENT", "no such file or directory"},
{3, "ESRCH", "no such process"},
{4, "EINTR", "interrupted system call"},
{5, "EIO", "I/O error"},
{6, "ENXIO", "no such device or address"},
{7, "E2BIG", "arg list too long"},
{8, "ENOEXEC", "exec format error"},
{9, "EBADF", "bad file number"},
{10, "ECHILD", "no child processes"},
{11, "EAGAIN", "resource temporarily unavailable"},
{12, "ENOMEM", "not enough space"},
{13, "EACCES", "permission denied"},
{14, "EFAULT", "bad address"},
{15, "ENOTBLK", "block device required"},
{16, "EBUSY", "device busy"},
{17, "EEXIST", "file exists"},
{18, "EXDEV", "cross-device link"},
{19, "ENODEV", "no such device"},
{20, "ENOTDIR", "not a directory"},
{21, "EISDIR", "is a directory"},
{22, "EINVAL", "invalid argument"},
{23, "ENFILE", "file table overflow"},
{24, "EMFILE", "too many open files"},
{25, "ENOTTY", "inappropriate ioctl for device"},
{26, "ETXTBSY", "text file busy"},
{27, "EFBIG", "file too large"},
{28, "ENOSPC", "no space left on device"},
{29, "ESPIPE", "illegal seek"},
{30, "EROFS", "read-only file system"},
{31, "EMLINK", "too many links"},
{32, "EPIPE", "broken pipe"},
{33, "EDOM", "argument out of domain"},
{34, "ERANGE", "result too large"},
{35, "ENOMSG", "no message of desired type"},
{36, "EIDRM", "identifier removed"},
{37, "ECHRNG", "channel number out of range"},
{38, "EL2NSYNC", "level 2 not synchronized"},
{39, "EL3HLT", "level 3 halted"},
{40, "EL3RST", "level 3 reset"},
{41, "ELNRNG", "link number out of range"},
{42, "EUNATCH", "protocol driver not attached"},
{43, "ENOCSI", "no CSI structure available"},
{44, "EL2HLT", "level 2 halted"},
{45, "EDEADLK", "deadlock situation detected/avoided"},
{46, "ENOLCK", "no record locks available"},
{47, "ECANCELED", "operation canceled"},
{48, "ENOTSUP", "operation not supported"},
{49, "EDQUOT", "disc quota exceeded"},
{50, "EBADE", "bad exchange descriptor"},
{51, "EBADR", "bad request descriptor"},
{52, "EXFULL", "message tables full"},
{53, "ENOANO", "anode table overflow"},
{54, "EBADRQC", "bad request code"},
{55, "EBADSLT", "invalid slot"},
{56, "EDEADLOCK", "file locking deadlock"},
{57, "EBFONT", "bad font file format"},
{58, "EOWNERDEAD", "owner of the lock died"},
{59, "ENOTRECOVERABLE", "lock is not recoverable"},
{60, "ENOSTR", "not a stream device"},
{61, "ENODATA", "no data available"},
{62, "ETIME", "timer expired"},
{63, "ENOSR", "out of stream resources"},
{64, "ENONET", "machine is not on the network"},
{65, "ENOPKG", "package not installed"},
{66, "EREMOTE", "object is remote"},
{67, "ENOLINK", "link has been severed"},
{68, "EADV", "advertise error"},
{69, "ESRMNT", "srmount error"},
{70, "ECOMM", "communication error on send"},
{71, "EPROTO", "protocol error"},
{72, "ELOCKUNMAPPED", "locked lock was unmapped "},
{73, "ENOTACTIVE", "facility is not active"},
{74, "EMULTIHOP", "multihop attempted"},
{77, "EBADMSG", "not a data message"},
{78, "ENAMETOOLONG", "file name too long"},
{79, "EOVERFLOW", "value too large for defined data type"},
{80, "ENOTUNIQ", "name not unique on network"},
{81, "EBADFD", "file descriptor in bad state"},
{82, "EREMCHG", "remote address changed"},
{83, "ELIBACC", "can not access a needed shared library"},
{84, "ELIBBAD", "accessing a corrupted shared library"},
{85, "ELIBSCN", ".lib section in a.out corrupted"},
{86, "ELIBMAX", "attempting to link in more shared libraries than system limit"},
{87, "ELIBEXEC", "can not exec a shared library directly"},
{88, "EILSEQ", "illegal byte sequence"},
{89, "ENOSYS", "operation not applicable"},
{90, "ELOOP", "number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS"},
{91, "ERESTART", "error 91"},
{92, "ESTRPIPE", "error 92"},
{93, "ENOTEMPTY", "directory not empty"},
{94, "EUSERS", "too many users"},
{95, "ENOTSOCK", "socket operation on non-socket"},
{96, "EDESTADDRREQ", "destination address required"},
{97, "EMSGSIZE", "message too long"},
{98, "EPROTOTYPE", "protocol wrong type for socket"},
{99, "ENOPROTOOPT", "option not supported by protocol"},
{120, "EPROTONOSUPPORT", "protocol not supported"},
{121, "ESOCKTNOSUPPORT", "socket type not supported"},
{122, "EOPNOTSUPP", "operation not supported on transport endpoint"},
{123, "EPFNOSUPPORT", "protocol family not supported"},
{124, "EAFNOSUPPORT", "address family not supported by protocol family"},
{125, "EADDRINUSE", "address already in use"},
{126, "EADDRNOTAVAIL", "cannot assign requested address"},
{127, "ENETDOWN", "network is down"},
{128, "ENETUNREACH", "network is unreachable"},
{129, "ENETRESET", "network dropped connection because of reset"},
{130, "ECONNABORTED", "software caused connection abort"},
{131, "ECONNRESET", "connection reset by peer"},
{132, "ENOBUFS", "no buffer space available"},
{133, "EISCONN", "transport endpoint is already connected"},
{134, "ENOTCONN", "transport endpoint is not connected"},
{143, "ESHUTDOWN", "cannot send after socket shutdown"},
{144, "ETOOMANYREFS", "too many references: cannot splice"},
{145, "ETIMEDOUT", "connection timed out"},
{146, "ECONNREFUSED", "connection refused"},
{147, "EHOSTDOWN", "host is down"},
{148, "EHOSTUNREACH", "no route to host"},
{149, "EALREADY", "operation already in progress"},
{150, "EINPROGRESS", "operation now in progress"},
{151, "ESTALE", "stale NFS file handle"},
}
// Signal table
var signalList = [...]struct {
num syscall.Signal
name string
desc string
}{
{1, "SIGHUP", "hangup"},
{2, "SIGINT", "interrupt"},
{3, "SIGQUIT", "quit"},
{4, "SIGILL", "illegal Instruction"},
{5, "SIGTRAP", "trace/Breakpoint Trap"},
{6, "SIGABRT", "abort"},
{7, "SIGEMT", "emulation Trap"},
{8, "SIGFPE", "arithmetic Exception"},
{9, "SIGKILL", "killed"},
{10, "SIGBUS", "bus Error"},
{11, "SIGSEGV", "segmentation Fault"},
{12, "SIGSYS", "bad System Call"},
{13, "SIGPIPE", "broken Pipe"},
{14, "SIGALRM", "alarm Clock"},
{15, "SIGTERM", "terminated"},
{16, "SIGUSR1", "user Signal 1"},
{17, "SIGUSR2", "user Signal 2"},
{18, "SIGCHLD", "child Status Changed"},
{19, "SIGPWR", "power-Fail/Restart"},
{20, "SIGWINCH", "window Size Change"},
{21, "SIGURG", "urgent Socket Condition"},
{22, "SIGIO", "pollable Event"},
{23, "SIGSTOP", "stopped (signal)"},
{24, "SIGTSTP", "stopped (user)"},
{25, "SIGCONT", "continued"},
{26, "SIGTTIN", "stopped (tty input)"},
{27, "SIGTTOU", "stopped (tty output)"},
{28, "SIGVTALRM", "virtual Timer Expired"},
{29, "SIGPROF", "profiling Timer Expired"},
{30, "SIGXCPU", "cpu Limit Exceeded"},
{31, "SIGXFSZ", "file Size Limit Exceeded"},
{32, "SIGWAITING", "no runnable lwp"},
{33, "SIGLWP", "inter-lwp signal"},
{34, "SIGFREEZE", "checkpoint Freeze"},
{35, "SIGTHAW", "checkpoint Thaw"},
{36, "SIGCANCEL", "thread Cancellation"},
{37, "SIGLOST", "resource Lost"},
{38, "SIGXRES", "resource Control Exceeded"},
{39, "SIGJVM1", "reserved for JVM 1"},
{40, "SIGJVM2", "reserved for JVM 2"},
{41, "SIGINFO", "information Request"},
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Swis\JsonApi\Client\Concerns;
use Swis\JsonApi\Client\Links;
trait HasLinks
{
/**
* @var \Swis\JsonApi\Client\Links|null
*/
protected $links;
/**
* @return \Swis\JsonApi\Client\Links|null
*/
public function getLinks(): ? Links
{
return $this->links;
}
/**
* @param \Swis\JsonApi\Client\Links|null $links
*
* @return $this
*/
public function setLinks(? Links $links)
{
$this->links = $links;
return $this;
}
}
| {
"pile_set_name": "Github"
} |
/*
* This file is part of PowerDNS or dnsdist.
* Copyright -- PowerDNS.COM B.V. and its contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* In addition, for the avoidance of any doubt, permission is granted to
* link this program with OpenSSL and to (re)distribute the binaries
* produced as the result of such linking.
*
* 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.
*/
#pragma once
#include "config.h"
#include "remote_logger.hh"
#ifdef HAVE_FSTRM
#include <unordered_map>
#include <fstrm.h>
#include <fstrm/iothr.h>
#include <fstrm/unix_writer.h>
#ifdef HAVE_FSTRM_TCP_WRITER_INIT
#include <fstrm/tcp_writer.h>
#endif
class FrameStreamLogger : public RemoteLoggerInterface, boost::noncopyable
{
public:
FrameStreamLogger(int family, const std::string& address, bool connect, const std::unordered_map<string,unsigned>& options = std::unordered_map<string,unsigned>());
~FrameStreamLogger();
void queueData(const std::string& data) override;
std::string toString() const override
{
return "FrameStreamLogger to " + d_address + " (" + std::to_string(d_framesSent) + " frames sent, " + std::to_string(d_queueFullDrops) + " dropped, " + std::to_string(d_permanentFailures) + " permanent failures)";
}
private:
const int d_family;
const std::string d_address;
struct fstrm_iothr_queue *d_ioqueue{nullptr};
struct fstrm_writer_options *d_fwopt{nullptr};
struct fstrm_unix_writer_options *d_uwopt{nullptr};
#ifdef HAVE_FSTRM_TCP_WRITER_INIT
struct fstrm_tcp_writer_options *d_twopt{nullptr};
#endif
struct fstrm_writer *d_writer{nullptr};
struct fstrm_iothr_options *d_iothropt{nullptr};
struct fstrm_iothr *d_iothr{nullptr};
std::atomic<uint64_t> d_framesSent{0};
std::atomic<uint64_t> d_queueFullDrops{0};
std::atomic<uint64_t> d_permanentFailures{0};
void cleanup();
};
#else
class FrameStreamLogger : public RemoteLoggerInterface, boost::noncopyable {};
#endif /* HAVE_FSTRM */
| {
"pile_set_name": "Github"
} |
//
// Sysinfo
//
// Copyright (c) 2015 Guillaume Gomez
//
//! `sysinfo` is a crate used to get a system's information.
//!
//! Before any attempt to read the different structs' information, you need to update them to
//! get up-to-date information.
//!
//! # Examples
//!
//! ```
//! use sysinfo::{ProcessExt, SystemExt};
//!
//! let mut system = sysinfo::System::new_all();
//!
//! // First we update all information of our system struct.
//! system.refresh_all();
//!
//! // Now let's print every process' id and name:
//! for (pid, proc_) in system.get_processes() {
//! println!("{}:{} => status: {:?}", pid, proc_.name(), proc_.status());
//! }
//!
//! // Then let's print the temperature of the different components:
//! for component in system.get_components() {
//! println!("{:?}", component);
//! }
//!
//! // And then all disks' information:
//! for disk in system.get_disks() {
//! println!("{:?}", disk);
//! }
//!
//! // And finally the RAM and SWAP information:
//! println!("total memory: {} KB", system.get_total_memory());
//! println!("used memory : {} KB", system.get_used_memory());
//! println!("total swap : {} KB", system.get_total_swap());
//! println!("used swap : {} KB", system.get_used_swap());
//! ```
#![crate_name = "sysinfo"]
#![crate_type = "lib"]
#![crate_type = "rlib"]
#![deny(missing_docs)]
#![deny(intra_doc_link_resolution_failure)]
//#![deny(warnings)]
#![allow(unknown_lints)]
#[macro_use]
extern crate cfg_if;
#[cfg(not(any(target_os = "unknown", target_arch = "wasm32")))]
extern crate libc;
extern crate rayon;
#[macro_use]
extern crate doc_comment;
extern crate once_cell;
#[cfg(doctest)]
doctest!("../README.md");
#[cfg(feature = "debug")]
#[doc(hidden)]
macro_rules! sysinfo_debug {
($($x:tt)*) => {{
eprintln!($($x)*);
}}
}
#[cfg(not(feature = "debug"))]
#[doc(hidden)]
macro_rules! sysinfo_debug {
($($x:tt)*) => {{}};
}
cfg_if! {
if #[cfg(any(target_os = "macos", target_os = "ios"))] {
mod mac;
use mac as sys;
#[cfg(test)]
const MIN_USERS: usize = 1;
} else if #[cfg(windows)] {
mod windows;
use windows as sys;
extern crate winapi;
extern crate ntapi;
#[cfg(test)]
const MIN_USERS: usize = 1;
} else if #[cfg(any(target_os = "linux", target_os = "android"))] {
mod linux;
use linux as sys;
#[cfg(test)]
const MIN_USERS: usize = 1;
} else {
mod unknown;
use unknown as sys;
#[cfg(test)]
const MIN_USERS: usize = 0;
}
}
pub use common::{
AsU32, DiskType, DiskUsage, LoadAvg, NetworksIter, Pid, RefreshKind, Signal, User,
};
pub use sys::{Component, Disk, NetworkData, Networks, Process, ProcessStatus, Processor, System};
pub use traits::{
ComponentExt, DiskExt, NetworkExt, NetworksExt, ProcessExt, ProcessorExt, SystemExt, UserExt,
};
#[cfg(feature = "c-interface")]
pub use c_interface::*;
pub use utils::get_current_pid;
#[cfg(feature = "c-interface")]
mod c_interface;
mod common;
mod debug;
mod system;
mod traits;
mod utils;
/// This function is only used on linux targets, on the other platforms it does nothing and returns
/// `false`.
///
/// On linux, to improve performance, we keep a `/proc` file open for each process we index with
/// a maximum number of files open equivalent to half of the system limit.
///
/// The problem is that some users might need all the available file descriptors so we need to
/// allow them to change this limit.
///
/// Note that if you set a limit bigger than the system limit, the system limit will be set.
///
/// Returns `true` if the new value has been set.
///
/// ```no_run
/// use sysinfo::{System, SystemExt, set_open_files_limit};
///
/// // We call the function before any call to the processes update.
/// if !set_open_files_limit(10) {
/// // It'll always return false on non-linux targets.
/// eprintln!("failed to update the open files limit...");
/// }
/// let s = System::new_all();
/// ```
pub fn set_open_files_limit(mut _new_limit: isize) -> bool {
#[cfg(any(target_os = "linux", target_os = "android"))]
{
if _new_limit < 0 {
_new_limit = 0;
}
let max = sys::system::get_max_nb_fds();
if _new_limit > max {
_new_limit = max;
}
if let Ok(ref mut x) = unsafe { sys::system::REMAINING_FILES.lock() } {
// If files are already open, to be sure that the number won't be bigger when those
// files are closed, we subtract the current number of opened files to the new limit.
let diff = max - **x;
**x = _new_limit - diff;
true
} else {
false
}
}
#[cfg(all(not(target_os = "linux"), not(target_os = "android")))]
{
false
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn check_memory_usage() {
let mut s = ::System::new();
s.refresh_all();
assert_eq!(
s.get_processes()
.iter()
.all(|(_, proc_)| proc_.memory() == 0),
false
);
}
#[test]
fn check_users() {
let mut s = ::System::new();
assert!(s.get_users().is_empty());
s.refresh_users_list();
assert!(s.get_users().len() >= MIN_USERS);
let mut s = ::System::new();
assert!(s.get_users().is_empty());
s.refresh_all();
assert!(s.get_users().is_empty());
let s = ::System::new_all();
assert!(s.get_users().len() >= MIN_USERS);
}
}
// Used to check that System is Send and Sync.
#[cfg(doctest)]
doc_comment!(
"
```
fn is_send<T: Send>() {}
is_send::<sysinfo::System>();
```
```
fn is_sync<T: Sync>() {}
is_sync::<sysinfo::System>();
```"
);
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="WorklistDefinition" module="Products.DCWorkflow.Worklists"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Accounts to Validate (%(count)s)</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string encoding="cdata"><![CDATA[
account_module/view?validation_state=draft&local_roles=%(local_roles)s&reset:int=1
]]></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>draft_account</string> </value>
</item>
<item>
<key> <string>var_matches</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>portal_type</string> </key>
<value>
<tuple>
<string>Account</string>
</tuple>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value>
<tuple>
<string>draft</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
| {
"pile_set_name": "Github"
} |
// (C) Copyright John Maddock and Steve Cleary 2000.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// macros and helpers for working with integral-constant-expressions.
#ifndef BOOST_TT_ICE_HPP_INCLUDED
#define BOOST_TT_ICE_HPP_INCLUDED
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/type_traits/detail/ice_eq.hpp>
#endif // BOOST_TT_ICE_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
/* Javadoc style sheet */
/* Define colors, fonts and other style attributes here to override the defaults */
/* Page background color */
body { background-color: #FFFFFF }
/* Headings */
h1 { font-size: 145% }
/* Table colors */
.TableHeadingColor { background: #CCCCFF } /* Dark mauve */
.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */
.TableRowColor { background: #FFFFFF } /* White */
/* Font used in left-hand frame lists */
.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif }
.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif }
.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif }
/* Navigation bar fonts and colors */
.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */
.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */
.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}
.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
| {
"pile_set_name": "Github"
} |
QA output created by 012
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
== mark image read-only
== read from read-only image
read 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
*** done
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/aux_/full_lambda.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
namespace aux {
template<
bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false
, bool C5 = false
>
struct lambda_or
: true_
{
};
template<>
struct lambda_or< false,false,false,false,false >
: false_
{
};
} // namespace aux
template<
typename T
, typename Tag
, typename Arity
>
struct lambda
{
typedef false_ is_le;
typedef T result_;
typedef T type;
};
template<
typename T
>
struct is_lambda_expression
: lambda<T>::is_le
{
};
template< int N, typename Tag >
struct lambda< arg<N>,Tag, int_< -1 > >
{
typedef true_ is_le;
typedef mpl::arg<N> result_; // qualified for the sake of MIPSpro 7.41
typedef mpl::protect<result_> type;
};
template<
typename F
, typename Tag
>
struct lambda<
bind0<F>
, Tag
, int_<1>
>
{
typedef false_ is_le;
typedef bind0<
F
> result_;
typedef result_ type;
};
namespace aux {
template<
typename IsLE, typename Tag
, template< typename P1 > class F
, typename L1
>
struct le_result1
{
typedef F<
typename L1::type
> result_;
typedef result_ type;
};
template<
typename Tag
, template< typename P1 > class F
, typename L1
>
struct le_result1< true_,Tag,F,L1 >
{
typedef bind1<
quote1< F,Tag >
, typename L1::result_
> result_;
typedef mpl::protect<result_> type;
};
} // namespace aux
template<
template< typename P1 > class F
, typename T1
, typename Tag
>
struct lambda<
F<T1>
, Tag
, int_<1>
>
{
typedef lambda< T1,Tag > l1;
typedef typename l1::is_le is_le1;
typedef typename aux::lambda_or<
is_le1::value
>::type is_le;
typedef aux::le_result1<
is_le, Tag, F, l1
> le_result_;
typedef typename le_result_::result_ result_;
typedef typename le_result_::type type;
};
template<
typename F, typename T1
, typename Tag
>
struct lambda<
bind1< F,T1 >
, Tag
, int_<2>
>
{
typedef false_ is_le;
typedef bind1<
F
, T1
> result_;
typedef result_ type;
};
namespace aux {
template<
typename IsLE, typename Tag
, template< typename P1, typename P2 > class F
, typename L1, typename L2
>
struct le_result2
{
typedef F<
typename L1::type, typename L2::type
> result_;
typedef result_ type;
};
template<
typename Tag
, template< typename P1, typename P2 > class F
, typename L1, typename L2
>
struct le_result2< true_,Tag,F,L1,L2 >
{
typedef bind2<
quote2< F,Tag >
, typename L1::result_, typename L2::result_
> result_;
typedef mpl::protect<result_> type;
};
} // namespace aux
template<
template< typename P1, typename P2 > class F
, typename T1, typename T2
, typename Tag
>
struct lambda<
F< T1,T2 >
, Tag
, int_<2>
>
{
typedef lambda< T1,Tag > l1;
typedef lambda< T2,Tag > l2;
typedef typename l1::is_le is_le1;
typedef typename l2::is_le is_le2;
typedef typename aux::lambda_or<
is_le1::value, is_le2::value
>::type is_le;
typedef aux::le_result2<
is_le, Tag, F, l1, l2
> le_result_;
typedef typename le_result_::result_ result_;
typedef typename le_result_::type type;
};
template<
typename F, typename T1, typename T2
, typename Tag
>
struct lambda<
bind2< F,T1,T2 >
, Tag
, int_<3>
>
{
typedef false_ is_le;
typedef bind2<
F
, T1, T2
> result_;
typedef result_ type;
};
namespace aux {
template<
typename IsLE, typename Tag
, template< typename P1, typename P2, typename P3 > class F
, typename L1, typename L2, typename L3
>
struct le_result3
{
typedef F<
typename L1::type, typename L2::type, typename L3::type
> result_;
typedef result_ type;
};
template<
typename Tag
, template< typename P1, typename P2, typename P3 > class F
, typename L1, typename L2, typename L3
>
struct le_result3< true_,Tag,F,L1,L2,L3 >
{
typedef bind3<
quote3< F,Tag >
, typename L1::result_, typename L2::result_, typename L3::result_
> result_;
typedef mpl::protect<result_> type;
};
} // namespace aux
template<
template< typename P1, typename P2, typename P3 > class F
, typename T1, typename T2, typename T3
, typename Tag
>
struct lambda<
F< T1,T2,T3 >
, Tag
, int_<3>
>
{
typedef lambda< T1,Tag > l1;
typedef lambda< T2,Tag > l2;
typedef lambda< T3,Tag > l3;
typedef typename l1::is_le is_le1;
typedef typename l2::is_le is_le2;
typedef typename l3::is_le is_le3;
typedef typename aux::lambda_or<
is_le1::value, is_le2::value, is_le3::value
>::type is_le;
typedef aux::le_result3<
is_le, Tag, F, l1, l2, l3
> le_result_;
typedef typename le_result_::result_ result_;
typedef typename le_result_::type type;
};
template<
typename F, typename T1, typename T2, typename T3
, typename Tag
>
struct lambda<
bind3< F,T1,T2,T3 >
, Tag
, int_<4>
>
{
typedef false_ is_le;
typedef bind3<
F
, T1, T2, T3
> result_;
typedef result_ type;
};
namespace aux {
template<
typename IsLE, typename Tag
, template< typename P1, typename P2, typename P3, typename P4 > class F
, typename L1, typename L2, typename L3, typename L4
>
struct le_result4
{
typedef F<
typename L1::type, typename L2::type, typename L3::type
, typename L4::type
> result_;
typedef result_ type;
};
template<
typename Tag
, template< typename P1, typename P2, typename P3, typename P4 > class F
, typename L1, typename L2, typename L3, typename L4
>
struct le_result4< true_,Tag,F,L1,L2,L3,L4 >
{
typedef bind4<
quote4< F,Tag >
, typename L1::result_, typename L2::result_, typename L3::result_
, typename L4::result_
> result_;
typedef mpl::protect<result_> type;
};
} // namespace aux
template<
template< typename P1, typename P2, typename P3, typename P4 > class F
, typename T1, typename T2, typename T3, typename T4
, typename Tag
>
struct lambda<
F< T1,T2,T3,T4 >
, Tag
, int_<4>
>
{
typedef lambda< T1,Tag > l1;
typedef lambda< T2,Tag > l2;
typedef lambda< T3,Tag > l3;
typedef lambda< T4,Tag > l4;
typedef typename l1::is_le is_le1;
typedef typename l2::is_le is_le2;
typedef typename l3::is_le is_le3;
typedef typename l4::is_le is_le4;
typedef typename aux::lambda_or<
is_le1::value, is_le2::value, is_le3::value, is_le4::value
>::type is_le;
typedef aux::le_result4<
is_le, Tag, F, l1, l2, l3, l4
> le_result_;
typedef typename le_result_::result_ result_;
typedef typename le_result_::type type;
};
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename Tag
>
struct lambda<
bind4< F,T1,T2,T3,T4 >
, Tag
, int_<5>
>
{
typedef false_ is_le;
typedef bind4<
F
, T1, T2, T3, T4
> result_;
typedef result_ type;
};
namespace aux {
template<
typename IsLE, typename Tag
, template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
, typename L1, typename L2, typename L3, typename L4, typename L5
>
struct le_result5
{
typedef F<
typename L1::type, typename L2::type, typename L3::type
, typename L4::type, typename L5::type
> result_;
typedef result_ type;
};
template<
typename Tag
, template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
, typename L1, typename L2, typename L3, typename L4, typename L5
>
struct le_result5< true_,Tag,F,L1,L2,L3,L4,L5 >
{
typedef bind5<
quote5< F,Tag >
, typename L1::result_, typename L2::result_, typename L3::result_
, typename L4::result_, typename L5::result_
> result_;
typedef mpl::protect<result_> type;
};
} // namespace aux
template<
template<
typename P1, typename P2, typename P3, typename P4
, typename P5
>
class F
, typename T1, typename T2, typename T3, typename T4, typename T5
, typename Tag
>
struct lambda<
F< T1,T2,T3,T4,T5 >
, Tag
, int_<5>
>
{
typedef lambda< T1,Tag > l1;
typedef lambda< T2,Tag > l2;
typedef lambda< T3,Tag > l3;
typedef lambda< T4,Tag > l4;
typedef lambda< T5,Tag > l5;
typedef typename l1::is_le is_le1;
typedef typename l2::is_le is_le2;
typedef typename l3::is_le is_le3;
typedef typename l4::is_le is_le4;
typedef typename l5::is_le is_le5;
typedef typename aux::lambda_or<
is_le1::value, is_le2::value, is_le3::value, is_le4::value
, is_le5::value
>::type is_le;
typedef aux::le_result5<
is_le, Tag, F, l1, l2, l3, l4, l5
> le_result_;
typedef typename le_result_::result_ result_;
typedef typename le_result_::type type;
};
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
, typename Tag
>
struct lambda<
bind5< F,T1,T2,T3,T4,T5 >
, Tag
, int_<6>
>
{
typedef false_ is_le;
typedef bind5<
F
, T1, T2, T3, T4, T5
> result_;
typedef result_ type;
};
/// special case for 'protect'
template< typename T, typename Tag >
struct lambda< mpl::protect<T>,Tag, int_<1> >
{
typedef false_ is_le;
typedef mpl::protect<T> result_;
typedef result_ type;
};
/// specializations for the main 'bind' form
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
, typename Tag
>
struct lambda<
bind< F,T1,T2,T3,T4,T5 >
, Tag
, int_<6>
>
{
typedef false_ is_le;
typedef bind< F,T1,T2,T3,T4,T5 > result_;
typedef result_ type;
};
template<
typename F
, typename Tag1
, typename Tag2
, typename Arity
>
struct lambda<
lambda< F,Tag1,Arity >
, Tag2
, int_<3>
>
{
typedef lambda< F,Tag2 > l1;
typedef lambda< Tag1,Tag2 > l2;
typedef typename l1::is_le is_le;
typedef bind1< quote1<aux::template_arity>, typename l1::result_ > arity_;
typedef lambda< typename if_< is_le,arity_,Arity >::type, Tag2 > l3;
typedef aux::le_result3<is_le, Tag2, mpl::lambda, l1, l2, l3> le_result_;
typedef typename le_result_::result_ result_;
typedef typename le_result_::type type;
};
BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
}}
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
@import "_variables.less";
@font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 900;
src: url('@{fa-font-path}/fa-solid-900.eot');
src: url('@{fa-font-path}/fa-solid-900.eot?#iefix') format('embedded-opentype'),
url('@{fa-font-path}/fa-solid-900.woff2') format('woff2'),
url('@{fa-font-path}/fa-solid-900.woff') format('woff'),
url('@{fa-font-path}/fa-solid-900.ttf') format('truetype'),
url('@{fa-font-path}/fa-solid-900.svg#fontawesome') format('svg');
}
.fa,
.fas {
font-family: 'Font Awesome 5 Free';
font-weight: 900;
}
| {
"pile_set_name": "Github"
} |
import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types";
export const definition: IconDefinition;
export const faFistRaised: IconDefinition;
export const prefix: IconPrefix;
export const iconName: IconName;
export const width: number;
export const height: number;
export const ligatures: string[];
export const unicode: string;
export const svgPathData: string; | {
"pile_set_name": "Github"
} |
{% load i18n %}
{% trans "Good news! An issue has been reserved for you on gitcoin. " %}
{% if bounty.total_reserved_length_label == "indefinitely" %}
{% trans "Please start working on the issue and release it to the public if you cannot commit to the work." %}
{% else %}
{% blocktrans with total_reserved_length_label=bounty.total_reserved_length_label %}
Please start working on the issue, within the next {{ total_reserved_length_label }}, before it is opened up for other bounty hunters to try as well.
{% endblocktrans %}
{% endif %}
{% include 'emails/bounty.txt' with bounty=bounty %}
{% trans "As always, if you have questions, please reach out to the project owner!" %}
| {
"pile_set_name": "Github"
} |
{
"activePlaceCount": 0,
"birth": {
"place": {
"name": "Tartu, Eesti",
"placeName": "Tartu",
"placeType": "inhabited_place"
},
"time": {
"startYear": 1939
}
},
"birthYear": 1939,
"date": "1939\u20131964",
"death": {
"place": {
"name": "Paris, France",
"placeName": "Paris",
"placeType": "inhabited_place"
},
"time": {
"startYear": 1964
}
},
"fc": "Thomas Erma",
"gender": "Male",
"id": 1063,
"mda": "Erma, Thomas",
"movements": [],
"startLetter": "E",
"totalWorks": 1,
"url": "http://www.tate.org.uk/art/artists/thomas-erma-1063"
} | {
"pile_set_name": "Github"
} |
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#ifndef SDL_sndioaudio_h_
#define SDL_sndioaudio_h_
#include <poll.h>
#include <sndio.h>
#include "../SDL_sysaudio.h"
/* Hidden "this" pointer for the audio functions */
#define _THIS SDL_AudioDevice *this
struct SDL_PrivateAudioData
{
/* The audio device handle */
struct sio_hdl *dev;
/* Raw mixing buffer */
Uint8 *mixbuf;
int mixlen;
/* Polling structures for non-blocking sndio devices */
struct pollfd *pfd;
};
#endif /* SDL_sndioaudio_h_ */
/* vi: set ts=4 sw=4 expandtab: */
| {
"pile_set_name": "Github"
} |
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <[email protected]>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace think;
use Closure;
use think\event\RouteLoaded;
/**
* 系统服务基础类
* @method void register()
* @method void boot()
*/
abstract class Service
{
protected $app;
public function __construct(App $app)
{
$this->app = $app;
}
/**
* 加载路由
* @access protected
* @param string $path 路由路径
*/
protected function loadRoutesFrom($path)
{
$this->registerRoutes(function () use ($path) {
include $path;
});
}
/**
* 注册路由
* @param Closure $closure
*/
protected function registerRoutes(Closure $closure)
{
$this->app->event->listen(RouteLoaded::class, $closure);
}
/**
* 添加指令
* @access protected
* @param array|string $commands 指令
*/
protected function commands($commands)
{
$commands = is_array($commands) ? $commands : func_get_args();
Console::starting(function (Console $console) use ($commands) {
$console->addCommands($commands);
});
}
}
| {
"pile_set_name": "Github"
} |
/**
* author: Marcel Genzmehr
* 02.12.2011
*/
package org.docear.plugin.core.actions;
import java.awt.event.ActionEvent;
import org.docear.plugin.core.DocearController;
import org.docear.plugin.core.logger.DocearLogEvent;
import org.freeplane.features.mode.QuitAction;
/**
*
*/
public class DocearQuitAction extends QuitAction {
private static final long serialVersionUID = 1L;
/***********************************************************************************
* CONSTRUCTORS
**********************************************************************************/
public DocearQuitAction() {
super();
}
/***********************************************************************************
* METHODS
**********************************************************************************/
/***********************************************************************************
* REQUIRED METHODS FOR INTERFACES
**********************************************************************************/
public void actionPerformed(ActionEvent e) {
quit(this);
}
public static void quit(Object src) {
if (DocearController.getController().shutdown()) {
DocearController.getController().getDocearEventLogger().appendToLog(src, DocearLogEvent.APPLICATION_CLOSED);
System.exit(0);
}
}
}
| {
"pile_set_name": "Github"
} |
package org.hswebframework.payment.api.payment.quick;
import org.hswebframework.payment.api.enums.TransType;
/**
* @author zhouhao
* @see TransType#GATEWAY
* @since 1.0.0
*/
public interface QuickPaymentService {
/**
* 发起快捷支付请求
*
* @param request 请求对象
* @return 发起支付请求结果
*/
QuickPaymentResponse requestQuickPayment(QuickPaymentRequest request);
/**
* 确认快捷支付
*
* @param request 确认请求对象
* @return 确认结果
*/
QuickPaymentConfirmResponse confirmQuickPayment(QuickPaymentConfirmRequest request);
}
| {
"pile_set_name": "Github"
} |
{
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
/**
* This callback type is completely empty, a no-operation.
*
* @callback Phaser.Types.Core.NOOP
* @since 3.0.0
*/
| {
"pile_set_name": "Github"
} |
@warn "This import is deprecated. Use 'compass/typography/lists/horizontal-list' instead.";
@import "../../typography/lists/horizontal-list";
| {
"pile_set_name": "Github"
} |
// declare some prefixes to use as abbreviations
prefixes = [ ("ex","http://dl-learner.org/test/doubles#") ]
// knowledge source definition
ks.type = "OWL File"
ks.fileName = "doubles.owl"
// reasoner
reasoner.type = "closed world reasoner"
reasoner.sources = { ks }
// learning problem
lp.type = "posNegStandard"
lp.positiveExamples = { "ex:N1", "ex:N2", "ex:N3" }
lp.negativeExamples = { "ex:N100", "ex:N102", "ex:N104" }
// create learning algorithm to run
alg.type = "celoe"
alg.maxExecutionTimeInSeconds = 1
| {
"pile_set_name": "Github"
} |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/openscreen/src/platform/api/time.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/time/time.h"
using std::chrono::microseconds;
using std::chrono::seconds;
namespace openscreen {
Clock::time_point Clock::now() noexcept {
// Open Screen requires at least 10,000 ticks per second, according to the
// docs. If IsHighResolution is false, the supplied resolution is much worse
// than that (potentially up to ~15.6ms).
if (UNLIKELY(!base::TimeTicks::IsHighResolution())) {
static bool need_to_log_once = true;
LOG_IF(ERROR, need_to_log_once)
<< "Open Screen requires a high resolution clock to work properly.";
need_to_log_once = false;
}
return Clock::time_point(
microseconds(base::TimeTicks::Now().since_origin().InMicroseconds()));
}
std::chrono::seconds GetWallTimeSinceUnixEpoch() noexcept {
const auto delta = base::Time::Now() - base::Time::UnixEpoch();
return seconds(delta.InSeconds());
}
} // namespace openscreen
| {
"pile_set_name": "Github"
} |
<!doctype html>
<title>CodeMirror: Smarty mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../xml/xml.js"></script>
<script src="smarty.js"></script>
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Smarty</a>
</ul>
</div>
<article>
<h2>Smarty mode</h2>
<form><textarea id="code" name="code">
{extends file="parent.tpl"}
{include file="template.tpl"}
{* some example Smarty content *}
{if isset($name) && $name == 'Blog'}
This is a {$var}.
{$integer = 451}, {$array[] = "a"}, {$stringvar = "string"}
{assign var='bob' value=$var.prop}
{elseif $name == $foo}
{function name=menu level=0}
{foreach $data as $entry}
{if is_array($entry)}
- {$entry@key}
{menu data=$entry level=$level+1}
{else}
{$entry}
{/if}
{/foreach}
{/function}
{/if}</textarea></form>
<p>Mode for Smarty version 2 or 3, which allows for custom delimiter tags.</p>
<p>Several configuration parameters are supported:</p>
<ul>
<li><code>leftDelimiter</code> and <code>rightDelimiter</code>,
which should be strings that determine where the Smarty syntax
starts and ends.</li>
<li><code>version</code>, which should be 2 or 3.</li>
<li><code>baseMode</code>, which can be a mode spec
like <code>"text/html"</code> to set a different background mode.</li>
</ul>
<p><strong>MIME types defined:</strong> <code>text/x-smarty</code></p>
<h3>Smarty 2, custom delimiters</h3>
<form><textarea id="code2" name="code2">
{--extends file="parent.tpl"--}
{--include file="template.tpl"--}
{--* some example Smarty content *--}
{--if isset($name) && $name == 'Blog'--}
This is a {--$var--}.
{--$integer = 451--}, {--$array[] = "a"--}, {--$stringvar = "string"--}
{--assign var='bob' value=$var.prop--}
{--elseif $name == $foo--}
{--function name=menu level=0--}
{--foreach $data as $entry--}
{--if is_array($entry)--}
- {--$entry@key--}
{--menu data=$entry level=$level+1--}
{--else--}
{--$entry--}
{--/if--}
{--/foreach--}
{--/function--}
{--/if--}</textarea></form>
<h3>Smarty 3</h3>
<textarea id="code3" name="code3">
Nested tags {$foo={counter one=1 two={inception}}+3} are now valid in Smarty 3.
<script>
function test() {
console.log("Smarty 3 permits single curly braces followed by whitespace to NOT slip into Smarty mode.");
}
</script>
{assign var=foo value=[1,2,3]}
{assign var=foo value=['y'=>'yellow','b'=>'blue']}
{assign var=foo value=[1,[9,8],3]}
{$foo=$bar+2} {* a comment *}
{$foo.bar=1} {* another comment *}
{$foo = myfunct(($x+$y)*3)}
{$foo = strlen($bar)}
{$foo.bar.baz=1}, {$foo[]=1}
Smarty "dot" syntax (note: embedded {} are used to address ambiguities):
{$foo.a.b.c} => $foo['a']['b']['c']
{$foo.a.$b.c} => $foo['a'][$b]['c']
{$foo.a.{$b+4}.c} => $foo['a'][$b+4]['c']
{$foo.a.{$b.c}} => $foo['a'][$b['c']]
{$object->method1($x)->method2($y)}</textarea>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
mode: "smarty"
});
var editor = CodeMirror.fromTextArea(document.getElementById("code2"), {
lineNumbers: true,
mode: {
name: "smarty",
leftDelimiter: "{--",
rightDelimiter: "--}"
}
});
var editor = CodeMirror.fromTextArea(document.getElementById("code3"), {
lineNumbers: true,
mode: {name: "smarty", version: 3, baseMode: "text/html"}
});
</script>
</article>
| {
"pile_set_name": "Github"
} |
; This structure must match the corresponding structure definition
; in LinkedListPrefetch.h
LlNode struct
ValA real8 4 dup(?)
ValB real8 4 dup(?)
ValC real8 4 dup(?)
ValD real8 4 dup(?)
FreeSpace byte 376 dup(?)
IFDEF ASMX86_32
Link dword ?
Pad byte 4 dup(?)
ENDIF
IFDEF ASMX86_64
Link qword ?
ENDIF
LlNode ends
| {
"pile_set_name": "Github"
} |
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import "osxFixes-c.h"
#include "mainwindow.h"
@interface OSXFixes : NSObject
{
MainWindow* mw;
}
// The Objective-C member function you want to call from C++
- (void) setMainWindow: (void*)amw;
//- (int) doSomethingWith:(void *) aParameter;
- (int) installSleepWakeNotifiers;
- (void) receiveSleepNote: (NSNotification*) note;
- (void) receiveWakeNote: (NSNotification*) note;
@end
| {
"pile_set_name": "Github"
} |
<% form_tag({}) do -%>
<%= hidden_field_tag 'back_url', url_for(params) %>
<div class="autoscroll">
<table class="list issues">
<thead><tr>
<th><%= link_to image_tag('toggle_check.png'), {}, :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<%= sort_header_tag('id', :caption => '#', :default_order => 'desc') %>
<% query.columns.each do |column| %>
<%= column_header(column) %>
<% end %>
</tr></thead>
<% previous_group = false %>
<tbody>
<% issues.each do |issue| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.columns.size + 2 %>">
<span class="expander" onclick="toggleRowGroup(this); return false;"> </span>
<%= group.blank? ? 'None' : column_content(@query.group_by_column, issue) %> <span class="count">(<%= @issue_count_by_group[group] %>)</span>
</td>
</tr>
<% previous_group = group %>
<% end %>
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
<td class="checkbox"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
<td class="id"><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
<% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.name %><% end %>
</tr>
<% end -%>
</tbody>
</table>
</div>
<% end -%>
| {
"pile_set_name": "Github"
} |
/***********************************************************************
* Software License Agreement (BSD License)
*
* Copyright 2008-2009 Marius Muja ([email protected]). All rights reserved.
* Copyright 2008-2009 David G. Lowe ([email protected]). All rights reserved.
*
* THE BSD LICENSE
*
* 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 THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR 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 FLANN_KMEANS_INDEX_H_
#define FLANN_KMEANS_INDEX_H_
#include <algorithm>
#include <string>
#include <map>
#include <cassert>
#include <limits>
#include <cmath>
#include "flann/general.h"
#include "flann/algorithms/nn_index.h"
#include "flann/algorithms/dist.h"
#include <flann/algorithms/center_chooser.h>
#include "flann/util/matrix.h"
#include "flann/util/result_set.h"
#include "flann/util/heap.h"
#include "flann/util/allocator.h"
#include "flann/util/random.h"
#include "flann/util/saving.h"
#include "flann/util/logger.h"
using namespace std;
namespace flann
{
struct KMeansIndexParams : public IndexParams
{
KMeansIndexParams(int branching = 32, int iterations = 11,
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 )
{
(*this)["algorithm"] = FLANN_INDEX_KMEANS;
// branching factor
(*this)["branching"] = branching;
// max iterations to perform in one kmeans clustering (kmeans tree)
(*this)["iterations"] = iterations;
// algorithm used for picking the initial cluster centers for kmeans tree
(*this)["centers_init"] = centers_init;
// cluster boundary index. Used when searching the kmeans tree
(*this)["cb_index"] = cb_index;
}
};
/**
* Hierarchical kmeans index
*
* Contains a tree constructed through a hierarchical kmeans clustering
* and other information for indexing a set of points for nearest-neighbour matching.
*/
template <typename Distance>
class KMeansIndex : public NNIndex<Distance>
{
public:
int kk;
typedef typename Distance::ElementType ElementType;
typedef typename Distance::ResultType DistanceType;
typedef NNIndex<Distance> BaseClass;
typedef bool needs_vector_space_distance;
flann_algorithm_t getType() const
{
return FLANN_INDEX_KMEANS;
}
/**
* Index constructor
*
* Params:
* inputData = dataset with the input features
* params = parameters passed to the hierarchical k-means algorithm
*/
KMeansIndex(const Matrix<ElementType>& inputData, const IndexParams& params = KMeansIndexParams(),
Distance d = Distance())
: BaseClass(params,d), root_(NULL), memoryCounter_(0)
{
branching_ = get_param(params,"branching",32);
iterations_ = get_param(params,"iterations",11);
if (iterations_<0) {
iterations_ = (std::numeric_limits<int>::max)();
}
centers_init_ = get_param(params,"centers_init",FLANN_CENTERS_RANDOM);
cb_index_ = get_param(params,"cb_index",0.4f);
initCenterChooser();
chooseCenters_->setDataset(inputData);
setDataset(inputData);
}
/**
* Index constructor
*
* Params:
* inputData = dataset with the input features
* params = parameters passed to the hierarchical k-means algorithm
*/
KMeansIndex(const IndexParams& params = KMeansIndexParams(), Distance d = Distance())
: BaseClass(params, d), root_(NULL), memoryCounter_(0)
{
branching_ = get_param(params,"branching",32);
iterations_ = get_param(params,"iterations",11);
if (iterations_<0) {
iterations_ = (std::numeric_limits<int>::max)();
}
centers_init_ = get_param(params,"centers_init",FLANN_CENTERS_RANDOM);
cb_index_ = get_param(params,"cb_index",0.4f);
initCenterChooser();
}
KMeansIndex(const KMeansIndex& other) : BaseClass(other),
branching_(other.branching_),
iterations_(other.iterations_),
centers_init_(other.centers_init_),
cb_index_(other.cb_index_),
memoryCounter_(other.memoryCounter_)
{
initCenterChooser();
copyTree(root_, other.root_);
}
KMeansIndex& operator=(KMeansIndex other)
{
this->swap(other);
return *this;
}
void initCenterChooser()
{
switch(centers_init_) {
case FLANN_CENTERS_RANDOM:
chooseCenters_ = new RandomCenterChooser<Distance>(distance_);
break;
case FLANN_CENTERS_GONZALES:
chooseCenters_ = new GonzalesCenterChooser<Distance>(distance_);
break;
case FLANN_CENTERS_KMEANSPP:
chooseCenters_ = new KMeansppCenterChooser<Distance>(distance_);
break;
default:
throw FLANNException("Unknown algorithm for choosing initial centers.");
}
}
/**
* Index destructor.
*
* Release the memory used by the index.
*/
virtual ~KMeansIndex()
{
delete chooseCenters_;
freeIndex();
}
BaseClass* clone() const
{
return new KMeansIndex(*this);
}
void set_cb_index( float index)
{
cb_index_ = index;
}
/**
* Computes the inde memory usage
* Returns: memory used by the index
*/
int usedMemory() const
{
return pool_.usedMemory+pool_.wastedMemory+memoryCounter_;
}
using BaseClass::buildIndex;
void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2)
{
assert(points.cols==veclen_);
size_t old_size = size_;
extendDataset(points);
if (rebuild_threshold>1 && size_at_build_*rebuild_threshold<size_) {
buildIndex();
}
else {
for (size_t i=0;i<points.rows;++i) {
DistanceType dist = distance_(root_->pivot, points[i], veclen_);
addPointToTree(root_, old_size + i, dist);
}
}
}
template<typename Archive>
void serialize(Archive& ar)
{
ar.setObject(this);
ar & *static_cast<NNIndex<Distance>*>(this);
ar & branching_;
ar & iterations_;
ar & memoryCounter_;
ar & cb_index_;
ar & centers_init_;
if (Archive::is_loading::value) {
root_ = new(pool_) Node();
}
ar & *root_;
if (Archive::is_loading::value) {
index_params_["algorithm"] = getType();
index_params_["branching"] = branching_;
index_params_["iterations"] = iterations_;
index_params_["centers_init"] = centers_init_;
index_params_["cb_index"] = cb_index_;
}
}
void saveIndex(FILE* stream)
{
serialization::SaveArchive sa(stream);
sa & *this;
}
void loadIndex(FILE* stream)
{
freeIndex();
serialization::LoadArchive la(stream);
la & *this;
}
/**
* Find set of nearest neighbors to vec. Their indices are stored inside
* the result object.
*
* Params:
* result = the result object in which the indices of the nearest-neighbors are stored
* vec = the vector for which to search the nearest neighbors
* searchParams = parameters that influence the search algorithm (checks, cb_index)
*/
void findNeighbors(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) const
{
if (removed_) {
findNeighborsWithRemoved<true>(result, vec, searchParams);
}
else {
findNeighborsWithRemoved<false>(result, vec, searchParams);
}
}
/**
* Clustering function that takes a cut in the hierarchical k-means
* tree and return the clusters centers of that clustering.
* Params:
* numClusters = number of clusters to have in the clustering computed
* Returns: number of cluster centers
*/
int getClusterCenters(Matrix<DistanceType>& centers)
{
int numClusters = centers.rows;
if (numClusters<1) {
throw FLANNException("Number of clusters must be at least 1");
}
DistanceType variance;
std::vector<NodePtr> clusters(numClusters);
int clusterCount = getMinVarianceClusters(root_, clusters, numClusters, variance);
Logger::info("Clusters requested: %d, returning %d\n",numClusters, clusterCount);
for (int i=0; i<clusterCount; ++i) {
DistanceType* center = clusters[i]->pivot;
for (size_t j=0; j<veclen_; ++j) {
centers[i][j] = center[j];
}
}
return clusterCount;
}
protected:
/**
* Builds the index
*/
void buildIndexImpl()
{
if (branching_<2) {
throw FLANNException("Branching factor must be at least 2");
}
std::vector<int> indices(size_);
for (size_t i=0; i<size_; ++i) {
indices[i] = int(i);
}
root_ = new(pool_) Node();
computeNodeStatistics(root_, indices);
computeClustering(root_, &indices[0], (int)size_, branching_);
/*
for(int i=0;i<branching_;i++)
{
NodePtr node=root_->childs[i];
std::cout<<node->size<<endl;
}*/
/*
cout<<size_<<endl;
cout<<counts.size()<<endl;
sort(counts.begin(),counts.end());
float var = 0;
float avg = size_*1.0 / counts.size();
for(int i=counts.size()-1; i>=0 ;i--)
{
float tmp = avg - counts[i];
var += tmp*tmp;
}
var /= counts.size();
cout<<counts[0]<<" "<<counts[counts.size()-1]<<" "<<avg<<" "<<var<<endl;
for(int i=counts.size()-1;i>=0;i--)
cout<<counts[i]<<" ";
cout<<"\n";
//write index
FILE * fp=fopen("index.km","wb");
//cout<<clusters.size()<<" "<<veclen_<<endl;
int cluster_size = clusters.size();
fwrite(&cluster_size,sizeof(int),1,fp);
for(int i=0;i<cluster_size;i++)
{
_clus cc=clusters[i];
float * center=cc.center;
int * ids=cc.ids;
int size = cc.size;
fwrite(center,sizeof(float),veclen_,fp);
fwrite(&size,sizeof(int),1,fp);
fwrite(ids,sizeof(int),size,fp);
}
fclose(fp);*/
}
private:
struct PointInfo
{
size_t index;
ElementType* point;
private:
template<typename Archive>
void serialize(Archive& ar)
{
typedef KMeansIndex<Distance> Index;
Index* obj = static_cast<Index*>(ar.getObject());
ar & index;
// ar & point;
if (Archive::is_loading::value) point = obj->points_[index];
}
friend struct serialization::access;
};
/**
* Struture representing a node in the hierarchical k-means tree.
*/
struct Node
{
/**
* The cluster center.
*/
DistanceType* pivot;
/**
* The cluster radius.
*/
DistanceType radius;
/**
* The cluster variance.
*/
DistanceType variance;
/**
* The cluster size (number of points in the cluster)
*/
int size;
/**
* Child nodes (only for non-terminal nodes)
*/
std::vector<Node*> childs;
/**
* Node points (only for terminal nodes)
*/
std::vector<PointInfo> points;
/**
* Level
*/
// int level;
~Node()
{
delete[] pivot;
if (!childs.empty()) {
for (size_t i=0; i<childs.size(); ++i) {
childs[i]->~Node();
}
}
}
template<typename Archive>
void serialize(Archive& ar)
{
typedef KMeansIndex<Distance> Index;
Index* obj = static_cast<Index*>(ar.getObject());
if (Archive::is_loading::value) {
pivot = new DistanceType[obj->veclen_];
}
ar & serialization::make_binary_object(pivot, obj->veclen_*sizeof(DistanceType));
ar & radius;
ar & variance;
ar & size;
size_t childs_size;
if (Archive::is_saving::value) {
childs_size = childs.size();
}
ar & childs_size;
if (childs_size==0) {
ar & points;
}
else {
if (Archive::is_loading::value) {
childs.resize(childs_size);
}
for (size_t i=0;i<childs_size;++i) {
if (Archive::is_loading::value) {
childs[i] = new(obj->pool_) Node();
}
ar & *childs[i];
}
}
}
friend struct serialization::access;
};
typedef Node* NodePtr;
/**
* Alias definition for a nicer syntax.
*/
typedef BranchStruct<NodePtr, DistanceType> BranchSt;
/**
* Helper function
*/
void freeIndex()
{
if (root_) root_->~Node();
root_ = NULL;
pool_.free();
}
void copyTree(NodePtr& dst, const NodePtr& src)
{
dst = new(pool_) Node();
dst->pivot = new DistanceType[veclen_];
std::copy(src->pivot, src->pivot+veclen_, dst->pivot);
dst->radius = src->radius;
dst->variance = src->variance;
dst->size = src->size;
if (src->childs.size()==0) {
dst->points = src->points;
}
else {
dst->childs.resize(src->childs.size());
for (size_t i=0;i<src->childs.size();++i) {
copyTree(dst->childs[i], src->childs[i]);
}
}
}
/**
* Computes the statistics of a node (mean, radius, variance).
*
* Params:
* node = the node to use
* indices = the indices of the points belonging to the node
*/
void computeNodeStatistics(NodePtr node, const std::vector<int>& indices)
{
size_t size = indices.size();
DistanceType* mean = new DistanceType[veclen_];
memoryCounter_ += int(veclen_*sizeof(DistanceType));
memset(mean,0,veclen_*sizeof(DistanceType));
for (size_t i=0; i<size; ++i) {
ElementType* vec = points_[indices[i]];
for (size_t j=0; j<veclen_; ++j) {
mean[j] += vec[j];
}
}
DistanceType div_factor = DistanceType(1)/size;
for (size_t j=0; j<veclen_; ++j) {
mean[j] *= div_factor;
}
DistanceType radius = 0;
DistanceType variance = 0;
for (size_t i=0; i<size; ++i) {
DistanceType dist = distance_(mean, points_[indices[i]], veclen_);
if (dist>radius) {
radius = dist;
}
variance += dist;
}
variance /= size;
node->variance = variance;
node->radius = radius;
node->pivot = mean;
}
/**
* The method responsible with actually doing the recursive hierarchical
* clustering
*
* Params:
* node = the node to cluster
* indices = indices of the points belonging to the current node
* branching = the branching factor to use in the clustering
*
* TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point)
*/
vector<int> counts;
struct _clus
{
int size;
float * center;
int * ids;
};
vector<_clus> clusters;
void computeClustering(NodePtr node, int* indices, int indices_length, int branching)
{
node->size = indices_length;
if (indices_length < branching) {
node->points.resize(indices_length);
/*
counts.push_back(indices_length);
float* mean = new float[veclen_];
memset(mean,0,veclen_*sizeof(float));
for (size_t i=0; i<indices_length; ++i) {
ElementType* vec = points_[indices[i]];
for (size_t j=0; j<veclen_; ++j) {
mean[j] += vec[j];
}
}
for(int i=0;i<veclen_;i++)
mean[i]=mean[i]/indices_length;
int* ids = new int[indices_length];
*/
for (int i=0;i<indices_length;++i) {
node->points[i].index = indices[i];
node->points[i].point = points_[indices[i]];
//ids[i]=indices[i];
}
/*
_clus cc;
cc.size = indices_length;
cc.center = mean;
cc.ids = ids;
clusters.push_back(cc);
*/
node->childs.clear();
return;
}
std::vector<int> centers_idx(branching);
int centers_length;
(*chooseCenters_)(branching, indices, indices_length, ¢ers_idx[0], centers_length);
if (centers_length<=branching) {
node->points.resize(indices_length);
for (int i=0;i<indices_length;++i) {
node->points[i].index = indices[i];
node->points[i].point = points_[indices[i]];
}
node->childs.clear();
return;
}
Matrix<double> dcenters(new double[branching*veclen_],branching,veclen_);
for (int i=0; i<centers_length; ++i) {
ElementType* vec = points_[centers_idx[i]];
for (size_t k=0; k<veclen_; ++k) {
dcenters[i][k] = double(vec[k]);
}
}
std::vector<DistanceType> radiuses(branching,0);
std::vector<int> count(branching,0);
// assign points to clusters
std::vector<int> belongs_to(indices_length);
for (int i=0; i<indices_length; ++i) {
DistanceType sq_dist = distance_(points_[indices[i]], dcenters[0], veclen_);
belongs_to[i] = 0;
for (int j=1; j<branching; ++j) {
DistanceType new_sq_dist = distance_(points_[indices[i]], dcenters[j], veclen_);
if (sq_dist>new_sq_dist) {
belongs_to[i] = j;
sq_dist = new_sq_dist;
}
}
if (sq_dist>radiuses[belongs_to[i]]) {
radiuses[belongs_to[i]] = sq_dist;
}
count[belongs_to[i]]++;
}
bool converged = false;
int iteration = 0;
while (!converged && iteration<iterations_) {
converged = true;
iteration++;
// compute the new cluster centers
for (int i=0; i<branching; ++i) {
memset(dcenters[i],0,sizeof(double)*veclen_);
radiuses[i] = 0;
}
for (int i=0; i<indices_length; ++i) {
ElementType* vec = points_[indices[i]];
double* center = dcenters[belongs_to[i]];
for (size_t k=0; k<veclen_; ++k) {
center[k] += vec[k];
}
}
for (int i=0; i<branching; ++i) {
int cnt = count[i];
double div_factor = 1.0/cnt;
for (size_t k=0; k<veclen_; ++k) {
dcenters[i][k] *= div_factor;
}
}
// reassign points to clusters
for (int i=0; i<indices_length; ++i) {
DistanceType sq_dist = distance_(points_[indices[i]], dcenters[0], veclen_);
int new_centroid = 0;
for (int j=1; j<branching; ++j) {
DistanceType new_sq_dist = distance_(points_[indices[i]], dcenters[j], veclen_);
if (sq_dist>new_sq_dist) {
new_centroid = j;
sq_dist = new_sq_dist;
}
}
if (sq_dist>radiuses[new_centroid]) {
radiuses[new_centroid] = sq_dist;
}
if (new_centroid != belongs_to[i]) {
count[belongs_to[i]]--;
count[new_centroid]++;
belongs_to[i] = new_centroid;
converged = false;
}
}
for (int i=0; i<branching; ++i) {
// if one cluster converges to an empty cluster,
// move an element into that cluster
if (count[i]==0) {
int j = (i+1)%branching;
while (count[j]<=1) {
j = (j+1)%branching;
}
for (int k=0; k<indices_length; ++k) {
if (belongs_to[k]==j) {
belongs_to[k] = i;
count[j]--;
count[i]++;
break;
}
}
converged = false;
}
}
}
std::vector<DistanceType*> centers(branching);
for (int i=0; i<branching; ++i) {
centers[i] = new DistanceType[veclen_];
memoryCounter_ += veclen_*sizeof(DistanceType);
for (size_t k=0; k<veclen_; ++k) {
centers[i][k] = (DistanceType)dcenters[i][k];
}
}
// compute kmeans clustering for each of the resulting clusters
node->childs.resize(branching);
int start = 0;
int end = start;
for (int c=0; c<branching; ++c) {
int s = count[c];
DistanceType variance = 0;
for (int i=0; i<indices_length; ++i) {
if (belongs_to[i]==c) {
variance += distance_(centers[c], points_[indices[i]], veclen_);
std::swap(indices[i],indices[end]);
std::swap(belongs_to[i],belongs_to[end]);
end++;
}
}
variance /= s;
node->childs[c] = new(pool_) Node();
node->childs[c]->radius = radiuses[c];
node->childs[c]->pivot = centers[c];
node->childs[c]->variance = variance;
computeClustering(node->childs[c],indices+start, end-start, branching);
kk++;
start=end;
}
delete[] dcenters.ptr();
}
template<bool with_removed>
void findNeighborsWithRemoved(ResultSet<DistanceType>& result, const ElementType* vec, const SearchParams& searchParams) const
{
int maxChecks = searchParams.checks;
if (maxChecks==FLANN_CHECKS_UNLIMITED) {
findExactNN<with_removed>(root_, result, vec);
}
else {
// Priority queue storing intermediate branches in the best-bin-first search
Heap<BranchSt>* heap = new Heap<BranchSt>((int)size_);
int checks = 0;
findNN<with_removed>(root_, result, vec, checks, maxChecks, heap);
BranchSt branch;
while (heap->popMin(branch) && (checks<maxChecks || !result.full())) {
NodePtr node = branch.node;
findNN<with_removed>(node, result, vec, checks, maxChecks, heap);
}
delete heap;
}
}
/**
* Performs one descent in the hierarchical k-means tree. The branches not
* visited are stored in a priority queue.
*
* Params:
* node = node to explore
* result = container for the k-nearest neighbors found
* vec = query points
* checks = how many points in the dataset have been checked so far
* maxChecks = maximum dataset points to checks
*/
template<bool with_removed>
void findNN(NodePtr node, ResultSet<DistanceType>& result, const ElementType* vec, int& checks, int maxChecks,
Heap<BranchSt>* heap) const
{
// Ignore those clusters that are too far away
{
DistanceType bsq = distance_(vec, node->pivot, veclen_);
DistanceType rsq = node->radius;
DistanceType wsq = result.worstDist();
DistanceType val = bsq-rsq-wsq;
DistanceType val2 = val*val-4*rsq*wsq;
//if (val>0) {
if ((val>0)&&(val2>0)) {
return;
}
}
if (node->childs.empty()) {
if (checks>=maxChecks) {
if (result.full()) return;
}
for (int i=0; i<node->size; ++i) {
PointInfo& point_info = node->points[i];
int index = point_info.index;
if (with_removed) {
if (removed_points_.test(index)) continue;
}
DistanceType dist = distance_(point_info.point, vec, veclen_);
result.addPoint(dist, index);
++checks;
}
}
else {
int closest_center = exploreNodeBranches(node, vec, heap);
findNN<with_removed>(node->childs[closest_center],result,vec, checks, maxChecks, heap);
}
}
/**
* Helper function that computes the nearest childs of a node to a given query point.
* Params:
* node = the node
* q = the query point
* distances = array with the distances to each child node.
* Returns:
*/
int exploreNodeBranches(NodePtr node, const ElementType* q, Heap<BranchSt>* heap) const
{
std::vector<DistanceType> domain_distances(branching_);
int best_index = 0;
domain_distances[best_index] = distance_(q, node->childs[best_index]->pivot, veclen_);
for (int i=1; i<branching_; ++i) {
domain_distances[i] = distance_(q, node->childs[i]->pivot, veclen_);
if (domain_distances[i]<domain_distances[best_index]) {
best_index = i;
}
}
// float* best_center = node->childs[best_index]->pivot;
for (int i=0; i<branching_; ++i) {
if (i != best_index) {
domain_distances[i] -= cb_index_*node->childs[i]->variance;
// float dist_to_border = getDistanceToBorder(node.childs[i].pivot,best_center,q);
// if (domain_distances[i]<dist_to_border) {
// domain_distances[i] = dist_to_border;
// }
heap->insert(BranchSt(node->childs[i],domain_distances[i]));
}
}
return best_index;
}
/**
* Function the performs exact nearest neighbor search by traversing the entire tree.
*/
template<bool with_removed>
void findExactNN(NodePtr node, ResultSet<DistanceType>& result, const ElementType* vec) const
{
// Ignore those clusters that are too far away
{
DistanceType bsq = distance_(vec, node->pivot, veclen_);
DistanceType rsq = node->radius;
DistanceType wsq = result.worstDist();
DistanceType val = bsq-rsq-wsq;
DistanceType val2 = val*val-4*rsq*wsq;
// if (val>0) {
if ((val>0)&&(val2>0)) {
return;
}
}
if (node->childs.empty()) {
for (int i=0; i<node->size; ++i) {
PointInfo& point_info = node->points[i];
int index = point_info.index;
if (with_removed) {
if (removed_points_.test(index)) continue;
}
DistanceType dist = distance_(point_info.point, vec, veclen_);
result.addPoint(dist, index);
}
}
else {
std::vector<int> sort_indices(branching_);
getCenterOrdering(node, vec, sort_indices);
for (int i=0; i<branching_; ++i) {
findExactNN<with_removed>(node->childs[sort_indices[i]],result,vec);
}
}
}
/**
* Helper function.
*
* I computes the order in which to traverse the child nodes of a particular node.
*/
void getCenterOrdering(NodePtr node, const ElementType* q, std::vector<int>& sort_indices) const
{
std::vector<DistanceType> domain_distances(branching_);
for (int i=0; i<branching_; ++i) {
DistanceType dist = distance_(q, node->childs[i]->pivot, veclen_);
int j=0;
while (domain_distances[j]<dist && j<i) j++;
for (int k=i; k>j; --k) {
domain_distances[k] = domain_distances[k-1];
sort_indices[k] = sort_indices[k-1];
}
domain_distances[j] = dist;
sort_indices[j] = i;
}
}
/**
* Method that computes the squared distance from the query point q
* from inside region with center c to the border between this
* region and the region with center p
*/
DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, DistanceType* q) const
{
DistanceType sum = 0;
DistanceType sum2 = 0;
for (int i=0; i<veclen_; ++i) {
DistanceType t = c[i]-p[i];
sum += t*(q[i]-(c[i]+p[i])/2);
sum2 += t*t;
}
return sum*sum/sum2;
}
/**
* Helper function the descends in the hierarchical k-means tree by spliting those clusters that minimize
* the overall variance of the clustering.
* Params:
* root = root node
* clusters = array with clusters centers (return value)
* varianceValue = variance of the clustering (return value)
* Returns:
*/
int getMinVarianceClusters(NodePtr root, std::vector<NodePtr>& clusters, int clusters_length, DistanceType& varianceValue) const
{
int clusterCount = 1;
clusters[0] = root;
DistanceType meanVariance = root->variance*root->size;
while (clusterCount<clusters_length) {
DistanceType minVariance = (std::numeric_limits<DistanceType>::max)();
int splitIndex = -1;
for (int i=0; i<clusterCount; ++i) {
if (!clusters[i]->childs.empty()) {
DistanceType variance = meanVariance - clusters[i]->variance*clusters[i]->size;
for (int j=0; j<branching_; ++j) {
variance += clusters[i]->childs[j]->variance*clusters[i]->childs[j]->size;
}
if (variance<minVariance) {
minVariance = variance;
splitIndex = i;
}
}
}
if (splitIndex==-1) break;
if ( (branching_+clusterCount-1) > clusters_length) break;
meanVariance = minVariance;
// split node
NodePtr toSplit = clusters[splitIndex];
clusters[splitIndex] = toSplit->childs[0];
for (int i=1; i<branching_; ++i) {
clusters[clusterCount++] = toSplit->childs[i];
}
}
varianceValue = meanVariance/root->size;
return clusterCount;
}
void addPointToTree(NodePtr node, size_t index, DistanceType dist_to_pivot)
{
ElementType* point = points_[index];
if (dist_to_pivot>node->radius) {
node->radius = dist_to_pivot;
}
// if radius changed above, the variance will be an approximation
node->variance = (node->size*node->variance+dist_to_pivot)/(node->size+1);
node->size++;
if (node->childs.empty()) { // leaf node
PointInfo point_info;
point_info.index = index;
point_info.point = point;
node->points.push_back(point_info);
std::vector<int> indices(node->points.size());
for (size_t i=0;i<node->points.size();++i) {
indices[i] = node->points[i].index;
}
computeNodeStatistics(node, indices);
if (indices.size()>=size_t(branching_)) {
computeClustering(node, &indices[0], indices.size(), branching_);
}
}
else {
// find the closest child
int closest = 0;
DistanceType dist = distance_(node->childs[closest]->pivot, point, veclen_);
for (size_t i=1;i<size_t(branching_);++i) {
DistanceType crt_dist = distance_(node->childs[i]->pivot, point, veclen_);
if (crt_dist<dist) {
dist = crt_dist;
closest = i;
}
}
addPointToTree(node->childs[closest], index, dist);
}
}
void swap(KMeansIndex& other)
{
std::swap(branching_, other.branching_);
std::swap(iterations_, other.iterations_);
std::swap(centers_init_, other.centers_init_);
std::swap(cb_index_, other.cb_index_);
std::swap(root_, other.root_);
std::swap(pool_, other.pool_);
std::swap(memoryCounter_, other.memoryCounter_);
std::swap(chooseCenters_, other.chooseCenters_);
}
private:
/** The branching factor used in the hierarchical k-means clustering */
int branching_;
/** Maximum number of iterations to use when performing k-means clustering */
int iterations_;
/** Algorithm for choosing the cluster centers */
flann_centers_init_t centers_init_;
/**
* Cluster border index. This is used in the tree search phase when determining
* the closest cluster to explore next. A zero value takes into account only
* the cluster centres, a value greater then zero also take into account the size
* of the cluster.
*/
float cb_index_;
/**
* The root node in the tree.
*/
NodePtr root_;
/**
* Pooled memory allocator.
*/
PooledAllocator pool_;
/**
* Memory occupied by the index.
*/
int memoryCounter_;
/**
* Algorithm used to choose initial centers
*/
CenterChooser<Distance>* chooseCenters_;
USING_BASECLASS_SYMBOLS
};
}
#endif //FLANN_KMEANS_INDEX_H_
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: BSD-3-Clause
/*============================================================================
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
Package, Release 3a, by John R. Hauser.
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
California. 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.
3. Neither the name of the University 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 REGENTS AND CONTRIBUTORS "AS IS", AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS 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 <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "softfloat.h"
float32_t
softfloat_roundPackToF32( bool sign, int_fast16_t exp, uint_fast32_t sig )
{
uint_fast8_t roundingMode;
bool roundNearEven;
uint_fast8_t roundIncrement, roundBits;
bool isTiny;
uint_fast32_t uiZ;
union ui32_f32 uZ;
roundingMode = softfloat_roundingMode;
roundNearEven = (roundingMode == softfloat_round_near_even);
roundIncrement = 0x40;
if ( ! roundNearEven && (roundingMode != softfloat_round_near_maxMag) ) {
roundIncrement =
(roundingMode
== (sign ? softfloat_round_min : softfloat_round_max))
? 0x7F
: 0;
}
roundBits = sig & 0x7F;
if ( 0xFD <= (uint16_t) exp ) {
if ( exp < 0 ) {
isTiny =
(softfloat_detectTininess
== softfloat_tininess_beforeRounding)
|| (exp < -1)
|| (sig + roundIncrement < 0x80000000);
sig = softfloat_shiftRightJam32( sig, -exp );
exp = 0;
roundBits = sig & 0x7F;
if ( isTiny && roundBits ) {
softfloat_raiseFlags( softfloat_flag_underflow );
}
} else if ( (0xFD < exp) || (0x80000000 <= sig + roundIncrement) ) {
softfloat_raiseFlags(
softfloat_flag_overflow | softfloat_flag_inexact );
uiZ = packToF32UI( sign, 0xFF, 0 ) - ! roundIncrement;
goto uiZ;
}
}
if ( roundBits ) softfloat_exceptionFlags |= softfloat_flag_inexact;
sig = (sig + roundIncrement)>>7;
sig &= ~(uint_fast32_t) (! (roundBits ^ 0x40) & roundNearEven);
uiZ = packToF32UI( sign, sig ? exp : 0, sig );
uiZ:
uZ.ui = uiZ;
return uZ.f;
}
| {
"pile_set_name": "Github"
} |
// This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.sosy_lab.cpachecker.core.defaults;
import java.util.Collection;
import org.sosy_lab.cpachecker.core.interfaces.AbstractState;
import org.sosy_lab.cpachecker.core.interfaces.Precision;
import org.sosy_lab.cpachecker.core.interfaces.StopOperator;
/**
* Standard stop operator, which always returns true
*/
public class StopAlwaysOperator implements StopOperator {
@Override
public boolean stop(AbstractState el, Collection<AbstractState> reached, Precision precision) {
return true;
}
private static final StopOperator instance = new StopAlwaysOperator();
public static StopOperator getInstance() {
return instance;
}
} | {
"pile_set_name": "Github"
} |
<?php
/*
* Copyright 2014 Google 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.
*/
class Google_Service_ServiceControl_ReportResponse extends Google_Collection
{
protected $collection_key = 'reportInfos';
protected $reportErrorsType = 'Google_Service_ServiceControl_ReportError';
protected $reportErrorsDataType = 'array';
protected $reportInfosType = 'Google_Service_ServiceControl_ReportInfo';
protected $reportInfosDataType = 'array';
public $serviceConfigId;
/**
* @param Google_Service_ServiceControl_ReportError
*/
public function setReportErrors($reportErrors)
{
$this->reportErrors = $reportErrors;
}
/**
* @return Google_Service_ServiceControl_ReportError
*/
public function getReportErrors()
{
return $this->reportErrors;
}
/**
* @param Google_Service_ServiceControl_ReportInfo
*/
public function setReportInfos($reportInfos)
{
$this->reportInfos = $reportInfos;
}
/**
* @return Google_Service_ServiceControl_ReportInfo
*/
public function getReportInfos()
{
return $this->reportInfos;
}
public function setServiceConfigId($serviceConfigId)
{
$this->serviceConfigId = $serviceConfigId;
}
public function getServiceConfigId()
{
return $this->serviceConfigId;
}
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only
# Intel MIC Platform Software Stack (MPSS)
#
# Copyright(c) 2013 Intel Corporation.
#
# Intel MIC User Space Tools.
#
# micctrl - Controls MIC boot/start/stop.
#
# chkconfig: 2345 95 05
# description: start MPSS stack processing.
#
### BEGIN INIT INFO
# Provides: micctrl
### END INIT INFO
# Source function library.
. /etc/init.d/functions
sysfs="/sys/class/mic"
_status()
{
f=$sysfs/$1
echo -e $1 state: "`cat $f/state`" shutdown_status: "`cat $f/shutdown_status`"
}
status()
{
if [ "`echo $1 | head -c3`" == "mic" ]; then
_status $1
return $?
fi
for f in $sysfs/*
do
_status `basename $f`
RETVAL=$?
[ $RETVAL -ne 0 ] && return $RETVAL
done
return 0
}
_reset()
{
f=$sysfs/$1
echo reset > $f/state
}
reset()
{
if [ "`echo $1 | head -c3`" == "mic" ]; then
_reset $1
return $?
fi
for f in $sysfs/*
do
_reset `basename $f`
RETVAL=$?
[ $RETVAL -ne 0 ] && return $RETVAL
done
return 0
}
_boot()
{
f=$sysfs/$1
echo "linux" > $f/bootmode
echo "mic/uos.img" > $f/firmware
echo "mic/$1.image" > $f/ramdisk
echo "boot" > $f/state
}
boot()
{
if [ "`echo $1 | head -c3`" == "mic" ]; then
_boot $1
return $?
fi
for f in $sysfs/*
do
_boot `basename $f`
RETVAL=$?
[ $RETVAL -ne 0 ] && return $RETVAL
done
return 0
}
_shutdown()
{
f=$sysfs/$1
echo shutdown > $f/state
}
shutdown()
{
if [ "`echo $1 | head -c3`" == "mic" ]; then
_shutdown $1
return $?
fi
for f in $sysfs/*
do
_shutdown `basename $f`
RETVAL=$?
[ $RETVAL -ne 0 ] && return $RETVAL
done
return 0
}
_wait()
{
f=$sysfs/$1
while [ "`cat $f/state`" != "offline" -a "`cat $f/state`" != "online" ]
do
sleep 1
echo -e "Waiting for $1 to go offline"
done
}
wait()
{
if [ "`echo $1 | head -c3`" == "mic" ]; then
_wait $1
return $?
fi
# Wait for the cards to go offline
for f in $sysfs/*
do
_wait `basename $f`
RETVAL=$?
[ $RETVAL -ne 0 ] && return $RETVAL
done
return 0
}
if [ ! -d "$sysfs" ]; then
echo -e $"Module unloaded "
exit 3
fi
case $1 in
-s)
status $2
;;
-r)
reset $2
;;
-b)
boot $2
;;
-S)
shutdown $2
;;
-w)
wait $2
;;
*)
echo $"Usage: $0 {-s (status) |-r (reset) |-b (boot) |-S (shutdown) |-w (wait)}"
exit 2
esac
exit $?
| {
"pile_set_name": "Github"
} |
/*
* arch/arm/mach-at91/include/mach/at91_shdwc.h
*
* Copyright (C) 2007 Andrew Victor
* Copyright (C) 2007 Atmel Corporation.
*
* Shutdown Controller (SHDWC) - System peripherals regsters.
* Based on AT91SAM9261 datasheet revision D.
*
* 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.
*/
#ifndef AT91_SHDWC_H
#define AT91_SHDWC_H
#define AT91_SHDW_CR (AT91_SHDWC + 0x00) /* Shut Down Control Register */
#define AT91_SHDW_SHDW (1 << 0) /* Shut Down command */
#define AT91_SHDW_KEY (0xa5 << 24) /* KEY Password */
#define AT91_SHDW_MR (AT91_SHDWC + 0x04) /* Shut Down Mode Register */
#define AT91_SHDW_WKMODE0 (3 << 0) /* Wake-up 0 Mode Selection */
#define AT91_SHDW_WKMODE0_NONE 0
#define AT91_SHDW_WKMODE0_HIGH 1
#define AT91_SHDW_WKMODE0_LOW 2
#define AT91_SHDW_WKMODE0_ANYLEVEL 3
#define AT91_SHDW_CPTWK0 (0xf << 4) /* Counter On Wake Up 0 */
#define AT91_SHDW_CPTWK0_(x) ((x) << 4)
#define AT91_SHDW_RTTWKEN (1 << 16) /* Real Time Timer Wake-up Enable */
#define AT91_SHDW_SR (AT91_SHDWC + 0x08) /* Shut Down Status Register */
#define AT91_SHDW_WAKEUP0 (1 << 0) /* Wake-up 0 Status */
#define AT91_SHDW_RTTWK (1 << 16) /* Real-time Timer Wake-up */
#define AT91_SHDW_RTCWK (1 << 17) /* Real-time Clock Wake-up [SAM9RL] */
#endif
| {
"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.cxf.jca.cxf.handlers;
import org.apache.cxf.jca.cxf.CXFInvocationHandler;
import org.apache.cxf.jca.cxf.CXFManagedConnectionFactory;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
public abstract class AbstractInvocationHandlerTest
extends HandlerTestBase {
public AbstractInvocationHandlerTest() {
}
// seach for the setNext method
@Test
public void testHandlerInvokesNext() throws Throwable {
Object[] args = new Object[0];
CXFInvocationHandler handler = getHandler();
handler.setNext(mockHandler);
handler.invoke(target, testMethod, args);
assertFalse("target object must not be called", target.methodInvoked);
}
@Test
public void testTargetAttribute() {
CXFInvocationHandler handler = getHandler();
handler.getData().setTarget(target);
assertSame("target must be retrievable after set",
target, handler.getData().getTarget());
}
@Test
public void testBusAttribute() {
CXFInvocationHandler handler = getHandler();
handler.getData().setBus(mockBus);
assertSame("bus must be retrievable after set", mockBus, handler.getData().getBus());
}
@Test
public void testManagedConnectionAttribute() {
CXFInvocationHandler handler = getHandler();
handler.getData().setManagedConnection(mockManagedConnection);
assertSame("bus must be retrievable after set", mockManagedConnection, handler.getData()
.getManagedConnection());
}
protected CXFInvocationHandler getNextHandler() {
return mockHandler;
}
protected abstract CXFInvocationHandler getHandler();
protected CXFManagedConnectionFactory getTestManagedConnectionFactory() {
return mcf;
}
}
| {
"pile_set_name": "Github"
} |
1:@:(dbr bind Debug)@:(9!:19)2^_44[(echo^:ECHOFILENAME) './gmbx0.ijs'
NB. mapped boxed arrays -------------------------------------------------
0!:0 <testpath,'gmbx.ijs'
NB. = -------------------------------------------------------------------
NB. literal
q=: x=: (<5!:2 <'g') 1};:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: (<5!:2 <'g') 1}(u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: (<5!:2 <'g') 1}(10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
NB. symbol
q=: x=: (<5!:2 <'g') 1}<@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: (<5!:2 <'g') 1}<@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: (<5!:2 <'g') 1}<@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
NB. literal
q=: x=: <"0 (<5!:2 <'g') 1};:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: <"0 (<5!:2 <'g') 1}(u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: <"0 (<5!:2 <'g') 1}(10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: <"0 +&.>?10 2 3$10
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
NB. symbol
q=: x=: <"0 (<5!:2 <'g') 1}<@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: <"0 (<5!:2 <'g') 1}<@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: <"0 (<5!:2 <'g') 1}<@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
q=: x=: <"0 +&.>?10 2 3$10
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (=j{x) -: = j{q [ j=: ?$~#x
NB. literal
q=: x=: (<5!:2 <'g') 1};:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (x=j{x) -: q = j{q [ j=: ?$~#x
(mbxcheck_jmf_ q), (x=j{x) -: q = j{x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = q
q=: x=: (<5!:2 <'g') 1}(u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (x=j{x) -: q = j{q [ j=: ?$~#x
(mbxcheck_jmf_ q), (x=j{x) -: q = j{x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = q
q=: x=: (<5!:2 <'g') 1}(10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (x=j{x) -: q = j{q [ j=: ?$~#x
(mbxcheck_jmf_ q), (x=j{x) -: q = j{x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = q
NB. symbol
q=: x=: (<5!:2 <'g') 1}<@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (x=j{x) -: q = j{q [ j=: ?$~#x
(mbxcheck_jmf_ q), (x=j{x) -: q = j{x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = q
q=: x=: (<5!:2 <'g') 1}<@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (x=j{x) -: q = j{q [ j=: ?$~#x
(mbxcheck_jmf_ q), (x=j{x) -: q = j{x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = q
q=: x=: (<5!:2 <'g') 1}<@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (x=j{x) -: q = j{q [ j=: ?$~#x
(mbxcheck_jmf_ q), (x=j{x) -: q = j{x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = x
(mbxcheck_jmf_ q), (x=j{x) -: (j{q) = q
NB. literal
q=: x=: (?10 3$#x){x=: <"0 (<5!:2 <'g') 1};:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{q [ j=: ?#x
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 q
q=: x=: (?10 3$#x){x=: <"0 (<5!:2 <'g') 1}(u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{q [ j=: ?#x
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 q
q=: x=: (?10 3$#x){x=: <"0 (<5!:2 <'g') 1}(10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{q [ j=: ?#x
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 q
NB. symbol
q=: x=: (?10 3$#x){x=: <"0 (<5!:2 <'g') 1}<@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{q [ j=: ?#x
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 q
q=: x=: (?10 3$#x){x=: <"0 (<5!:2 <'g') 1}<@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{q [ j=: ?#x
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 q
q=: x=: (?10 3$#x){x=: <"0 (<5!:2 <'g') 1}<@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{q [ j=: ?#x
(mbxcheck_jmf_ q), (x="1 j{x) -: q ="1 j{x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 x
(mbxcheck_jmf_ q), (x="1 j{x) -: (j{q) ="1 q
NB. =: ------------------------------------------------------------------
NB. literal
q=: x=: (<5!:2 <'g'), ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
q=: x=: (<5!:2 <'g'), (u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
q=: x=: (<5!:2 <'g'), (10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
NB. symbol
q=: x=: (<5!:2 <'g'), <@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
q=: x=: (<5!:2 <'g'), <@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
q=: x=: (<5!:2 <'g'), <@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
x=: 2 2 2 2 2 2 2$x
q=: 2 2 2 2 2 2 2$q
(mbxcheck_jmf_ q), x -: q
x=: x;2
q=: q;2
(mbxcheck_jmf_ q), x -: q
x=: >{.x
q=: >{.q
(mbxcheck_jmf_ q), x -: q
x=: ,x
q=: ,q
(mbxcheck_jmf_ q), x -: q
'allocation error' -: ex 'q=: i.&.>10^i.7'
NB. < -------------------------------------------------------------------
NB. literal
q=: x=: (?2 3 4$#x){x=: (<5!:2 <'g'),;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (<x) -: <q
(mbxcheck_jmf_ q), (<"0 x) -: <"0 q
(mbxcheck_jmf_ q), (<"1 x) -: <"1 q
(mbxcheck_jmf_ q), (<"2 x) -: <"2 q
q=: x=: (?2 3 4$#x){x=: (<5!:2 <'g'),(u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (<x) -: <q
(mbxcheck_jmf_ q), (<"0 x) -: <"0 q
(mbxcheck_jmf_ q), (<"1 x) -: <"1 q
(mbxcheck_jmf_ q), (<"2 x) -: <"2 q
q=: x=: (?2 3 4$#x){x=: (<5!:2 <'g'),(10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (<x) -: <q
(mbxcheck_jmf_ q), (<"0 x) -: <"0 q
(mbxcheck_jmf_ q), (<"1 x) -: <"1 q
(mbxcheck_jmf_ q), (<"2 x) -: <"2 q
NB. symbol
q=: x=: (?2 3 4$#x){x=: (<5!:2 <'g'),<@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (<x) -: <q
(mbxcheck_jmf_ q), (<"0 x) -: <"0 q
(mbxcheck_jmf_ q), (<"1 x) -: <"1 q
(mbxcheck_jmf_ q), (<"2 x) -: <"2 q
q=: x=: (?2 3 4$#x){x=: (<5!:2 <'g'),<@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (<x) -: <q
(mbxcheck_jmf_ q), (<"0 x) -: <"0 q
(mbxcheck_jmf_ q), (<"1 x) -: <"1 q
(mbxcheck_jmf_ q), (<"2 x) -: <"2 q
q=: x=: (?2 3 4$#x){x=: (<5!:2 <'g'),<@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (<x) -: <q
(mbxcheck_jmf_ q), (<"0 x) -: <"0 q
(mbxcheck_jmf_ q), (<"1 x) -: <"1 q
(mbxcheck_jmf_ q), (<"2 x) -: <"2 q
NB. > -------------------------------------------------------------------
NB. literal
q=: x=: ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (> x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {. q
q=: x=: (u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (> x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {. q
q=: x=: (10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (> x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {. q
NB. symbol
q=: x=: <@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (> x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {. q
q=: x=: <@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (> x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {. q
q=: x=: <@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (> x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {. q
NB. literal
q=: x=: <"0 ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {.q
x=: (<1;2;3;4) 1}x
q=: (<1;2;3;4) 1}q
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q),(>x) -: >q
q=: x=: <"0 (u:&.>) ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {.q
x=: (<1;2;3;4) 1}x
q=: (<1;2;3;4) 1}q
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q),(>x) -: >q
q=: x=: <"0 (10&u:&.>) ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {.q
x=: (<1;2;3;4) 1}x
q=: (<1;2;3;4) 1}q
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q),(>x) -: >q
NB. symbol
q=: x=: <"0 <@(s:"0) ;:'Cogito, ergo sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {.q
x=: (<1;2;3;4) 1}x
q=: (<1;2;3;4) 1}q
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q),(>x) -: >q
q=: x=: <"0 <@(s:"0) ([: u: 128+a.&i.)&.> ;:'COGITO, ERGO SUM.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {.q
x=: (<1;2;3;4) 1}x
q=: (<1;2;3;4) 1}q
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q),(>x) -: >q
q=: x=: <"0 <@(s:"0) (10 u: 65536+a.&i.)&.> ;:'Cogito, Ergo Sum.'
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: > q
(mbxcheck_jmf_ q), (>{.x) -: > {.q
x=: (<1;2;3;4) 1}x
q=: (<1;2;3;4) 1}q
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q),(>x) -: >q
NB. literal
q=: x=: ((<4$<'x'),<<"0 ]2 3$'abcdef') ((1;0;2);<0;1;0)} <"0 <"0 i.2 3 4
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: >q
q=: x=: ((<4$<'x'),<<"0 ]2 3$u:'ABCDEF') ((1;0;2);<0;1;0)} <"0 <"0 i.2 3 4
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: >q
q=: x=: ((<4$<'x'),<<"0 ]2 3$10&u:'AbCdEf') ((1;0;2);<0;1;0)} <"0 <"0 i.2 3 4
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: >q
NB. symbol
q=: x=: ((<4$<'x'),<<"0 ]<@(s:"0) 2 3$'abcdef') ((1;0;2);<0;1;0)} <"0 <"0 i.2 3 4
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: >q
q=: x=: ((<4$<'x'),<<"0 ]<@(s:"0) 2 3$u:'ABCDEF') ((1;0;2);<0;1;0)} <"0 <"0 i.2 3 4
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: >q
q=: x=: ((<4$<'x'),<<"0 ]<@(s:"0) 2 3$10&u:'AbCdEf') ((1;0;2);<0;1;0)} <"0 <"0 i.2 3 4
(mbxcheck_jmf_ q), x -: q
(mbxcheck_jmf_ q), (>x) -: >q
1 [ unmap_jmf_ 'q'
1 [ unmap_jmf_ 'r'
4!:55 ;:'f f1 g j mean q r t x y'
| {
"pile_set_name": "Github"
} |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://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 containeranalysis
// [START containeranalysis_get_occurrence]
import (
"context"
"fmt"
containeranalysis "cloud.google.com/go/containeranalysis/apiv1"
grafeaspb "google.golang.org/genproto/googleapis/grafeas/v1"
)
// getOccurrence retrieves and prints a specified Occurrence from the server.
func getOccurrence(occurrenceID, projectID string) (*grafeaspb.Occurrence, error) {
// occurrenceID := path.Base(occurrence.Name)
ctx := context.Background()
client, err := containeranalysis.NewClient(ctx)
if err != nil {
return nil, fmt.Errorf("NewClient: %v", err)
}
defer client.Close()
req := &grafeaspb.GetOccurrenceRequest{
Name: fmt.Sprintf("projects/%s/occurrences/%s", projectID, occurrenceID),
}
occ, err := client.GetGrafeasClient().GetOccurrence(ctx, req)
if err != nil {
return nil, fmt.Errorf("client.GetOccurrence: %v", err)
}
return occ, nil
}
// [END containeranalysis_get_occurrence]
| {
"pile_set_name": "Github"
} |
/*---------------------------------------------------------------------------------
Copyright (C) 2012-2017
Alekmaul
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
---------------------------------------------------------------------------------*/
#include <snes/background.h>
#include <snes/lzss.h>
BgState bgState[4];
//---------------------------------------------------------------------------------
void bgSetGfxPtr(u8 bgNumber, u16 address) {
bgState[bgNumber].gfxaddr = address;
// Change address regarde background number
if (bgNumber < 2) {
REG_BG12NBA = (bgState[1].gfxaddr >> 8 ) | (bgState[0].gfxaddr >> 12);
}
else {
REG_BG34NBA = (bgState[3].gfxaddr >> 8 ) | (bgState[2].gfxaddr >> 12);
}
}
//---------------------------------------------------------------------------------
void bgSetMapPtr(u8 bgNumber, u16 address, u8 mapSize) {
// Compute map address
u8 mapadr = ((address >> 8) & 0xfc) | (mapSize & 0x03);
bgState[bgNumber].mapaddr = mapadr; // ((address >> 8) & 0xfc) | (mapSize & 0x03);
// Change it
if (bgNumber == 0) REG_BG1SC = mapadr;
else if (bgNumber == 1) REG_BG2SC = mapadr;
else if (bgNumber == 2) REG_BG3SC = mapadr;
else if (bgNumber == 3) REG_BG4SC = mapadr;
}
//---------------------------------------------------------------------------------
void bgInitTileSet(u8 bgNumber, u8 *tileSource, u8 *tilePalette, u8 paletteEntry, u16 tileSize, u16 paletteSize, u16 colorMode, u16 address) {
u16 palEntry;
// If mode 0, compute palette entry with separate subpalettes in entries 0-31, 32-63, 64-95, and 96-127
if (colorMode == BG_4COLORS0)
palEntry = bgNumber*32 + paletteEntry*BG_4COLORS;
else
palEntry = paletteEntry*colorMode;
setBrightness(0); // Force VBlank Interrupt
WaitForVBlank();
// Send to VRAM and CGRAM
dmaCopyVram(tileSource, address, tileSize);
dmaCopyCGram(tilePalette, palEntry, paletteSize);
bgSetGfxPtr(bgNumber, address);
}
//---------------------------------------------------------------------------------
void bgInitTileSetLz(u8 bgNumber, u8 *tileSource, u8 *tilePalette, u8 paletteEntry, u16 tileSize, u16 paletteSize, u16 colorMode, u16 address) {
u16 palEntry;
// If mode 0, compute palette entry with separate subpalettes in entries 0-31, 32-63, 64-95, and 96-127
if (colorMode == BG_4COLORS0)
palEntry = bgNumber*32 + paletteEntry*BG_4COLORS;
else
palEntry = paletteEntry*colorMode;
setBrightness(0); // Force VBlank Interrupt
WaitForVBlank();
// Send to VRAM and CGRAM
LzssDecodeVram(tileSource, address, tileSize);
dmaCopyCGram(tilePalette, palEntry, paletteSize);
bgSetGfxPtr(bgNumber, address);
}
//---------------------------------------------------------------------------------
void bgInitMapTileSet7(u8 *tileSource, u8 *mapSource, u8 *tilePalette, u16 tileSize, u16 address) {
setBrightness(0); // Force VBlank Interrupt
dmaCopyVram7(mapSource, address,0x4000, VRAM_INCLOW | VRAM_ADRTR_0B | VRAM_ADRSTINC_1,0x1800);
bgSetMapPtr(0, address, SC_32x32);
dmaCopyVram7(tileSource, address, tileSize, VRAM_INCHIGH | VRAM_ADRTR_0B | VRAM_ADRSTINC_1,0x1900);
dmaCopyCGram(tilePalette, 0, 256*2);
bgSetGfxPtr(0, address);
}
//---------------------------------------------------------------------------------
void bgInitMapSet(u8 bgNumber, u8 *mapSource, u16 mapSize, u8 sizeMode, u16 address) {
WaitForVBlank();
dmaCopyVram(mapSource, address,mapSize);
if (bgNumber != 0xff)
bgSetMapPtr(bgNumber, address, sizeMode);
}
//---------------------------------------------------------------------------------
void bgInitTileSetData(u8 bgNumber, u8 *tileSource, u16 tileSize, u16 address) {
setBrightness(0); // Force VBlank Interrupt
dmaCopyVram(tileSource, address, tileSize);
if (bgNumber != 0xff)
bgSetGfxPtr(bgNumber, address);
}
//---------------------------------------------------------------------------------
void bgSetEnable(u8 bgNumber) {
videoMode |= (1 << bgNumber);
REG_TM = videoMode;
}
//---------------------------------------------------------------------------------
void bgSetDisable(u8 bgNumber) {
videoMode &= ~(1 << bgNumber);
REG_TM = videoMode;
}
//---------------------------------------------------------------------------------
void bgSetEnableSub(u8 bgNumber) {
videoModeSub |= (1 << bgNumber);
REG_TS = videoModeSub;
}
//---------------------------------------------------------------------------------
void bgSetDisableSub(u8 bgNumber) {
videoModeSub &= ~(1 << bgNumber);
REG_TS = videoModeSub;
}
//---------------------------------------------------------------------------------
void bgSetWindowsRegions(u8 bgNumber, u8 winNumber, u8 xLeft, u8 xRight) {
REG_W12SEL = 0x03;
REG_WOBJSEL = 0x03;
REG_WH0 = xLeft;
REG_WH1 = xRight;
REG_WBGLOG = 0x01;
REG_WOBJLOG = 0x01;
REG_TMW = 0x11;
} | {
"pile_set_name": "Github"
} |
define(
({
widgetLabel: "فحص هجاء دفعي",
unfound: "غير موجودة",
skip: "تخطي",
skipAll: "تخطي كل",
toDic: "اضافة الى القاموس",
suggestions: "اقتراحات",
replace: "استبدال",
replaceWith: "استبدال مع",
replaceAll: "استبدال كل",
cancel: "الغاء",
msg: "لا يوجد أخطاء في الهجاء",
iSkip: "تخطي هذا",
iSkipAll: "تخطي كل المماثل لهذا",
iMsg: "لا توجد اقتراحات للهجاء"
})
);
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 8d713940fcbede142ae4a33ea0062b33
timeCreated: 1425440388
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
// Code generated by SQLBoiler 3.5.0-gct (https://github.com/thrasher-corp/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package postgres
import (
"bytes"
"context"
"reflect"
"testing"
"github.com/thrasher-corp/sqlboiler/boil"
"github.com/thrasher-corp/sqlboiler/queries"
"github.com/thrasher-corp/sqlboiler/randomize"
"github.com/thrasher-corp/sqlboiler/strmangle"
)
var (
// Relationships sometimes use the reflection helper queries.Equal/queries.Assign
// so force a package dependency in case they don't.
_ = queries.Equal
)
func testCandles(t *testing.T) {
t.Parallel()
query := Candles()
if query.Query == nil {
t.Error("expected a query, got nothing")
}
}
func testCandlesDelete(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
if rowsAff, err := o.Delete(ctx, tx); err != nil {
t.Error(err)
} else if rowsAff != 1 {
t.Error("should only have deleted one row, but affected:", rowsAff)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 0 {
t.Error("want zero records, got:", count)
}
}
func testCandlesQueryDeleteAll(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
if rowsAff, err := Candles().DeleteAll(ctx, tx); err != nil {
t.Error(err)
} else if rowsAff != 1 {
t.Error("should only have deleted one row, but affected:", rowsAff)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 0 {
t.Error("want zero records, got:", count)
}
}
func testCandlesSliceDeleteAll(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
slice := CandleSlice{o}
if rowsAff, err := slice.DeleteAll(ctx, tx); err != nil {
t.Error(err)
} else if rowsAff != 1 {
t.Error("should only have deleted one row, but affected:", rowsAff)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 0 {
t.Error("want zero records, got:", count)
}
}
func testCandlesExists(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
e, err := CandleExists(ctx, tx, o.ID)
if err != nil {
t.Errorf("Unable to check if Candle exists: %s", err)
}
if !e {
t.Errorf("Expected CandleExists to return true, but got false.")
}
}
func testCandlesFind(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
candleFound, err := FindCandle(ctx, tx, o.ID)
if err != nil {
t.Error(err)
}
if candleFound == nil {
t.Error("want a record, got nil")
}
}
func testCandlesBind(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
if err = Candles().Bind(ctx, tx, o); err != nil {
t.Error(err)
}
}
func testCandlesOne(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
if x, err := Candles().One(ctx, tx); err != nil {
t.Error(err)
} else if x == nil {
t.Error("expected to get a non nil record")
}
}
func testCandlesAll(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
candleOne := &Candle{}
candleTwo := &Candle{}
if err = randomize.Struct(seed, candleOne, candleDBTypes, false, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
if err = randomize.Struct(seed, candleTwo, candleDBTypes, false, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = candleOne.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
if err = candleTwo.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
slice, err := Candles().All(ctx, tx)
if err != nil {
t.Error(err)
}
if len(slice) != 2 {
t.Error("want 2 records, got:", len(slice))
}
}
func testCandlesCount(t *testing.T) {
t.Parallel()
var err error
seed := randomize.NewSeed()
candleOne := &Candle{}
candleTwo := &Candle{}
if err = randomize.Struct(seed, candleOne, candleDBTypes, false, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
if err = randomize.Struct(seed, candleTwo, candleDBTypes, false, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = candleOne.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
if err = candleTwo.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 2 {
t.Error("want 2 records, got:", count)
}
}
func candleBeforeInsertHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleAfterInsertHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleAfterSelectHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleBeforeUpdateHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleAfterUpdateHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleBeforeDeleteHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleAfterDeleteHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleBeforeUpsertHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func candleAfterUpsertHook(ctx context.Context, e boil.ContextExecutor, o *Candle) error {
*o = Candle{}
return nil
}
func testCandlesHooks(t *testing.T) {
t.Parallel()
var err error
ctx := context.Background()
empty := &Candle{}
o := &Candle{}
seed := randomize.NewSeed()
if err = randomize.Struct(seed, o, candleDBTypes, false); err != nil {
t.Errorf("Unable to randomize Candle object: %s", err)
}
AddCandleHook(boil.BeforeInsertHook, candleBeforeInsertHook)
if err = o.doBeforeInsertHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doBeforeInsertHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected BeforeInsertHook function to empty object, but got: %#v", o)
}
candleBeforeInsertHooks = []CandleHook{}
AddCandleHook(boil.AfterInsertHook, candleAfterInsertHook)
if err = o.doAfterInsertHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doAfterInsertHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected AfterInsertHook function to empty object, but got: %#v", o)
}
candleAfterInsertHooks = []CandleHook{}
AddCandleHook(boil.AfterSelectHook, candleAfterSelectHook)
if err = o.doAfterSelectHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doAfterSelectHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected AfterSelectHook function to empty object, but got: %#v", o)
}
candleAfterSelectHooks = []CandleHook{}
AddCandleHook(boil.BeforeUpdateHook, candleBeforeUpdateHook)
if err = o.doBeforeUpdateHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doBeforeUpdateHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected BeforeUpdateHook function to empty object, but got: %#v", o)
}
candleBeforeUpdateHooks = []CandleHook{}
AddCandleHook(boil.AfterUpdateHook, candleAfterUpdateHook)
if err = o.doAfterUpdateHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doAfterUpdateHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected AfterUpdateHook function to empty object, but got: %#v", o)
}
candleAfterUpdateHooks = []CandleHook{}
AddCandleHook(boil.BeforeDeleteHook, candleBeforeDeleteHook)
if err = o.doBeforeDeleteHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doBeforeDeleteHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected BeforeDeleteHook function to empty object, but got: %#v", o)
}
candleBeforeDeleteHooks = []CandleHook{}
AddCandleHook(boil.AfterDeleteHook, candleAfterDeleteHook)
if err = o.doAfterDeleteHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doAfterDeleteHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected AfterDeleteHook function to empty object, but got: %#v", o)
}
candleAfterDeleteHooks = []CandleHook{}
AddCandleHook(boil.BeforeUpsertHook, candleBeforeUpsertHook)
if err = o.doBeforeUpsertHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doBeforeUpsertHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected BeforeUpsertHook function to empty object, but got: %#v", o)
}
candleBeforeUpsertHooks = []CandleHook{}
AddCandleHook(boil.AfterUpsertHook, candleAfterUpsertHook)
if err = o.doAfterUpsertHooks(ctx, nil); err != nil {
t.Errorf("Unable to execute doAfterUpsertHooks: %s", err)
}
if !reflect.DeepEqual(o, empty) {
t.Errorf("Expected AfterUpsertHook function to empty object, but got: %#v", o)
}
candleAfterUpsertHooks = []CandleHook{}
}
func testCandlesInsert(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 1 {
t.Error("want one record, got:", count)
}
}
func testCandlesInsertWhitelist(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Whitelist(candleColumnsWithoutDefault...)); err != nil {
t.Error(err)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 1 {
t.Error("want one record, got:", count)
}
}
func testCandleToOneExchangeUsingExchangeName(t *testing.T) {
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
var local Candle
var foreign Exchange
seed := randomize.NewSeed()
if err := randomize.Struct(seed, &local, candleDBTypes, false, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
if err := randomize.Struct(seed, &foreign, exchangeDBTypes, false, exchangeColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Exchange struct: %s", err)
}
if err := foreign.Insert(ctx, tx, boil.Infer()); err != nil {
t.Fatal(err)
}
local.ExchangeNameID = foreign.ID
if err := local.Insert(ctx, tx, boil.Infer()); err != nil {
t.Fatal(err)
}
check, err := local.ExchangeName().One(ctx, tx)
if err != nil {
t.Fatal(err)
}
if check.ID != foreign.ID {
t.Errorf("want: %v, got %v", foreign.ID, check.ID)
}
slice := CandleSlice{&local}
if err = local.L.LoadExchangeName(ctx, tx, false, (*[]*Candle)(&slice), nil); err != nil {
t.Fatal(err)
}
if local.R.ExchangeName == nil {
t.Error("struct should have been eager loaded")
}
local.R.ExchangeName = nil
if err = local.L.LoadExchangeName(ctx, tx, true, &local, nil); err != nil {
t.Fatal(err)
}
if local.R.ExchangeName == nil {
t.Error("struct should have been eager loaded")
}
}
func testCandleToOneSetOpExchangeUsingExchangeName(t *testing.T) {
var err error
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
var a Candle
var b, c Exchange
seed := randomize.NewSeed()
if err = randomize.Struct(seed, &a, candleDBTypes, false, strmangle.SetComplement(candlePrimaryKeyColumns, candleColumnsWithoutDefault)...); err != nil {
t.Fatal(err)
}
if err = randomize.Struct(seed, &b, exchangeDBTypes, false, strmangle.SetComplement(exchangePrimaryKeyColumns, exchangeColumnsWithoutDefault)...); err != nil {
t.Fatal(err)
}
if err = randomize.Struct(seed, &c, exchangeDBTypes, false, strmangle.SetComplement(exchangePrimaryKeyColumns, exchangeColumnsWithoutDefault)...); err != nil {
t.Fatal(err)
}
if err := a.Insert(ctx, tx, boil.Infer()); err != nil {
t.Fatal(err)
}
if err = b.Insert(ctx, tx, boil.Infer()); err != nil {
t.Fatal(err)
}
for i, x := range []*Exchange{&b, &c} {
err = a.SetExchangeName(ctx, tx, i != 0, x)
if err != nil {
t.Fatal(err)
}
if a.R.ExchangeName != x {
t.Error("relationship struct not set to correct value")
}
if x.R.ExchangeNameCandles[0] != &a {
t.Error("failed to append to foreign relationship struct")
}
if a.ExchangeNameID != x.ID {
t.Error("foreign key was wrong value", a.ExchangeNameID)
}
zero := reflect.Zero(reflect.TypeOf(a.ExchangeNameID))
reflect.Indirect(reflect.ValueOf(&a.ExchangeNameID)).Set(zero)
if err = a.Reload(ctx, tx); err != nil {
t.Fatal("failed to reload", err)
}
if a.ExchangeNameID != x.ID {
t.Error("foreign key was wrong value", a.ExchangeNameID, x.ID)
}
}
}
func testCandlesReload(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
if err = o.Reload(ctx, tx); err != nil {
t.Error(err)
}
}
func testCandlesReloadAll(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
slice := CandleSlice{o}
if err = slice.ReloadAll(ctx, tx); err != nil {
t.Error(err)
}
}
func testCandlesSelect(t *testing.T) {
t.Parallel()
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
slice, err := Candles().All(ctx, tx)
if err != nil {
t.Error(err)
}
if len(slice) != 1 {
t.Error("want one record, got:", len(slice))
}
}
var (
candleDBTypes = map[string]string{`ID`: `uuid`, `ExchangeNameID`: `uuid`, `Base`: `character varying`, `Quote`: `character varying`, `Interval`: `bigint`, `Timestamp`: `timestamp with time zone`, `Open`: `double precision`, `High`: `double precision`, `Low`: `double precision`, `Close`: `double precision`, `Volume`: `double precision`, `Asset`: `character varying`}
_ = bytes.MinRead
)
func testCandlesUpdate(t *testing.T) {
t.Parallel()
if 0 == len(candlePrimaryKeyColumns) {
t.Skip("Skipping table with no primary key columns")
}
if len(candleAllColumns) == len(candlePrimaryKeyColumns) {
t.Skip("Skipping table with only primary key columns")
}
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 1 {
t.Error("want one record, got:", count)
}
if err = randomize.Struct(seed, o, candleDBTypes, true, candlePrimaryKeyColumns...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
if rowsAff, err := o.Update(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
} else if rowsAff != 1 {
t.Error("should only affect one row but affected", rowsAff)
}
}
func testCandlesSliceUpdateAll(t *testing.T) {
t.Parallel()
if len(candleAllColumns) == len(candlePrimaryKeyColumns) {
t.Skip("Skipping table with only primary key columns")
}
seed := randomize.NewSeed()
var err error
o := &Candle{}
if err = randomize.Struct(seed, o, candleDBTypes, true, candleColumnsWithDefault...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Insert(ctx, tx, boil.Infer()); err != nil {
t.Error(err)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 1 {
t.Error("want one record, got:", count)
}
if err = randomize.Struct(seed, o, candleDBTypes, true, candlePrimaryKeyColumns...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
// Remove Primary keys and unique columns from what we plan to update
var fields []string
if strmangle.StringSliceMatch(candleAllColumns, candlePrimaryKeyColumns) {
fields = candleAllColumns
} else {
fields = strmangle.SetComplement(
candleAllColumns,
candlePrimaryKeyColumns,
)
}
value := reflect.Indirect(reflect.ValueOf(o))
typ := reflect.TypeOf(o).Elem()
n := typ.NumField()
updateMap := M{}
for _, col := range fields {
for i := 0; i < n; i++ {
f := typ.Field(i)
if f.Tag.Get("boil") == col {
updateMap[col] = value.Field(i).Interface()
}
}
}
slice := CandleSlice{o}
if rowsAff, err := slice.UpdateAll(ctx, tx, updateMap); err != nil {
t.Error(err)
} else if rowsAff != 1 {
t.Error("wanted one record updated but got", rowsAff)
}
}
func testCandlesUpsert(t *testing.T) {
t.Parallel()
if len(candleAllColumns) == len(candlePrimaryKeyColumns) {
t.Skip("Skipping table with only primary key columns")
}
seed := randomize.NewSeed()
var err error
// Attempt the INSERT side of an UPSERT
o := Candle{}
if err = randomize.Struct(seed, &o, candleDBTypes, true); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
ctx := context.Background()
tx := MustTx(boil.BeginTx(ctx, nil))
defer func() { _ = tx.Rollback() }()
if err = o.Upsert(ctx, tx, false, nil, boil.Infer(), boil.Infer()); err != nil {
t.Errorf("Unable to upsert Candle: %s", err)
}
count, err := Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 1 {
t.Error("want one record, got:", count)
}
// Attempt the UPDATE side of an UPSERT
if err = randomize.Struct(seed, &o, candleDBTypes, false, candlePrimaryKeyColumns...); err != nil {
t.Errorf("Unable to randomize Candle struct: %s", err)
}
if err = o.Upsert(ctx, tx, true, nil, boil.Infer(), boil.Infer()); err != nil {
t.Errorf("Unable to upsert Candle: %s", err)
}
count, err = Candles().Count(ctx, tx)
if err != nil {
t.Error(err)
}
if count != 1 {
t.Error("want one record, got:", count)
}
}
| {
"pile_set_name": "Github"
} |
/*
* Vortex OpenSplice
*
* This software and documentation are Copyright 2006 to TO_YEAR ADLINK
* Technology Limited, its affiliated companies and licensors. All rights
* reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.vortex.FACE;
public class ConfigurationException extends Exception {
/**
*
*/
private static final long serialVersionUID = 6405508866799791471L;
public ConfigurationException(String message) {
super(message);
}
}
| {
"pile_set_name": "Github"
} |
--
-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
-- under one or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information regarding copyright
-- ownership. Camunda licenses this file to you under the Apache License,
-- Version 2.0; 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.
--
-- https://app.camunda.com/jira/browse/CAM-9165
create index ACT_IDX_CASE_EXE_CASE_INST on ACT_RU_CASE_EXECUTION(CASE_INST_ID_);
| {
"pile_set_name": "Github"
} |
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';
ReactDOM.render(
<App />,
document.getElementById('root')
);
| {
"pile_set_name": "Github"
} |
<?php
namespace ESCloud\SDK\Tests\Service;
use ESCloud\SDK\Service\ResourceService;
use ESCloud\SDK\Tests\BaseTestCase;
class ResourceServiceTest extends BaseTestCase
{
public function testStartUpload()
{
$mock = ['no' => 'fc8ea8c24d7945da86b9d49a82ee16b7', 'uploadUrl' => '//upload.qiqiuyun.net', 'reskey' => '1577089429/5e007995f3d5794220468', 'uploadToken' => 'test_token_1'];
$httpClient = $this->mockHttpClient($mock);
$service = new ResourceService($this->auth, array(), null, $httpClient);
$result = $service->startUpload(['name' => 'test.mp4', 'extno' => 'test_extno_1']);
$this->assertEquals($mock['no'], $result['no']);
$this->assertEquals($mock['uploadUrl'], $result['uploadUrl']);
$this->assertEquals($mock['reskey'], $result['reskey']);
}
public function testFinishUpload()
{
$resource = $this->mockResource();
$httpClient = $this->mockHttpClient($resource);
$service = new ResourceService($this->auth, array(), null, $httpClient);
$result = $service->finishUpload($resource['no']);
$this->assertEquals($resource['no'], $result['no']);
$this->assertEquals($resource['extno'], $result['extno']);
$this->assertEquals($resource['name'], $result['name']);
}
public function testGet()
{
$resource = $this->mockResource();
$httpClient = $this->mockHttpClient($resource);
$service = new ResourceService($this->auth, array(), null, $httpClient);
$result = $service->get($resource['no']);
$this->assertEquals($resource['no'], $result['no']);
$this->assertEquals($resource['extno'], $result['extno']);
$this->assertEquals($resource['name'], $result['name']);
}
public function testSearch()
{
$resource = $this->mockResource();
$httpClient = $this->mockHttpClient([$resource]);
$service = new ResourceService($this->auth, array(), null, $httpClient);
$result = $service->search([]);
$this->assertEquals($resource['no'], $result[0]['no']);
$this->assertEquals($resource['extno'], $result[0]['extno']);
$this->assertEquals($resource['name'], $result[0]['name']);
}
public function testGetDownloadUrl()
{
$resource = $this->mockResource();
$httpClient = $this->mockHttpClient(['downloadUrl' => 'http://downloadUrl.qiqiuyun.net']);
$service = new ResourceService($this->auth, array(), null, $httpClient);
$result = $service->getDownloadUrl($resource['no']);
$this->assertNotNull($result['downloadUrl']);
}
public function testRename()
{
$resource = $this->mockResource();
$httpClient = $this->mockHttpClient($resource);
$service = new ResourceService($this->auth, array(), null, $httpClient);
$result = $service->rename($resource['no'], 'test.mp4');
$this->assertEquals($resource['no'], $result['no']);
$this->assertEquals($resource['extno'], $result['extno']);
$this->assertEquals($resource['name'], $result['name']);
}
public function testDelete()
{
$resource = $this->mockResource();
$httpClient = $this->mockHttpClient(['success' => true]);
$service = new ResourceService($this->auth, array(), null, $httpClient);
$result = $service->delete($resource['no']);
$this->assertTrue($result['success']);
}
private function mockResource()
{
return array(
'no' => 'test_no_1',
'extno' => 'test_extno_1',
'name' => 'test.mp4',
'type' => 'video',
'size' => 5201314,
'length' => 3600,
'thumbnail' => '',
'processStatus' => '2333',
'isShare' => 1,
'processedTime' => 1548915578,
'createdTime' => 1548915578,
'updatedTIme' => 1548915578
);
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package ipv6
import (
"net"
"unsafe"
"golang.org/x/net/internal/iana"
"golang.org/x/net/internal/socket"
)
func marshalTrafficClass(b []byte, cm *ControlMessage) []byte {
m := socket.ControlMessage(b)
m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_TCLASS, 4)
if cm != nil {
socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.TrafficClass))
}
return m.Next(4)
}
func parseTrafficClass(cm *ControlMessage, b []byte) {
cm.TrafficClass = int(socket.NativeEndian.Uint32(b[:4]))
}
func marshalHopLimit(b []byte, cm *ControlMessage) []byte {
m := socket.ControlMessage(b)
m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_HOPLIMIT, 4)
if cm != nil {
socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit))
}
return m.Next(4)
}
func parseHopLimit(cm *ControlMessage, b []byte) {
cm.HopLimit = int(socket.NativeEndian.Uint32(b[:4]))
}
func marshalPacketInfo(b []byte, cm *ControlMessage) []byte {
m := socket.ControlMessage(b)
m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_PKTINFO, sizeofInet6Pktinfo)
if cm != nil {
pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0]))
if ip := cm.Src.To16(); ip != nil && ip.To4() == nil {
copy(pi.Addr[:], ip)
}
if cm.IfIndex > 0 {
pi.setIfindex(cm.IfIndex)
}
}
return m.Next(sizeofInet6Pktinfo)
}
func parsePacketInfo(cm *ControlMessage, b []byte) {
pi := (*inet6Pktinfo)(unsafe.Pointer(&b[0]))
if len(cm.Dst) < net.IPv6len {
cm.Dst = make(net.IP, net.IPv6len)
}
copy(cm.Dst, pi.Addr[:])
cm.IfIndex = int(pi.Ifindex)
}
func marshalNextHop(b []byte, cm *ControlMessage) []byte {
m := socket.ControlMessage(b)
m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_NEXTHOP, sizeofSockaddrInet6)
if cm != nil {
sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0]))
sa.setSockaddr(cm.NextHop, cm.IfIndex)
}
return m.Next(sizeofSockaddrInet6)
}
func parseNextHop(cm *ControlMessage, b []byte) {
}
func marshalPathMTU(b []byte, cm *ControlMessage) []byte {
m := socket.ControlMessage(b)
m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_PATHMTU, sizeofIPv6Mtuinfo)
return m.Next(sizeofIPv6Mtuinfo)
}
func parsePathMTU(cm *ControlMessage, b []byte) {
mi := (*ipv6Mtuinfo)(unsafe.Pointer(&b[0]))
if len(cm.Dst) < net.IPv6len {
cm.Dst = make(net.IP, net.IPv6len)
}
copy(cm.Dst, mi.Addr.Addr[:])
cm.IfIndex = int(mi.Addr.Scope_id)
cm.MTU = int(mi.Mtu)
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.