text
stringlengths
2
100k
meta
dict
<img src="http://cdn.trailsjs.io/art/logos/trails-horiz-logo-green.svg" height="96px" title="Trails Logo" /> [![Gitter][gitter-image]][gitter-url] [![NPM version][npm-image]][npm-url] [![Linux + OSX Build Status][ci-image]][ci-url] [![Windows Build Status][appveyor-image]][appveyor-url] [![Test Coverage][coverage-image]][coverage-url] [![Follow @trailsjs on Twitter][twitter-image]][twitter-url] Trails is a modern, [community-driven](https://opencollective.com/trails) web application framework for Node.js. It builds on the pedigree of [Rails](http://rubyonrails.org/) and [Grails](https://grails.org/) to accelerate development by adhering to a straightforward, convention-based, API-driven design philosophy. ## Getting Started #### Install ```sh $ npm install -g yo generator-trails $ yo trails ``` #### Trailblaze Trails uses [Yeoman](http://yeoman.io/) to generate scaffolding for new applications, and to create resources inside the application. ```sh $ yo trails --help Usage: yo trails Generators: Create New Model yo trails:model <model-name> Create New Controller yo trails:controller <controller-name> Create New Policy yo trails:policy <policy-name> Create New Service yo trails:service <service-name> ``` #### Run Once installation is complete, begin your journey! ```sh $ node server.js ``` #### Happy Trails! ## Trailpacks [Trailpacks](https://github.com/trailsjs/trailpack) extend the framework's capabilities and allow developers to leverage existing ecosystem tools through a simple and well-defined API. New features, behavior, APIs, and other functionality can be added to the Trails framework through Trailpacks. Many Trails installations will include some of the following Trailpacks: - [router](https://github.com/trailsjs/trailpack-router) - [repl](https://github.com/trailsjs/trailpack-repl) - [hapi](https://github.com/trailsjs/trailpack-hapi) - [express](https://github.com/trailsjs/trailpack-express) - [waterline](https://github.com/trailsjs/trailpack-waterline) - [knex](https://github.com/trailsjs/trailpack-knex) ## Compatibility - Windows, Mac, and Linux - Node 7.0 and newer ## Documentation See [**trailsjs.io/doc**](http://trailsjs.io/doc) for complete documentation. ## More Resources #### Tutorials - [Getting Started](http://blog.jaumard.com/en/2016/01/05/getting-started-with-trails/) - [Create a Custom Trailpack](http://blog.jaumard.com/en/2016/01/06/create-a-trailpack-for-trails/) - [Trails and Angular](https://cali-style.com/blog/trails-js-and-angular) #### Videos - [Getting Started with Trails.js](https://www.youtube.com/watch?v=AbSp8jqFDAY) #### Support - [Live Gitter Chat](https://gitter.im/trailsjs/trails) - [Twitter](https://twitter.com/trailsjs) - [Trails.js Website](http://trailsjs.io/support) - [Stackoverflow](http://stackoverflow.com/questions/tagged/trailsjs) ## FAQ See https://github.com/trailsjs/trails/wiki/FAQ ## Contributing We love contributions! Please check out our [Contributor's Guide](https://github.com/trailsjs/trails/blob/master/.github/CONTRIBUTING.md) for more information on how our projects are organized and how to get started. ## License [MIT](https://github.com/trailsjs/trails/blob/master/LICENSE) <img src="http://cdn.trailsjs.io/art/backgrounds/trails-day.png"> [npm-image]: https://img.shields.io/npm/v/trails.svg?style=flat-square [npm-url]: https://npmjs.org/package/trails [ci-image]: https://img.shields.io/travis/trailsjs/trails.svg?style=flat-square&label=Linux%20/%20OSX [ci-url]: https://travis-ci.org/trailsjs/trails [appveyor-image]: https://img.shields.io/appveyor/ci/trailsjs/trails/master.svg?style=flat-square&label=Windows [appveyor-url]: https://ci.appveyor.com/project/trailsjs/trails [gitter-image]: http://img.shields.io/badge/+%20GITTER-JOIN%20CHAT%20%E2%86%92-1DCE73.svg?style=flat-square [gitter-url]: https://gitter.im/trailsjs/trails [twitter-image]: https://img.shields.io/twitter/follow/trailsjs.svg?style=social [twitter-url]: https://twitter.com/trailsjs [coverage-image]: https://img.shields.io/codeclimate/coverage/github/trailsjs/trails.svg?style=flat-square [coverage-url]: https://codeclimate.com/github/trailsjs/trails/coverage
{ "pile_set_name": "Github" }
@using ApiTesting.Areas.HelpPage.ModelDescriptions @model SimpleTypeModelDescription @Model.Documentation
{ "pile_set_name": "Github" }
/** @file The common variable volatile store routines shared by the DXE_RUNTIME variable module and the DXE_SMM variable module. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef _VARIABLE_RUNTIME_CACHE_H_ #define _VARIABLE_RUNTIME_CACHE_H_ #include "Variable.h" /** Copies any pending updates to runtime variable caches. @retval EFI_UNSUPPORTED The volatile store to be updated is not initialized properly. @retval EFI_SUCCESS The volatile store was updated successfully. **/ EFI_STATUS FlushPendingRuntimeVariableCacheUpdates ( VOID ); /** Synchronizes the runtime variable caches with all pending updates outside runtime. Ensures all conditions are met to maintain coherency for runtime cache updates. This function will attempt to write the given update (and any other pending updates) if the ReadLock is available. Otherwise, the update is added as a pending update for the given variable store and it will be flushed to the runtime cache at the next opportunity the ReadLock is available. @param[in] VariableRuntimeCache Variable runtime cache structure for the runtime cache being synchronized. @param[in] Offset Offset in bytes to apply the update. @param[in] Length Length of data in bytes of the update. @retval EFI_SUCCESS The update was added as a pending update successfully. If the variable runtime cache ReadLock was available, the runtime cache was updated successfully. @retval EFI_UNSUPPORTED The volatile store to be updated is not initialized properly. **/ EFI_STATUS SynchronizeRuntimeVariableCache ( IN VARIABLE_RUNTIME_CACHE *VariableRuntimeCache, IN UINTN Offset, IN UINTN Length ); #endif
{ "pile_set_name": "Github" }
############################################################################ # # Program: OpenSees # # Purpose: A Top-level Makefile to create the libraries needed # to use the OpenSees framework. # # version created for TACC ranger & their Portland Group Compilers # # Written: fmk # Created: 02/2008 # # ############################################################################ # you nooed load module petsc in .bashrc # in the .basrc_user, or .cshrc_user you need to add the following # module load petsc # PUT YOUR HOME DIRECTOREY HERE IF NOT THE DEFAULT ONE IN #HOME = /home1/00477/tg457427/ BASE = FE = $(HOME)/OpenSees/SRC PROGRAMMING_MODE = SEQUENTIAL #PROGRAMMING_MODE = PARALLEL #PROGRAMMING_MODE = PARALLEL_INTERPRETERS OpenSees_PROGRAM = $(HOME)/bin/OpenSees ifeq ($(PROGRAMMING_MODE), PARALLEL) OpenSees_PROGRAM = $(HOME)/bin/OpenSeesSP endif ifeq ($(PROGRAMMING_MODE), PARALLEL_INTERPRETERS) OpenSees_PROGRAM = $(HOME)/bin/OpenSeesMP endif # %---------------------------------% # | SECTION 2: MAKEFILE CONSTANTS | # %---------------------------------% # # Specify the constants the are used as control structure variables in the Makefiles. OPERATING_SYSTEM = LINUX #DEBUG_MODE = DEBUG, NO_DEBUG DEBUG_MODE = NO_DEBUG RELIABILITY = NO_RELIABILITY GRAPHICS = NONE BLASdir = $(HOME)/OpenSees/OTHER/BLAS CBLASdir = $(HOME)/OpenSees/OTHER/CBLAS AMDdir = $(HOME)/OpenSees/OTHER/AMD LAPACKdir = $(HOME)/OpenSees/OTHER/LAPACK ARPACKdir = $(HOME)/OpenSees/OTHER/ARPACK UMFPACKdir = $(HOME)/OpenSees/OTHER/UMFPACK METISdir = $(HOME)/OpenSees/OTHER/METIS SRCdir = $(HOME)/OpenSees/SRC SUPERLUdir = $(HOME)/OpenSees/OTHER/SuperLU_5.1.1/SRC SUPERLU_DISTdir = $(HOME)/OpenSees/OTHER/SuperLU_DIST_4.3/SRC CSPARSEdir = $(HOME)/OpenSees/OTHER/CSPARSE DIRS = $(SUPERLUdir) \ $(SUPERLU_DISTdir) \ $(ARPACKdir) \ $(CBLASdir) \ $(UMFPACKdir) \ $(AMDdir) \ $(CSPARSEdir) \ $(METISdir) \ $(SRCdir) ifeq ($(PROGRAMMING_MODE), SEQUENTIAL) DIRS = \ $(SUPERLUdir) \ $(ARPACKdir) \ $(CBLASdir) \ $(UMFPACKdir) \ $(METISdir) \ $(CSPARSEdir) \ $(AMDdir) \ $(SRCdir) endif # %-------------------------------------------------------% # | SECTION 4: LIBRARIES | # | | # | The following section defines the libraries that will | # | be created and/or linked with when the libraries are | # | being created or linked with. | # %-------------------------------------------------------% # # Note: if vendor supplied BLAS and LAPACK libraries leave the # libraries blank. You have to get your own copy of the tcl/tk # library!! # # Note: For libraries that will be created (any in DIRS above) # make sure the directory exsists where you want the library to go! FE_LIBRARY = $(HOME)/lib/libOpenSees.a NDARRAY_LIBRARY = $(HOME)/lib/libndarray.a # BJ_UCD jeremic@@ucdavis.edu MATMOD_LIBRARY = $(HOME)/lib/libmatmod.a # BJ_UCD jeremic@@ucdavis.edu BJMISC_LIBRARY = $(HOME)/lib/libBJmisc.a # BJ_UCD jeremic@@ucdavis.edu #LAPACK_LIBRARY = $(HOME)/lib/libLapack.a #BLAS_LIBRARY = $(HOME)/lib/libBlas.a LAPACK_LIBRARY = BLAS_LIBRARY = SUPERLU_LIBRARY = $(HOME)/lib/libSuperLU.a AMD_LIBRARY = $(HOME)/lib/libAMD.a CBLAS_LIBRARY = $(HOME)/lib/libCBlas.a ARPACK_LIBRARY = $(HOME)/lib/libArpack.a UMFPACK_LIBRARY = $(HOME)/lib/libUmfpack.a METIS_LIBRARY = $(HOME)/lib/libMetis.a CSPARSE_LIBRARY = $(HOME)/lib/libCSparse.a DISTRIBUTED_SUPERLU_LIBRARY = $(HOME)/lib/libDistributedSuperLU.a ifeq ($(PROGRAMMING_MODE), SEQUENTIAL) DISTRIBUTED_SUPERLU_LIBRARY = endif #TCL_LIBRARY = $(HOME)/tcl/lib/libtcl8.5.a TCL_LIBRARY = -ltcl8.5 TCL_INCLUDES = GRAPHIC_LIBRARY = #RELIABILITY_LIBRARY = $(HOME)/lib/libReliability.a RELIABILITY_LIBRARY = # WATCH OUT .. These libraries are removed when 'make wipe' is invoked. WIPE_LIBS = $(FE_LIBRARY) \ $(NDARRAY_LIBRARY) \ $(MATMOD_LIBRARY) \ $(SUPERLU_LIBRARY) \ $(ARPACK_LIBRARY) \ $(AMD_LIBRARY) \ $(UMFPACK_LIBRARY) \ $(METIS_LIBRARY) \ $(LAPACK_LIBRARY) \ $(BLAS_LIBRARY) \ $(CBLAS_LIBRARY) \ # %---------------------------------------------------------% # | SECTION 5: COMPILERS | # | | # | The following macros specify compilers, linker/loaders, | # | the archiver, and their options. You need to make sure | # | these are correct for your system. | # %---------------------------------------------------------% # ################################################### # # Compilers # ################################################### MPI_DIR = $(MPICH_HOME)/intel64 MPI_BIN = $(MPI_DIR)/bin ifeq ($(PROGRAMMING_MODE), SEQUENTIAL) CC++ = $(ICC_BIN)/icpc CC = $(ICC_BIN)/icc FC = $(IFC_BIN)/ifort F90 = $(FC) LINKER = $(CC++) else CC++ = $(MPI_BIN)/mpicxx CC = $(MPI_BIN)/mpicc FC = $(MPI_BIN)/mpif90 F90 = $(MPI_BIN)/mpif90 FORTRAN = $(FC) LINKER = $(CC++) endif AR = ar ARCH = ar ARFLAGS = -q #ARCHFLAGS = cqls ARCHFLAGS = -v -q RANLIB = ranlib RANLIBFLAGS = GRAPHIC_FLAG = -D_NOGRAPHICS PROGRAMMING_FLAG = ifeq ($(PROGRAMMING_MODE), PARALLEL) PROGRAMMING_FLAG = -D_PARALLEL_PROCESSING endif ifeq ($(PROGRAMMING_MODE), PARALLEL_INTERPRETERS) PROGRAMMING_FLAG = -D_PARALLEL_INTERPRETERS endif #RELIABILITY_FLAG = -D_RELIABILITY RELIABILITY_FLAG = #DEBUG_FLAG = -D_G3DEBUG #DEBUG_FLAG = -g -p -pg #DEBUG_FLAG = -p -g DEBUG_FLAG = MUMPS_FLAG = PETSC_FLAG = #OPT_FLAG = -fPIC OPT_FLAG = -O2 #OPT_FLAG = -O0 COMP_FLAG = -DMPICH_IGNORE_CXX_SEEK C++FLAGS = -I${MKLROOT}/include/intel64/lp64 -I${MKLROOT}/include -D_LINUX -D_UNIX $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG) $(OPT_FLAG) $(COMP_FLAG)\ $(PROGRAMMING_FLAG) $(PETSC_FLAG) $(MUMPS_FLAG) \ -D_TCL85 -D_BLAS CFLAGS = -I${MKLROOT}/include/intel64/lp64 -I${MKLROOT}/include $(GRAPHIC_FLAG) $(RELIABILITY_FLAG) $(DEBUG_FLAG)$(PROGRAMMING_FLAG) $(OPT_FLAG) $(COMP_FLAG) -D_TCL85 -D_BLAS FFLAGS = $(OPT_FLAG) $(COMP_FLAG) LINKFLAGS = # Misc MAKE = /usr/bin/gmake CD = cd ECHO = echo RM = rm RMFLAGS = -f SHELL = /bin/sh # %---------------------------------------------------------% # | SECTION 6: COMPILATION | # | | # | The following macros specify the macros used in | # | to compile the source code into object code. | # %---------------------------------------------------------% .SUFFIXES: .SUFFIXES: .C .c .f .f90 .cpp .o .cpp # # %------------------% # | Default command. | # %------------------% # .DEFAULT: @@$(ECHO) "Unknown target $@@, try: make help" # # %-----------------------------------------------% # | Command to build .o files from source files. | # %-----------------------------------------------% # .cpp.o: @@$(ECHO) Making $@@ from $< $@@ with $(CC++) $(C++FLAGS) $(INCLUDES) -c $< @@$(CC++) $(C++FLAGS) $(INCLUDES) -c $< .C.o: @@$(ECHO) Making $@@ from $< $(CC++) $(C++FLAGS) $(INCLUDES) -c $< .c.o: @@$(ECHO) Making $@@ from $< $(CC) $(CFLAGS) -c $< .f.o: @@$(ECHO) Making $@@ from $< $(FC) $(FFLAGS) -c $< .f77.o: @@$(ECHO) Making $@@ from $< $(FC) $(FFLAGS) -c $< .f90.o: @@$(ECHO) Making $@@ from $< $(FC90) $(FFLAGS) -c $< # %---------------------------------------------------------% # | SECTION 7: OTHER LIBRARIES | # | | # | The following macros specify other libraries that must | # | be linked with when creating executables. These are | # | platform specific and typically order does matter!! | # %---------------------------------------------------------% MACHINE_LINKLIBS = -L$(BASE)/lib \ -L$(HOME)/lib # PETSC HAVEPETSC = NO PETSCINC = PETSC_LIB = ifeq ($(PROGRAMMMING_MODE), SEQUENTIAL) HAVEPETSC = NO endif ifeq ($(HAVEPETSC), YES) PETSC = YES PETSC_FLAG = -D_PETSC PETSC_DIR = $(TACC_PETSC_DIR) BOPT = O PETSC_INC = -I$(PETSC_DIR)/include -I$(PETSC_DIR)/bmake/$(PETSC_ARCH) -D_PETSC PETSC_LIB = -L$(PETSC_DIR)/lib/libO_c++/$(PETSC_ARCH) \ $(FE)/system_of_eqn/linearSOE/petsc/PetscSOE.o \ $(FE)/system_of_eqn/linearSOE/petsc/PetscSolver.o \ $(FE)/system_of_eqn/linearSOE/petsc/PetscSparseSeqSolver.o \ -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc \ -L/usr/X11/lib -lX11 -lGL endif MUMPS_INCLUDE = MUMPS_LIB = ifeq ($(PROGRAMMING_MODE), SEQUENTIAL) HAVEMUMPS = NO MUMPS_FLAG = MUMPS_LIB = else MUMPS = YES MUMPS_FLAG = -D_MUMPS MUMPS_DIR = $(HOME)/MUMPS_5.0.0 #MUMPS_DIR = $(TACC_PETSC_LIB)/.. PLAT = MPICHGM-INTEL80 ifeq ($(PROGRAMMING_MODE), PARALLEL) SCALAP = $(BLACSlib) $(SCALAPlib) $(BLACSlib) \ endif ifeq ($(PROGRAMMING_MODE), PARALLEL_INTERPRETERS) SCALAP = $(BLACSlib) $(SCALAPlib) $(BLACSlib) \ $(FE)/system_of_eqn/linearSOE/mumps/MumpsParallelSolver.o \ $(FE)/system_of_eqn/linearSOE/mumps/MumpsParallelSOE.o \ $(FE)/system_of_eqn/linearSOE/mumps/MumpsSOE.o \ $(FE)/system_of_eqn/linearSOE/mumps/MumpsSolver.o \ endif MUMPS_LIB = -L$(MUMPS_DIR)/lib \ -ldmumps -lmumps_common \ -lpord \ $(SCALAP) MUMPS_INCLUDE = -I$(MUMPS_DIR)/include endif MKL_LIB = $(MKLROOT)/lib/intel64 ifeq ($(PROGRAMMING_MODE), SEQUENTIAL) PARALLEL_LIB = else PARALLEL_LIB = \ -Wl,-rpath,$(MKL_LIB) \ -L$(MKL_LIB) \ $(MKL_LIB)/libmkl_scalapack_lp64.a \ $(MKL_LIB)/libmkl_core.a \ $(MKL_LIB)/libmkl_blacs_intelmpi_lp64.a \ $(MKL_LIB)/libmkl_intel_lp64.a \ $(MKL_LIB)/libmkl_sequential.a \ $(MKL_LIB)/libmkl_core.a \ $(MKL_LIB)/libmkl_sequential.a \ $(MKL_LIB)/libmkl_core.a endif HPM_LIB = # $(FE)/system_of_eqn/linearSOE/sparseGEN/SparseGenColLinSolver.o \ # $(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSparseGenColLinSOE.o \ # $(FE)/system_of_eqn/linearSOE/sparseGEN/DistributedSuperLU.o \ MACHINE_NUMERICAL_LIBS = -lm \ $(ARPACK_LIBRARY) \ $(SUPERLU_LIBRARY) \ $(UMFPACK_LIBRARY) \ $(AMD_LIBRARY) \ $(GRAPHIC_LIBRARY)\ $(RELIABILITY_LIBRARY) \ $(DISTRIBUTED_SUPERLU_LIBRARY) $(CSPARSE_LIBRARY) \ $(METIS_LIBRARY) $(PETSC_LIB) $(CBLAS_LIBRARY) \ $(DISTRIBUTED_SUPERLU_LIBRARY) $(METIS_LIBRARY) \ $(LAPACK_LIBRARY) $(MUMPS_LIB) $(BLAS_LIBRARY) $(PARALLEL_LIB) ifeq ($(PROGRAMMING_MODE), SEQUENTIAL) MACHINE_SPECIFIC_LIBS = -mkl=sequential -static-intel -lifcore else MACHINE_SPECIFIC_LIBS = -static-intel -L$(IFC_LIB) -lifcore endif # %---------------------------------------------------------% # | SECTION 8: INCLUDE FILES | # | | # | The following macros specify include files needed for | # | compilation. | # %---------------------------------------------------------% MACHINE_INCLUDES = -I$(MPICH_HOME)/include \ -I/usr/local/BerkeleyDB.4.0/include \ -I/usr/include/mysql \ -I$(HOME)/include \ -I$(UMFPACKdir) \ -I$(SUPERLUdir) \ -I$(SUPERLU_DISTdir) \ $(PETSC_INC) $(MUMPS_INCLUDE) # this file contains all the OpenSees/SRC includes include $(FE)/Makefile.incl #TCL_INCLUDES = -I$(HOME)/include PYTHON_INCLUDES =-I/opt/apps/intel17/python3/3.6.3/include/python3.6m INCLUDES = $(TCL_INCLUDES) $(PYTHON_INCLUDES) $(FE_INCLUDES) $(MACHINE_INCLUDES)
{ "pile_set_name": "Github" }
glabel func_809A6D08 /* 003A8 809A6D08 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 /* 003AC 809A6D0C AFBF0014 */ sw $ra, 0x0014($sp) /* 003B0 809A6D10 AFA5001C */ sw $a1, 0x001C($sp) /* 003B4 809A6D14 84CE0056 */ lh $t6, 0x0056($a2) ## 00000056 /* 003B8 809A6D18 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000000 /* 003BC 809A6D1C 3C060402 */ lui $a2, 0x0402 ## $a2 = 04020000 /* 003C0 809A6D20 55C00004 */ bnel $t6, $zero, .L809A6D34 /* 003C4 809A6D24 8FBF0014 */ lw $ra, 0x0014($sp) /* 003C8 809A6D28 0C269AB6 */ jal func_809A6AD8 /* 003CC 809A6D2C 24C644B0 */ addiu $a2, $a2, 0x44B0 ## $a2 = 040244B0 /* 003D0 809A6D30 8FBF0014 */ lw $ra, 0x0014($sp) .L809A6D34: /* 003D4 809A6D34 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 /* 003D8 809A6D38 03E00008 */ jr $ra /* 003DC 809A6D3C 00000000 */ nop
{ "pile_set_name": "Github" }
94b5325d5d91a61c10a4456432ddd3e7169546ad386b4ac56a184f6f10172ea3df1a7f948c44b9a8ee1a4e195c40f28c4f2482f855468a7e6200632442a65451
{ "pile_set_name": "Github" }
[/Script/Engine.InputSettings] -AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) -AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) -AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) -AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) -AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) -AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Left_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) bAltEnterTogglesFullscreen=True bF11TogglesFullscreen=True bUseMouseForTouch=True bEnableMouseSmoothing=True bEnableFOVScaling=True FOVScale=0.011110 DoubleClickTime=0.200000 bCaptureMouseOnLaunch=True DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown bDefaultViewportMouseLock=False DefaultViewportMouseLockMode=LockOnCapture bAlwaysShowTouchInterface=False bShowConsoleOnFourFingerTap=True DefaultTouchInterface=None ConsoleKey=None -ConsoleKeys=Tilde +ConsoleKeys=Tilde
{ "pile_set_name": "Github" }
[Unit] Description=Unbind framebuffer console ConditionPathExists=/sys/class/vtconsole/vtcon1/bind [Service] Type=oneshot ExecStart=/bin/sh -c 'echo 0 > /sys/class/vtconsole/vtcon1/bind' [Install] WantedBy=graphical.target
{ "pile_set_name": "Github" }
/* */ /* -------------------------------------------- */ /* ------------------Reset--------------------- */ a,abbr,acronym,address,applet,article,aside,audio,b,blockquote,big,body,center,canvas,caption,cite,code,command,datalist,dd,del,details,dfn,dl,div,dt,em,embed,fieldset,figcaption,figure,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,keygen,label,legend,li,meter,nav,object,ol,output,p,pre,progress,q,s,samp,section,small,span,source,strike,strong,sub,sup,table,tbody,tfoot,thead,th,tr,tdvideo,tt,u,ul,var{background:transparent;border:0 none;font-size:100%;margin:0;padding:0;border:0;outline:0;vertical-align:top;}blockquote, q {quotes:none;}table, table td {padding:0;border:none;border-collapse:collapse;}img {vertical-align:top;}embed {vertical-align:top;} article, aside, audio, canvas, command, datalist, details, embed, figcaption, figure, footer, header, hgroup, keygen, meter, nav, output, progress, section, source, video {display:block;} mark, rp, rt, ruby, summary, time {display:inline;} input, textarea {border:0; padding:0; margin:0; outline: 0;} iframe {border:0; margin:0; padding:0;} input, textarea, select {margin:0; padding:0px;} /* -------------------------------------------- */ /* ------------------Font---------------------- */ @import url(http://fonts.googleapis.com/css?family=Montserrat:400,700|Open+Sans:400,300,600,700); /* -------------------------------------------- */ /* ------------------Clear--------------------- */ .clear{content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; } article:after, article:before{clear: both; content: '\0020'; display: block; visibility: hidden; width: 0; height: 0;} .box:after, .box:before{clear: both; content: '\0020'; display: block; visibility: hidden; width: 0; height: 0;} /* -------------------------------------------- */ /* ------------------Style--------------------- */ html, body {width:100%; padding:0; margin:0;} body {background: #F6F5F2;color: #474747; font-family: 'Montserrat', sans-serif; font-size: 16px; line-height: 25px;} body .wrap-body{} a{color: #444444;text-decoration: none;} a:hover {color: #2ECC71; text-decoration: none;} a.button{cursor: pointer;color: #ffffff;line-height: 14px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;font-weight: bold; background: #2ECC71 ;} a.button {display: inline-block; text-decoration: none; padding: 6px 12px 6px 12px;} a.button:hover{} h1,h2,h3,h4,h5,h6{ font-family: 'Montserrat', sans-serif; text-transform:uppercase; font-weight:700; line-height:1.4em; color: #474747; } h1{ font-size:30px; } h2{ font-size:25px; } h3{ font-size:20px; } h4{ font-size:18px; } h5{ font-size:16px; } h6{ font-size:14px; } h1 a, h2 a, h3 a, h4 a{color: #474747; text-decoration: none;} h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover{color: #2ECC71; text-decoration: none;} .copyrights{text-indent:-9999px;height:0;line-height:0;font-size:0;overflow:hidden;} /* -------------------------------------------- */ /* ------------------Header-------------------- */ header {background:#333333; margin-bottom:30px;} header .wrap-header{height: 80px;} header #logo {float: left; margin: 10px;} /* -------------------------------------------- */ /* ------------------Navigation---------------- */ nav {} nav .wrap-nav{float: right;} .menu ul {list-style: none;margin: 0;padding: 0;} .menu ul li {position: relative;float: left;padding: 28px 15px 21px 15px; background:#2ECC71;} .menu ul li:hover {background-color:#ffffff;} .menu ul li a {font-size: 14px; line-height:14px;color: #ffffff;display: block;padding: 6px 10px;margin-bottom: 5px;z-index: 6;position: relative;font-weight:bold; text-transform:uppercase;} .menu ul li:hover a {color:#000000;} /* -------------------------------------------- */ /* ------------------Content------------------- */ #content {} #content .wrap-content{} .block{} #main-content{} #main-content article {margin:10px 0px; background:#ffffff;} #main-content article .heading{ padding: 30px 40px;} #main-content article .heading .title{text-transform: uppercase; font-weight: bold;} #main-content article .heading .title2{font-size: 16px; line-height: 20px;} #main-content article img{display: inline-block; width: 100%;} #main-content article .content{padding: 30px 40px;} #main-content article p{margin-bottom:10px;} #main-content article .extra{background: #2ECC71; padding: 10px 20px;} #main-content article .more {float: right;} #main-content article .info{float: left; color: #ffffff;} #main-content article .info a{text-decoration: underline; color:#ffffff;} #sidebar{} #sidebar .box {margin-bottom:20px; background:#ffffff;} #sidebar .box .heading { padding:20px; border-bottom:1px solid #EEEEEE;} #sidebar .box .heading .title{text-transform: uppercase; font-size: 16px; font-weight: bold;} #sidebar .box .content {padding:20px} #sidebar .box .content .connect{} #sidebar .box .content .last{border-bottom: 0px !important;} #sidebar .box .content ul{ list-style-type:none;} #sidebar .box .content ul li{border-bottom: 1px solid #EEEEEE; padding: 5px 0;} #sidebar .box .content .post {padding-bottom: 10px; margin-bottom:10px; border-bottom: 1px solid #EEEEEE;} #sidebar .box .content .post .title{ font-weight:normal; font-size: 16px; text-transform: none;} #sidebar .box .content .post img{ float:left; margin:0 10px 10px 0;} #sidebar .box .content .post p{color:#A3A3A3; font-style:italic;} /* -------------------------------------------- */ /* ------------------Form------------------- */ #comment{padding: 30px 40px;} #contact-form {width:500px;} #contact-form label { display:block; height:44px; } #contact-form input { width:100%; font-size:15px; line-height:1.2em; color:#a0a0a0; padding:8px 15px; margin:0; font-family:Arial, Helvetica, sans-serif; border:1px solid #eeeeee; background: #ffffff; outline:none; } #contact-form textarea { height:158px; overflow:auto; width:100%; font-size:15px; line-height:1.2em; color:#a0a0a0; padding:7px 15px; margin:0; font-family:Arial, Helvetica, sans-serif; border:1px solid #eeeeee; background: #ffffff; outline:none; } .buttons {padding-top:17px; text-align:right} .buttons a {margin-left:30px} /* -------------------------------------------- */ /* ------------------Footer-------------------- */ footer {background-color:#333333; margin-top:30px;} footer .wrap-footer{padding:10px 0px; color:#ffffff;} footer .box .heading{ padding:5px; border-bottom:1px dotted #ffffff;} footer .box .heading .title{padding:0 10px; color:#ffffff;} footer .box .content{padding:20px} footer .box .content a{ color: #ffffff; text-decoration: underline;} footer .box .content a:hover {color: #2ECC71; text-decoration: none;} footer .box .content p{margin-bottom: 10px;} footer .box .content .gallery {} footer .box .content .gallery img{} .copyright{text-align:center; margin-top:20px; background:#000; padding:10px 0px;color:#ffffff; } .copyright a{text-decoration:underline; color:#ffffff; }
{ "pile_set_name": "Github" }
|Google logo| ================================== System Requirements for GEE Server ================================== .. container:: .. container:: content Hardware Requirements - Minimum 2 dual-core Intel or AMD CPUs; 2.0 GHz or higher recommended. - Minimum 4 GB RAM (8 GB RAM for Red Hat Enterprise Linux); 8 GB RAM (or more) per core recommended for Fusion. - Minimum 500 GB of total hard disk storage. - A graphics card with at least 64 MB video RAM (NVIDIA GeForce4 or higher preferred for Fusion GUI). You can install this graphics card in a separate workstation that accesses Fusion. .. note:: If you plan on cutting globes, this processing can be CPU-intensive and you may also need to plan on providing more storage depending on the size of the globes. **Note on virtual machines**: Fusion can be both CPU and I/O intensive. For optimal, stable performance, you should install it only on physical (non-virtual) machines. You can run GEE Server on a virtualized platform, provided the guest OS is one of our supported 64-bit distributions and you allocate sufficient resources to the VM. **Software Requirements** **Operating Systems** Open GEE is supported only on the 64-bit versions of the operating systems listed below. - Red Hat Enterprise Linux 6.x and 7.x, including the most recent security patches - CentOS 6.x and 7.x - Ubuntu 14.04 LTS and 16.04 LTS **Browsers** Google Earth Enterprise is supported on the following browsers on all operating systems: - The latest version of Google Chrome - The latest version of Mozilla Firefox However, Google Earth Enterprise should work with any modern browser. **Google Earth Enterprise Client (EC)** The following versions of Google Earth Enterprise Client (EC) are recommended for use with Google Earth Enterprise: - For GEE 5.x, use Google Earth EC version 7.0 or later - For GEE 4.4, use Google Earth EC version 6.1 or later .. note:: Although older versions of Google Earth EC, i.e., 6.0 and earlier, *may* still connect to Google Earth Enterprise or Portable 3D databases, not all features will be available. Also, as Google Earth Enterprise has not been tested or certified against older versions of Google Earth EC, there may be unknown operational problems. Google Earth Enterprise Client (EC) is supported on the following platforms: - Windows - Mac - Linux **Unsupported Versions and Environments** There are many variations of operating systems and related software; point ("x.x") releases can sometimes contain changes that can impact your GEE installation. Although an unsupported version of these software packages may appear to function correctly, their use in a production environment is not recommended. Unexpected results may occur. Where possible, you should adhere to the hardware and software specifications listed in this document. If a problem arises in an unsupported configuration, we may not be able to help you resolve it. **Network Requirements** Each destination server must meet the requirements below before you install GEE, and you must not change these settings after deploying GEE. The hostname must be the FQDN (Fully Qualified Domain Name) of your destination server, e.g., ``myserver.mydomainname.com``. You can verify the hostname of your workstation by entering ``hostname`` at a shell prompt, and you can verify the network connection by using the ``ping`` command to reach other hosts in the same network. The requests should resolve using both an IP address and the FQDN. - Hostname registered in DNS - Hosts file is acceptable for small-scale systems - Allocated IP addresses - Correct network routing paths - Network connectivity (Ports 80 and 22; Port 443 for HTTPS) - Default installation of a Supported OS - Java Development Kit or Runtime Environment (must download from Sun; use version 1.6.0_12 or newer) - OpenSSL 0.9.8y (on OS media) - Python 2.7.5 (on OS media) - Storage for all source data and asset tree - May be local storage (i.e., RAID 5 array) - NAS storage via NFS acceptable - SAN storage acceptable - USB drive not recommended Supported Configurations Google Earth Enterprise products are developed per the hardware and software requirements listed above. The products are intended to be installed according to the processes described in this documentation. When installing Google Earth Enterprise in an unsupported environment, there are risks that the products may not operate as intended. Some factors that could affect your installation and deployment are: - Installations on unsupported operating systems. - Improperly configured DNS. - Third party or non-default permissions or security measures (no root access, sudo blockers, etc.). - Complex proxy configurations that prevent the network communications from operating as intended. Important System Security Information We strongly recommend users who wish to host 3D and 2D globes online with Google Earth Enterprise follow industry standard security practices and review for their systems and networks before enabling access. Although we takes every precaution to secure the information, there is always the risk of unauthorized access outside of a closed or protected network. .. |Google logo| image:: ../../art/common/googlelogo_color_260x88dp.png :width: 130px :height: 44px
{ "pile_set_name": "Github" }
// Copyright 2013 the V8 project authors. All rights reserved. // Copyright (C) 2005, 2006, 2007, 2008, 2009 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. 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 INC. 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. description( "This tests that op_get_by_pname is compiled correctly for non-final objects." ); function foo(o) { var result = 0; for (var n in o) result += o[n]; return result; } var o = new Date(); var p = new Date(); var q = new Date(); var r = new Date(); var s = new Date(); o.a = 1; o.b = 3; o.c = 7; p.a = 1; p.b = 2; p.c = 3; p.d = 4; q.a = 1; q.b = 2; q.c = 3; q.d = 4; q.e = 3457; r.a = 1; r.b = 2; r.c = 3; r.d = 4; r.e = 91; r.f = 12; s.a = 1; s.b = 2; s.c = 3; s.d = 4; s.e = 91; s.f = 12; s.g = 69; for (var i = 0; i < 100; ++i) { shouldBe("foo(o)", "11"); shouldBe("foo(p)", "10"); shouldBe("foo(q)", "3467"); shouldBe("foo(r)", "113"); shouldBe("foo(s)", "182"); }
{ "pile_set_name": "Github" }
package crash.commands.test import org.crsh.cli.Command import org.crsh.cli.Option import org.crsh.cli.Usage public class readline { @Command @Usage("read a line of text and print it") public String main(@Option(names = ["hidden"]) Boolean hidden) { try { String s = context.readLine("Give me something:", !hidden); return "You gave $s"; } catch (InterruptedException e) { return "was interrupted when reading value"; } } }
{ "pile_set_name": "Github" }
using Nitra.Model; using Nitra.Typing; using Nemerle; using Nemerle.Collections; using Nemerle.Text; using Nemerle.Utility; using System; using System.Text; namespace Nitra.Compiler.PatternMatching { internal variant Decision[T] { | Failure | Success { Value : T } | IfEq { Access : Access; Con : ParseTreeCtor; True : Decision[T]; False : Decision[T]; } | Variable { Name : Identifier; Access : Access; Continuation : Decision[T]; } public static AppendDecision(this buffer : StringBuilder, tab : int, decision : Decision[T]) : StringBuilder { match (decision) { | Failure => buffer.Append(' ', tab).Append("FAIL") | Success(value) => buffer.Append(' ', tab).Append("return ").Append(value) | IfEq(access, con, t, f) => buffer.Append(' ', tab).Append("If ").AppendAccess(access).Append(" is ").AppendCtor(con).AppendLine() .AppendDecision(tab + 2, t).AppendLine() .Append(' ', tab).Append("Else").AppendLine() .AppendDecision(tab + 2, f) | Variable(name, access, continuation) => buffer.Append(' ', tab).Append("var ").Append(name.Value).Append(" = ").AppendAccess(access).AppendLine() .AppendDecision(tab, continuation) } } public override ToString() : string { StringBuilder().AppendDecision(0, this).ToString() } } }
{ "pile_set_name": "Github" }
{ "version": 8, "metadata": { "test": { "description": "Because text-allow-overlap is true, the query results will be reordered based on rotated rendering order (compare to rotated-after-insert, in which the results match the order in the original data)", "width": 256, "height": 256, "queryGeometry": [ [ 0, 0 ], [ 256, 256 ] ] } }, "center": [ 0, 0 ], "zoom": 3, "bearing": 45, "sources": { "geojson": { "type": "geojson", "data": "local://data/121points.geojson" } }, "glyphs": "local://glyphs/{fontstack}/{range}.pbf", "sprite": "local://sprites/sprite", "layers": [ { "id": "symbol", "type": "symbol", "source": "geojson", "layout": { "text-field": ".", "text-size": 6, "text-allow-overlap": true, "text-font": [ "Open Sans Semibold", "Arial Unicode MS Bold" ] } } ] }
{ "pile_set_name": "Github" }
too-many-statements:5:stupid_function:Too many statements (55/50) too-many-statements:62:long_function_with_inline_def:Too many statements (62/50)
{ "pile_set_name": "Github" }
var UIDatepaginator = function () { return { //main function to initiate the module init: function () { //sample #1 $('#datepaginator_sample_1').datepaginator(); //sample #2 $('#datepaginator_sample_2').datepaginator({ size: "large" }); //sample #3 $('#datepaginator_sample_3').datepaginator({ size: "small" }); //sample #3 $('#datepaginator_sample_4').datepaginator({ onSelectedDateChanged: function(event, date) { alert("Selected date: " + moment(date).format("Do, MMM YYYY")); } }); } // end init }; }();
{ "pile_set_name": "Github" }
// // CAKeyframeAnimation+AHEasing.m // // Copyright (c) 2011, Auerhaus Development, LLC // // This program is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it // and/or modify it under the terms of the Do What The Fuck You Want // To Public License, Version 2, as published by Sam Hocevar. See // http://sam.zoy.org/wtfpl/COPYING for more details. // #import "CAKeyframeAnimation+AHEasing.h" #if !defined(AHEasingDefaultKeyframeCount) // The larger this number, the smoother the animation #define AHEasingDefaultKeyframeCount 60 #endif @implementation CAKeyframeAnimation (AHEasing) + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromValue:(CGFloat)fromValue toValue:(CGFloat)toValue keyframeCount:(size_t)keyframeCount { NSMutableArray *values = [NSMutableArray arrayWithCapacity:keyframeCount]; CGFloat t = 0.0; CGFloat dt = 1.0 / (keyframeCount - 1); for(size_t frame = 0; frame < keyframeCount; ++frame, t += dt) { CGFloat value = fromValue + function(t) * (toValue - fromValue); [values addObject:[NSNumber numberWithFloat:(float)value]]; } CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:path]; [animation setValues:values]; return animation; } + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromValue:(CGFloat)fromValue toValue:(CGFloat)toValue { return [self animationWithKeyPath:path function:function fromValue:fromValue toValue:toValue keyframeCount:AHEasingDefaultKeyframeCount]; } + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint keyframeCount:(size_t)keyframeCount { NSMutableArray *values = [NSMutableArray arrayWithCapacity:keyframeCount]; CGFloat t = 0.0; CGFloat dt = 1.0 / (keyframeCount - 1); for(size_t frame = 0; frame < keyframeCount; ++frame, t += dt) { CGFloat x = fromPoint.x + function(t) * (toPoint.x - fromPoint.x); CGFloat y = fromPoint.y + function(t) * (toPoint.y - fromPoint.y); #if TARGET_OS_IPHONE [values addObject:[NSValue valueWithCGPoint:CGPointMake(x, y)]]; #else [values addObject:[NSValue valueWithPoint:NSMakePoint(x, y)]]; #endif } CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:path]; [animation setValues:values]; return animation; } + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint { return [self animationWithKeyPath:path function:function fromPoint:fromPoint toPoint:toPoint keyframeCount:AHEasingDefaultKeyframeCount]; } + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromSize:(CGSize)fromSize toSize:(CGSize)toSize keyframeCount:(size_t)keyframeCount { NSMutableArray *values = [NSMutableArray arrayWithCapacity:keyframeCount]; CGFloat t = 0.0; CGFloat dt = 1.0 / (keyframeCount - 1); for(size_t frame = 0; frame < keyframeCount; ++frame, t += dt) { CGFloat w = fromSize.width + function(t) * (toSize.width - fromSize.width); CGFloat h = fromSize.height + function(t) * (toSize.height - fromSize.height); #if TARGET_OS_IPHONE [values addObject:[NSValue valueWithCGSize:CGSizeMake(w, h)]]; #else [values addObject:[NSValue valueWithSize:NSMakeSize(w, h)]]; #endif } CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:path]; [animation setValues:values]; return animation; } + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromSize:(CGSize)fromSize toSize:(CGSize)toSize { return [self animationWithKeyPath:path function:function fromSize:fromSize toSize:toSize keyframeCount:AHEasingDefaultKeyframeCount]; } @end
{ "pile_set_name": "Github" }
// This source file is part of the Swift.org open source project // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // RUN: not %target-swift-frontend %s -typecheck > T where h: String class a: Bool]).Element>] private class B : Hashable> V, U) -> T, object2).B func f<T) { func c: (f) } } struct D : A { } struct c { } protocol A : a { return $0.f = compose() { } func a<T
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using NzbDrone.Common.Extensions; using NzbDrone.Core.Messaging.Commands; using Readarr.Http.REST; namespace Readarr.Api.V1.Commands { public class CommandResource : RestResource { public string Name { get; set; } public string CommandName { get; set; } public string Message { get; set; } public Command Body { get; set; } public CommandPriority Priority { get; set; } public CommandStatus Status { get; set; } public DateTime Queued { get; set; } public DateTime? Started { get; set; } public DateTime? Ended { get; set; } public TimeSpan? Duration { get; set; } public string Exception { get; set; } public CommandTrigger Trigger { get; set; } [JsonIgnore] public string CompletionMessage { get; set; } public DateTime? StateChangeTime { get { if (Started.HasValue) { return Started.Value; } return Ended; } set { } } public bool SendUpdatesToClient { get { if (Body != null) { return Body.SendUpdatesToClient; } return false; } set { } } public bool UpdateScheduledTask { get { if (Body != null) { return Body.UpdateScheduledTask; } return false; } set { } } public DateTime? LastExecutionTime { get; set; } } public static class CommandResourceMapper { public static CommandResource ToResource(this CommandModel model) { if (model == null) { return null; } return new CommandResource { Id = model.Id, Name = model.Name, CommandName = model.Name.SplitCamelCase(), Message = model.Message, Body = model.Body, Priority = model.Priority, Status = model.Status, Queued = model.QueuedAt, Started = model.StartedAt, Ended = model.EndedAt, Duration = model.Duration, Exception = model.Exception, Trigger = model.Trigger, CompletionMessage = model.Body.CompletionMessage, LastExecutionTime = model.Body.LastExecutionTime }; } public static List<CommandResource> ToResource(this IEnumerable<CommandModel> models) { return models.Select(ToResource).ToList(); } } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015, 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 javax.xml.catalog; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; /** * The Normalizer is responsible for normalizing Public and System Identifiers * as specified in section 6.2, 6.3 and 6.4 of the specification * * <a * href="https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html"> * XML Catalogs, OASIS Standard V1.1, 7 October 2005</a>. * * @since 9 */ class Normalizer { /** * Normalize a public identifier in accordance with section 6.2 of the * Catalog specification. * * <p> * All strings of white space in public identifiers must be normalized to * single space characters (#x20), and leading and trailing white space must * be removed. * * @param publicId The unnormalized public identifier * * @return The normalized identifier */ static String normalizePublicId(String publicId) { if (publicId == null) return null; StringBuilder sb = new StringBuilder(publicId.length()); char last = 'a'; for (char c : publicId.toCharArray()) { //skip beginning and duplicate space if ((c == ' ') && (sb.length() == 0 || last == ' ')) { continue; } //replace whitespace with space if (c == '\t' || c == '\r' || c == '\n') { if (last != ' ') { sb.append(' '); last = ' '; } } else { sb.append(c); last = c; } } //remove the last space if (last == ' ') { sb.deleteCharAt(sb.length() - 1); } return sb.toString(); } /** * Encode a public identifier as a "publicid" URN. * * @param publicId The unnormalized public identifier * * @return The normalized identifier * @throws CatalogException if encoding failed */ static String encodeURN(String publicId) { String urn = normalizePublicId(publicId); try { urn = URLEncoder.encode(urn, "UTF-8"); urn = urn.replace("::", ";"); urn = urn.replace("//", ":"); } catch (UnsupportedEncodingException ex) { CatalogMessages.reportRunTimeError(CatalogMessages.ERR_OTHER, ex); } return Util.URN + urn; } /** * Decode a "publicid" URN into a public identifier. * * @param urn The urn:publicid: URN * * @return The normalized identifier * @throws CatalogException if decoding failed */ static String decodeURN(String urn) { String publicId; if (urn != null && urn.startsWith(Util.URN)) { publicId = urn.substring(13); } else { return urn; } try { publicId = publicId.replace(":", "//"); publicId = publicId.replace(";", "::"); publicId = URLDecoder.decode(publicId, "UTF-8"); } catch (UnsupportedEncodingException ex) { CatalogMessages.reportRunTimeError(CatalogMessages.ERR_OTHER, ex); } return publicId; } /** * Perform character normalization on a URI reference. * * @param uriref The URI reference * @return The normalized URI reference */ static String normalizeURI(String uriref) { if (uriref == null) { return null; } byte[] bytes; uriref = uriref.trim(); try { bytes = uriref.getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { // this can't happen return uriref; } StringBuilder newRef = new StringBuilder(bytes.length); for (int count = 0; count < bytes.length; count++) { int ch = bytes[count] & 0xFF; if ((ch <= 0x20) // ctrl || (ch > 0x7F) // high ascii || (ch == 0x22) // " || (ch == 0x3C) // < || (ch == 0x3E) // > || (ch == 0x5C) // \ || (ch == 0x5E) // ^ || (ch == 0x60) // ` || (ch == 0x7B) // { || (ch == 0x7C) // | || (ch == 0x7D) // } || (ch == 0x7F)) { newRef.append("%").append(String.format("%02X", ch)); } else { newRef.append((char) bytes[count]); } } return newRef.toString().trim(); } }
{ "pile_set_name": "Github" }
--- title: "tup" layout: formula --- {{ content }}
{ "pile_set_name": "Github" }
/* * Copyright (c) 2008-2011 Atheros Communications Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "hw.h" static inline u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz) { if (fbin == AR5416_BCHAN_UNUSED) return fbin; return (u16) ((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin)); } void ath9k_hw_analog_shift_regwrite(struct ath_hw *ah, u32 reg, u32 val) { REG_WRITE(ah, reg, val); if (ah->config.analog_shiftreg) udelay(100); } void ath9k_hw_analog_shift_rmw(struct ath_hw *ah, u32 reg, u32 mask, u32 shift, u32 val) { u32 regVal; regVal = REG_READ(ah, reg) & ~mask; regVal |= (val << shift) & mask; REG_WRITE(ah, reg, regVal); if (ah->config.analog_shiftreg) udelay(100); } int16_t ath9k_hw_interpolate(u16 target, u16 srcLeft, u16 srcRight, int16_t targetLeft, int16_t targetRight) { int16_t rv; if (srcRight == srcLeft) { rv = targetLeft; } else { rv = (int16_t) (((target - srcLeft) * targetRight + (srcRight - target) * targetLeft) / (srcRight - srcLeft)); } return rv; } bool ath9k_hw_get_lower_upper_index(u8 target, u8 *pList, u16 listSize, u16 *indexL, u16 *indexR) { u16 i; if (target <= pList[0]) { *indexL = *indexR = 0; return true; } if (target >= pList[listSize - 1]) { *indexL = *indexR = (u16) (listSize - 1); return true; } for (i = 0; i < listSize - 1; i++) { if (pList[i] == target) { *indexL = *indexR = i; return true; } if (target < pList[i + 1]) { *indexL = i; *indexR = (u16) (i + 1); return false; } } return false; } void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data, int eep_start_loc, int size) { int i = 0, j, addr; u32 addrdata[8]; u32 data[8]; for (addr = 0; addr < size; addr++) { addrdata[i] = AR5416_EEPROM_OFFSET + ((addr + eep_start_loc) << AR5416_EEPROM_S); i++; if (i == 8) { REG_READ_MULTI(ah, addrdata, data, i); for (j = 0; j < i; j++) { *eep_data = data[j]; eep_data++; } i = 0; } } if (i != 0) { REG_READ_MULTI(ah, addrdata, data, i); for (j = 0; j < i; j++) { *eep_data = data[j]; eep_data++; } } } bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data) { return common->bus_ops->eeprom_read(common, off, data); } void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList, u8 *pVpdList, u16 numIntercepts, u8 *pRetVpdList) { u16 i, k; u8 currPwr = pwrMin; u16 idxL = 0, idxR = 0; for (i = 0; i <= (pwrMax - pwrMin) / 2; i++) { ath9k_hw_get_lower_upper_index(currPwr, pPwrList, numIntercepts, &(idxL), &(idxR)); if (idxR < 1) idxR = 1; if (idxL == numIntercepts - 1) idxL = (u16) (numIntercepts - 2); if (pPwrList[idxL] == pPwrList[idxR]) k = pVpdList[idxL]; else k = (u16)(((currPwr - pPwrList[idxL]) * pVpdList[idxR] + (pPwrList[idxR] - currPwr) * pVpdList[idxL]) / (pPwrList[idxR] - pPwrList[idxL])); pRetVpdList[i] = (u8) k; currPwr += 2; } } void ath9k_hw_get_legacy_target_powers(struct ath_hw *ah, struct ath9k_channel *chan, struct cal_target_power_leg *powInfo, u16 numChannels, struct cal_target_power_leg *pNewPower, u16 numRates, bool isExtTarget) { struct chan_centers centers; u16 clo, chi; int i; int matchIndex = -1, lowIndex = -1; u16 freq; ath9k_hw_get_channel_centers(ah, chan, &centers); freq = (isExtTarget) ? centers.ext_center : centers.ctl_center; if (freq <= ath9k_hw_fbin2freq(powInfo[0].bChannel, IS_CHAN_2GHZ(chan))) { matchIndex = 0; } else { for (i = 0; (i < numChannels) && (powInfo[i].bChannel != AR5416_BCHAN_UNUSED); i++) { if (freq == ath9k_hw_fbin2freq(powInfo[i].bChannel, IS_CHAN_2GHZ(chan))) { matchIndex = i; break; } else if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, IS_CHAN_2GHZ(chan)) && i > 0 && freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, IS_CHAN_2GHZ(chan))) { lowIndex = i - 1; break; } } if ((matchIndex == -1) && (lowIndex == -1)) matchIndex = i - 1; } if (matchIndex != -1) { *pNewPower = powInfo[matchIndex]; } else { clo = ath9k_hw_fbin2freq(powInfo[lowIndex].bChannel, IS_CHAN_2GHZ(chan)); chi = ath9k_hw_fbin2freq(powInfo[lowIndex + 1].bChannel, IS_CHAN_2GHZ(chan)); for (i = 0; i < numRates; i++) { pNewPower->tPow2x[i] = (u8)ath9k_hw_interpolate(freq, clo, chi, powInfo[lowIndex].tPow2x[i], powInfo[lowIndex + 1].tPow2x[i]); } } } void ath9k_hw_get_target_powers(struct ath_hw *ah, struct ath9k_channel *chan, struct cal_target_power_ht *powInfo, u16 numChannels, struct cal_target_power_ht *pNewPower, u16 numRates, bool isHt40Target) { struct chan_centers centers; u16 clo, chi; int i; int matchIndex = -1, lowIndex = -1; u16 freq; ath9k_hw_get_channel_centers(ah, chan, &centers); freq = isHt40Target ? centers.synth_center : centers.ctl_center; if (freq <= ath9k_hw_fbin2freq(powInfo[0].bChannel, IS_CHAN_2GHZ(chan))) { matchIndex = 0; } else { for (i = 0; (i < numChannels) && (powInfo[i].bChannel != AR5416_BCHAN_UNUSED); i++) { if (freq == ath9k_hw_fbin2freq(powInfo[i].bChannel, IS_CHAN_2GHZ(chan))) { matchIndex = i; break; } else if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, IS_CHAN_2GHZ(chan)) && i > 0 && freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, IS_CHAN_2GHZ(chan))) { lowIndex = i - 1; break; } } if ((matchIndex == -1) && (lowIndex == -1)) matchIndex = i - 1; } if (matchIndex != -1) { *pNewPower = powInfo[matchIndex]; } else { clo = ath9k_hw_fbin2freq(powInfo[lowIndex].bChannel, IS_CHAN_2GHZ(chan)); chi = ath9k_hw_fbin2freq(powInfo[lowIndex + 1].bChannel, IS_CHAN_2GHZ(chan)); for (i = 0; i < numRates; i++) { pNewPower->tPow2x[i] = (u8)ath9k_hw_interpolate(freq, clo, chi, powInfo[lowIndex].tPow2x[i], powInfo[lowIndex + 1].tPow2x[i]); } } } u16 ath9k_hw_get_max_edge_power(u16 freq, struct cal_ctl_edges *pRdEdgesPower, bool is2GHz, int num_band_edges) { u16 twiceMaxEdgePower = MAX_RATE_POWER; int i; for (i = 0; (i < num_band_edges) && (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl); break; } else if ((i > 0) && (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz))) { if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, is2GHz) < freq && CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) { twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl); } break; } } return twiceMaxEdgePower; } void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); switch (ar5416_get_ntxchains(ah->txchainmask)) { case 1: break; case 2: regulatory->max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN; break; case 3: regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN; break; default: ath_dbg(common, EEPROM, "Invalid chainmask configuration\n"); break; } } void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah, struct ath9k_channel *chan, void *pRawDataSet, u8 *bChans, u16 availPiers, u16 tPdGainOverlap, u16 *pPdGainBoundaries, u8 *pPDADCValues, u16 numXpdGains) { int i, j, k; int16_t ss; u16 idxL = 0, idxR = 0, numPiers; static u8 vpdTableL[AR5416_NUM_PD_GAINS] [AR5416_MAX_PWR_RANGE_IN_HALF_DB]; static u8 vpdTableR[AR5416_NUM_PD_GAINS] [AR5416_MAX_PWR_RANGE_IN_HALF_DB]; static u8 vpdTableI[AR5416_NUM_PD_GAINS] [AR5416_MAX_PWR_RANGE_IN_HALF_DB]; u8 *pVpdL, *pVpdR, *pPwrL, *pPwrR; u8 minPwrT4[AR5416_NUM_PD_GAINS]; u8 maxPwrT4[AR5416_NUM_PD_GAINS]; int16_t vpdStep; int16_t tmpVal; u16 sizeCurrVpdTable, maxIndex, tgtIndex; bool match; int16_t minDelta = 0; struct chan_centers centers; int pdgain_boundary_default; struct cal_data_per_freq *data_def = pRawDataSet; struct cal_data_per_freq_4k *data_4k = pRawDataSet; struct cal_data_per_freq_ar9287 *data_9287 = pRawDataSet; bool eeprom_4k = AR_SREV_9285(ah) || AR_SREV_9271(ah); int intercepts; if (AR_SREV_9287(ah)) intercepts = AR9287_PD_GAIN_ICEPTS; else intercepts = AR5416_PD_GAIN_ICEPTS; memset(&minPwrT4, 0, AR5416_NUM_PD_GAINS); ath9k_hw_get_channel_centers(ah, chan, &centers); for (numPiers = 0; numPiers < availPiers; numPiers++) { if (bChans[numPiers] == AR5416_BCHAN_UNUSED) break; } match = ath9k_hw_get_lower_upper_index((u8)FREQ2FBIN(centers.synth_center, IS_CHAN_2GHZ(chan)), bChans, numPiers, &idxL, &idxR); if (match) { if (AR_SREV_9287(ah)) { /* FIXME: array overrun? */ for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = data_9287[idxL].pwrPdg[i][0]; maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4]; ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], data_9287[idxL].pwrPdg[i], data_9287[idxL].vpdPdg[i], intercepts, vpdTableI[i]); } } else if (eeprom_4k) { for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = data_4k[idxL].pwrPdg[i][0]; maxPwrT4[i] = data_4k[idxL].pwrPdg[i][4]; ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], data_4k[idxL].pwrPdg[i], data_4k[idxL].vpdPdg[i], intercepts, vpdTableI[i]); } } else { for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = data_def[idxL].pwrPdg[i][0]; maxPwrT4[i] = data_def[idxL].pwrPdg[i][4]; ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], data_def[idxL].pwrPdg[i], data_def[idxL].vpdPdg[i], intercepts, vpdTableI[i]); } } } else { for (i = 0; i < numXpdGains; i++) { if (AR_SREV_9287(ah)) { pVpdL = data_9287[idxL].vpdPdg[i]; pPwrL = data_9287[idxL].pwrPdg[i]; pVpdR = data_9287[idxR].vpdPdg[i]; pPwrR = data_9287[idxR].pwrPdg[i]; } else if (eeprom_4k) { pVpdL = data_4k[idxL].vpdPdg[i]; pPwrL = data_4k[idxL].pwrPdg[i]; pVpdR = data_4k[idxR].vpdPdg[i]; pPwrR = data_4k[idxR].pwrPdg[i]; } else { pVpdL = data_def[idxL].vpdPdg[i]; pPwrL = data_def[idxL].pwrPdg[i]; pVpdR = data_def[idxR].vpdPdg[i]; pPwrR = data_def[idxR].pwrPdg[i]; } minPwrT4[i] = max(pPwrL[0], pPwrR[0]); maxPwrT4[i] = min(pPwrL[intercepts - 1], pPwrR[intercepts - 1]); ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL, intercepts, vpdTableL[i]); ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR, intercepts, vpdTableR[i]); for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) { vpdTableI[i][j] = (u8)(ath9k_hw_interpolate((u16) FREQ2FBIN(centers. synth_center, IS_CHAN_2GHZ (chan)), bChans[idxL], bChans[idxR], vpdTableL[i][j], vpdTableR[i][j])); } } } k = 0; for (i = 0; i < numXpdGains; i++) { if (i == (numXpdGains - 1)) pPdGainBoundaries[i] = (u16)(maxPwrT4[i] / 2); else pPdGainBoundaries[i] = (u16)((maxPwrT4[i] + minPwrT4[i + 1]) / 4); pPdGainBoundaries[i] = min((u16)MAX_RATE_POWER, pPdGainBoundaries[i]); minDelta = 0; if (i == 0) { if (AR_SREV_9280_20_OR_LATER(ah)) ss = (int16_t)(0 - (minPwrT4[i] / 2)); else ss = 0; } else { ss = (int16_t)((pPdGainBoundaries[i - 1] - (minPwrT4[i] / 2)) - tPdGainOverlap + 1 + minDelta); } vpdStep = (int16_t)(vpdTableI[i][1] - vpdTableI[i][0]); vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep); while ((ss < 0) && (k < (AR5416_NUM_PDADC_VALUES - 1))) { tmpVal = (int16_t)(vpdTableI[i][0] + ss * vpdStep); pPDADCValues[k++] = (u8)((tmpVal < 0) ? 0 : tmpVal); ss++; } sizeCurrVpdTable = (u8) ((maxPwrT4[i] - minPwrT4[i]) / 2 + 1); tgtIndex = (u8)(pPdGainBoundaries[i] + tPdGainOverlap - (minPwrT4[i] / 2)); maxIndex = (tgtIndex < sizeCurrVpdTable) ? tgtIndex : sizeCurrVpdTable; while ((ss < maxIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) { pPDADCValues[k++] = vpdTableI[i][ss++]; } vpdStep = (int16_t)(vpdTableI[i][sizeCurrVpdTable - 1] - vpdTableI[i][sizeCurrVpdTable - 2]); vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep); if (tgtIndex >= maxIndex) { while ((ss <= tgtIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) { tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] + (ss - maxIndex + 1) * vpdStep)); pPDADCValues[k++] = (u8)((tmpVal > 255) ? 255 : tmpVal); ss++; } } } if (eeprom_4k) pdgain_boundary_default = 58; else pdgain_boundary_default = pPdGainBoundaries[i - 1]; while (i < AR5416_PD_GAINS_IN_MASK) { pPdGainBoundaries[i] = pdgain_boundary_default; i++; } while (k < AR5416_NUM_PDADC_VALUES) { pPDADCValues[k] = pPDADCValues[k - 1]; k++; } } int ath9k_hw_eeprom_init(struct ath_hw *ah) { int status; if (AR_SREV_9300_20_OR_LATER(ah)) ah->eep_ops = &eep_ar9300_ops; else if (AR_SREV_9287(ah)) { ah->eep_ops = &eep_ar9287_ops; } else if (AR_SREV_9285(ah) || AR_SREV_9271(ah)) { ah->eep_ops = &eep_4k_ops; } else { ah->eep_ops = &eep_def_ops; } if (!ah->eep_ops->fill_eeprom(ah)) return -EIO; status = ah->eep_ops->check_eeprom(ah); return status; }
{ "pile_set_name": "Github" }
repo: GoogleChrome/lighthouse filters: - type: issue criteria: text: $or: - $match: 'Error: INVALID_URL' state: open - type: comments length: $lt: 2 actions: - type: add_comment body: 'Howdy! Appreciate you filing this bug. :clap: We think this is the same root issue as #6421. So, **we''ll automatically mark this as a duplicate**. Thanks! :robot: Beep beep boop. ' - type: add_label label: duplicate - type: close
{ "pile_set_name": "Github" }
/* Author: Andy, [email protected] Date: Jan 16, 2015 Problem: Construct Binary Tree from Inorder and Postorder Traversal Difficulty: Easy Source: http://leetcode.com/onlinejudge#question_106 Notes: Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. Solution: Recursion. */ /** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution { public TreeNode buildTree(int[] inorder, int[] postorder) { if(inorder.length==0||postorder.length==0||inorder.length!=postorder.length) return null; return buildTreeRe(inorder,0,inorder.length-1,postorder,0,postorder.length-1); } public TreeNode buildTreeRe(int[] inorder,int s1,int e1, int[] postorder, int s2,int e2){ if(e2<s2) return null; if(s2==e2) return new TreeNode(postorder[e2]); int j=-1; for(int i=s1;i<=e1;i++){ if(inorder[i]==postorder[e2]){ j=i; break; } } int left_len = j-s1; TreeNode root = new TreeNode(postorder[e2]); root.left = buildTreeRe(inorder,s1,j-1,postorder,s2,s2+left_len-1); root.right = buildTreeRe(inorder,j+1,e1,postorder,s2+left_len,e2-1); return root; } }
{ "pile_set_name": "Github" }
/// Copyright (c) 2012 Ecma International. All rights reserved. /** * @path ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-3-28.js * @description Array.prototype.reduce - value of 'length' is boundary value (2^32) */ function testcase() { var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; return 2; } var obj = { 0: 12, length: 4294967296 }; return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; } runTestCase(testcase);
{ "pile_set_name": "Github" }
--- title: ユーザー フローの API コネクタ コード サンプル - Azure AD description: Azure Active Directory for External Identities のセルフサービス サインアップ フローにおける API コネクタのコード サンプルです。 services: active-directory ms.service: active-directory ms.subservice: B2B ms.topic: sample ms.date: 06/16/2020 ms.author: mimart author: msmimart manager: celestedg ms.custom: it-pro ms.collection: M365-identity-device-management ms.openlocfilehash: a3995395cfd6256689bedc7a4a3c83effc65c0b4 ms.sourcegitcommit: 4e5560887b8f10539d7564eedaff4316adb27e2c ms.translationtype: HT ms.contentlocale: ja-JP ms.lasthandoff: 08/06/2020 ms.locfileid: "87906936" --- # <a name="samples-for-external-identities-self-service-sign-up"></a>External Identities のセルフサービス サインアップのサンプル 次の表に、[API コネクタ](api-connectors-overview.md)を使用したセルフサービス サインアップ ユーザー フローで Web API を活用するためのコード サンプルへのリンクを示します。 ## <a name="api-connector-azure-function-quickstarts"></a>API コネクタを使用した Azure 関数のクイックスタート | サンプル | 説明 | | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | [.NET Core](https://github.com/Azure-Samples/active-directory-dotnet-external-identities-api-connector-azure-function-validate) | この .NET Core Azure 関数サンプルには、特定のテナント ドメインへのサインアップを制限し、ユーザー指定の情報を検証する方法が示されています。 | | [Node.js](https://github.com/Azure-Samples/active-directory-nodejs-external-identities-api-connector-azure-function-validate) | この Node.js Azure 関数サンプルには、特定のテナント ドメインへのサインアップを制限し、ユーザー指定の情報を検証する方法が示されています。 | | [Python](https://github.com/Azure-Samples/active-directory-python-external-identities-api-connector-azure-function-validate) | この Python Azure 関数サンプルには、特定のテナント ドメインへのサインアップを制限し、ユーザー指定の情報を検証する方法が示されています。 | <!-- \| [Java](../../azure-docs-pr/articles/active-directory/b2b/invite-internal-users.md#use-the-invitation-api-to-send-a-b2b-invitation) | The sample below illustrates how to call the invitation API to invite an internal user as a B2B user. | --> ## <a name="custom-approval-workflows"></a>カスタム承認ワークフロー | サンプル | 説明 | |--------| ----------- | | [手動承認ワークフロー](https://github.com/Azure-Samples/active-directory-dotnet-external-identities-api-connectors-approvals) | このサンプルでは、セルフサービス サインアップでゲスト ユーザー アカウントの作成を管理するためのエンド ツー エンドの承認ワークフローを示します | ## <a name="identity-verification"></a>本人確認 | サンプル | 説明 | | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | [IDology](https://github.com/Azure-Samples/active-directory-dotnet-external-identities-idology-identity-verification) | このサンプルでは、API コネクタを使用して IDology と統合することで、セルフサービス サインアップの一部としてユーザー ID を確認する方法を示します。 | | [Experian](https://github.com/Azure-Samples/active-directory-dotnet-external-identities-experian-identity-verification) | このサンプルでは、API コネクタを使用して Experian と統合することで、セルフサービス サインアップの一部としてユーザー ID を確認する方法を示します。 |
{ "pile_set_name": "Github" }
// {{{ MIT License // Copyright 2017 Roland Kaminski // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // }}} #ifndef _GRINGO_INPUT_PROGRAMBUILDER_HH #define _GRINGO_INPUT_PROGRAMBUILDER_HH #include <gringo/locatable.hh> #include <gringo/symbol.hh> #include <gringo/indexed.hh> #include <gringo/base.hh> #include <vector> #include <memory> #include <forward_list> namespace Gringo { struct CSPMulTerm; struct CSPAddTerm; class TheoryOpDef; class TheoryTermDef; class TheoryAtomDef; class TheoryDef; namespace Input { class Program; struct Statement; struct BodyAggregate; struct HeadAggregate; struct Literal; struct CSPLiteral; struct CSPElem; class TheoryElement; class TheoryAtom; } // namespace Input namespace Output { class TheoryTerm; class RawTheoryTerm; class OutputBase; using UTheoryTerm = std::unique_ptr<TheoryTerm>; } } // namespace Output Gringo namespace Gringo { namespace Input { // {{{1 declaration of unique ids of program elements enum IdVecUid : unsigned { }; enum CSPAddTermUid : unsigned { }; enum CSPMulTermUid : unsigned { }; enum CSPLitUid : unsigned { }; enum TermUid : unsigned { }; enum TermVecUid : unsigned { }; enum TermVecVecUid : unsigned { }; enum LitUid : unsigned { }; enum LitVecUid : unsigned { }; enum CondLitVecUid : unsigned { }; enum BdAggrElemVecUid : unsigned { }; enum HdAggrElemVecUid : unsigned { }; enum HdLitUid : unsigned { }; enum BdLitVecUid : unsigned { }; enum BoundVecUid : unsigned { }; enum CSPElemVecUid : unsigned { }; enum TheoryOpVecUid : unsigned { }; enum TheoryTermUid : unsigned { }; enum TheoryOptermUid : unsigned { }; enum TheoryOptermVecUid : unsigned { }; enum TheoryElemVecUid : unsigned { }; enum TheoryAtomUid : unsigned { }; enum TheoryOpDefUid : unsigned { }; enum TheoryOpDefVecUid : unsigned { }; enum TheoryTermDefUid : unsigned { }; enum TheoryAtomDefUid : unsigned { }; enum TheoryDefVecUid : unsigned { }; // {{{1 declaration of INongroundProgramBuilder class INongroundProgramBuilder { public: TermUid predRep(Location const &loc, bool neg, String name, TermVecVecUid tvvUid) { TermUid t = term(loc, name, tvvUid, false); if (neg) { t = term(loc, UnOp::NEG, t); } return t; } // {{{2 terms virtual TermUid term(Location const &loc, Symbol val) = 0; // constant virtual TermUid term(Location const &loc, String name) = 0; // variable virtual TermUid term(Location const &loc, UnOp op, TermUid a) = 0; // unary operation virtual TermUid term(Location const &loc, UnOp op, TermVecUid a) = 0; // unary operation virtual TermUid term(Location const &loc, BinOp op, TermUid a, TermUid b) = 0; // binary operation virtual TermUid term(Location const &loc, TermUid a, TermUid b) = 0; // dots virtual TermUid term(Location const &loc, String name, TermVecVecUid b, bool lua) = 0; // function or lua function virtual TermUid term(Location const &loc, TermVecUid args, bool forceTuple) = 0; // a tuple term (or simply a term) virtual TermUid pool(Location const &loc, TermVecUid args) = 0; // a pool term // {{{2 csp virtual CSPMulTermUid cspmulterm(Location const &loc, TermUid coe, TermUid var) = 0; virtual CSPMulTermUid cspmulterm(Location const &loc, TermUid coe) = 0; virtual CSPAddTermUid cspaddterm(Location const &loc, CSPAddTermUid a, CSPMulTermUid b, bool add) = 0; virtual CSPAddTermUid cspaddterm(Location const &loc, CSPMulTermUid a) = 0; virtual LitUid csplit(CSPLitUid a) = 0; virtual CSPLitUid csplit(Location const &loc, CSPLitUid a, Relation rel, CSPAddTermUid b) = 0; virtual CSPLitUid csplit(Location const &loc, CSPAddTermUid a, Relation rel, CSPAddTermUid b) = 0; // {{{2 id vectors virtual IdVecUid idvec() = 0; virtual IdVecUid idvec(IdVecUid uid, Location const &loc, String id) = 0; // {{{2 term vectors virtual TermVecUid termvec() = 0; virtual TermVecUid termvec(TermVecUid uid, TermUid term) = 0; // {{{2 term vector vectors virtual TermVecVecUid termvecvec() = 0; virtual TermVecVecUid termvecvec(TermVecVecUid uid, TermVecUid termvecUid) = 0; // {{{2 literals virtual LitUid boollit(Location const &loc, bool type) = 0; virtual LitUid predlit(Location const &loc, NAF naf, TermUid atom) = 0; virtual LitUid rellit(Location const &loc, Relation rel, TermUid termUidLeft, TermUid termUidRight) = 0; // {{{2 literal vectors virtual LitVecUid litvec() = 0; virtual LitVecUid litvec(LitVecUid uid, LitUid literalUid) = 0; // {{{2 conditional literals virtual CondLitVecUid condlitvec() = 0; virtual CondLitVecUid condlitvec(CondLitVecUid uid, LitUid lit, LitVecUid litvec) = 0; // {{{2 body aggregate elements virtual BdAggrElemVecUid bodyaggrelemvec() = 0; virtual BdAggrElemVecUid bodyaggrelemvec(BdAggrElemVecUid uid, TermVecUid termvec, LitVecUid litvec) = 0; // {{{2 head aggregate elements virtual HdAggrElemVecUid headaggrelemvec() = 0; virtual HdAggrElemVecUid headaggrelemvec(HdAggrElemVecUid uid, TermVecUid termvec, LitUid lit, LitVecUid litvec) = 0; // {{{2 bounds virtual BoundVecUid boundvec() = 0; virtual BoundVecUid boundvec(BoundVecUid uid, Relation rel, TermUid term) = 0; // {{{2 heads virtual HdLitUid headlit(LitUid lit) = 0; virtual HdLitUid headaggr(Location const &loc, TheoryAtomUid atom) = 0; virtual HdLitUid headaggr(Location const &loc, AggregateFunction fun, BoundVecUid bounds, HdAggrElemVecUid headaggrelemvec) = 0; virtual HdLitUid headaggr(Location const &loc, AggregateFunction fun, BoundVecUid bounds, CondLitVecUid headaggrelemvec) = 0; virtual HdLitUid disjunction(Location const &loc, CondLitVecUid condlitvec) = 0; // {{{2 bodies virtual BdLitVecUid body() = 0; virtual BdLitVecUid bodylit(BdLitVecUid body, LitUid bodylit) = 0; virtual BdLitVecUid bodyaggr(BdLitVecUid body, Location const &loc, NAF naf, TheoryAtomUid atom) = 0; virtual BdLitVecUid bodyaggr(BdLitVecUid body, Location const &loc, NAF naf, AggregateFunction fun, BoundVecUid bounds, BdAggrElemVecUid bodyaggrelemvec) = 0; virtual BdLitVecUid bodyaggr(BdLitVecUid body, Location const &loc, NAF naf, AggregateFunction fun, BoundVecUid bounds, CondLitVecUid bodyaggrelemvec) = 0; virtual BdLitVecUid conjunction(BdLitVecUid body, Location const &loc, LitUid head, LitVecUid litvec) = 0; virtual BdLitVecUid disjoint(BdLitVecUid body, Location const &loc, NAF naf, CSPElemVecUid elem) = 0; // {{{2 csp constraint elements virtual CSPElemVecUid cspelemvec() = 0; virtual CSPElemVecUid cspelemvec(CSPElemVecUid uid, Location const &loc, TermVecUid termvec, CSPAddTermUid addterm, LitVecUid litvec) = 0; // {{{2 statements virtual void rule(Location const &loc, HdLitUid head) = 0; virtual void rule(Location const &loc, HdLitUid head, BdLitVecUid body) = 0; virtual void define(Location const &loc, String name, TermUid value, bool defaultDef, Logger &log) = 0; virtual void optimize(Location const &loc, TermUid weight, TermUid priority, TermVecUid cond, BdLitVecUid body) = 0; virtual void showsig(Location const &loc, Sig, bool csp) = 0; virtual void defined(Location const &loc, Sig) = 0; virtual void show(Location const &loc, TermUid t, BdLitVecUid body, bool csp) = 0; virtual void python(Location const &loc, String code) = 0; virtual void lua(Location const &loc, String code) = 0; virtual void block(Location const &loc, String name, IdVecUid args) = 0; virtual void external(Location const &loc, TermUid head, BdLitVecUid body, TermUid type) = 0; virtual void edge(Location const &loc, TermVecVecUid edges, BdLitVecUid body) = 0; virtual void heuristic(Location const &loc, TermUid termUid, BdLitVecUid body, TermUid a, TermUid b, TermUid mod) = 0; virtual void project(Location const &loc, TermUid termUid, BdLitVecUid body) = 0; virtual void project(Location const &loc, Sig sig) = 0; // {{{2 theory atoms virtual TheoryTermUid theorytermset(Location const &loc, TheoryOptermVecUid args) = 0; virtual TheoryTermUid theoryoptermlist(Location const &loc, TheoryOptermVecUid args) = 0; virtual TheoryTermUid theorytermopterm(Location const &loc, TheoryOptermUid opterm) = 0; virtual TheoryTermUid theorytermtuple(Location const &loc, TheoryOptermVecUid args) = 0; virtual TheoryTermUid theorytermfun(Location const &loc, String name, TheoryOptermVecUid args) = 0; virtual TheoryTermUid theorytermvalue(Location const &loc, Symbol val) = 0; virtual TheoryTermUid theorytermvar(Location const &loc, String var) = 0; virtual TheoryOptermUid theoryopterm(TheoryOpVecUid ops, TheoryTermUid term) = 0; virtual TheoryOptermUid theoryopterm(TheoryOptermUid opterm, TheoryOpVecUid ops, TheoryTermUid term) = 0; virtual TheoryOpVecUid theoryops() = 0; virtual TheoryOpVecUid theoryops(TheoryOpVecUid ops, String op) = 0; virtual TheoryOptermVecUid theoryopterms() = 0; virtual TheoryOptermVecUid theoryopterms(TheoryOptermVecUid opterms, Location const &loc, TheoryOptermUid opterm) = 0; virtual TheoryOptermVecUid theoryopterms(Location const &loc, TheoryOptermUid opterm, TheoryOptermVecUid opterms) = 0; virtual TheoryElemVecUid theoryelems() = 0; virtual TheoryElemVecUid theoryelems(TheoryElemVecUid elems, TheoryOptermVecUid opterms, LitVecUid cond) = 0; virtual TheoryAtomUid theoryatom(TermUid term, TheoryElemVecUid elems) = 0; virtual TheoryAtomUid theoryatom(TermUid term, TheoryElemVecUid elems, String op, Location const &loc, TheoryOptermUid opterm) = 0; // {{{2 theory definitions virtual TheoryOpDefUid theoryopdef(Location const &loc, String op, unsigned priority, TheoryOperatorType type) = 0; virtual TheoryOpDefVecUid theoryopdefs() = 0; virtual TheoryOpDefVecUid theoryopdefs(TheoryOpDefVecUid defs, TheoryOpDefUid def) = 0; virtual TheoryTermDefUid theorytermdef(Location const &loc, String name, TheoryOpDefVecUid defs, Logger &log) = 0; virtual TheoryAtomDefUid theoryatomdef(Location const &loc, String name, unsigned arity, String termDef, TheoryAtomType type) = 0; virtual TheoryAtomDefUid theoryatomdef(Location const &loc, String name, unsigned arity, String termDef, TheoryAtomType type, TheoryOpVecUid ops, String guardDef) = 0; virtual TheoryDefVecUid theorydefs() = 0; virtual TheoryDefVecUid theorydefs(TheoryDefVecUid defs, TheoryTermDefUid def) = 0; virtual TheoryDefVecUid theorydefs(TheoryDefVecUid defs, TheoryAtomDefUid def) = 0; virtual void theorydef(Location const &loc, String name, TheoryDefVecUid defs, Logger &log) = 0; // }}}2 virtual ~INongroundProgramBuilder() { } }; // {{{1 declaration of NongroundProgramBuilder using UCSPLit = std::unique_ptr<CSPLiteral>; using ULit = std::unique_ptr<Literal>; using ULitVec = std::vector<ULit>; using UHeadAggr = std::unique_ptr<HeadAggregate>; using UBodyAggr = std::unique_ptr<BodyAggregate>; using UStm = std::unique_ptr<Statement>; using BoundVec = std::vector<Bound>; using BodyAggrElem = std::pair<UTermVec, ULitVec>; using BodyAggrElemVec = std::vector<BodyAggrElem>; using CondLit = std::pair<ULit, ULitVec>; using CondLitVec = std::vector<CondLit>; using HeadAggrElem = std::tuple<UTermVec, ULit, ULitVec>; using HeadAggrElemVec = std::vector<HeadAggrElem>; using UBodyAggrVec = std::vector<UBodyAggr>; using CSPElemVec = std::vector<CSPElem>; using IdVec = std::vector<std::pair<Location, String>>; class NongroundProgramBuilder : public INongroundProgramBuilder { public: NongroundProgramBuilder(Context &context, Program &prg, Output::OutputBase &out, Defines &defs, bool rewriteMinimize = false); // {{{2 terms TermUid term(Location const &loc, Symbol val) override; // constant TermUid term(Location const &loc, String name) override; // variable TermUid term(Location const &loc, UnOp op, TermUid a) override; // unary operation TermUid term(Location const &loc, UnOp op, TermVecUid a) override; // unary operation TermUid term(Location const &loc, BinOp op, TermUid a, TermUid b) override; // binary operation TermUid term(Location const &loc, TermUid a, TermUid b) override; // assignment TermUid term(Location const &loc, String name, TermVecVecUid b, bool lua) override; // function or lua function TermUid term(Location const &loc, TermVecUid args, bool forceTuple) override; // a tuple term (or simply a term) TermUid pool(Location const &loc, TermVecUid args) override; // a pool term // {{{2 term vectors TermVecUid termvec() override; TermVecUid termvec(TermVecUid uid, TermUid term) override; // {{{2 id vectors IdVecUid idvec() override; IdVecUid idvec(IdVecUid uid, Location const &loc, String id) override; // {{{2 csp CSPMulTermUid cspmulterm(Location const &loc, TermUid coe, TermUid var) override; CSPMulTermUid cspmulterm(Location const &loc, TermUid coe) override; CSPAddTermUid cspaddterm(Location const &loc, CSPAddTermUid a, CSPMulTermUid b, bool add) override; CSPAddTermUid cspaddterm(Location const &loc, CSPMulTermUid a) override; LitUid csplit(CSPLitUid a) override; CSPLitUid csplit(Location const &loc, CSPLitUid a, Relation rel, CSPAddTermUid b) override; CSPLitUid csplit(Location const &loc, CSPAddTermUid a, Relation rel, CSPAddTermUid b) override; // {{{2 term vector vectors TermVecVecUid termvecvec() override; TermVecVecUid termvecvec(TermVecVecUid uid, TermVecUid termvecUid) override; // {{{2 literals LitUid boollit(Location const &loc, bool type) override; LitUid predlit(Location const &loc, NAF naf, TermUid term) override; LitUid rellit(Location const &loc, Relation rel, TermUid termUidLeft, TermUid termUidRight) override; // {{{2 literal vectors LitVecUid litvec() override; LitVecUid litvec(LitVecUid uid, LitUid literalUid) override; // {{{2 conditional literal vectors CondLitVecUid condlitvec() override; CondLitVecUid condlitvec(CondLitVecUid uid, LitUid lit, LitVecUid litvec) override; // {{{2 body aggregate elements BdAggrElemVecUid bodyaggrelemvec() override; BdAggrElemVecUid bodyaggrelemvec(BdAggrElemVecUid uid, TermVecUid termvec, LitVecUid litvec) override; // {{{2 head aggregate elements HdAggrElemVecUid headaggrelemvec() override; HdAggrElemVecUid headaggrelemvec(HdAggrElemVecUid uid, TermVecUid termvec, LitUid lit, LitVecUid litvec) override; // {{{2 bounds BoundVecUid boundvec() override; BoundVecUid boundvec(BoundVecUid uid, Relation rel, TermUid term) override; // {{{2 heads HdLitUid headlit(LitUid lit) override; HdLitUid headaggr(Location const &loc, TheoryAtomUid atom) override; HdLitUid headaggr(Location const &loc, AggregateFunction fun, BoundVecUid bounds, HdAggrElemVecUid headaggrelemvec) override; HdLitUid headaggr(Location const &loc, AggregateFunction fun, BoundVecUid bounds, CondLitVecUid headaggrelemvec) override; HdLitUid disjunction(Location const &loc, CondLitVecUid condlitvec) override; // {{{2 bodies BdLitVecUid body() override; BdLitVecUid bodylit(BdLitVecUid body, LitUid bodylit) override; BdLitVecUid bodyaggr(BdLitVecUid body, Location const &loc, NAF naf, TheoryAtomUid atom) override; BdLitVecUid bodyaggr(BdLitVecUid body, Location const &loc, NAF naf, AggregateFunction fun, BoundVecUid bounds, BdAggrElemVecUid bodyaggrelemvec) override; BdLitVecUid bodyaggr(BdLitVecUid body, Location const &loc, NAF naf, AggregateFunction fun, BoundVecUid bounds, CondLitVecUid bodyaggrelemvec) override; BdLitVecUid conjunction(BdLitVecUid body, Location const &loc, LitUid head, LitVecUid litvec) override; BdLitVecUid disjoint(BdLitVecUid body, Location const &loc, NAF naf, CSPElemVecUid elem) override; // {{{2 csp constraint elements CSPElemVecUid cspelemvec() override; CSPElemVecUid cspelemvec(CSPElemVecUid uid, Location const &loc, TermVecUid termvec, CSPAddTermUid addterm, LitVecUid litvec) override; // {{{2 statements void rule(Location const &loc, HdLitUid head) override; void rule(Location const &loc, HdLitUid head, BdLitVecUid body) override; void define(Location const &loc, String name, TermUid value, bool defaultDef, Logger &log) override; void optimize(Location const &loc, TermUid weight, TermUid priority, TermVecUid cond, BdLitVecUid body) override; void showsig(Location const &loc, Sig sig, bool csp) override; void defined(Location const &loc, Sig) override; void show(Location const &loc, TermUid t, BdLitVecUid body, bool csp) override; void python(Location const &loc, String code) override; void lua(Location const &loc, String code) override; void block(Location const &loc, String name, IdVecUid args) override; void external(Location const &loc, TermUid head, BdLitVecUid body, TermUid type) override; void edge(Location const &loc, TermVecVecUid edges, BdLitVecUid body) override; void heuristic(Location const &loc, TermUid termUid, BdLitVecUid body, TermUid a, TermUid b, TermUid mod) override; void project(Location const &loc, TermUid termUid, BdLitVecUid body) override; void project(Location const &loc, Sig sig) override; // }}}2 // {{{2 theory atoms TheoryTermUid theorytermset(Location const &loc, TheoryOptermVecUid args) override; TheoryTermUid theoryoptermlist(Location const &loc, TheoryOptermVecUid args) override; TheoryTermUid theorytermopterm(Location const &loc, TheoryOptermUid opterm) override; TheoryTermUid theorytermtuple(Location const &loc, TheoryOptermVecUid args) override; TheoryTermUid theorytermfun(Location const &loc, String name, TheoryOptermVecUid args) override; TheoryTermUid theorytermvalue(Location const &loc, Symbol val) override; TheoryTermUid theorytermvar(Location const &loc, String var) override; TheoryOptermUid theoryopterm(TheoryOpVecUid ops, TheoryTermUid term) override; TheoryOptermUid theoryopterm(TheoryOptermUid opterm, TheoryOpVecUid ops, TheoryTermUid term) override; TheoryOpVecUid theoryops() override; TheoryOpVecUid theoryops(TheoryOpVecUid ops, String op) override; TheoryOptermVecUid theoryopterms() override; TheoryOptermVecUid theoryopterms(TheoryOptermVecUid opterms, Location const &loc, TheoryOptermUid opterm) override; TheoryOptermVecUid theoryopterms(Location const &loc, TheoryOptermUid opterm, TheoryOptermVecUid opterms) override; TheoryElemVecUid theoryelems() override; TheoryElemVecUid theoryelems(TheoryElemVecUid elems, TheoryOptermVecUid opterms, LitVecUid cond) override; TheoryAtomUid theoryatom(TermUid term, TheoryElemVecUid elems) override; TheoryAtomUid theoryatom(TermUid term, TheoryElemVecUid elems, String op, Location const &loc, TheoryOptermUid opterm) override; // {{{2 theory definitions TheoryOpDefUid theoryopdef(Location const &loc, String op, unsigned priority, TheoryOperatorType type) override; TheoryOpDefVecUid theoryopdefs() override; TheoryOpDefVecUid theoryopdefs(TheoryOpDefVecUid defs, TheoryOpDefUid def) override; TheoryTermDefUid theorytermdef(Location const &loc, String name, TheoryOpDefVecUid defs, Logger &log) override; TheoryAtomDefUid theoryatomdef(Location const &loc, String name, unsigned arity, String termDef, TheoryAtomType type) override; TheoryAtomDefUid theoryatomdef(Location const &loc, String name, unsigned arity, String termDef, TheoryAtomType type, TheoryOpVecUid ops, String guardDef) override; TheoryDefVecUid theorydefs() override; TheoryDefVecUid theorydefs(TheoryDefVecUid defs, TheoryTermDefUid def) override; TheoryDefVecUid theorydefs(TheoryDefVecUid defs, TheoryAtomDefUid def) override; void theorydef(Location const &loc, String name, TheoryDefVecUid defs, Logger &log) override; // }}}2 virtual ~NongroundProgramBuilder(); private: using Terms = Indexed<UTerm, TermUid>; using TermVecs = Indexed<UTermVec, TermVecUid>; using TermVecVecs = Indexed<UTermVecVec, TermVecVecUid>; using IdVecs = Indexed<IdVec, IdVecUid>; using Lits = Indexed<ULit, LitUid>; using LitVecs = Indexed<ULitVec, LitVecUid>; using BodyAggrElemVecs = Indexed<BodyAggrElemVec, BdAggrElemVecUid>; using CondLitVecs = Indexed<CondLitVec, CondLitVecUid>; using HeadAggrElemVecs = Indexed<HeadAggrElemVec, HdAggrElemVecUid>; using Bodies = Indexed<UBodyAggrVec, BdLitVecUid>; using Heads = Indexed<UHeadAggr, HdLitUid>; using CSPLits = Indexed<UCSPLit, CSPLitUid>; using CSPAddTerms = Indexed<CSPAddTerm, CSPAddTermUid>; using CSPMulTerms = Indexed<CSPMulTerm, CSPMulTermUid>; using CSPElems = Indexed<CSPElemVec, CSPElemVecUid>; using Statements = std::vector<UStm>; using Bounds = Indexed<BoundVec, BoundVecUid>; using VarVals = std::unordered_map<String, Term::SVal>; using TheoryOpVecs = Indexed<std::vector<String>, TheoryOpVecUid>; using TheoryTerms = Indexed<Output::UTheoryTerm, TheoryTermUid>; using RawTheoryTerms = Indexed<Output::RawTheoryTerm, TheoryOptermUid>; using RawTheoryTermVecs = Indexed<std::vector<Output::UTheoryTerm>, TheoryOptermVecUid>; using TheoryElementVecs = Indexed<std::vector<TheoryElement>, TheoryElemVecUid>; using TheoryAtoms = Indexed<TheoryAtom, TheoryAtomUid>; using TheoryOpDefs = Indexed<TheoryOpDef, TheoryOpDefUid>; using TheoryOpDefVecs = Indexed<std::vector<TheoryOpDef>, TheoryOpDefVecUid>; using TheoryTermDefs = Indexed<TheoryTermDef, TheoryTermDefUid>; using TheoryAtomDefs = Indexed<TheoryAtomDef, TheoryAtomDefUid>; using TheoryDefVecs = Indexed<std::pair<std::vector<TheoryTermDef>, std::vector<TheoryAtomDef>>, TheoryDefVecUid>; Terms terms_; TermVecs termvecs_; TermVecVecs termvecvecs_; IdVecs idvecs_; Lits lits_; LitVecs litvecs_; BodyAggrElemVecs bodyaggrelemvecs_; HeadAggrElemVecs headaggrelemvecs_; CondLitVecs condlitvecs_; Bounds bounds_; Bodies bodies_; Heads heads_; VarVals vals_; CSPLits csplits_; CSPAddTerms cspaddterms_; CSPMulTerms cspmulterms_; CSPElems cspelems_; TheoryOpVecs theoryOpVecs_; TheoryTerms theoryTerms_; RawTheoryTerms theoryOpterms_; RawTheoryTermVecs theoryOptermVecs_; TheoryElementVecs theoryElems_; TheoryAtoms theoryAtoms_; TheoryOpDefs theoryOpDefs_; TheoryOpDefVecs theoryOpDefVecs_; TheoryTermDefs theoryTermDefs_; TheoryAtomDefs theoryAtomDefs_; TheoryDefVecs theoryDefVecs_; Context &context_; Program &prg_; Output::OutputBase &out; Defines &defs_; bool rewriteMinimize_; }; // }}}1 } } // namespace Input Gringo #endif // _GRINGO_PROGRAMBUILDER_HH
{ "pile_set_name": "Github" }
LineWidthMult = 0.4 MinLineWidthMult = 0.01 MeshesToSkip = flagtransform canopy BadParts = RadialDrill MKS.Drill.02 MKS.Drill.03 dmFlexoTube Colors { Enabled { html = #00FF00FF } Active { html = #FFEB04FF } Inactive { html = #808080FF } Confirm { html = #00FF00FF } Open { html = #00FF00FF } Close { html = #FF0000FF } Good { html = #00FF00FF } Warning { html = #FFEB04FF } Danger { html = #FF0000FF } Selected1 { html = #00FFFFFF } Selected2 { html = #FF00FFFF } FractionGradient { Item { html = #FF0000FF } Item { html = #FFEB04FF } Item { html = #FFFFFF } Item { html = #00FF00FF } } } StylesConfig { } //:mode=c#:
{ "pile_set_name": "Github" }
/* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** ** $Id: util.c,v 1.46 2002/06/14 20:58:45 drh Exp $ */ #include "sqliteInt.h" #include <stdarg.h> #include <ctype.h> /* ** If malloc() ever fails, this global variable gets set to 1. ** This causes the library to abort and never again function. */ int sqlite_malloc_failed = 0; /* ** If MEMORY_DEBUG is defined, then use versions of malloc() and ** free() that track memory usage and check for buffer overruns. */ #ifdef MEMORY_DEBUG /* ** For keeping track of the number of mallocs and frees. This ** is used to check for memory leaks. */ int sqlite_nMalloc; /* Number of sqliteMalloc() calls */ int sqlite_nFree; /* Number of sqliteFree() calls */ int sqlite_iMallocFail; /* Fail sqliteMalloc() after this many calls */ /* ** Allocate new memory and set it to zero. Return NULL if ** no memory is available. */ void *sqliteMalloc_(int n, char *zFile, int line){ void *p; int *pi; int k; if( sqlite_iMallocFail>=0 ){ sqlite_iMallocFail--; if( sqlite_iMallocFail==0 ){ sqlite_malloc_failed++; #if MEMORY_DEBUG>1 fprintf(stderr,"**** failed to allocate %d bytes at %s:%d\n", n, zFile,line); #endif sqlite_iMallocFail--; return 0; } } if( n==0 ) return 0; k = (n+sizeof(int)-1)/sizeof(int); pi = malloc( (3+k)*sizeof(int)); if( pi==0 ){ sqlite_malloc_failed++; return 0; } sqlite_nMalloc++; pi[0] = 0xdead1122; pi[1] = n; pi[k+2] = 0xdead3344; p = &pi[2]; memset(p, 0, n); #if MEMORY_DEBUG>1 fprintf(stderr,"malloc %d bytes at 0x%x from %s:%d\n", n, (int)p, zFile,line); #endif return p; } /* ** Free memory previously obtained from sqliteMalloc() */ void sqliteFree_(void *p, char *zFile, int line){ if( p ){ int *pi, k, n; pi = p; pi -= 2; sqlite_nFree++; if( pi[0]!=0xdead1122 ){ fprintf(stderr,"Low-end memory corruption at 0x%x\n", (int)p); return; } n = pi[1]; k = (n+sizeof(int)-1)/sizeof(int); if( pi[k+2]!=0xdead3344 ){ fprintf(stderr,"High-end memory corruption at 0x%x\n", (int)p); return; } memset(pi, 0xff, (k+3)*sizeof(int)); #if MEMORY_DEBUG>1 fprintf(stderr,"free %d bytes at 0x%x from %s:%d\n", n, (int)p, zFile,line); #endif free(pi); } } /* ** Resize a prior allocation. If p==0, then this routine ** works just like sqliteMalloc(). If n==0, then this routine ** works just like sqliteFree(). */ void *sqliteRealloc_(void *oldP, int n, char *zFile, int line){ int *oldPi, *pi, k, oldN, oldK; void *p; if( oldP==0 ){ return sqliteMalloc_(n,zFile,line); } if( n==0 ){ sqliteFree_(oldP,zFile,line); return 0; } oldPi = oldP; oldPi -= 2; if( oldPi[0]!=0xdead1122 ){ fprintf(stderr,"Low-end memory corruption in realloc at 0x%x\n", (int)p); return 0; } oldN = oldPi[1]; oldK = (oldN+sizeof(int)-1)/sizeof(int); if( oldPi[oldK+2]!=0xdead3344 ){ fprintf(stderr,"High-end memory corruption in realloc at 0x%x\n", (int)p); return 0; } k = (n + sizeof(int) - 1)/sizeof(int); pi = malloc( (k+3)*sizeof(int) ); if( pi==0 ){ sqlite_malloc_failed++; return 0; } pi[0] = 0xdead1122; pi[1] = n; pi[k+2] = 0xdead3344; p = &pi[2]; memcpy(p, oldP, n>oldN ? oldN : n); if( n>oldN ){ memset(&((char*)p)[oldN], 0, n-oldN); } memset(oldPi, 0, (oldK+3)*sizeof(int)); free(oldPi); #if MEMORY_DEBUG>1 fprintf(stderr,"realloc %d to %d bytes at 0x%x to 0x%x at %s:%d\n", oldN, n, (int)oldP, (int)p, zFile, line); #endif return p; } /* ** Make a duplicate of a string into memory obtained from malloc() ** Free the original string using sqliteFree(). ** ** This routine is called on all strings that are passed outside of ** the SQLite library. That way clients can free the string using free() ** rather than having to call sqliteFree(). */ void sqliteStrRealloc(char **pz){ char *zNew; if( pz==0 || *pz==0 ) return; zNew = malloc( strlen(*pz) + 1 ); if( zNew==0 ){ sqlite_malloc_failed++; sqliteFree(*pz); *pz = 0; } strcpy(zNew, *pz); sqliteFree(*pz); *pz = zNew; } /* ** Make a copy of a string in memory obtained from sqliteMalloc() */ char *sqliteStrDup_(const char *z, char *zFile, int line){ char *zNew; if( z==0 ) return 0; zNew = sqliteMalloc_(strlen(z)+1, zFile, line); if( zNew ) strcpy(zNew, z); return zNew; } char *sqliteStrNDup_(const char *z, int n, char *zFile, int line){ char *zNew; if( z==0 ) return 0; zNew = sqliteMalloc_(n+1, zFile, line); if( zNew ){ memcpy(zNew, z, n); zNew[n] = 0; } return zNew; } #endif /* MEMORY_DEBUG */ /* ** The following versions of malloc() and free() are for use in a ** normal build. */ #if !defined(MEMORY_DEBUG) /* ** Allocate new memory and set it to zero. Return NULL if ** no memory is available. */ void *sqliteMalloc(int n){ void *p = malloc(n); if( p==0 ){ sqlite_malloc_failed++; return 0; } memset(p, 0, n); return p; } /* ** Free memory previously obtained from sqliteMalloc() */ void sqliteFree(void *p){ if( p ){ free(p); } } /* ** Resize a prior allocation. If p==0, then this routine ** works just like sqliteMalloc(). If n==0, then this routine ** works just like sqliteFree(). */ void *sqliteRealloc(void *p, int n){ void *p2; if( p==0 ){ return sqliteMalloc(n); } if( n==0 ){ sqliteFree(p); return 0; } p2 = realloc(p, n); if( p2==0 ){ sqlite_malloc_failed++; } return p2; } /* ** Make a copy of a string in memory obtained from sqliteMalloc() */ char *sqliteStrDup(const char *z){ char *zNew; if( z==0 ) return 0; zNew = sqliteMalloc(strlen(z)+1); if( zNew ) strcpy(zNew, z); return zNew; } char *sqliteStrNDup(const char *z, int n){ char *zNew; if( z==0 ) return 0; zNew = sqliteMalloc(n+1); if( zNew ){ memcpy(zNew, z, n); zNew[n] = 0; } return zNew; } #endif /* !defined(MEMORY_DEBUG) */ /* ** Create a string from the 2nd and subsequent arguments (up to the ** first NULL argument), store the string in memory obtained from ** sqliteMalloc() and make the pointer indicated by the 1st argument ** point to that string. */ void sqliteSetString(char **pz, const char *zFirst, ...){ va_list ap; int nByte; const char *z; char *zResult; if( pz==0 ) return; nByte = strlen(zFirst) + 1; va_start(ap, zFirst); while( (z = va_arg(ap, const char*))!=0 ){ nByte += strlen(z); } va_end(ap); sqliteFree(*pz); *pz = zResult = sqliteMalloc( nByte ); if( zResult==0 ){ return; } strcpy(zResult, zFirst); zResult += strlen(zResult); va_start(ap, zFirst); while( (z = va_arg(ap, const char*))!=0 ){ strcpy(zResult, z); zResult += strlen(zResult); } va_end(ap); #ifdef MEMORY_DEBUG #if MEMORY_DEBUG>1 fprintf(stderr,"string at 0x%x is %s\n", (int)*pz, *pz); #endif #endif } /* ** Works like sqliteSetString, but each string is now followed by ** a length integer which specifies how much of the source string ** to copy (in bytes). -1 means use the whole string. */ void sqliteSetNString(char **pz, ...){ va_list ap; int nByte; const char *z; char *zResult; int n; if( pz==0 ) return; nByte = 0; va_start(ap, pz); while( (z = va_arg(ap, const char*))!=0 ){ n = va_arg(ap, int); if( n<=0 ) n = strlen(z); nByte += n; } va_end(ap); sqliteFree(*pz); *pz = zResult = sqliteMalloc( nByte + 1 ); if( zResult==0 ) return; va_start(ap, pz); while( (z = va_arg(ap, const char*))!=0 ){ n = va_arg(ap, int); if( n<=0 ) n = strlen(z); strncpy(zResult, z, n); zResult += n; } *zResult = 0; #ifdef MEMORY_DEBUG #if MEMORY_DEBUG>1 fprintf(stderr,"string at 0x%x is %s\n", (int)*pz, *pz); #endif #endif va_end(ap); } /* ** Convert an SQL-style quoted string into a normal string by removing ** the quote characters. The conversion is done in-place. If the ** input does not begin with a quote character, then this routine ** is a no-op. ** ** 2002-Feb-14: This routine is extended to remove MS-Access style ** brackets from around identifers. For example: "[a-b-c]" becomes ** "a-b-c". */ void sqliteDequote(char *z){ int quote; int i, j; if( z==0 ) return; quote = z[0]; switch( quote ){ case '\'': break; case '"': break; case '[': quote = ']'; break; default: return; } for(i=1, j=0; z[i]; i++){ if( z[i]==quote ){ if( z[i+1]==quote ){ z[j++] = quote; i++; }else{ z[j++] = 0; break; } }else{ z[j++] = z[i]; } } } /* An array to map all upper-case characters into their corresponding ** lower-case character. */ static unsigned char UpperToLower[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103, 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107, 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125, 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161, 162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179, 180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197, 198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215, 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233, 234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251, 252,253,254,255 }; /* ** This function computes a hash on the name of a keyword. ** Case is not significant. */ int sqliteHashNoCase(const char *z, int n){ int h = 0; if( n<=0 ) n = strlen(z); while( n > 0 ){ h = (h<<3) ^ h ^ UpperToLower[(unsigned char)*z++]; n--; } if( h<0 ) h = -h; return h; } /* ** Some systems have stricmp(). Others have strcasecmp(). Because ** there is no consistency, we will define our own. */ int sqliteStrICmp(const char *zLeft, const char *zRight){ register unsigned char *a, *b; a = (unsigned char *)zLeft; b = (unsigned char *)zRight; while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } return *a - *b; } int sqliteStrNICmp(const char *zLeft, const char *zRight, int N){ register unsigned char *a, *b; a = (unsigned char *)zLeft; b = (unsigned char *)zRight; while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } return N<0 ? 0 : *a - *b; } /* ** The sortStrCmp() function below is used to order elements according ** to the ORDER BY clause of a SELECT. The sort order is a little different ** from what one might expect. This note attempts to describe what is ** going on. ** ** We want the main string comparision function used for sorting to ** sort both numbers and alphanumeric words into the correct sequence. ** The same routine should do both without prior knowledge of which ** type of text the input represents. It should even work for strings ** which are a mixture of text and numbers. (It does not work for ** numeric substrings in exponential notation, however.) ** ** To accomplish this, we keep track of a state number while scanning ** the two strings. The states are as follows: ** ** 1 Beginning of word ** 2 Arbitrary text ** 3 Integer ** 4 Negative integer ** 5 Real number ** 6 Negative real ** ** The scan begins in state 1, beginning of word. Transitions to other ** states are determined by characters seen, as shown in the following ** chart: ** ** Current State Character Seen New State ** -------------------- -------------- ------------------- ** 0 Beginning of word "-" 3 Negative integer ** digit 2 Integer ** space 0 Beginning of word ** otherwise 1 Arbitrary text ** ** 1 Arbitrary text space 0 Beginning of word ** digit 2 Integer ** otherwise 1 Arbitrary text ** ** 2 Integer space 0 Beginning of word ** "." 4 Real number ** digit 2 Integer ** otherwise 1 Arbitrary text ** ** 3 Negative integer space 0 Beginning of word ** "." 5 Negative Real num ** digit 3 Negative integer ** otherwise 1 Arbitrary text ** ** 4 Real number space 0 Beginning of word ** digit 4 Real number ** otherwise 1 Arbitrary text ** ** 5 Negative real num space 0 Beginning of word ** digit 5 Negative real num ** otherwise 1 Arbitrary text ** ** To implement this state machine, we first classify each character ** into on of the following categories: ** ** 0 Text ** 1 Space ** 2 Digit ** 3 "-" ** 4 "." ** ** Given an arbitrary character, the array charClass[] maps that character ** into one of the atove categories. */ static const unsigned char charClass[] = { /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ /* 0x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, /* 1x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, /* 3x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, /* 4x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 5x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 7x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 8x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Ax */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Bx */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Cx */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Dx */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Ex */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Fx */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #define N_CHAR_CLASS 5 /* ** Given the current state number (0 thru 5), this array figures ** the new state number given the character class. */ static const unsigned char stateMachine[] = { /* Text, Space, Digit, "-", "." */ 1, 0, 2, 3, 1, /* State 0: Beginning of word */ 1, 0, 2, 1, 1, /* State 1: Arbitrary text */ 1, 0, 2, 1, 4, /* State 2: Integer */ 1, 0, 3, 1, 5, /* State 3: Negative integer */ 1, 0, 4, 1, 1, /* State 4: Real number */ 1, 0, 5, 1, 1, /* State 5: Negative real num */ }; /* This routine does a comparison of two strings. Case is used only ** if useCase!=0. Numeric substrings compare in numerical order for the ** most part but this routine does not understand exponential notation. */ static int sortStrCmp(const char *atext, const char *btext, int useCase){ register unsigned char *a, *b, *map, ca, cb; int result; register int cclass = 0; a = (unsigned char *)atext; b = (unsigned char *)btext; if( useCase ){ do{ if( (ca= *a++)!=(cb= *b++) ) break; cclass = stateMachine[cclass*N_CHAR_CLASS + charClass[ca]]; }while( ca!=0 ); }else{ map = UpperToLower; do{ if( (ca=map[*a++])!=(cb=map[*b++]) ) break; cclass = stateMachine[cclass*N_CHAR_CLASS + charClass[ca]]; }while( ca!=0 ); if( ca>='[' && ca<='`' ) cb = b[-1]; if( cb>='[' && cb<='`' ) ca = a[-1]; } switch( cclass ){ case 0: case 1: { if( isdigit(ca) && isdigit(cb) ){ cclass = 2; } break; } default: { break; } } switch( cclass ){ case 2: case 3: { if( isdigit(ca) ){ if( isdigit(cb) ){ int acnt, bcnt; acnt = bcnt = 0; while( isdigit(*a++) ) acnt++; while( isdigit(*b++) ) bcnt++; result = acnt - bcnt; if( result==0 ) result = ca-cb; }else{ result = 1; } }else if( isdigit(cb) ){ result = -1; }else if( ca=='.' ){ result = 1; }else if( cb=='.' ){ result = -1; }else{ result = ca - cb; cclass = 2; } if( cclass==3 ) result = -result; break; } case 0: case 1: case 4: { result = ca - cb; break; } case 5: { result = cb - ca; }; } return result; } /* ** Return TRUE if z is a pure numeric string. Return FALSE if the ** string contains any character which is not part of a number. ** ** Am empty string is considered numeric. */ static int sqliteIsNumber(const char *z){ if( *z=='-' || *z=='+' ) z++; if( !isdigit(*z) ){ return *z==0; } z++; while( isdigit(*z) ){ z++; } if( *z=='.' ){ z++; if( !isdigit(*z) ) return 0; while( isdigit(*z) ){ z++; } if( *z=='e' || *z=='E' ){ z++; if( *z=='+' || *z=='-' ) z++; if( !isdigit(*z) ) return 0; while( isdigit(*z) ){ z++; } } } return *z==0; } /* This comparison routine is what we use for comparison operations ** in an SQL expression. (Ex: name<'Hello' or value<5). ** ** Numerical strings compare in numerical order. Numerical strings ** are always less than non-numeric strings. Non-numeric strings ** compare in lexigraphical order (the same order as strcmp()). ** ** This is NOT the comparison function used for sorting. The sort ** order is a little bit different. See sqliteSortCompare below ** for additional information. */ int sqliteCompare(const char *atext, const char *btext){ int result; int isNumA, isNumB; if( atext==0 ){ return -1; }else if( btext==0 ){ return 1; } isNumA = sqliteIsNumber(atext); isNumB = sqliteIsNumber(btext); if( isNumA ){ if( !isNumB ){ result = -1; }else{ double rA, rB; rA = atof(atext); rB = atof(btext); if( rA<rB ){ result = -1; }else if( rA>rB ){ result = +1; }else{ result = 0; } } }else if( isNumB ){ result = +1; }else { result = strcmp(atext, btext); } return result; } /* ** This routine is used for sorting. Each key is a list of one or more ** null-terminated strings. The list is terminated by two nulls in ** a row. For example, the following text is key with three strings: ** ** +one\000-two\000+three\000\000 ** ** Both arguments will have the same number of strings. This routine ** returns negative, zero, or positive if the first argument is less ** than, equal to, or greater than the first. (Result is a-b). ** ** Every string begins with either a "+" or "-" character. If the ** character is "-" then the return value is negated. This is done ** to implement a sort in descending order. ** ** For sorting purposes, pur numeric strings (strings for which the ** isNum() function above returns TRUE) always compare less than strings ** that are not pure numerics. Within non-numeric strings, substrings ** of digits compare in numerical order. Finally, case is used only ** to break a tie. ** ** Note that the sort order imposed by the rules above is different ** from the ordering defined by the "<", "<=", ">", and ">=" operators ** of expressions. The operators compare non-numeric strings in ** lexigraphical order. This routine does the additional processing ** to sort substrings of digits into numerical order and to use case ** only as a tie-breaker. */ int sqliteSortCompare(const char *a, const char *b){ int len; int res = 0; int isNumA, isNumB; while( res==0 && *a && *b ){ if( a[1]==0 ){ res = -1; break; }else if( b[1]==0 ){ res = +1; break; } isNumA = sqliteIsNumber(&a[1]); isNumB = sqliteIsNumber(&b[1]); if( isNumA ){ double rA, rB; if( !isNumB ){ res = -1; break; } rA = atof(&a[1]); rB = atof(&b[1]); if( rA<rB ){ res = -1; break; } if( rA>rB ){ res = +1; break; } }else if( isNumB ){ res = +1; break; }else{ res = sortStrCmp(&a[1],&b[1],0); if( res==0 ){ res = sortStrCmp(&a[1],&b[1],1); } if( res!=0 ){ break; } } len = strlen(&a[1]) + 2; a += len; b += len; } if( *a=='-' ) res = -res; return res; } /* ** Some powers of 64. These constants are needed in the ** sqliteRealToSortable() routine below. */ #define _64e3 (64.0 * 64.0 * 64.0) #define _64e4 (64.0 * 64.0 * 64.0 * 64.0) #define _64e15 (_64e3 * _64e4 * _64e4 * _64e4) #define _64e16 (_64e4 * _64e4 * _64e4 * _64e4) #define _64e63 (_64e15 * _64e16 * _64e16 * _64e16) #define _64e64 (_64e16 * _64e16 * _64e16 * _64e16) /* ** The following procedure converts a double-precision floating point ** number into a string. The resulting string has the property that ** two such strings comparied using strcmp() or memcmp() will give the ** same results as a numeric comparison of the original floating point ** numbers. ** ** This routine is used to generate database keys from floating point ** numbers such that the keys sort in the same order as the original ** floating point numbers even though the keys are compared using ** memcmp(). ** ** The calling function should have allocated at least 14 characters ** of space for the buffer z[]. */ void sqliteRealToSortable(double r, char *z){ int neg; int exp; int cnt = 0; /* This array maps integers between 0 and 63 into base-64 digits. ** The digits must be chosen such at their ASCII codes are increasing. ** This means we can not use the traditional base-64 digit set. */ static const char zDigit[] = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "|~"; if( r<0.0 ){ neg = 1; r = -r; *z++ = '-'; } else { neg = 0; *z++ = '0'; } exp = 0; if( r==0.0 ){ exp = -1024; }else if( r<(0.5/64.0) ){ while( r < 0.5/_64e64 && exp > -961 ){ r *= _64e64; exp -= 64; } while( r < 0.5/_64e16 && exp > -1009 ){ r *= _64e16; exp -= 16; } while( r < 0.5/_64e4 && exp > -1021 ){ r *= _64e4; exp -= 4; } while( r < 0.5/64.0 && exp > -1024 ){ r *= 64.0; exp -= 1; } }else if( r>=0.5 ){ while( r >= 0.5*_64e63 && exp < 960 ){ r *= 1.0/_64e64; exp += 64; } while( r >= 0.5*_64e15 && exp < 1008 ){ r *= 1.0/_64e16; exp += 16; } while( r >= 0.5*_64e3 && exp < 1020 ){ r *= 1.0/_64e4; exp += 4; } while( r >= 0.5 && exp < 1023 ){ r *= 1.0/64.0; exp += 1; } } if( neg ){ exp = -exp; r = -r; } exp += 1024; r += 0.5; if( exp<0 ) return; if( exp>=2048 || r>=1.0 ){ strcpy(z, "~~~~~~~~~~~~"); return; } *z++ = zDigit[(exp>>6)&0x3f]; *z++ = zDigit[exp & 0x3f]; while( r>0.0 && cnt<10 ){ int digit; r *= 64.0; digit = (int)r; assert( digit>=0 && digit<64 ); *z++ = zDigit[digit & 0x3f]; r -= digit; cnt++; } *z = 0; } #ifdef SQLITE_UTF8 /* ** X is a pointer to the first byte of a UTF-8 character. Increment ** X so that it points to the next character. This only works right ** if X points to a well-formed UTF-8 string. */ #define sqliteNextChar(X) while( (0xc0&*++(X))==0x80 ){} #define sqliteCharVal(X) sqlite_utf8_to_int(X) #else /* !defined(SQLITE_UTF8) */ /* ** For iso8859 encoding, the next character is just the next byte. */ #define sqliteNextChar(X) (++(X)); #define sqliteCharVal(X) ((int)*(X)) #endif /* defined(SQLITE_UTF8) */ #ifdef SQLITE_UTF8 /* ** Convert the UTF-8 character to which z points into a 31-bit ** UCS character. This only works right if z points to a well-formed ** UTF-8 string. */ static int sqlite_utf8_to_int(const unsigned char *z){ int c; static const int initVal[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 254, 255, }; c = initVal[*(z++)]; while( (0xc0&*z)==0x80 ){ c = (c<<6) | (0x3f&*(z++)); } return c; } #endif /* ** Compare two UTF-8 strings for equality where the first string can ** potentially be a "glob" expression. Return true (1) if they ** are the same and false (0) if they are different. ** ** Globbing rules: ** ** '*' Matches any sequence of zero or more characters. ** ** '?' Matches exactly one character. ** ** [...] Matches one character from the enclosed list of ** characters. ** ** [^...] Matches one character not in the enclosed list. ** ** With the [...] and [^...] matching, a ']' character can be included ** in the list by making it the first character after '[' or '^'. A ** range of characters can be specified using '-'. Example: ** "[a-z]" matches any single lower-case letter. To match a '-', make ** it the last character in the list. ** ** This routine is usually quick, but can be N**2 in the worst case. ** ** Hints: to match '*' or '?', put them in "[]". Like this: ** ** abc[*]xyz Matches "abc*xyz" only */ int sqliteGlobCompare(const unsigned char *zPattern, const unsigned char *zString){ register int c; int invert; int seen; int c2; while( (c = *zPattern)!=0 ){ switch( c ){ case '*': while( (c=zPattern[1]) == '*' || c == '?' ){ if( c=='?' ){ if( *zString==0 ) return 0; sqliteNextChar(zString); } zPattern++; } if( c==0 ) return 1; c = UpperToLower[c]; if( c=='[' ){ while( *zString && sqliteGlobCompare(&zPattern[1],zString)==0 ){ sqliteNextChar(zString); } return *zString!=0; }else{ while( (c2 = *zString)!=0 ){ while( c2 != 0 && c2 != c ){ c2 = *++zString; } if( c2==0 ) return 0; if( sqliteGlobCompare(&zPattern[1],zString) ) return 1; sqliteNextChar(zString); } return 0; } case '?': { if( *zString==0 ) return 0; sqliteNextChar(zString); zPattern++; break; } case '[': { int prior_c = 0; seen = 0; invert = 0; c = sqliteCharVal(zString); if( c==0 ) return 0; c2 = *++zPattern; if( c2=='^' ){ invert = 1; c2 = *++zPattern; } if( c2==']' ){ if( c==']' ) seen = 1; c2 = *++zPattern; } while( (c2 = sqliteCharVal(zPattern))!=0 && c2!=']' ){ if( c2=='-' && zPattern[1]!=']' && zPattern[1]!=0 && prior_c>0 ){ zPattern++; c2 = sqliteCharVal(zPattern); if( c>=prior_c && c<=c2 ) seen = 1; prior_c = 0; }else if( c==c2 ){ seen = 1; prior_c = c2; }else{ prior_c = c2; } sqliteNextChar(zPattern); } if( c2==0 || (seen ^ invert)==0 ) return 0; sqliteNextChar(zString); zPattern++; break; } default: { if( c != *zString ) return 0; zPattern++; zString++; break; } } } return *zString==0; } /* ** Compare two UTF-8 strings for equality using the "LIKE" operator of ** SQL. The '%' character matches any sequence of 0 or more ** characters and '_' matches any single character. Case is ** not significant. ** ** This routine is just an adaptation of the sqliteGlobCompare() ** routine above. */ int sqliteLikeCompare(const unsigned char *zPattern, const unsigned char *zString){ register int c; int c2; while( (c = UpperToLower[*zPattern])!=0 ){ switch( c ){ case '%': { while( (c=zPattern[1]) == '%' || c == '_' ){ if( c=='_' ){ if( *zString==0 ) return 0; sqliteNextChar(zString); } zPattern++; } if( c==0 ) return 1; c = UpperToLower[c]; while( (c2=UpperToLower[*zString])!=0 ){ while( c2 != 0 && c2 != c ){ c2 = UpperToLower[*++zString]; } if( c2==0 ) return 0; if( sqliteLikeCompare(&zPattern[1],zString) ) return 1; sqliteNextChar(zString); } return 0; } case '_': { if( *zString==0 ) return 0; sqliteNextChar(zString); zPattern++; break; } default: { if( c != UpperToLower[*zString] ) return 0; zPattern++; zString++; break; } } } return *zString==0; } /* ** Change the sqlite.magic from SQLITE_MAGIC_OPEN to SQLITE_MAGIC_BUSY. ** Return an error (non-zero) if the magic was not SQLITE_MAGIC_OPEN ** when this routine is called. ** ** This routine is a attempt to detect if two threads use the ** same sqlite* pointer at the same time. There is a race ** condition so it is possible that the error is not detected. ** But usually the problem will be seen. The result will be an ** error which can be used to debug the application that is ** using SQLite incorrectly. */ int sqliteSafetyOn(sqlite *db){ if( db->magic==SQLITE_MAGIC_OPEN ){ db->magic = SQLITE_MAGIC_BUSY; return 0; }else{ db->magic = SQLITE_MAGIC_ERROR; db->flags |= SQLITE_Interrupt; return 1; } } /* ** Change the magic from SQLITE_MAGIC_BUSY to SQLITE_MAGIC_OPEN. ** Return an error (non-zero) if the magic was not SQLITE_MAGIC_BUSY ** when this routine is called. */ int sqliteSafetyOff(sqlite *db){ if( db->magic==SQLITE_MAGIC_BUSY ){ db->magic = SQLITE_MAGIC_OPEN; return 0; }else{ db->magic = SQLITE_MAGIC_ERROR; db->flags |= SQLITE_Interrupt; return 1; } } /* ** Check to make sure we are not currently executing an sqlite_exec(). ** If we are currently in an sqlite_exec(), return true and set ** sqlite.magic to SQLITE_MAGIC_ERROR. This will cause a complete ** shutdown of the database. ** ** This routine is used to try to detect when API routines are called ** at the wrong time or in the wrong sequence. */ int sqliteSafetyCheck(sqlite *db){ if( db->recursionDepth ){ db->magic = SQLITE_MAGIC_ERROR; return 1; } return 0; }
{ "pile_set_name": "Github" }
/* * Copyright 2016 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Ben Skeggs */ #include "priv.h" static void gp100_ltc_intr(struct nvkm_ltc *ltc) { struct nvkm_device *device = ltc->subdev.device; u32 mask; mask = nvkm_rd32(device, 0x0001c0); while (mask) { u32 s, c = __ffs(mask); for (s = 0; s < ltc->lts_nr; s++) gm107_ltc_intr_lts(ltc, c, s); mask &= ~(1 << c); } } static int gp100_ltc_oneinit(struct nvkm_ltc *ltc) { struct nvkm_device *device = ltc->subdev.device; ltc->ltc_nr = nvkm_rd32(device, 0x12006c); ltc->lts_nr = nvkm_rd32(device, 0x17e280) >> 28; /*XXX: tagram allocation - TBD */ return nvkm_mm_init(&ltc->tags, 0, 0, 1); } static void gp100_ltc_init(struct nvkm_ltc *ltc) { /*XXX: PMU LS call to setup tagram address */ } static const struct nvkm_ltc_func gp100_ltc = { .oneinit = gp100_ltc_oneinit, .init = gp100_ltc_init, .intr = gp100_ltc_intr, .cbc_clear = gm107_ltc_cbc_clear, .cbc_wait = gm107_ltc_cbc_wait, .zbc = 16, .zbc_clear_color = gm107_ltc_zbc_clear_color, .zbc_clear_depth = gm107_ltc_zbc_clear_depth, .invalidate = gf100_ltc_invalidate, .flush = gf100_ltc_flush, }; int gp100_ltc_new(struct nvkm_device *device, int index, struct nvkm_ltc **pltc) { return nvkm_ltc_new_(&gp100_ltc, device, index, pltc); }
{ "pile_set_name": "Github" }
Ext.define('AddressBook.controller.Application', { extend: 'Ext.app.Controller', config: { refs: { main: 'mainview', editButton: '#editButton', contacts: 'contacts', showContact: 'contact-show', editContact: 'contact-edit', saveButton: '#saveButton' }, control: { main: { push: 'onMainPush', pop: 'onMainPop' }, editButton: { tap: 'onContactEdit' }, contacts: { itemtap: 'onContactSelect' }, saveButton: { tap: 'onContactSave' }, editContact: { change: 'onContactChange' }, '#logoutButton': { tap: function() { this.getApplication().fireEvent('logout'); } } } }, onMainPush: function(view, item) { var editButton = this.getEditButton(); if (item.xtype == "contact-show") { this.getContacts().deselectAll(); this.showEditButton(); } else { this.hideEditButton(); } }, onMainPop: function(view, item) { if (item.xtype == "contact-edit") { this.showEditButton(); } else { this.hideEditButton(); } }, onContactSelect: function(list, index, node, record) { var editButton = this.getEditButton(); if (!this.showContact) { this.showContact = Ext.create('AddressBook.view.contact.Show'); } // Bind the record onto the show contact view this.showContact.setRecord(record); // Push the show contact view into the navigation view this.getMain().push(this.showContact); }, onContactEdit: function() { if (!this.editContact) { this.editContact = Ext.create('AddressBook.view.contact.Edit'); } // Bind the record onto the edit contact view this.editContact.setRecord(this.getShowContact().getRecord()); this.getMain().push(this.editContact); }, onContactChange: function() { this.showSaveButton(); }, onContactSave: function() { var record = this.getEditContact().saveRecord(); this.getShowContact().updateRecord(record); this.getMain().pop(); }, showEditButton: function() { var editButton = this.getEditButton(); if (!editButton.isHidden()) { return; } this.hideSaveButton(); editButton.show(); }, hideEditButton: function() { var editButton = this.getEditButton(); if (editButton.isHidden()) { return; } editButton.hide(); }, showSaveButton: function() { var saveButton = this.getSaveButton(); if (!saveButton.isHidden()) { return; } saveButton.show(); }, hideSaveButton: function() { var saveButton = this.getSaveButton(); if (saveButton.isHidden()) { return; } saveButton.hide(); } });
{ "pile_set_name": "Github" }
/* * Copyright 2015-2020 The OpenZipkin Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package zipkin2.collector.kafka; import org.apache.kafka.clients.admin.AdminClient; import org.apache.kafka.clients.admin.AdminClientConfig; import org.apache.kafka.clients.admin.NewTopic; import org.junit.AssumptionViolatedException; import org.junit.ClassRule; import org.junit.rules.ExternalResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testcontainers.containers.FixedHostPortGenericContainer; import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; import java.util.Collections; import java.util.Properties; import java.util.concurrent.ExecutionException; /** This should be used as a {@link ClassRule} as it takes a very long time to start-up. */ class KafkaCollectorRule extends ExternalResource { static final Logger LOGGER = LoggerFactory.getLogger(KafkaCollectorRule.class); static final String IMAGE = "openzipkin/zipkin-kafka:2.21.7"; static final int KAFKA_PORT = 19092; static final String KAFKA_BOOTSTRAP_SERVERS = "localhost:" + KAFKA_PORT; static final String KAFKA_TOPIC = "zipkin"; static final class KafkaContainer extends FixedHostPortGenericContainer<KafkaContainer> { KafkaContainer(String image) { super(image); withFixedExposedPort(KAFKA_PORT, KAFKA_PORT); this.waitStrategy = new LogMessageWaitStrategy().withRegEx(".*INFO \\[KafkaServer id=0\\] started.*"); } } KafkaContainer container; @Override protected void before() { if ("true".equals(System.getProperty("docker.skip"))) { throw new AssumptionViolatedException("Skipping startup of docker " + IMAGE); } try { LOGGER.info("Starting docker image " + IMAGE); container = new KafkaContainer(IMAGE); container.start(); } catch (Throwable e) { throw new AssumptionViolatedException( "Couldn't start docker image " + IMAGE + ": " + e.getMessage(), e); } prepareTopic(KAFKA_TOPIC, 1); } void prepareTopic(final String topic, final int partitions) { final Properties config = new Properties(); config.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, KAFKA_BOOTSTRAP_SERVERS); AdminClient adminClient = AdminClient.create(config); try { adminClient.createTopics( Collections.singletonList(new NewTopic(topic, partitions, (short) 1)) ).all().get(); } catch (InterruptedException | ExecutionException e) { throw new AssumptionViolatedException( "Topic cannot be created " + topic + ": " + e.getMessage(), e); } } KafkaCollector.Builder newCollectorBuilder() { return KafkaCollector.builder().bootstrapServers(KAFKA_BOOTSTRAP_SERVERS); } @Override protected void after() { if (container != null) { LOGGER.info("Stopping docker container " + container); container.stop(); } } }
{ "pile_set_name": "Github" }
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // 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. // AUTO-GENERATED CODE. DO NOT EDIT. package vision import ( "time" "cloud.google.com/go/internal/version" gax "github.com/googleapis/gax-go" "golang.org/x/net/context" "google.golang.org/api/option" "google.golang.org/api/transport" visionpb "google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" ) // ImageAnnotatorCallOptions contains the retry settings for each method of ImageAnnotatorClient. type ImageAnnotatorCallOptions struct { BatchAnnotateImages []gax.CallOption } func defaultImageAnnotatorClientOptions() []option.ClientOption { return []option.ClientOption{ option.WithEndpoint("vision.googleapis.com:443"), option.WithScopes(DefaultAuthScopes()...), } } func defaultImageAnnotatorCallOptions() *ImageAnnotatorCallOptions { retry := map[[2]string][]gax.CallOption{ {"default", "idempotent"}: { gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{ codes.DeadlineExceeded, codes.Unavailable, }, gax.Backoff{ Initial: 100 * time.Millisecond, Max: 60000 * time.Millisecond, Multiplier: 1.3, }) }), }, } return &ImageAnnotatorCallOptions{ BatchAnnotateImages: retry[[2]string{"default", "idempotent"}], } } // ImageAnnotatorClient is a client for interacting with Google Cloud Vision API. type ImageAnnotatorClient struct { // The connection to the service. conn *grpc.ClientConn // The gRPC API client. imageAnnotatorClient visionpb.ImageAnnotatorClient // The call options for this service. CallOptions *ImageAnnotatorCallOptions // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } // NewImageAnnotatorClient creates a new image annotator client. // // Service that performs Google Cloud Vision API detection tasks over client // images, such as face, landmark, logo, label, and text detection. The // ImageAnnotator service returns detected entities from the images. func NewImageAnnotatorClient(ctx context.Context, opts ...option.ClientOption) (*ImageAnnotatorClient, error) { conn, err := transport.DialGRPC(ctx, append(defaultImageAnnotatorClientOptions(), opts...)...) if err != nil { return nil, err } c := &ImageAnnotatorClient{ conn: conn, CallOptions: defaultImageAnnotatorCallOptions(), imageAnnotatorClient: visionpb.NewImageAnnotatorClient(conn), } c.setGoogleClientInfo() return c, nil } // Connection returns the client's connection to the API service. func (c *ImageAnnotatorClient) Connection() *grpc.ClientConn { return c.conn } // Close closes the connection to the API service. The user should invoke this when // the client is no longer required. func (c *ImageAnnotatorClient) Close() error { return c.conn.Close() } // setGoogleClientInfo sets the name and version of the application in // the `x-goog-api-client` header passed on each request. Intended for // use by Google-written clients. func (c *ImageAnnotatorClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", version.Go()}, keyval...) kv = append(kv, "gapic", version.Repo, "gax", gax.Version, "grpc", grpc.Version) c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) } // BatchAnnotateImages run image detection and annotation for a batch of images. func (c *ImageAnnotatorClient) BatchAnnotateImages(ctx context.Context, req *visionpb.BatchAnnotateImagesRequest, opts ...gax.CallOption) (*visionpb.BatchAnnotateImagesResponse, error) { ctx = insertMetadata(ctx, c.xGoogMetadata) opts = append(c.CallOptions.BatchAnnotateImages[0:len(c.CallOptions.BatchAnnotateImages):len(c.CallOptions.BatchAnnotateImages)], opts...) var resp *visionpb.BatchAnnotateImagesResponse err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error resp, err = c.imageAnnotatorClient.BatchAnnotateImages(ctx, req, settings.GRPC...) return err }, opts...) if err != nil { return nil, err } return resp, nil }
{ "pile_set_name": "Github" }
#include <gnuregex.h> #include <string> int main() { std::string str = "test0159"; regex_t re; int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB); if (ec != 0) { return ec; } return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0; }
{ "pile_set_name": "Github" }
import pygame EMPTY = 0 BLACK = 1 WHITE = 2 black_color = [0, 0, 0] white_color = [255, 255, 255] class RenjuBoard(object): def __init__(self): self._board = [[]] * 15 self.reset() def reset(self): for row in range(len(self._board)): self._board[row] = [EMPTY] * 15 def move(self, row, col, is_black): if self._board[row][col] == EMPTY: self._board[row][col] = BLACK if is_black else WHITE return True return False def draw(self, screen): for index in range(1, 16): pygame.draw.line(screen, black_color, [40, 40 * index], [600, 40 * index], 1) pygame.draw.line(screen, black_color, [40 * index, 40], [40 * index, 600], 1) pygame.draw.rect(screen, black_color, [36, 36, 568, 568], 4) pygame.draw.circle(screen, black_color, [320, 320], 5, 0) pygame.draw.circle(screen, black_color, [160, 160], 5, 0) pygame.draw.circle(screen, black_color, [480, 480], 5, 0) pygame.draw.circle(screen, black_color, [480, 160], 5, 0) pygame.draw.circle(screen, black_color, [160, 480], 5, 0) for row in range(len(self._board)): for col in range(len(self._board[row])): if self._board[row][col] != EMPTY: ccolor = black_color \ if self._board[row][col] == BLACK else white_color pos = [40 * (col + 1), 40 * (row + 1)] pygame.draw.circle(screen, ccolor, pos, 20, 0) def main(): board = RenjuBoard() is_black = True pygame.init() pygame.display.set_caption('五子棋') screen = pygame.display.set_mode([640, 640]) screen.fill([255, 255, 0]) board.draw(screen) pygame.display.flip() running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == pygame.KEYUP: pass elif event.type == pygame.MOUSEBUTTONDOWN\ and event.button == 1: x, y = event.pos row = round((y - 40) / 40) col = round((x - 40) / 40) if board.move(row, col, is_black): is_black = not is_black screen.fill([255, 255, 0]) board.draw(screen) pygame.display.flip() pygame.quit() if __name__ == '__main__': main()
{ "pile_set_name": "Github" }
#pragma once #include "Stdafx.h" #include "GameLogic.h" #include "GameClientView.h" #include "HistoryRecord.h" ////////////////////////////////////////////////////////////////////////// //游戏对话框 class CGameClientDlg : public CGameFrameDlg { //游戏变量 protected: WORD m_wLandUser; //挖坑用户 WORD m_wBombTime; //炸弹倍数 BYTE m_bCardCount[3]; //扑克数目 BYTE m_bHandCardCount; //扑克数目 BYTE m_bHandCardData[20]; //手上扑克 bool m_bAutoPlay ; //托管变量 //出牌变量 protected: BYTE m_bTurnOutType; //出牌类型 BYTE m_bTurnCardCount; //出牌数目 BYTE m_bTurnCardData[20]; //出牌列表 //配置变量 protected: bool m_bDeasilOrder; //出牌顺序 DWORD m_dwCardHSpace; //扑克象素 bool m_bAllowLookon; //允许旁观 //辅助变量 protected: WORD m_wMostUser; //最大玩家 WORD m_wCurrentUser; //当前用户 WORD m_wTimeOutCount; //超时次数 BYTE m_cbSortType; //排序类型 //辅助变量 protected: BYTE m_cbRemnantCardCount; //剩余数目 BYTE m_cbDispatchCardCount; //派发数目 BYTE m_cbDispatchCardData[20]; //派发扑克 //控件变量 protected: CGameLogic m_GameLogic; //游戏逻辑 CGameClientView m_GameClientView; //游戏视图 CHistoryScore m_HistoryScore; //历史积分 //函数定义 public: //构造函数 CGameClientDlg(); //析构函数 virtual ~CGameClientDlg(); //常规继承 private: //初始函数 virtual bool InitGameFrame(); //重置框架 virtual void ResetGameFrame(); //游戏设置 virtual void OnGameOptionSet(); //时间消息 virtual bool OnTimerMessage(WORD wChairID, UINT nElapse, UINT nTimerID); //旁观状态 virtual void OnLookonChanged(bool bLookonUser, const void * pBuffer, WORD wDataSize); //网络消息 virtual bool OnGameMessage(WORD wSubCmdID, const void * pBuffer, WORD wDataSize); //游戏场景 virtual bool OnGameSceneMessage(BYTE cbGameStatus, bool bLookonOther, const void * pBuffer, WORD wDataSize); //用户事件 public: //用户进入 virtual void __cdecl OnEventUserEnter(tagUserData * pUserData, WORD wChairID, bool bLookonUser); //用户离开 virtual void __cdecl OnEventUserLeave(tagUserData * pUserData, WORD wChairID, bool bLookonUser); //用户积分 virtual void __cdecl OnEventUserScore(tagUserData * pUserData, WORD wChairID, bool bLookonUser); //用户状态 virtual void __cdecl OnEventUserStatus(tagUserData * pUserData, WORD wChairID, bool bLookonUser); //消息处理 protected: //发送扑克 bool OnSubSendCard(const void * pBuffer, WORD wDataSize); //用户叫分 bool OnSubLandScore(const void * pBuffer, WORD wDataSize); //游戏开始 bool OnSubGameStart(const void * pBuffer, WORD wDataSize); //用户出牌 bool OnSubOutCard(const void * pBuffer, WORD wDataSize); //放弃出牌 bool OnSubPassCard(const void * pBuffer, WORD wDataSize); //游戏结束 bool OnSubGameEnd(const void * pBuffer, WORD wDataSize); //辅助函数 protected: //出牌判断 bool VerdictOutCard(); //自动出牌 bool AutomatismOutCard(); //停止发牌 bool DoncludeDispatchCard(); //派发扑克 bool DispatchUserCard(BYTE cbCardData[], BYTE cbCardCount); //消息映射 protected: //定时器消息 afx_msg void OnTimer(UINT nIDEvent); //开始消息 LRESULT OnStart(WPARAM wParam, LPARAM lParam); //出牌消息 LRESULT OnOutCard(WPARAM wParam, LPARAM lParam); //放弃出牌 LRESULT OnPassCard(WPARAM wParam, LPARAM lParam); //叫分消息 LRESULT OnLandScore(WPARAM wParam, LPARAM lParam); //出牌提示 LRESULT OnAutoOutCard(WPARAM wParam, LPARAM lParam); //右键扑克 LRESULT OnLeftHitCard(WPARAM wParam, LPARAM lParam); //左键扑克 LRESULT OnRightHitCard(WPARAM wParam, LPARAM lParam); //托管消息 LRESULT OnAutoPlay(WPARAM wParam, LPARAM lParam); //排列扑克 LRESULT OnMessageSortCard(WPARAM wParam, LPARAM lParam); DECLARE_MESSAGE_MAP() }; //////////////////////////////////////////////////////////////////////////
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: aab67730e686673459aca18e708b13b7 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
# example 7.19 of section 7.2.5 # (example 7.19 of section 7.2.5) : Linear and logistic regression : Using logistic regression : Reading the model summary and characterizing coefficients # Title: Calculating the pseudo R-squared pr2 <- 1-(resid.dev/null.dev) print(pr2) ## [1] 0.08734674 pr2.test <- 1-(resid.dev.test/null.dev.test) print(pr2.test) ## [1] 0.07760427
{ "pile_set_name": "Github" }
#!/bin/bash #============================================================= # https://github.com/P3TERX/Actions-OpenWrt # File name: diy-part1.sh # Description: OpenWrt DIY script part 1 (Before Update feeds) # Lisence: MIT # Author: P3TERX # Blog: https://p3terx.com #============================================================= # fw876/helloworld sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default # Lienol/openwrt-package sed -i '$a src-git lienol https://github.com/Lancenas/lienol-openwrt-package.git' feeds.conf.default
{ "pile_set_name": "Github" }
cd GoNorthServerSide/docfx docfx metadata docfx.json docfx build cd ../../ jsdoc ../../wwwroot/js -c GoNorthClientSide/jsdoc/jsdocConfig.json -d GoNorthClientSide/generatedDocumentation --verbose
{ "pile_set_name": "Github" }
# 10 inst placement legal (should not move anything) source "helpers.tcl" read_lef Nangate45/Nangate45.lef read_def pad04.def set_placement_padding -global -left 2 -right 2 detailed_placement check_placement set def_file [make_result_file pad04.def] write_def $def_file diff_file pad04.defok $def_file
{ "pile_set_name": "Github" }
spring.mvc.view.prefix: /WEB-INF/jsp/ spring.mvc.view.suffix: .jsp logging.level.org.springframework=INFO ################### DataSource Configuration ########################## spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/users_database spring.datasource.username=root spring.datasource.password=root ################### Hibernate Configuration ########################## spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true
{ "pile_set_name": "Github" }
cbuffer skinning_info : register(b2) { float4x4 bones[85]; }; float4 skin_pos(float4 pos, float4 weights, float4 indices) { int bone_indices[4]; bone_indices[0] = int(indices.x); bone_indices[1] = int(indices.y); bone_indices[2] = int(indices.z); bone_indices[3] = int(indices.w); float4 sp = float4( 0.0, 0.0, 0.0, 0.0 ); float final_weight = 1.0; for(int i = 3; i >= 0; --i) { sp += mul( pos, bones[bone_indices[i]] ) * weights[i]; final_weight -= weights[i]; } sp += mul( pos, bones[bone_indices[0]] ) * final_weight; sp.w = 1.0; return sp; } void skin_tbn(inout float3 t, inout float3 b, inout float3 n, float4 weights, float4 indices) { int bone_indices[4]; bone_indices[0] = int(indices.x); bone_indices[1] = int(indices.y); bone_indices[2] = int(indices.z); bone_indices[3] = int(indices.w); float3 rt = float3( 0.0, 0.0, 0.0); float3 rb = float3( 0.0, 0.0, 0.0); float3 rn = float3( 0.0, 0.0, 0.0); float final_weight = 1.0; for( int i = 0; i < 3; ++i) { float3x3 rot_mat = to_3x3(bones[bone_indices[i]]); rt += mul(t, rot_mat) * weights[i]; rb += mul(b, rot_mat) * weights[i]; rn += mul(n, rot_mat) * weights[i]; final_weight -= weights[i]; } float3x3 rot_mat = to_3x3(bones[bone_indices[3]]); rt += mul(t, rot_mat) * final_weight; rb += mul(b, rot_mat) * final_weight; rn += mul(n, rot_mat) * final_weight; t = rt; b = rb; n = rn; } void skin_pos_tbn(inout float4 pos, inout float3 t, inout float3 b, inout float3 n, float4 weights, float4 indices) { int bone_indices[4]; bone_indices[0] = int(indices.x); bone_indices[1] = int(indices.y); bone_indices[2] = int(indices.z); bone_indices[3] = int(indices.w); float3 rt = float3( 0.0, 0.0, 0.0); float3 rb = float3( 0.0, 0.0, 0.0); float3 rn = float3( 0.0, 0.0, 0.0); float4 sp = float4( 0.0, 0.0, 0.0, 0.0 ); float final_weight = 1.0; for( int i = 0; i < 3; ++i) { sp += mul( pos, bones[bone_indices[i]] ) * weights[i]; float3x3 rot_mat = to_3x3(bones[bone_indices[i]]); rt += mul(t, rot_mat) * weights[i]; rb += mul(b, rot_mat) * weights[i]; rn += mul(n, rot_mat) * weights[i]; final_weight -= weights[i]; } sp += mul( pos, bones[bone_indices[3]] ) * final_weight; float3x3 rot_mat = to_3x3(bones[bone_indices[3]]); rt += mul(t, rot_mat) * final_weight; rb += mul(b, rot_mat) * final_weight; rn += mul(n, rot_mat) * final_weight; t = rt; b = rb; n = rn; pos = sp; pos.w = 1.0; }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>CSS Grid Layout Test: parsing grid-template-rows with invalid values</title> <link rel="help" href="https://drafts.csswg.org/css-grid-1/#propdef-grid-template-rows"> <meta name="assert" content="grid-template-rows supports only the grammar 'none | <track-list> | <auto-track-list>'."> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/css/support/parsing-testcommon.js"></script> </head> <body> <script> test_invalid_value("grid-template-rows", '-10px'); test_invalid_value("grid-template-rows", '-20%'); test_invalid_value("grid-template-rows", '-5fr'); test_invalid_value("grid-template-rows", 'minmax(5fr, calc(0.5em + 10px))'); test_invalid_value("grid-template-rows", 'minmax(-10px, auto)'); test_invalid_value("grid-template-rows", 'minmax(-20%, max-content)'); test_invalid_value("grid-template-rows", 'minmax(min-content, -20%)'); test_invalid_value("grid-template-rows", 'fit-content(-10px)'); test_invalid_value("grid-template-rows", 'fit-content(-20%)'); test_invalid_value("grid-template-rows", '[one] 10px [two three] repeat(20%) [four five six] 3fr [seven]'); test_invalid_value("grid-template-rows", '[one]'); test_invalid_value("grid-template-rows", '[one] 10px [two] [three]'); test_invalid_value("grid-template-rows", 'repeat(auto-fill, -10px)'); test_invalid_value("grid-template-rows", 'repeat(auto-fill, 10px) repeat(auto-fit, 20%)'); test_invalid_value("grid-template-rows", '[auto] 1px'); </script> </body> </html>
{ "pile_set_name": "Github" }
<!doctype html> <html> <head> <title>CodeMirror: RPM spec mode</title> <link rel="stylesheet" href="../../../lib/codemirror.css"> <script src="../../../lib/codemirror.js"></script> <script src="spec.js"></script> <link rel="stylesheet" href="spec.css"> <link rel="stylesheet" href="../../../doc/docs.css"> <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> </head> <body> <h1>CodeMirror: RPM spec mode</h1> <div><textarea id="code" name="code"> # # spec file for package minidlna # # Copyright (c) 2011, Sascha Peilicke <[email protected]> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. Name: libupnp6 Version: 1.6.13 Release: 0 Summary: Portable Universal Plug and Play (UPnP) SDK Group: System/Libraries License: BSD-3-Clause Url: http://sourceforge.net/projects/pupnp/ Source0: http://downloads.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description The portable Universal Plug and Play (UPnP) SDK provides support for building UPnP-compliant control points, devices, and bridges on several operating systems. %package -n libupnp-devel Summary: Portable Universal Plug and Play (UPnP) SDK Group: Development/Libraries/C and C++ Provides: pkgconfig(libupnp) Requires: %{name} = %{version} %description -n libupnp-devel The portable Universal Plug and Play (UPnP) SDK provides support for building UPnP-compliant control points, devices, and bridges on several operating systems. %prep %setup -n libupnp-%{version} %build %configure --disable-static make %{?_smp_mflags} %install %makeinstall find %{buildroot} -type f -name '*.la' -exec rm -f {} ';' %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc ChangeLog NEWS README TODO %{_libdir}/libixml.so.* %{_libdir}/libthreadutil.so.* %{_libdir}/libupnp.so.* %files -n libupnp-devel %defattr(-,root,root,-) %{_libdir}/pkgconfig/libupnp.pc %{_libdir}/libixml.so %{_libdir}/libthreadutil.so %{_libdir}/libupnp.so %{_includedir}/upnp/ %changelog</textarea></div> <script> var editor = CodeMirror.fromTextArea(document.getElementById("code"), { mode: {name: "spec"}, lineNumbers: true, indentUnit: 4, matchBrackets: true }); </script> <p><strong>MIME types defined:</strong> <code>text/x-rpm-spec</code>.</p> </body> </html>
{ "pile_set_name": "Github" }
function tests = test_mpt_paramcost_1 tests = functiontests(localfunctions); function test1(dummy) B = [-1 1 1 1 0 0 0 0 0 0; 1 0 0 0 1 -1 1 0 0 0; 0 -1 0 0 0 0 0 1 -1 1; 0 0 -1 0 -1 1 0 -1 1 0 0 0 0 -1 0 0 -1 0 0 -1] c = [3.1 2.3 1.2 12.3 2.5 9.6 2.1 6.8 2.1 2.2]'; d = [4.2 7.4 14.7 9.7 1.0 3.1 5.1 2.2 5.9 6.7]'; b = [size(B,1)-1;-ones(4,1)]; t = sdpvar(1,1); x = sdpvar(10,1); F = (0 <= t <= 1) + (B*x == b) + (0 <= x <= 10) [SOL, DIAGNOSTIC,Z,HPWF,ZPWF] = solvemp(F,(t*c+(1-t)*d)'*x,sdpsettings('debug',1),t) assign(t,0.38); cost = value(HPWF); assert(abs(cost-43.8) <= 1e-3)
{ "pile_set_name": "Github" }
// // GlucoseEffectVelocity.swift // Loop // // Copyright © 2017 LoopKit Authors. All rights reserved. // import HealthKit import LoopKit extension GlucoseEffectVelocity: RawRepresentable { public typealias RawValue = [String: Any] static let unit = HKUnit.milligramsPerDeciliter.unitDivided(by: .minute()) public init?(rawValue: RawValue) { guard let startDate = rawValue["startDate"] as? Date, let doubleValue = rawValue["doubleValue"] as? Double else { return nil } self.init( startDate: startDate, endDate: rawValue["endDate"] as? Date ?? startDate, quantity: HKQuantity(unit: type(of: self).unit, doubleValue: doubleValue) ) } public var rawValue: RawValue { return [ "startDate": startDate, "endDate": endDate, "doubleValue": quantity.doubleValue(for: type(of: self).unit) ] } }
{ "pile_set_name": "Github" }
/* ***** BEGIN LICENSE BLOCK ***** * Distributed under the BSD license: * * Copyright (c) 2010, Ajax.org B.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. 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. * * ***** END LICENSE BLOCK ***** */ ace.define('ace/mode/cobol', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/cobol_highlight_rules', 'ace/range'], function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var Tokenizer = require("../tokenizer").Tokenizer; var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules; var Range = require("../range").Range; var Mode = function() { this.HighlightRules = CobolHighlightRules; }; oop.inherits(Mode, TextMode); (function() { this.lineCommentStart = "*"; this.$id = "ace/mode/cobol"; }).call(Mode.prototype); exports.Mode = Mode; }); ace.define('ace/mode/cobol_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var CobolHighlightRules = function() { var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" + "AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" + "ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" + "TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" + "UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" + "PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" + "CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" + "COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" + "RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" + "DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" + "ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" + "EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT"; var builtinConstants = ( "true|false|null" ); var builtinFunctions = ( "count|min|max|avg|sum|rank|now|coalesce|main" ); var keywordMapper = this.createKeywordMapper({ "support.function": builtinFunctions, "keyword": keywords, "constant.language": builtinConstants }, "identifier", true); this.$rules = { "start" : [ { token : "comment", regex : "\\*.*$" }, { token : "string", // " string regex : '".*?"' }, { token : "string", // ' string regex : "'.*?'" }, { token : "constant.numeric", // float regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { token : keywordMapper, regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { token : "keyword.operator", regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" }, { token : "paren.lparen", regex : "[\\(]" }, { token : "paren.rparen", regex : "[\\)]" }, { token : "text", regex : "\\s+" } ] }; }; oop.inherits(CobolHighlightRules, TextHighlightRules); exports.CobolHighlightRules = CobolHighlightRules; });
{ "pile_set_name": "Github" }
using System; namespace SpanJson.Shared.Models { public class UserTimeline : IGenericEquality<UserTimeline> { public DateTime? creation_date { get; set; } public PostType? post_type { get; set; } public UserTimelineType? timeline_type { get; set; } public int? user_id { get; set; } public int? post_id { get; set; } public int? comment_id { get; set; } public int? suggested_edit_id { get; set; } public int? badge_id { get; set; } public string title { get; set; } public string detail { get; set; } public string link { get; set; } public bool Equals(UserTimeline obj) { return badge_id.TrueEquals(obj.badge_id) && comment_id.TrueEquals(obj.comment_id) && creation_date.TrueEquals(obj.creation_date) && detail.TrueEqualsString(obj.detail) && link.TrueEqualsString(obj.link) && post_id.TrueEquals(obj.post_id) && post_type.TrueEquals(obj.post_type) && suggested_edit_id.TrueEquals(obj.suggested_edit_id) && timeline_type.TrueEquals(obj.timeline_type) && title.TrueEqualsString(obj.title) && user_id.TrueEquals(obj.user_id); } public bool EqualsDynamic(dynamic obj) { return badge_id.TrueEquals((int?) obj.badge_id) && comment_id.TrueEquals((int?) obj.comment_id) && creation_date.TrueEquals((DateTime?) obj.creation_date) && detail.TrueEqualsString((string) obj.detail) && link.TrueEqualsString((string) obj.link) && post_id.TrueEquals((int?) obj.post_id) && post_type.TrueEquals((PostType?) obj.post_type) && suggested_edit_id.TrueEquals((int?) obj.suggested_edit_id) && timeline_type.TrueEquals((UserTimelineType?) obj.timeline_type) && title.TrueEqualsString((string) obj.title) && user_id.TrueEquals((int?) obj.user_id); } } }
{ "pile_set_name": "Github" }
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <Version>1.2.0.1</Version> <PackageProjectUrl>https://github.com/q315523275/FamilyBucket</PackageProjectUrl> <Authors>FamilyBucket</Authors> <Description>全家桶-负载计算方法,包含随机、轮询、请求较少、hash</Description> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\..\Bucket.Core\Bucket.Core.csproj" /> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "../javascript/javascript", "../css/css", "../htmlmixed/htmlmixed"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("pug", function (config) { // token types var KEYWORD = 'keyword'; var DOCTYPE = 'meta'; var ID = 'builtin'; var CLASS = 'qualifier'; var ATTRS_NEST = { '{': '}', '(': ')', '[': ']' }; var jsMode = CodeMirror.getMode(config, 'javascript'); function State() { this.javaScriptLine = false; this.javaScriptLineExcludesColon = false; this.javaScriptArguments = false; this.javaScriptArgumentsDepth = 0; this.isInterpolating = false; this.interpolationNesting = 0; this.jsState = CodeMirror.startState(jsMode); this.restOfLine = ''; this.isIncludeFiltered = false; this.isEach = false; this.lastTag = ''; this.scriptType = ''; // Attributes Mode this.isAttrs = false; this.attrsNest = []; this.inAttributeName = true; this.attributeIsType = false; this.attrValue = ''; // Indented Mode this.indentOf = Infinity; this.indentToken = ''; this.innerMode = null; this.innerState = null; this.innerModeForLine = false; } /** * Safely copy a state * * @return {State} */ State.prototype.copy = function () { var res = new State(); res.javaScriptLine = this.javaScriptLine; res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon; res.javaScriptArguments = this.javaScriptArguments; res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth; res.isInterpolating = this.isInterpolating; res.interpolationNesting = this.interpolationNesting; res.jsState = CodeMirror.copyState(jsMode, this.jsState); res.innerMode = this.innerMode; if (this.innerMode && this.innerState) { res.innerState = CodeMirror.copyState(this.innerMode, this.innerState); } res.restOfLine = this.restOfLine; res.isIncludeFiltered = this.isIncludeFiltered; res.isEach = this.isEach; res.lastTag = this.lastTag; res.scriptType = this.scriptType; res.isAttrs = this.isAttrs; res.attrsNest = this.attrsNest.slice(); res.inAttributeName = this.inAttributeName; res.attributeIsType = this.attributeIsType; res.attrValue = this.attrValue; res.indentOf = this.indentOf; res.indentToken = this.indentToken; res.innerModeForLine = this.innerModeForLine; return res; }; function javaScript(stream, state) { if (stream.sol()) { // if javaScriptLine was set at end of line, ignore it state.javaScriptLine = false; state.javaScriptLineExcludesColon = false; } if (state.javaScriptLine) { if (state.javaScriptLineExcludesColon && stream.peek() === ':') { state.javaScriptLine = false; state.javaScriptLineExcludesColon = false; return; } var tok = jsMode.token(stream, state.jsState); if (stream.eol()) state.javaScriptLine = false; return tok || true; } } function javaScriptArguments(stream, state) { if (state.javaScriptArguments) { if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') { state.javaScriptArguments = false; return; } if (stream.peek() === '(') { state.javaScriptArgumentsDepth++; } else if (stream.peek() === ')') { state.javaScriptArgumentsDepth--; } if (state.javaScriptArgumentsDepth === 0) { state.javaScriptArguments = false; return; } var tok = jsMode.token(stream, state.jsState); return tok || true; } } function yieldStatement(stream) { if (stream.match(/^yield\b/)) { return 'keyword'; } } function doctype(stream) { if (stream.match(/^(?:doctype) *([^\n]+)?/)) { return DOCTYPE; } } function interpolation(stream, state) { if (stream.match('#{')) { state.isInterpolating = true; state.interpolationNesting = 0; return 'punctuation'; } } function interpolationContinued(stream, state) { if (state.isInterpolating) { if (stream.peek() === '}') { state.interpolationNesting--; if (state.interpolationNesting < 0) { stream.next(); state.isInterpolating = false; return 'punctuation'; } } else if (stream.peek() === '{') { state.interpolationNesting++; } return jsMode.token(stream, state.jsState) || true; } } function caseStatement(stream, state) { if (stream.match(/^case\b/)) { state.javaScriptLine = true; return KEYWORD; } } function when(stream, state) { if (stream.match(/^when\b/)) { state.javaScriptLine = true; state.javaScriptLineExcludesColon = true; return KEYWORD; } } function defaultStatement(stream) { if (stream.match(/^default\b/)) { return KEYWORD; } } function extendsStatement(stream, state) { if (stream.match(/^extends?\b/)) { state.restOfLine = 'string'; return KEYWORD; } } function append(stream, state) { if (stream.match(/^append\b/)) { state.restOfLine = 'variable'; return KEYWORD; } } function prepend(stream, state) { if (stream.match(/^prepend\b/)) { state.restOfLine = 'variable'; return KEYWORD; } } function block(stream, state) { if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) { state.restOfLine = 'variable'; return KEYWORD; } } function include(stream, state) { if (stream.match(/^include\b/)) { state.restOfLine = 'string'; return KEYWORD; } } function includeFiltered(stream, state) { if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) { state.isIncludeFiltered = true; return KEYWORD; } } function includeFilteredContinued(stream, state) { if (state.isIncludeFiltered) { var tok = filter(stream, state); state.isIncludeFiltered = false; state.restOfLine = 'string'; return tok; } } function mixin(stream, state) { if (stream.match(/^mixin\b/)) { state.javaScriptLine = true; return KEYWORD; } } function call(stream, state) { if (stream.match(/^\+([-\w]+)/)) { if (!stream.match(/^\( *[-\w]+ *=/, false)) { state.javaScriptArguments = true; state.javaScriptArgumentsDepth = 0; } return 'variable'; } if (stream.match(/^\+#{/, false)) { stream.next(); state.mixinCallAfter = true; return interpolation(stream, state); } } function callArguments(stream, state) { if (state.mixinCallAfter) { state.mixinCallAfter = false; if (!stream.match(/^\( *[-\w]+ *=/, false)) { state.javaScriptArguments = true; state.javaScriptArgumentsDepth = 0; } return true; } } function conditional(stream, state) { if (stream.match(/^(if|unless|else if|else)\b/)) { state.javaScriptLine = true; return KEYWORD; } } function each(stream, state) { if (stream.match(/^(- *)?(each|for)\b/)) { state.isEach = true; return KEYWORD; } } function eachContinued(stream, state) { if (state.isEach) { if (stream.match(/^ in\b/)) { state.javaScriptLine = true; state.isEach = false; return KEYWORD; } else if (stream.sol() || stream.eol()) { state.isEach = false; } else if (stream.next()) { while (!stream.match(/^ in\b/, false) && stream.next()); return 'variable'; } } } function whileStatement(stream, state) { if (stream.match(/^while\b/)) { state.javaScriptLine = true; return KEYWORD; } } function tag(stream, state) { var captures; if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) { state.lastTag = captures[1].toLowerCase(); if (state.lastTag === 'script') { state.scriptType = 'application/javascript'; } return 'tag'; } } function filter(stream, state) { if (stream.match(/^:([\w\-]+)/)) { var innerMode; if (config && config.innerModes) { innerMode = config.innerModes(stream.current().substring(1)); } if (!innerMode) { innerMode = stream.current().substring(1); } if (typeof innerMode === 'string') { innerMode = CodeMirror.getMode(config, innerMode); } setInnerMode(stream, state, innerMode); return 'atom'; } } function code(stream, state) { if (stream.match(/^(!?=|-)/)) { state.javaScriptLine = true; return 'punctuation'; } } function id(stream) { if (stream.match(/^#([\w-]+)/)) { return ID; } } function className(stream) { if (stream.match(/^\.([\w-]+)/)) { return CLASS; } } function attrs(stream, state) { if (stream.peek() == '(') { stream.next(); state.isAttrs = true; state.attrsNest = []; state.inAttributeName = true; state.attrValue = ''; state.attributeIsType = false; return 'punctuation'; } } function attrsContinued(stream, state) { if (state.isAttrs) { if (ATTRS_NEST[stream.peek()]) { state.attrsNest.push(ATTRS_NEST[stream.peek()]); } if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) { state.attrsNest.pop(); } else if (stream.eat(')')) { state.isAttrs = false; return 'punctuation'; } if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { if (stream.peek() === '=' || stream.peek() === '!') { state.inAttributeName = false; state.jsState = CodeMirror.startState(jsMode); if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') { state.attributeIsType = true; } else { state.attributeIsType = false; } } return 'attribute'; } var tok = jsMode.token(stream, state.jsState); if (state.attributeIsType && tok === 'string') { state.scriptType = stream.current().toString(); } if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) { try { Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, '')); state.inAttributeName = true; state.attrValue = ''; stream.backUp(stream.current().length); return attrsContinued(stream, state); } catch (ex) { //not the end of an attribute } } state.attrValue += stream.current(); return tok || true; } } function attributesBlock(stream, state) { if (stream.match(/^&attributes\b/)) { state.javaScriptArguments = true; state.javaScriptArgumentsDepth = 0; return 'keyword'; } } function indent(stream) { if (stream.sol() && stream.eatSpace()) { return 'indent'; } } function comment(stream, state) { if (stream.match(/^ *\/\/(-)?([^\n]*)/)) { state.indentOf = stream.indentation(); state.indentToken = 'comment'; return 'comment'; } } function colon(stream) { if (stream.match(/^: */)) { return 'colon'; } } function text(stream, state) { if (stream.match(/^(?:\| ?| )([^\n]+)/)) { return 'string'; } if (stream.match(/^(<[^\n]*)/, false)) { // html string setInnerMode(stream, state, 'htmlmixed'); state.innerModeForLine = true; return innerMode(stream, state, true); } } function dot(stream, state) { if (stream.eat('.')) { var innerMode = null; if (state.lastTag === 'script' && state.scriptType.toLowerCase().indexOf('javascript') != -1) { innerMode = state.scriptType.toLowerCase().replace(/"|'/g, ''); } else if (state.lastTag === 'style') { innerMode = 'css'; } setInnerMode(stream, state, innerMode); return 'dot'; } } function fail(stream) { stream.next(); return null; } function setInnerMode(stream, state, mode) { mode = CodeMirror.mimeModes[mode] || mode; mode = config.innerModes ? config.innerModes(mode) || mode : mode; mode = CodeMirror.mimeModes[mode] || mode; mode = CodeMirror.getMode(config, mode); state.indentOf = stream.indentation(); if (mode && mode.name !== 'null') { state.innerMode = mode; } else { state.indentToken = 'string'; } } function innerMode(stream, state, force) { if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { if (state.innerMode) { if (!state.innerState) { state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {}; } return stream.hideFirstChars(state.indentOf + 2, function () { return state.innerMode.token(stream, state.innerState) || true; }); } else { stream.skipToEnd(); return state.indentToken; } } else if (stream.sol()) { state.indentOf = Infinity; state.indentToken = null; state.innerMode = null; state.innerState = null; } } function restOfLine(stream, state) { if (stream.sol()) { // if restOfLine was set at end of line, ignore it state.restOfLine = ''; } if (state.restOfLine) { stream.skipToEnd(); var tok = state.restOfLine; state.restOfLine = ''; return tok; } } function startState() { return new State(); } function copyState(state) { return state.copy(); } /** * Get the next token in the stream * * @param {Stream} stream * @param {State} state */ function nextToken(stream, state) { var tok = innerMode(stream, state) || restOfLine(stream, state) || interpolationContinued(stream, state) || includeFilteredContinued(stream, state) || eachContinued(stream, state) || attrsContinued(stream, state) || javaScript(stream, state) || javaScriptArguments(stream, state) || callArguments(stream, state) || yieldStatement(stream, state) || doctype(stream, state) || interpolation(stream, state) || caseStatement(stream, state) || when(stream, state) || defaultStatement(stream, state) || extendsStatement(stream, state) || append(stream, state) || prepend(stream, state) || block(stream, state) || include(stream, state) || includeFiltered(stream, state) || mixin(stream, state) || call(stream, state) || conditional(stream, state) || each(stream, state) || whileStatement(stream, state) || tag(stream, state) || filter(stream, state) || code(stream, state) || id(stream, state) || className(stream, state) || attrs(stream, state) || attributesBlock(stream, state) || indent(stream, state) || text(stream, state) || comment(stream, state) || colon(stream, state) || dot(stream, state) || fail(stream, state); return tok === true ? null : tok; } return { startState: startState, copyState: copyState, token: nextToken }; }, 'javascript', 'css', 'htmlmixed'); CodeMirror.defineMIME('text/x-pug', 'pug'); CodeMirror.defineMIME('text/x-jade', 'pug'); });
{ "pile_set_name": "Github" }
<?php /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */ include_once("./Services/Object/classes/class.ilObjectAccess.php"); include_once 'Services/Conditions/interfaces/interface.ilConditionHandling.php'; /** * Class ilObjContentObjectAccess * * * @author Alex Killing <[email protected]> * @version $Id$ * * @ingroup ModulesScormAicc */ class ilObjSAHSLearningModuleAccess extends ilObjectAccess implements ilConditionHandling { /** * Get possible conditions operaditors */ public static function getConditionOperators() { include_once './Services/Conditions/classes/class.ilConditionHandler.php'; return array( ilConditionHandler::OPERATOR_FINISHED, ilConditionHandler::OPERATOR_FAILED ); } /** * check condition * @param type $a_svy_id * @param type $a_operator * @param type $a_value * @param type $a_usr_id * @return boolean */ public static function checkCondition($a_trigger_obj_id, $a_operator, $a_value, $a_usr_id) { switch ($a_operator) { case ilConditionHandler::OPERATOR_FAILED: include_once './Services/Tracking/classes/class.ilLPStatus.php'; return ilLPStatus::_lookupStatus($a_trigger_obj_id, $a_usr_id) == ilLPStatus::LP_STATUS_FAILED_NUM; break; case ilConditionHandler::OPERATOR_FINISHED: default: include_once './Services/Tracking/classes/class.ilLPStatus.php'; return ilLPStatus::_hasUserCompleted($a_trigger_obj_id, $a_usr_id); } return true; } /** * checks wether a user may invoke a command or not * (this method is called by ilAccessHandler::checkAccess) * * @param string $a_cmd command (not permission!) * @param string $a_permission permission * @param int $a_ref_id reference id * @param int $a_obj_id object id * @param int $a_user_id user id (if not provided, current user is taken) * * @return boolean true, if everything is ok */ public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "") //UK weg? { global $DIC; $ilUser = $DIC['ilUser']; $lng = $DIC['lng']; $rbacsystem = $DIC['rbacsystem']; $ilAccess = $DIC['ilAccess']; if ($a_user_id == "") { $a_user_id = $ilUser->getId(); } // switch ($a_cmd) // { // case "view": // if(!ilObjSAHSLearningModuleAccess::_lookupOnline($a_obj_id) // && !$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id)) // { // $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline")); // return false; // } // break; // } // switch ($a_permission) // { // case "visible": // if (!ilObjSAHSLearningModuleAccess::_lookupOnline($a_obj_id) && // (!$rbacsystem->checkAccessOfUser($a_user_id,'write', $a_ref_id))) // { // $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline")); // return false; // } // break; // } return true; } /** * get commands * * this method returns an array of all possible commands/permission combinations * * example: * $commands = array * ( * array("permission" => "read", "cmd" => "view", "lang_var" => "show"), * array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), * ); */ public static function _getCommands($a_obj_id = null) { $commands = array( array("permission" => "read", "cmd" => "view", "lang_var" => "show","default" => true), array("permission" => "write", "cmd" => "editContent", "lang_var" => "edit_content"), array("permission" => "write", "cmd" => "edit", "lang_var" => "settings") ); // #14866 if ($a_obj_id && ilObjSAHSLearningModuleAccess::_lookupOfflineModeAvailable($a_obj_id)) { $offlineMode = ilObjSAHSLearningModuleAccess::_lookupUserIsOfflineMode($a_obj_id); if ($offlineMode == false) { $commands[] = array("permission" => "read", "cmd" => "offlineModeStart", "lang_var" => "offline_mode"); } else { $commands[] = array("permission" => "read", "cmd" => "offlineModeStop", "lang_var" => "offline_mode"); $commands[0] = array("permission" => "read", "cmd" => "offlineModeView", "lang_var" => "show","default" => true); } } return $commands; } // // access relevant methods // /** * Lookup editable */ public static function _lookupEditable($a_obj_id) { global $DIC; $ilDB = $DIC['ilDB']; $set = $ilDB->queryF( 'SELECT * FROM sahs_lm WHERE id = %s', array('integer'), array($a_obj_id) ); $rec = $ilDB->fetchAssoc($set); return $rec["editable"]; } /** * check whether goto script will succeed */ public static function _checkGoto($a_target) { global $DIC; $ilAccess = $DIC['ilAccess']; $t_arr = explode("_", $a_target); if ($t_arr[0] != "sahs" || ((int) $t_arr[1]) <= 0) { return false; } if ($ilAccess->checkAccess("visible", "", $t_arr[1]) || $ilAccess->checkAccess("read", "", $t_arr[1])) { return true; } return false; } /** * Returns the number of bytes used on the harddisk by the learning module * with the specified object id. * @param int object id of a file object. */ public static function _lookupDiskUsage($a_id) { $lm_data_dir = ilUtil::getWebspaceDir('filesystem') . "/lm_data"; $lm_dir = $lm_data_dir . DIRECTORY_SEPARATOR . "lm_" . $a_id; return file_exists($lm_dir) ? ilUtil::dirsize($lm_dir) : 0; } /** * Checks offlineMode and returns false if */ public static function _lookupUserIsOfflineMode($a_obj_id) { global $DIC; $ilDB = $DIC['ilDB']; $ilUser = $DIC['ilUser']; $user_id = $ilUser->getId(); $set = $ilDB->queryF( 'SELECT offline_mode FROM sahs_user WHERE obj_id = %s AND user_id = %s', array('integer','integer'), array($a_obj_id, $user_id) ); $rec = $ilDB->fetchAssoc($set); if ($rec["offline_mode"] == "offline") { return true; } return false; } /** * check wether learning module is online */ public static function _lookupOfflineModeAvailable($a_id) { global $DIC; $ilDB = $DIC['ilDB']; $set = $ilDB->queryF( 'SELECT offline_mode FROM sahs_lm WHERE id = %s', array('integer'), array($a_id) ); $rec = $ilDB->fetchAssoc($set); return ilUtil::yn2tf($rec["offline_mode"]); } }
{ "pile_set_name": "Github" }
{-# OPTIONS_GHC -fno-warn-orphans #-} {-| Module : Kore.Parser.ParserUtils Description : Helper tools for parsing Kore. Meant for internal use only. Copyright : (c) Runtime Verification, 2018 License : NCSA Maintainer : [email protected] Stability : experimental Portability : POSIX Helper tools for parsing Kore. Meant for internal use only. -} module Kore.Parser.ParserUtils ( Parser , takeWhile , parseOnly , endOfInput , peekChar , peekChar' , sepByCharWithDelimitingChars , manyUntilChar ) where import Prelude.Kore hiding ( takeWhile ) import Control.Monad ( void ) import Text.Megaparsec ( Parsec , anySingle , eof , lookAhead , parse , takeWhileP ) import qualified Text.Megaparsec.Char as Parser import Text.Megaparsec.Error ( ShowErrorComponent (..) , errorBundlePretty ) type Parser = Parsec String String {-|'peekChar' is similar to Attoparsec's 'peekChar'. It returns the next available character in the input, without consuming it. Returns 'Nothing' if the input does not have any available characters. -} peekChar :: Parser (Maybe Char) peekChar = Just <$> peekChar' <|> return Nothing {-|'peekChar'' is similar to Attoparsec's 'peekChar''. It returns the next available character in the input, without consuming it. Fails if the input does not have any available characters. -} peekChar' :: Parser Char peekChar' = lookAhead anySingle {-|'takeWhile' is similar to Attoparsec's 'takeWhile'. It consumes all the input characters that satisfy the given predicate and returns them as a string. -} takeWhile :: (Char -> Bool) -> Parser String takeWhile = takeWhileP Nothing {-|'endOfInput' is similar to Attoparsec's 'endOfInput'. It matches only the end-of-input position. -} endOfInput :: Parser () endOfInput = eof instance ShowErrorComponent String where showErrorComponent str = str {-|'parseOnly' is similar to Attoparsec's 'parseOnly'. It takes a parser, a FilePath that is used for generating error messages and an input string and produces either a parsed object, or an error message. -} parseOnly :: Parser a -> FilePath -> String -> Either String a parseOnly parser filePathForErrors input = case parse parser filePathForErrors input of Left err -> Left (errorBundlePretty err) Right v -> Right v {-|'manyUntilChar' parses a list of 'a' items. It uses the item parser to parse 0 or more items until the end character is encountered at the edge of an item (or at the beginning of the input). Returns a list of items. The difference between this and the standard 'many' construct is that this one returns any errors reported by the item parser. -} manyUntilChar :: Char -- ^ The end character -> Parser a -- ^ The item parser -> Parser [a] manyUntilChar endChar itemParser = do mc <- peekChar if mc == Just endChar then return [] else (:) <$> itemParser <*> manyUntilChar endChar itemParser {-|'skipCharParser' skips the given character, using the provided parser to consume whatever is after the character. -} skipCharParser :: Parser () -> Char -> Parser () skipCharParser skipWhitespace c = do void(Parser.char c) skipWhitespace {-|'sepByCharWithDelimitingChars' parses a list of 0 or more 'a' items. The list must start with the start character and end with the end character. The separator character should occur between items. The parser uses the skipping parser to consume input after these. The difference between this and the standard 'sepBy' construct is that this one returns any errors reported by 'itemParser' -} sepByCharWithDelimitingChars :: Parser() -- ^ Skipping parser -> Char -- ^ The start character -> Char -- ^ The end character -> Char -- ^ The separator character -> Parser a -- ^ The item perser -> Parser [a] sepByCharWithDelimitingChars skipWhitespace firstChar endChar delimiter itemParser = do skipCharParser skipWhitespace firstChar mc <- peekChar case mc of Nothing -> fail "Unexpected end of input." Just c | c == endChar -> skipCharParser skipWhitespace endChar $> [] | otherwise -> (:) <$> itemParser <*> sepByCharWithDelimitingChars' where sepByCharWithDelimitingChars' = do mc <- peekChar case mc of Nothing -> fail "Unexpected end of input." Just c | c == endChar -> skipCharParser skipWhitespace endChar $> [] | c == delimiter -> skipCharParser skipWhitespace delimiter *> ((:) <$> itemParser <*> sepByCharWithDelimitingChars') | otherwise -> fail ("Unexpected character: '" ++ c:"'. " ++ "Expecting '" ++ delimiter:"' or '" ++ endChar:"'.")
{ "pile_set_name": "Github" }
a>b
{ "pile_set_name": "Github" }
CAPI=2: name: openpiton::dynamic_node:0.1 description: Top-level Dynamic Node filesets: rtl: files: - dynamic_node_top_wrap.v - dynamic_node_top.v depend: - openpiton::dynamic_node_components - openpiton::dynamic_node_dynamic - openpiton::dynamic_node_common - openpiton::piton_include file_type: verilogSource targets: default: filesets: [rtl] generate: [pyhp_preprocess] pickle: default_tool: icarus filesets: [rtl] generate: [pyhp_preprocess] toplevel: [dynamic_node_top] tools: icarus: iverilog_options: [-g 2001 -E] verify: default_tool: icarus filesets: [rtl] generate: [pyhp_preprocess] toplevel: [dynamic_node_top] tools: icarus: iverilog_options: [-g 2001] generate: pyhp_preprocess: generator: pyhp_preprocess_gen parameters: process_me : [[dynamic_node_top_wrap_para.v.pyv, dynamic_node_top_wrap_para.tmp.v], [dynamic_node_top_para.v.pyv, dynamic_node_top_para.tmp.v]]
{ "pile_set_name": "Github" }
COMPILE_DEFINITIONS_<CONFIG> ---------------------------- Ignored. See CMake Policy :policy:`CMP0043`. Per-configuration preprocessor definitions in a directory. This is the configuration-specific version of :prop_dir:`COMPILE_DEFINITIONS` where ``<CONFIG>`` is an upper-case name (ex. ``COMPILE_DEFINITIONS_DEBUG``). This property will be initialized in each directory by its value in the directory's parent. Contents of ``COMPILE_DEFINITIONS_<CONFIG>`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. Generator expressions should be preferred instead of setting this property.
{ "pile_set_name": "Github" }
/* * Copyright (c) 2016-2019 Arm Limited * All rights reserved * * The license below extends only to copyright in the software and shall * not be construed as granting a license to any other intellectual * property including but not limited to intellectual property relating * to a hardware implementation of the functionality of the software * licensed hereunder. You may use the software subject to the license * terms below provided that you ensure that this notice is replicated * unmodified and in its entirety in all distributions of the software, * modified or unmodified, in source code or in binary form. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer; * redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution; * neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "base/stats/hdf5.hh" #include "base/logging.hh" #include "base/stats/info.hh" /** * Check if all strings in a container are empty. */ template<typename T> bool emptyStrings(const T &labels) { for (const auto &s : labels) { if (!s.empty()) return false; } return true; } namespace Stats { Hdf5::Hdf5(const std::string &file, unsigned chunking, bool desc, bool formulas) : fname(file), timeChunk(chunking), enableDescriptions(desc), enableFormula(formulas), dumpCount(0) { // Tell the library not to print exceptions by default. There are // cases where we rely on exceptions to determine if we need to // create a node or if we can just open it. H5::Exception::dontPrint(); } Hdf5::~Hdf5() { } void Hdf5::begin() { h5File = H5::H5File(fname, // Truncate the file if this is the first dump dumpCount > 0 ? H5F_ACC_RDWR : H5F_ACC_TRUNC); path.push(h5File.openGroup("/")); } void Hdf5::end() { assert(valid()); dumpCount++; } bool Hdf5::valid() const { return true; } void Hdf5::beginGroup(const char *name) { auto base = path.top(); // Try to open an existing stat group corresponding to the // name. Create it if it doesn't exist. H5::Group group; try { group = base.openGroup(name); } catch (const H5::FileIException& e) { group = base.createGroup(name); } catch (const H5::GroupIException& e) { group = base.createGroup(name); } path.push(group); } void Hdf5::endGroup() { assert(!path.empty()); path.pop(); } void Hdf5::visit(const ScalarInfo &info) { // Since this stat is a scalar, we need 1-dimensional value in the // stat file. The Hdf5::appendStat helper will populate the size // of the first dimension (time). hsize_t fdims[1] = { 0, }; double data[1] = { info.result(), }; appendStat(info, 1, fdims, data); } void Hdf5::visit(const VectorInfo &info) { appendVectorInfo(info); } void Hdf5::visit(const DistInfo &info) { warn_once("HDF5 stat files don't support distributions.\n"); } void Hdf5::visit(const VectorDistInfo &info) { warn_once("HDF5 stat files don't support vector distributions.\n"); } void Hdf5::visit(const Vector2dInfo &info) { // Request a 3-dimensional stat, the first dimension will be // populated by the Hdf5::appendStat() helper. The remaining two // dimensions correspond to the stat instance. hsize_t fdims[3] = { 0, info.x, info.y }; H5::DataSet data_set = appendStat(info, 3, fdims, info.cvec.data()); if (dumpCount == 0) { if (!info.subnames.empty() && !emptyStrings(info.subnames)) addMetaData(data_set, "subnames", info.subnames); if (!info.y_subnames.empty() && !emptyStrings(info.y_subnames)) addMetaData(data_set, "y_subnames", info.y_subnames); if (!info.subdescs.empty() && !emptyStrings(info.subdescs)) addMetaData(data_set, "subdescs", info.subdescs); } } void Hdf5::visit(const FormulaInfo &info) { if (!enableFormula) return; H5::DataSet data_set = appendVectorInfo(info); if (dumpCount == 0) addMetaData(data_set, "equation", info.str()); } void Hdf5::visit(const SparseHistInfo &info) { warn_once("HDF5 stat files don't support sparse histograms.\n"); } H5::DataSet Hdf5::appendVectorInfo(const VectorInfo &info) { const VResult &vr(info.result()); // Request a 2-dimensional stat, the first dimension will be // populated by the Hdf5::appendStat() helper. The remaining // dimension correspond to the stat instance. hsize_t fdims[2] = { 0, vr.size() }; H5::DataSet data_set = appendStat(info, 2, fdims, vr.data()); if (dumpCount == 0) { if (!info.subnames.empty() && !emptyStrings(info.subnames)) addMetaData(data_set, "subnames", info.subnames); if (!info.subdescs.empty() && !emptyStrings(info.subdescs)) addMetaData(data_set, "subdescs", info.subdescs); } return data_set; } H5::DataSet Hdf5::appendStat(const Info &info, int rank, hsize_t *dims, const double *data) { H5::Group group = path.top(); H5::DataSet data_set; H5::DataSpace fspace; dims[0] = dumpCount + 1; if (dumpCount > 0) { // Get the existing stat if we have already dumped this stat // before. data_set = group.openDataSet(info.name); data_set.extend(dims); fspace = data_set.getSpace(); } else { // We don't have the stat already, create it. H5::DSetCreatPropList props; // Setup max dimensions based on the requested file dimensions std::vector<hsize_t> max_dims(rank); std::copy(dims, dims + rank, max_dims.begin()); max_dims[0] = H5S_UNLIMITED; // Setup chunking std::vector<hsize_t> chunk_dims(rank); std::copy(dims, dims + rank, chunk_dims.begin()); chunk_dims[0] = timeChunk; props.setChunk(rank, chunk_dims.data()); // Enable compression props.setDeflate(1); fspace = H5::DataSpace(rank, dims, max_dims.data()); data_set = group.createDataSet(info.name, H5::PredType::NATIVE_DOUBLE, fspace, props); if (enableDescriptions && !info.desc.empty()) { addMetaData(data_set, "description", info.desc); } } // The first dimension is time which isn't included in data. dims[0] = 1; H5::DataSpace mspace(rank, dims); std::vector<hsize_t> foffset(rank, 0); foffset[0] = dumpCount; fspace.selectHyperslab(H5S_SELECT_SET, dims, foffset.data()); data_set.write(data, H5::PredType::NATIVE_DOUBLE, mspace, fspace); return data_set; } void Hdf5::addMetaData(H5::DataSet &loc, const char *name, const std::vector<const char *> &values) { H5::StrType type(H5::PredType::C_S1, H5T_VARIABLE); hsize_t dims[1] = { values.size(), }; H5::DataSpace space(1, dims); H5::Attribute attribute = loc.createAttribute(name, type, space); attribute.write(type, values.data()); } void Hdf5::addMetaData(H5::DataSet &loc, const char *name, const std::vector<std::string> &values) { std::vector<const char *> cstrs(values.size()); for (int i = 0; i < values.size(); ++i) cstrs[i] = values[i].c_str(); addMetaData(loc, name, cstrs); } void Hdf5::addMetaData(H5::DataSet &loc, const char *name, const std::string &value) { H5::StrType type(H5::PredType::C_S1, value.length() + 1); hsize_t dims[1] = { 1, }; H5::DataSpace space(1, dims); H5::Attribute attribute = loc.createAttribute(name, type, space); attribute.write(type, value.c_str()); } void Hdf5::addMetaData(H5::DataSet &loc, const char *name, double value) { hsize_t dims[1] = { 1, }; H5::DataSpace space(1, dims); H5::Attribute attribute = loc.createAttribute( name, H5::PredType::NATIVE_DOUBLE, space); attribute.write(H5::PredType::NATIVE_DOUBLE, &value); } std::unique_ptr<Output> initHDF5(const std::string &filename, unsigned chunking, bool desc, bool formulas) { return std::unique_ptr<Output>( new Hdf5(simout.resolve(filename), chunking, desc, formulas)); } }; // namespace Stats
{ "pile_set_name": "Github" }
export PATH=/adt32/ant/bin:$PATH export JAVA_HOME=/Program Files/Java/jdk1.8.0_151 cd /eclipse/demos/GUI/AppCompatNavigationDrawerDemo1/ ant clean release
{ "pile_set_name": "Github" }
# # USB Imaging devices configuration # comment "USB Imaging devices" config USB_MDC800 tristate "USB Mustek MDC800 Digital Camera support" ---help--- Say Y here if you want to connect this type of still camera to your computer's USB port. This driver can be used with gphoto 0.4.3 and higher (look at <http://www.gphoto.org/>). To use it create a device node with "mknod /dev/mustek c 180 32" and configure it in your software. To compile this driver as a module, choose M here: the module will be called mdc800. config USB_MICROTEK tristate "Microtek X6USB scanner support" depends on SCSI help Say Y here if you want support for the Microtek X6USB and possibly the Phantom 336CX, Phantom C6 and ScanMaker V6U(S)L. Support for anything but the X6 is experimental. Please report failures and successes. The scanner will appear as a scsi generic device to the rest of the system. Scsi support is required. This driver can be compiled as a module, called microtek.
{ "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.storm.starter.tools; public interface Rankable extends Comparable<Rankable> { Object getObject(); long getCount(); /** * Note: We do not defensively copy the object wrapped by the Rankable. It is passed as is. * * @return a defensive copy */ Rankable copy(); }
{ "pile_set_name": "Github" }
/* * Sample fifo dma implementation * * Copyright (C) 2010 Stefani Seibold <[email protected]> * * Released under the GPL version 2 only. * */ #include <linux/init.h> #include <linux/module.h> #include <linux/kfifo.h> /* * This module shows how to handle fifo dma operations. */ /* fifo size in elements (bytes) */ #define FIFO_SIZE 32 static struct kfifo fifo; static int __init example_init(void) { int i; unsigned int ret; unsigned int nents; struct scatterlist sg[10]; printk(KERN_INFO "DMA fifo test start\n"); if (kfifo_alloc(&fifo, FIFO_SIZE, GFP_KERNEL)) { printk(KERN_WARNING "error kfifo_alloc\n"); return -ENOMEM; } printk(KERN_INFO "queue size: %u\n", kfifo_size(&fifo)); kfifo_in(&fifo, "test", 4); for (i = 0; i != 9; i++) kfifo_put(&fifo, i); /* kick away first byte */ kfifo_skip(&fifo); printk(KERN_INFO "queue len: %u\n", kfifo_len(&fifo)); /* * Configure the kfifo buffer to receive data from DMA input. * * .--------------------------------------. * | 0 | 1 | 2 | ... | 12 | 13 | ... | 31 | * |---|------------------|---------------| * \_/ \________________/ \_____________/ * \ \ \ * \ \_allocated data \ * \_*free space* \_*free space* * * We need two different SG entries: one for the free space area at the * end of the kfifo buffer (19 bytes) and another for the first free * byte at the beginning, after the kfifo_skip(). */ sg_init_table(sg, ARRAY_SIZE(sg)); nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); printk(KERN_INFO "DMA sgl entries: %d\n", nents); if (!nents) { /* fifo is full and no sgl was created */ printk(KERN_WARNING "error kfifo_dma_in_prepare\n"); return -EIO; } /* receive data */ printk(KERN_INFO "scatterlist for receive:\n"); for (i = 0; i < nents; i++) { printk(KERN_INFO "sg[%d] -> " "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n", i, sg[i].page_link, sg[i].offset, sg[i].length); if (sg_is_last(&sg[i])) break; } /* put here your code to setup and exectute the dma operation */ /* ... */ /* example: zero bytes received */ ret = 0; /* finish the dma operation and update the received data */ kfifo_dma_in_finish(&fifo, ret); /* Prepare to transmit data, example: 8 bytes */ nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); printk(KERN_INFO "DMA sgl entries: %d\n", nents); if (!nents) { /* no data was available and no sgl was created */ printk(KERN_WARNING "error kfifo_dma_out_prepare\n"); return -EIO; } printk(KERN_INFO "scatterlist for transmit:\n"); for (i = 0; i < nents; i++) { printk(KERN_INFO "sg[%d] -> " "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n", i, sg[i].page_link, sg[i].offset, sg[i].length); if (sg_is_last(&sg[i])) break; } /* put here your code to setup and exectute the dma operation */ /* ... */ /* example: 5 bytes transmitted */ ret = 5; /* finish the dma operation and update the transmitted data */ kfifo_dma_out_finish(&fifo, ret); ret = kfifo_len(&fifo); printk(KERN_INFO "queue len: %u\n", kfifo_len(&fifo)); if (ret != 7) { printk(KERN_WARNING "size mismatch: test failed"); return -EIO; } printk(KERN_INFO "test passed\n"); return 0; } static void __exit example_exit(void) { kfifo_free(&fifo); } module_init(example_init); module_exit(example_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Stefani Seibold <[email protected]>");
{ "pile_set_name": "Github" }
Probleme & Lösungen • Re: Spracherkennung! ========================================== Date: 2012-09-20 18:00:43 > <div> > > gaston hat geschrieben:\ > Das analysieren von html klappt ja leider auch nicht immer, sei es > javascript oder css was manchmal nicht richtig \"entfernt\" wird.\ > > </div> \ Bitte mit Beispiel in den Bug-Tracker posten. <http://bugs.yacy.net> Statistik: Verfasst von [Lotus](http://forum.yacy-websuche.de/memberlist.php?mode=viewprofile&u=68) --- Do Sep 20, 2012 5:00 pm ------------------------------------------------------------------------
{ "pile_set_name": "Github" }
/* * Copyright © 2017 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * */ #ifndef __MOCK_DRM_H #define __MOCK_DRM_H struct drm_file *mock_file(struct drm_i915_private *i915); void mock_file_free(struct drm_i915_private *i915, struct drm_file *file); #endif /* !__MOCK_DRM_H */
{ "pile_set_name": "Github" }
/* * Some or all of this work - Copyright (c) 2006 - 2020, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ DefinitionBlock ("external", "SSDT", 2, "Intel", "Many", 0x00000001) { /* All declarations */ Include ("../../../../runtime/cntl/DECL.asl") Include ("../../../../runtime/collections/functional/external/DECL.asl") Method (MAIN, 0, NotSerialized) { /* Initialization */ STRT (0x00) /* Run verification methods */ Include ("../../../../runtime/collections/functional/external/RUN.asl") /* Final actions */ Store (FNSH (), Local7) Return (Local7) } } DefinitionBlock ("external", "SSDT", 2, "Intel", "Many", 0x00000001) { /* Name(EX00, UnknownObj) */ Name (E000, 0x00) Name (E001, 0x01) Name (E002, "test string") Name (E003, Buffer (0x01) { 0x00 // . }) Name (E004, Package (0x00){}) OperationRegion (E010, PCI_Config, Zero, 0xFF) Field (E010, AnyAcc, NoLock, Preserve) { E005, 8 } Device (E006) { } Event (E007) Method (E008, 0, NotSerialized) { Return (0x01F4) } Mutex (E009, 0x00) PowerResource (E011, 0x00, 0x0000){} Processor (E012, 0x00, 0x00000001, 0x02){} ThermalZone (E013) { } CreateBitField (E003, 0x00, E014) } /* * bz 1389 test case provided by [email protected] * This table should compile without error */ DefinitionBlock ("external", "SSDT", 2, "Intel", "Many", 0x00000001) { External (RMCF.XPEE, IntObj) Device (RMCF) { Name (_ADR, 0x00) // _ADR: Address } } /* * This is a variation on the table above. This should compile. */ DefinitionBlock ("external", "SSDT", 2, "Intel", "Many", 0x00000001) { External (ABCD.XPEE, IntObj) External (ABCD.XPED, IntObj) Device (ABCD) { Name (_ADR, 0x00) // _ADR: Address Name (XPEF, 0x00) } External (ABCD.XPEG, IntObj) }
{ "pile_set_name": "Github" }
// MESSAGE VFR_HUD support class #pragma once namespace mavlink { namespace common { namespace msg { /** * @brief VFR_HUD message * * Metrics typically displayed on a HUD for fixed wing aircraft */ struct VFR_HUD : mavlink::Message { static constexpr msgid_t MSG_ID = 74; static constexpr size_t LENGTH = 20; static constexpr size_t MIN_LENGTH = 20; static constexpr uint8_t CRC_EXTRA = 20; static constexpr auto NAME = "VFR_HUD"; float airspeed; /*< Current airspeed in m/s */ float groundspeed; /*< Current ground speed in m/s */ int16_t heading; /*< Current heading in degrees, in compass units (0..360, 0=north) */ uint16_t throttle; /*< Current throttle setting in integer percent, 0 to 100 */ float alt; /*< Current altitude (MSL), in meters */ float climb; /*< Current climb rate in meters/second */ inline std::string get_name(void) const override { return NAME; } inline Info get_message_info(void) const override { return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA }; } inline std::string to_yaml(void) const override { std::stringstream ss; ss << NAME << ":" << std::endl; ss << " airspeed: " << airspeed << std::endl; ss << " groundspeed: " << groundspeed << std::endl; ss << " heading: " << heading << std::endl; ss << " throttle: " << throttle << std::endl; ss << " alt: " << alt << std::endl; ss << " climb: " << climb << std::endl; return ss.str(); } inline void serialize(mavlink::MsgMap &map) const override { map.reset(MSG_ID, LENGTH); map << airspeed; // offset: 0 map << groundspeed; // offset: 4 map << alt; // offset: 8 map << climb; // offset: 12 map << heading; // offset: 16 map << throttle; // offset: 18 } inline void deserialize(mavlink::MsgMap &map) override { map >> airspeed; // offset: 0 map >> groundspeed; // offset: 4 map >> alt; // offset: 8 map >> climb; // offset: 12 map >> heading; // offset: 16 map >> throttle; // offset: 18 } }; } // namespace msg } // namespace common } // namespace mavlink
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <doc xml:lang="en"> <assembly> <name>Microsoft.AI.DependencyCollector</name> </assembly> <members> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer"> <summary> Telemetry Initializer that parses http dependencies into well-known types like Azure Storage. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer.Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry)"> <summary> If telemetry item is http dependency - converts it to the well-known type of the dependency. </summary> <param name="telemetry">Telemetry item to convert.</param> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ClientServerDependencyTracker.PretendProfilerIsAttached"> <summary> Gets or sets a value indicating whether pretending the profiler is attached or not. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ClientServerDependencyTracker.BeginTracking(Microsoft.ApplicationInsights.TelemetryClient)"> <summary> The function that needs to be called before sending a request to the server. Creates and initializes dependency telemetry item. </summary> <param name="telemetryClient">Telemetry client object to initialize the context of the telemetry item.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ClientServerDependencyTracker.EndTracking(Microsoft.ApplicationInsights.TelemetryClient,Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry)"> <summary> Function that needs to be invoked after the request call to the sever. Computes the duration of the request and tracks the dependency telemetry item. </summary> <param name="telemetryClient">Telemetry client object to track the telemetry item.</param> <param name="telemetry">Telemetry item to compute the duration and track.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ClientServerDependencyTracker.GetTupleForWebDependencies(System.Net.WebRequest)"> <summary> Gets the tuple from either conditional weak table or cache (based on the framework for the input web request). </summary> <param name="webRequest">Target web request.</param> <returns>Tuple of dependency telemetry and a boolean that tells if the tuple is custom created or not.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ClientServerDependencyTracker.AddTupleForWebDependencies(System.Net.WebRequest,Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry,System.Boolean)"> <summary> Adds the tuple to either conditional weak table or cache (based on the framework for the input web request). </summary> <param name="webRequest">Target web request.</param> <param name="telemetry">Dependency telemetry item to add to the table for the corresponding web request.</param> <param name="isCustomCreated">Boolean value that tells if the current telemetry item is being added by the customer or not.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ClientServerDependencyTracker.GetTupleForSqlDependencies(System.Data.SqlClient.SqlCommand)"> <summary> Gets the tuple from either conditional weak table or cache (based on the framework for the input SQL request). </summary> <param name="sqlRequest">Target SQL request.</param> <returns>Tuple of dependency telemetry and a boolean that tells if the tuple is custom created or not.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ClientServerDependencyTracker.AddTupleForSqlDependencies(System.Data.SqlClient.SqlCommand,Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry,System.Boolean)"> <summary> Adds the tuple to either conditional weak table or cache (based on the framework for the input SQL request). </summary> <param name="sqlRequest">Target SQL request.</param> <param name="telemetry">Dependency telemetry item to add to the table for the corresponding SQL request.</param> <param name="isCustomCreated">Boolean value that tells if the current telemetry item is being added by the customer or not.</param> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.WebRequestDependencyTrackingHelpers"> <summary> Client-Server dependency tracking. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.WebRequestDependencyTrackingHelpers.SetUserAndSessionContextForWebRequest(Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry,System.Net.WebRequest)"> <summary> Populates WebRequest using the user, session initialized in telemetry item. </summary> <param name="dependencyTelemetry">Dependency telemetry item.</param> <param name="webRequest">Http web request.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.WebRequestDependencyTrackingHelpers.SetCorrelationContextForWebRequest(Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry,System.Net.WebRequest)"> <summary> Populates WebRequest using the operation context in telemetry item. </summary> <param name="dependencyTelemetry">Dependency telemetry item.</param> <param name="webRequest">Http web request.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.WebRequestDependencyTrackingHelpers.CreateAndAddCookie(System.Net.WebRequest,System.String,System.String)"> <summary> Creates and adds cookie to the web request. </summary> <param name="webRequest">Web request object.</param> <param name="key">Cookie key.</param> <param name="value">Cookie value.</param> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource"> <summary> ETW EventSource tracing class. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource.DependencyTelemetryItemIsNullWarning(System.String)"> <summary> Logs the information when the DependencyTelemetry item is null as warning. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource.WebRequestIsNullWarning(System.String)"> <summary> Logs the information when the HttpWebRequest is null as warning. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource.TrackingAnExistingTelemetryItemVerbose(System.String)"> <summary> Logs the information when a telemetry item that is already existing in the tables (that is currently being tracked) is tracked again. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource.TelemetryToTrackIsNullWarning(System.String)"> <summary> Logs the information when the telemetry item to track is null. </summary> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource.Keywords"> <summary> Keywords for the <see cref="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource"/>. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource.Keywords.UserActionable"> <summary> Key word for user actionable events. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.DependencyCollectorEventSource.Keywords.RddEventKeywords"> <summary> Key word for resource discovery module failures. </summary> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener"> <summary> Provides methods for listening to events from FrameworkEventSource for HTTP. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.HttpProcessingFramework"> <summary> The Http processor. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.FrameworkEventSourceName"> <summary> The Framework EventSource name. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.BeginGetResponseEventId"> <summary> BeginGetResponse Event ID. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.EndGetResponseEventId"> <summary> EndGetResponse Event ID. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.BeginGetRequestStreamEventId"> <summary> BeginGetRequestStream Event ID. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.EndGetRequestStreamEventId"> <summary> EndGetRequestStream Event ID. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.Dispose"> <summary> Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.OnEventSourceCreated(System.Diagnostics.Tracing.EventSource)"> <summary> Enables HTTP event source when EventSource is created. Called for all existing event sources when the event listener is created and when a new event source is attached to the listener. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.OnEventWritten(System.Diagnostics.Tracing.EventWrittenEventArgs)"> <summary> Called whenever an event has been written by an event source for which the event listener has enabled events. </summary> <param name="eventData">The event arguments that describe the event.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.OnBeginGetResponse(System.Diagnostics.Tracing.EventWrittenEventArgs)"> <summary> Called when a postfix of a (HttpWebRequest|FileWebRequest|FtpWebRequest).BeginGetResponse method has been invoked. </summary> <param name="eventData">The event arguments that describe the event.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.OnEndGetResponse(System.Diagnostics.Tracing.EventWrittenEventArgs)"> <summary> Called when a postfix of a (HttpWebRequest|FileWebRequest|FtpWebRequest).EndGetResponse method has been invoked. </summary> <param name="eventData">The event arguments that describe the event.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpEventListener.OnBeginGetRequestStream(System.Diagnostics.Tracing.EventWrittenEventArgs)"> <summary> Called when a postfix of a (HttpWebRequest|FileWebRequest|FtpWebRequest).BeginGetRequestStream method has been invoked. </summary> <param name="eventData">The event arguments that describe the event.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpProcessing.OnBeginHttpCallback(System.Int64,System.String)"> <summary> On begin callback from Framework event source. </summary> <param name="id">This object.</param> <param name="resourceName">URI of the web request.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpProcessing.OnEndHttpCallback(System.Int64,System.Nullable{System.Boolean},System.Boolean,System.Nullable{System.Int32})"> <summary> On end callback from Framework event source. </summary> <param name="id">The id.</param> <param name="success">The success to indicate if the dependency call completed successfully or not.</param> <param name="synchronous">The synchronous flag to indicate if the dependency call was synchronous or not.</param> <param name="statusCode">The HTTP status code of the response.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkHttpProcessing.Dispose"> <summary> Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. </summary> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing"> <summary> Concrete class with all processing logic to generate RDD data from the calls backs received from Profiler instrumentation for HTTP . </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.#ctor(Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration,System.String,Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.ObjectInstanceBasedOperationHolder)"> <summary> Initializes a new instance of the <see cref="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing"/> class. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnBeginForGetResponse(System.Object)"> <summary> On begin callback for GetResponse. </summary> <param name="thisObj">This object.</param> <returns>The context for end callback.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnEndForGetResponse(System.Object,System.Object,System.Object)"> <summary> On end callback for GetResponse. </summary> <param name="context">The context.</param> <param name="returnValue">The return value.</param> <param name="thisObj">This object.</param> <returns>The resulting return value.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnExceptionForGetResponse(System.Object,System.Object,System.Object)"> <summary> On exception callback for GetResponse callback. </summary> <param name="context">The context.</param> <param name="exception">The exception object.</param> <param name="thisObj">This object.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnBeginForGetRequestStream(System.Object,System.Object)"> <summary> On begin callback for GetRequestStream callback. </summary> <param name="thisObj">This object.</param> <param name="transportContext">The transport context parameter.</param> <returns>The context for end callback.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnExceptionForGetRequestStream(System.Object,System.Object,System.Object,System.Object)"> <summary> On exception for GetRequestStream callback. Note: There is no call back required for GetRequestStream except on exception cases. </summary> <param name="context">The context.</param> <param name="exception">The exception.</param> <param name="thisObj">This object.</param> <param name="transportContext">The transport context parameter.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnBeginForBeginGetResponse(System.Object,System.Object,System.Object)"> <summary> On begin for BeginGetResponse callback. </summary> <param name="thisObj">This object.</param> <param name="callback">The callback parameter.</param> <param name="state">The state parameter.</param> <returns>The context for end callback.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnEndForEndGetResponse(System.Object,System.Object,System.Object,System.Object)"> <summary> On end for EndGetResponse callbacks. </summary> <param name="context">The context.</param> <param name="returnValue">The return value.</param> <param name="thisObj">This object.</param> <param name="asyncResult">The asyncResult parameter.</param> <returns>The return value passed.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnExceptionForEndGetResponse(System.Object,System.Object,System.Object,System.Object)"> <summary> On exception for EndGetResponse callbacks. </summary> <param name="context">The context.</param> <param name="exception">The exception.</param> <param name="thisObj">This object.</param> <param name="asyncResult">The asyncResult parameter.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnBeginForBeginGetRequestStream(System.Object,System.Object,System.Object)"> <summary> On begin for BeginGetRequestStream callback. </summary> <param name="thisObj">This object.</param> <param name="callback">The callback parameter.</param> <param name="state">The state parameter.</param> <returns>The context for end callback.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnExceptionForEndGetRequestStream(System.Object,System.Object,System.Object,System.Object,System.Object)"> <summary> On exception for EndGetRequestStream callback. Note: There is no call back required for EndGetRequestStream except on exception cases. </summary> <param name="context">The context.</param> <param name="exception">The exception.</param> <param name="thisObj">This object.</param> <param name="asyncResult">The asyncResult parameter.</param> <param name="transportContext">The transportContext parameter.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.GetUrl(System.Net.WebRequest)"> <summary> Gets HTTP request url. </summary> <param name="webRequest">Represents web request.</param> <returns>The url if possible otherwise empty string.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnBegin(System.Object,System.Boolean)"> <summary> Common helper for all Begin Callbacks. </summary> <param name="thisObj">This object.</param> <param name="isAsyncCall">Indicates if the method used is async or not.</param> <returns>Null object as all context is maintained in this class via weak tables.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnEnd(System.Object,System.Object,System.Object)"> <summary> Common helper for all End Callbacks. </summary> <param name="exception">The exception object if any.</param> <param name="thisObj">This object.</param> <param name="returnValue">Return value of the function if any.</param> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1"> <summary> The implementation of cache provider for Windows Phone and Windows Store as MemoryCache is not available there. </summary> <typeparam name="TValue">Type of items to store in the cache.</typeparam> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.readerWriterLock"> <summary> Reader-Writer Lock for thread safety. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.dictionary"> <summary> Dictionary of cache items for fast Get and Contains operations. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.sortedList"> <summary> Cache items sorted by the time of adding to cache. Required for to clear fast cache items when items are expired. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.maxSize"> <summary> The maximum number of elements in the cache to avoid out of memory crashes. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.timer"> <summary> Timer for clearing expired cache items on recurring bases. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.expirationMilliseconds"> <summary> The duration in milliseconds after which item in the cache is expired. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.#ctor(System.Int32,System.Int32,System.Boolean)"> <summary> Initializes a new instance of the <see cref="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1" /> class. </summary> <param name="expirationMilliseconds">Expiration timeout in milliseconds for an object to live in the cache.</param> <param name="maxSize">Maximum number of entries to cache (adjustable at runtime with MaxSize property).</param> <param name="synchronized">True to use a reader-writer lock to protect the data in the MemoryCacheList; false if the caller will handle synchronization.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.Contains(System.Int64)"> <summary> Checks whether the cache entry already exists in the cache. </summary> <param name="key">A unique identifier for the cache entry.</param> <returns>true if the cache contains a cache entry with the same key value as key; otherwise, false.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.Get(System.Int64)"> <summary> Gets the specified cache entry from the cache. </summary> <param name="key">A unique identifier for the cache entry.</param> <returns>A reference to the cache entry identified by key if the entry exists; otherwise, null.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.Set(System.Int64,`0)"> <summary> Inserts a cache entry into the cache. </summary> <param name="key">A unique identifier for the cache entry.</param> <param name="value">The object to insert.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.Remove(System.Int64)"> <summary> Removes a specific key from the cache. </summary> <param name="key">Key to remove.</param> <returns>An object that represents the value of the removed cache entry that was specified by the key, or null if the specified entry was not found.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.Dispose"> <summary> Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.ClearExpiredCacheItems(System.Object)"> <summary> The timer callback that clears expired items in the cache. </summary> <param name="state">An object containing information to be used by the callback method, or null.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.Add(System.Int64,`0,System.Boolean)"> <summary> Adds the specified key and value to the dictionary. </summary> <param name="key">Key to add.</param> <param name="value">Value to associate with key.</param> <param name="overwrite">If true, will overwrite an existing key.</param> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemoryCacheEntry"> <summary> An entry in the MemoryCacheList. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemoryCacheEntry.#ctor(System.Int64,`0)"> <summary> Initializes a new instance of the <see cref="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemoryCacheEntry" /> class. </summary> <param name="key">The key of the element.</param> <param name="value">The value of the element.</param> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemoryCacheEntry.Key"> <summary> Gets the key of the element. </summary> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemoryCacheEntry.Value"> <summary> Gets or sets the value of the element. </summary> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemoryCacheEntry.CreatedTicks"> <summary> Gets number of ticks elapsed on the clock since the element was created. </summary> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemmoryCacheEntryTimeComparer"> <summary> Exposes a method that compares two MemoryCacheEntry objects. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider`1.MemmoryCacheEntryTimeComparer.Compare(Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider{`0}.MemoryCacheEntry,Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheProvider{`0}.MemoryCacheEntry)"> <summary> Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. </summary> <param name="x">The first object to compare.</param> <param name="y">The second object to compare.</param> <returns>A signed integer that indicates the relative values of x and y, as shown in the following table.</returns> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.ICacheProvider`1"> <summary> Represents an object cache and provides the base methods and properties for accessing the object cache. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.ICacheProvider`1.Contains(System.Int64)"> <summary> Checks whether the cache entry already exists in the cache. </summary> <param name="key">A unique identifier for the cache entry.</param> <returns>true if the cache contains a cache entry with the same key value as key; otherwise, false.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.ICacheProvider`1.Get(System.Int64)"> <summary> Gets the specified cache entry from the cache. </summary> <param name="key">A unique identifier for the cache entry.</param> <returns>A reference to the cache entry identified by key if the entry exists; otherwise, null.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.ICacheProvider`1.Set(System.Int64,`0)"> <summary> Inserts a cache entry into the cache. </summary> <param name="key">A unique identifier for the cache entry.</param> <param name="value">The object to insert.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.ICacheProvider`1.Remove(System.Int64)"> <summary> Removes the cache entry from the cache. </summary> <param name="key">A unique identifier for the cache entry.</param> <returns>True if the element is successfully found and removed; otherwise, false. This method returns false if key is not found.</returns> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.OperationWatch"> <summary> Single high precision clock used by operations. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.OperationWatch.Watch"> <summary> High precision stopwatch. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.OperationWatch.HundredNanosecondsPerTick"> <summary> Number of 100 nanoseconds per high-precision clock tick. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.OperationWatch.StartTime"> <summary> The time clock started. </summary> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.OperationWatch.ElapsedTicks"> <summary> Gets number of ticks elapsed on the clock since the start. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.OperationWatch.Duration(System.Int64,System.Int64)"> <summary> Calculates time between two clock readings. </summary> <param name="fromTicks">Start time in ticks.</param> <param name="toTicks">End time in ticks.</param> <returns>Time between two clock readings.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.OperationWatch.Timestamp(System.Int64)"> <summary> Converts time on the operation clock (in ticks) to date and time structure. </summary> <param name="elapsedTicks">Ticks elapsed according to operation watch.</param> <returns>Date time structure representing the date and time that corresponds to the operation clock reading.</returns> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1"> <summary> Represents a collection of sorted elements that are accessible by index. </summary> <typeparam name="T">The type of element.</typeparam> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.list"> <summary> Represents a collection of objects that can be individually accessed by index. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.comparer"> <summary> Exposes a method that compares two objects. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.#ctor(System.Collections.Generic.IComparer{`0})"> <summary> Initializes a new instance of the SortedList class that is empty. </summary> <param name="comparer">The IComparer implementation to use when comparing elements.</param> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.Count"> <summary> Gets the number of elements contained in a SortedList object. </summary> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.Item(System.Int32)"> <summary> Gets the element at a specified index in a sequence. </summary> <param name="index">The zero-based index of the element to get.</param> <returns>The element at the specified position in the source sequence.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.GetEnumerator"> <summary> Returns an enumerator that iterates through a collection. </summary> <returns>An IEnumerator object that can be used to iterate through the collection.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.System#Collections#IEnumerable#GetEnumerator"> <summary> Returns an enumerator that iterates through a collection. </summary> <returns>An IEnumerator object that can be used to iterate through the collection.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.Add(`0)"> <summary> Adds an element with the specified value to a SortedList object. </summary> <param name="item">Item to add.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.RemoveAt(System.Int32)"> <summary> Removes the element at the specified index of a SortedList object. </summary> <param name="index">The zero-based index of the element to remove.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.Remove(`0)"> <summary> Removes the element with the specified value from a SortedList object. </summary> <param name="item">Item to remove.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.SortedList`1.TryIndexOf(`0,System.Boolean@)"> <summary> Determines the index of a specific item in the IList. </summary> <param name="item">The object to locate in the IList.</param> <param name="found">True if value is found in the list, otherwise false.</param> <returns>The index of value if found in the list; otherwise, the index of value where it needs to be inserted.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ApplicationInsightsUrlFilter.IsApplicationInsightsUrl(System.String)"> <summary> Determines whether an URL is application insights URL. </summary> <param name="url">HTTP URL.</param> <returns>True if URL is application insights url, otherwise false.</returns> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener"> <summary> Provides methods for listening to events from FrameworkEventSource for SQL. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.SqlProcessingFramework"> <summary> The SQL processor. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.AdoNetEventSourceName"> <summary> The Framework EventSource name for SQL. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.BeginExecuteEventId"> <summary> BeginExecute Event ID. </summary> </member> <member name="F:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.EndExecuteEventId"> <summary> EndExecute Event ID. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.Dispose"> <summary> Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.OnEventSourceCreated(System.Diagnostics.Tracing.EventSource)"> <summary> Enables SQL event source when EventSource is created. Called for all existing event sources when the event listener is created and when a new event source is attached to the listener. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.OnEventWritten(System.Diagnostics.Tracing.EventWrittenEventArgs)"> <summary> Called whenever an event has been written by an event source for which the event listener has enabled events. </summary> <param name="eventData">The event arguments that describe the event.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.OnBeginExecute(System.Diagnostics.Tracing.EventWrittenEventArgs)"> <summary> Called when a postfix of a SQLCommand begin methods have been invoked. </summary> <param name="eventData">The event arguments that describe the event.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlEventListener.OnEndExecute(System.Diagnostics.Tracing.EventWrittenEventArgs)"> <summary> Called when a postfix of a postfix of a SQLCommand end methods have been invoked. </summary> <param name="eventData">The event arguments that describe the event.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlProcessing.#ctor(Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration,Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.CacheBasedOperationHolder)"> <summary> Initializes a new instance of the <see cref="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlProcessing"/> class. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlProcessing.OnBeginExecuteCallback(System.Int64,System.String,System.String,System.String)"> <summary> On begin callback from Framework event source. </summary> <param name="id">Identifier of SQL connection object.</param> <param name="dataSource">Data source name.</param> <param name="database">Database name.</param> <param name="commandText">Command text.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlProcessing.OnEndExecuteCallback(System.Int64,System.Boolean,System.Boolean,System.Int32)"> <summary> On end callback from Framework event source. </summary> <param name="id">Identifier of SQL connection object.</param> <param name="success">Indicate whether operation completed successfully.</param> <param name="synchronous">Indicates whether operation was called synchronously or asynchronously.</param> <param name="sqlExceptionNumber">SQL exception number.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.FrameworkSqlProcessing.GetResourceName(System.String,System.String,System.String)"> <summary> Gets SQL command resource name. </summary> <param name="dataSource">DataSource name.</param> <param name="database">Database name.</param> <param name="commandText">CommandText name.</param> <returns>The resource name if possible otherwise empty string.</returns> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing"> <summary> Concrete class with all processing logic to generate RDD data from the calls backs received from Profiler instrumentation for SQL. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.#ctor(Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration,System.String,Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation.ObjectInstanceBasedOperationHolder)"> <summary> Initializes a new instance of the <see cref="T:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing"/> class. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnBeginForOneParameter(System.Object)"> <summary> On begin callback for methods with 1 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnBeginForTwoParameters(System.Object,System.Object)"> <summary> On begin callback for methods with 2 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnBeginForThreeParameters(System.Object,System.Object,System.Object)"> <summary> On begin callback for methods with 3 parameters. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnBeginForFourParameters(System.Object,System.Object,System.Object,System.Object)"> <summary> On begin callback for methods with 4 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnEndForOneParameter(System.Object,System.Object,System.Object)"> <summary> On end callback for methods with 1 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnEndForTwoParameters(System.Object,System.Object,System.Object,System.Object)"> <summary> On end callback for methods with 2 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnEndForThreeParameters(System.Object,System.Object,System.Object,System.Object,System.Object)"> <summary> On end callback for methods with 3 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnExceptionForOneParameter(System.Object,System.Object,System.Object)"> <summary> On exception callback for methods with 1 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnExceptionForTwoParameters(System.Object,System.Object,System.Object,System.Object)"> <summary> On exception callback for methods with 2 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnExceptionForThreeParameters(System.Object,System.Object,System.Object,System.Object,System.Object)"> <summary> On exception callback for methods with 3 parameter. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.GetResourceName(System.Object)"> <summary> Gets SQL command resource name. </summary> <param name="thisObj">The SQL command.</param> <remarks>Before we have clarity with SQL team around EventSource instrumentation, providing name as a concatenation of parameters.</remarks> <returns>The resource name if possible otherwise empty string.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.GetCommandName(System.Object)"> <summary> Return CommandTest for SQL resource. </summary> <param name="thisObj">The SQL command.</param> <returns>Returns the command text or empty.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnBegin(System.Object)"> <summary> Common helper for all Begin Callbacks. </summary> <param name="thisObj">This object.</param> <returns>The context for end callback.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerSqlProcessing.OnEnd(System.Object,System.Object)"> <summary> Common helper for all End Callbacks. </summary> <param name="exceptionObj">The exception object if any.</param> <param name="thisObj">This object.</param> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule"> <summary> Remote dependency monitoring. </summary> </member> <member name="P:Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule.DisableRuntimeInstrumentation"> <summary> Gets or sets a value indicating whether to disable runtime instrumentation. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule.Dispose"> <summary> IDisposable implementation. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule.Initialize(Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration)"> <summary> Initialize method is called after all configuration properties have been loaded from the configuration. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule.Dispose(System.Boolean)"> <summary> IDisposable implementation. </summary> <param name="disposing">The method has been called directly or indirectly by a user's code.</param> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule.InitializeForFrameworkEventSource"> <summary> Initialize for framework event source (not supported for Net40). </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule.InitializeForRuntimeInstrumentationOrFramework"> <summary> Initialize for runtime instrumentation or framework event source. </summary> </member> <member name="T:Microsoft.ApplicationInsights.DependencyCollector.TelemetryExtensionsForDependencyCollector"> <summary> Dependency Telemetry extension methods to associate with request objects and to store in conditional/cache tables to avoid duplicate tracking. </summary> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.TelemetryExtensionsForDependencyCollector.AssociateTelemetryWithWebRequest(Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry,System.Net.WebRequest,System.Boolean,System.Boolean)"> <summary> Associates telemetry item to a web request to avoid duplicate tracking, and populates cookies with data from initialized telemetry item if setCookies is set to true. When there is an existing telemetry item in the corresponding to the given WEB REQUEST, we return the existing telemetry and associate the same with the WEB REQUEST. </summary> <param name="telemetry">Telemetry object that needs to be associated with the web request.</param> <param name="webRequest">Web request object which we use to populate from the information obtained from the initialized telemetry.</param> <param name="setCookies">Set cookies enables the process of setting the cookies to the web request. By default it is set to false.</param> <param name="setCorrelationContext">Set request headers to correlate dependency telemetry item with the request telemetry item that will process this http request.</param> <returns>Dependency telemetry item with an associated dependency telemetry item.</returns> </member> <member name="M:Microsoft.ApplicationInsights.DependencyCollector.TelemetryExtensionsForDependencyCollector.AssociateTelemetryWithSqlRequest(Microsoft.ApplicationInsights.DataContracts.DependencyTelemetry,System.Data.SqlClient.SqlCommand)"> <summary> Associates telemetry item to a SQL command object to to avoid duplicate tracking. When there is an existing telemetry item in the corresponding to the given SQL REQUEST, we return the existing telemetry and associate the same with the SQL REQUEST. </summary> <param name="telemetry">Telemetry object that needs to be associated with the web request.</param> <param name="sqlRequest">SQL request object which is used as a key to store in the tables.</param> <returns>Dependency telemetry item with an associated dependency telemetry item.</returns> </member> </members> </doc>
{ "pile_set_name": "Github" }
/***************************************************************************** * Licensed to Qualys, Inc. (QUALYS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * QUALYS 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. ****************************************************************************/ /** * @file * @brief IronBee --- LUA Runtime * * Lua runtime management code used throughout `ibmod_lua`. * * A runtime includes a little meta information and a lua_State pointer. * * @author Sam Baskinger <[email protected]> */ #include "ironbee_config_auto.h" #include "lua_runtime_private.h" #include "lua_modules_private.h" #include "lua_private.h" #include <ironbee/context.h> #include <ironbee/mm_mpool_lite.h> #include <lauxlib.h> #include <lua.h> #include <luajit.h> #include <lualib.h> #include <assert.h> #include <stdlib.h> /* If LUA_BASE_PATH was not set as part of autoconf, define a default. */ #ifndef LUA_BASE_PATH #define LUA_BASE_PATH /usr/local/ironbee/lib/lua #endif #define LUA_BASE_PATH_STR IB_XSTRINGIFY(LUA_BASE_PATH) //! Maximum number of times a resource pool Lua stack should be used. static size_t MAX_LUA_STACK_USES = 1000; /** * Opaque runtime structure passed back to the user. * * This may be modified during configuration time by the user, but should be * readonly at runtime. */ struct modlua_runtime_cfg_t { /** * The limit on the number of times a Lua stack may be used. */ ssize_t max_lua_stack_uses; }; /** * Data provided to the resource pool to use in creating Lua stacks. */ struct modlua_runtime_cbdata_t { ib_engine_t *ib; /**< The engine. */ ib_module_t *module; /**< `ibmod_lua` structure. */ modlua_runtime_cfg_t cfg; /**< Configuration information. */ }; typedef struct modlua_runtime_cbdata_t modlua_runtime_cbdata_t; /** * Given a search prefix this will build a search path and add it to Lua. * * @param[in] ib IronBee engine. * @param[in,out] L Lua State that the search path will be set in. * @param[in] prefix The prefix. `?.lua` will be appended. * * @returns * - IB_OK on success * - IB_EALLOC on malloc failure. */ static ib_status_t modlua_append_searchprefix( ib_engine_t *ib, lua_State *L, const char *prefix ) { assert(ib != NULL); assert(L != NULL); assert(prefix != NULL); /* This is the search pattern that is appended to each element of * lua_search_paths and then added to the Lua runtime package.path * global variable. */ static const char *lua_file_pattern = "?.lua"; static const char *lua_cfile_pattern = "?.so"; ib_mpool_lite_t *mp; ib_mm_t mm; ib_status_t rc; char *path = NULL; /* Tmp string to build a search path. */ char *cpath = NULL; /* Tmp string to build a search path. */ rc = ib_mpool_lite_create(&mp); if (rc != IB_OK) { return rc; } mm = ib_mm_mpool_lite(mp); /* Strlen + 2. One for \0 and 1 for the path separator. */ path = ib_mm_alloc(mm, strlen(prefix) + strlen(lua_file_pattern) + 2); if (path == NULL) { rc = IB_EALLOC; goto cleanup; } cpath = ib_mm_alloc(mm, strlen(prefix) + strlen(lua_cfile_pattern) + 2); if (cpath == NULL) { rc = IB_EALLOC; goto cleanup; } strcpy(path, prefix); strcpy(path + strlen(path), "/"); strcpy(path + strlen(path), lua_file_pattern); ib_lua_add_require_path(ib, L, path); strcpy(cpath, prefix); strcpy(cpath + strlen(cpath), "/"); strcpy(cpath + strlen(cpath), lua_cfile_pattern); ib_lua_add_require_cpath(ib, L, cpath); cleanup: ib_mpool_lite_destroy(mp); return rc; } /** * Set the search path in the lua state from the core config. * * @param[in] ib IronBee engine. * @param[in] L The Lua State to setup. * * @returns * - IB_OK On success. * - Other on failure to retrieve configuration context or Lua eval error. */ static ib_status_t modlua_setup_searchpath(ib_engine_t *ib, lua_State *L) { /* Null terminated list of search paths. */ const char *lua_search_paths[4]; ib_status_t rc; ib_core_cfg_t *corecfg = NULL; rc = ib_core_context_config(ib_context_main(ib), &corecfg); if (rc != IB_OK) { ib_log_error(ib, "Failed to retrieve core module configuration."); return rc; } /* Initialize the search paths list. */ lua_search_paths[0] = LUA_BASE_PATH_STR; lua_search_paths[1] = corecfg->module_base_path; lua_search_paths[2] = corecfg->rule_base_path; lua_search_paths[3] = NULL; for (const char **path = lua_search_paths; *path != NULL; ++path) { rc = modlua_append_searchprefix(ib, L, *path); if (rc != IB_OK) { return rc; } } return IB_OK; } /** * Pre-load files into the given lua stack. * * This will attempt to run... * - waggle = require("ironbee/waggle") * - ibconfig = require("ironbee/config") * - ffi = require("ffi") * - ibapi = require("ironbee/api") * - modlua = require("ironbee/module") * * @param[in] ib IronBee engine. Used to find load paths from the * core module. * @param[out] L The Lua state that the modules will be "required" into. * * @returns * - IB_OK On success. * - Other on Lua evaluation error. */ static ib_status_t modlua_preload(ib_engine_t *ib, lua_State *L) { ib_status_t rc; const char *lua_preloads[][2] = { { "waggle", "ironbee/waggle" }, { "ibconfig", "ironbee/config" }, { "ffi", "ffi" }, { "ibapi", "ironbee/api" }, { "modlua", "ironbee/module" }, { NULL, NULL } }; for (int i = 0; lua_preloads[i][0] != NULL; ++i) { rc = ib_lua_require(ib, L, lua_preloads[i][0], lua_preloads[i][1]); if (rc != IB_OK) { ib_log_error(ib, "Failed to load mode \"%s\" into \"%s\".", lua_preloads[i][1], lua_preloads[i][0]); return rc; } } return IB_OK; } /** * Create a new Lua state. * * @param[in] ib IronBee engine. * @param[in] cfg Configuration of the module. * @param[in] Lout The Lua stack to create. * * @returns * - IB_OK On success. * - IB_EUNKNOWN If luaL_newstate() fails. */ static ib_status_t modlua_newstate( ib_engine_t *ib, modlua_cfg_t *cfg, lua_State **Lout ) { lua_State *L; ib_status_t rc; int lua_rc; L = luaL_newstate(); if (L == NULL) { ib_log_error(ib, "Failed to initialize lua module."); return IB_EUNKNOWN; } luaL_openlibs(L); /* Inject some constants so we know we are in the IronBee Lua Module. */ lua_pushboolean(L, 1); lua_setglobal(L, "IRONBEE_MODLUA"); lua_pushstring(L, VERSION); lua_setglobal(L, "IRONBEE_VERSION"); /* Setup search paths before ffi, api, etc loading. */ rc = modlua_setup_searchpath(ib, L); if (rc != IB_OK) { return rc; } /* Load ffi, api, etc. */ rc = modlua_preload(ib, L); if (rc != IB_OK) { ib_log_error(ib, "Failed to pre-load Lua files."); return rc; } /* Set package paths if configured. */ if (cfg->pkg_path) { ib_log_debug( ib, "Using lua package.path=\"%s\"", cfg->pkg_path); lua_getfield(L, -1, "path"); lua_pushstring(L, cfg->pkg_path); lua_setglobal(L, "path"); } if (cfg->pkg_cpath) { ib_log_debug( ib, "Using lua package.cpath=\"%s\"", cfg->pkg_cpath); lua_getfield(L, -1, "cpath"); lua_pushstring(L, cfg->pkg_cpath); lua_setglobal(L, "cpath"); } lua_rc = luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE|LUAJIT_MODE_OFF); if (lua_rc == 0) { ib_log_error(ib, "Failed to disable Lua JIT"); } *Lout = L; return IB_OK; } /** * A helper function that reloads Lua rules and modules in a context. * * @param[in] ib IronBee engine. * @param[in] module Used to retrieve the configuration. * @param[in] ctx The context whose configuration for @a module to retrieve. * @param[in] L The stack the configuration will be loaded into. * * @returns * - IB_OK On success. * - Other on error. A log message is generated. */ static ib_status_t modlua_reload_ctx( ib_engine_t *ib, ib_module_t *module, ib_context_t *ctx, lua_State *L ) { assert(ib != NULL); assert(ctx != NULL); assert(L != NULL); assert(module != NULL); ib_status_t rc; ib_status_t tmp_rc = IB_OK; modlua_cfg_t *cfg; const ib_list_node_t *node; rc = ib_context_module_config(ctx, module, &cfg); if (rc != IB_OK) { ib_log_error(ib, "Failed to retrieve modlua configuration."); return rc; } IB_LIST_LOOP_CONST(cfg->reloads, node) { const modlua_reload_t *reload = (const modlua_reload_t *)ib_list_node_data_const(node); switch(reload->type) { case MODLUA_RELOAD_MODULE: tmp_rc = modlua_module_load_lua( ib, reload->file, reload->module, L); break; case MODLUA_RELOAD_RULE: tmp_rc = ib_lua_load_func( ib, L, reload->file, reload->rule_id); break; } if (rc == IB_OK && tmp_rc != IB_OK) { ib_log_error( ib, "Failed to reload Lua rule or module \"%s\".", reload->file); rc = tmp_rc; } } return rc; } ib_status_t modlua_record_reload( ib_engine_t *ib, modlua_cfg_t *cfg, modlua_reload_type_t type, ib_module_t *module, const char *rule_id, const char *file ) { assert(ib != NULL); assert(cfg != NULL); assert(cfg->reloads != NULL); assert(file != NULL); ib_mm_t mm; ib_status_t rc; modlua_reload_t *data; mm = ib_engine_mm_config_get(ib); data = ib_mm_alloc(mm, sizeof(*data)); if (data == NULL) { return IB_EALLOC; } /* Record type. */ data->type = type; /* Record what the user gave us for a module structure. */ data->module = module; /* Copy file name. */ data->file = ib_mm_strdup(mm, file); if (data->file == NULL) { ib_log_error(ib, "Failed to copy file name \"%s\".", file); return IB_EALLOC; } /* Copy rule_id. */ if (rule_id != NULL) { data->rule_id = ib_mm_strdup(mm, rule_id); if (data->rule_id == NULL) { ib_log_error(ib, "Failed to copy rule_id \"%s\".", rule_id); return IB_EALLOC; } } rc = ib_list_push(cfg->reloads, data); if (rc != IB_OK) { return rc; } return IB_OK; } ib_status_t modlua_reload_ctx_main( ib_engine_t *ib, ib_module_t *module, lua_State *L ) { assert(ib != NULL); assert(module != NULL); assert(L != NULL); ib_status_t rc; ib_context_t *ctx = ib_context_main(ib); /* Reload this context. */ rc = modlua_reload_ctx(ib, module, ctx, L); if (rc != IB_OK) { ib_log_error(ib, "Failed to load main context into Lua stack."); return rc; } return IB_OK; } /** * Reload all the contexts except the main context. */ ib_status_t modlua_reload_ctx_except_main( ib_engine_t *ib, ib_module_t *module, ib_context_t *ctx, lua_State *L ) { assert(ib != NULL); assert(module != NULL); assert(ctx != NULL); assert(L != NULL); ib_status_t rc; /* Do not reload the main context. */ if (ctx == ib_context_main(ib)) { return IB_OK; } /* Reload the parent context first. */ rc = modlua_reload_ctx_except_main( ib, module, ib_context_parent_get(ctx), L); if (rc != IB_OK) { return rc; } /* Reload this context. */ rc = modlua_reload_ctx(ib, module, ctx, L); if (rc != IB_OK) { ib_log_error( ib, "Failed to load context \"%s\" into Lua stack.", ib_context_name_get(ctx)); return rc; } return IB_OK; } /** * Resource pool callback to create a new Lua runtime. * * @param[out] resource The created @ref modlua_runtime_t. * @param[in] cbdata Callback data. @ref modlua_runtime_cbdata_t. * * @returns * - IB_OK On Success. * - Other on failure. */ static ib_status_t lua_pool_create_fn(void *resource, void *cbdata) { assert(resource != NULL); assert(cbdata != NULL); modlua_runtime_t *modlua_runtime; ib_mpool_lite_t *mp; ib_status_t rc; modlua_cfg_t *cfg; ib_context_t *ctx; ib_engine_t *ib; ib_module_t *module; modlua_runtime_cbdata_t *modlua_runtime_cbdata = (modlua_runtime_cbdata_t *)cbdata; assert(modlua_runtime_cbdata->ib != NULL); assert(modlua_runtime_cbdata->module != NULL); /* Alias some callback values. */ ib = modlua_runtime_cbdata->ib; module = modlua_runtime_cbdata->module; rc = ib_mpool_lite_create(&mp); if (rc != IB_OK) { return rc; } modlua_runtime = ib_mm_calloc(ib_mm_mpool_lite(mp), 1, sizeof(*modlua_runtime)); if (modlua_runtime == NULL) { rc = IB_EALLOC; goto exit_failure; } ctx = ib_context_main(ib); rc = modlua_cfg_get(ib, ctx, &cfg); if (rc != IB_OK) { ib_log_error(ib, "Failed to fetch lua configuration."); goto exit_failure; } modlua_runtime->use_count = 0; modlua_runtime->mp = mp; /* Create a new Lua State. */ rc = modlua_newstate(ib, cfg, &(modlua_runtime->L)); if (rc != IB_OK) { ib_log_error(ib, "Failed to create Lua stack."); goto exit_failure; } /* Preload the user's main context. */ rc = modlua_reload_ctx_main(ib, module, modlua_runtime->L); if (rc != IB_OK) { ib_log_error(ib, "Failed to configure Lua stack."); goto exit_failure; } *(void **)resource = modlua_runtime; return IB_OK; exit_failure: ib_mpool_lite_destroy(mp); return rc; } /** * A resource pool callback to destroy a @ref modlua_runtime_t. * * @param[out] resource The @ref modlua_runtime_t to destroy. * @param[in] cbdata Unused. */ static void lua_pool_destroy_fn(void *resource, void *cbdata) { assert(resource != NULL); modlua_runtime_t *modlua_runtime = (modlua_runtime_t *)resource; ib_mpool_lite_t *mp = modlua_runtime->mp; lua_State *L = modlua_runtime->L; assert(mp != NULL); assert(L != NULL); /* Clear the struct to provoke faster crashes. */ memset(modlua_runtime, 0, sizeof(*modlua_runtime)); /* Set the use count to -1 to signal that this is a cleared structure. */ modlua_runtime->use_count = -1; /* Finally, release the resources. */ lua_close(L); ib_mpool_lite_destroy(mp); } /** * Increment modlua_runtime_t::uses when fetched from a resource pool. * * @param[out] resource The @ref modlua_runtime_t being fetched. * @param[in] cbdata Unused. */ static void lua_pool_preuse_fn(void *resource, void *cbdata) { assert(resource != NULL); modlua_runtime_t *modlua_runtime = (modlua_runtime_t *)resource; ++(modlua_runtime->use_count); } /** * Returns @ref IB_EINVAL when modlua_runtime_t should be destroyed. * * Currently the only condition that triggers destruction is * if the max_lua_stack_uses limit is exceeded. * * @param[in] resource The @ref modlua_runtime_t to check. * @param[in] cbdata Callback data. @ref modlua_runtime_cbdata_t. * * @returns * - IB_OK When no action is required. The @a resource is still valid. * - IB_EINVAL When @a resource should be destroyed. */ static ib_status_t lua_pool_postuse_fn(void *resource, void *cbdata) { assert(resource != NULL); assert(cbdata != NULL); modlua_runtime_t *modlua_runtime = (modlua_runtime_t *)resource; modlua_runtime_cbdata_t *modlua_runtime_cbdata = (modlua_runtime_cbdata_t *)cbdata; /* Extract the limit. */ const ssize_t limit = modlua_runtime_cbdata->cfg.max_lua_stack_uses; /* Signal stack destruction if it was used some number of times. */ return (modlua_runtime->use_count > limit)? IB_EINVAL : IB_OK; } ib_status_t modlua_runtime_cfg_set_stack_use_limit( modlua_runtime_cfg_t *cfg, ssize_t limit ) { assert(cfg != NULL); if (limit <= 0) { return IB_EINVAL; } cfg->max_lua_stack_uses = limit; return IB_OK; } ib_status_t modlua_runtime_resource_pool_create( ib_resource_pool_t **resource_pool, ib_engine_t *ib, ib_module_t *module, ib_mm_t mm, modlua_runtime_cfg_t **cfg ) { assert(resource_pool != NULL); assert(ib != NULL); assert(module != NULL); ib_status_t rc; modlua_runtime_cbdata_t *modlua_runtime_cbdata; modlua_runtime_cbdata = ib_mm_calloc(mm, 1, sizeof(*modlua_runtime_cbdata)); if (modlua_runtime_cbdata == NULL) { return IB_EALLOC; } modlua_runtime_cbdata->ib = ib; modlua_runtime_cbdata->module = module; /* Initialize the configuration. */ modlua_runtime_cbdata->cfg.max_lua_stack_uses = MAX_LUA_STACK_USES; rc = ib_resource_pool_create( resource_pool, /* Out variable. */ mm, /* Memory manager. */ 10, /* Minimum 10 Lua stacks in reserve. */ 0, /* No maximum limit. */ lua_pool_create_fn, /* Create function. */ modlua_runtime_cbdata, /* Callback data is just the active engine. */ lua_pool_destroy_fn, /* Destroy function. Calls lua_close(). */ modlua_runtime_cbdata, /* Callback data is just the active engine. */ lua_pool_preuse_fn, /* Pre use function. Increments use count. */ modlua_runtime_cbdata, /* Callback data is just the active engine. */ lua_pool_postuse_fn, /* Post use function. Signals delete. */ modlua_runtime_cbdata /* Callback data is just the active engine. */ ); if (rc != IB_OK) { return rc; } *cfg = &(modlua_runtime_cbdata->cfg); return IB_OK; } ib_status_t modlua_releasestate( ib_engine_t *ib, modlua_cfg_t *cfg, modlua_runtime_t *modlua_runtime ) { assert(ib != NULL); assert(cfg != NULL); ib_status_t rc; rc = ib_lock_lock(cfg->lua_pool_lock); if (rc != IB_OK) { return rc; } rc = ib_resource_release(modlua_runtime->resource); if (rc != IB_OK) { ib_lock_unlock(cfg->lua_pool_lock); return rc; } rc = ib_lock_unlock(cfg->lua_pool_lock); if (rc != IB_OK) { return rc; } return IB_OK; } ib_status_t modlua_acquirestate( ib_engine_t *ib, modlua_cfg_t *cfg, modlua_runtime_t **modlua_runtime ) { assert(ib != NULL); assert(cfg != NULL); ib_status_t rc; ib_resource_t *resource; rc = ib_lock_lock(cfg->lua_pool_lock); if (rc != IB_OK) { return rc; } rc = ib_resource_acquire(cfg->lua_pool, &resource); if (rc != IB_OK) { ib_lock_unlock(cfg->lua_pool_lock); return rc; } rc = ib_lock_unlock(cfg->lua_pool_lock); if (rc != IB_OK) { return rc; } *modlua_runtime = (modlua_runtime_t *)ib_resource_get(resource); /* Validate the runtime. */ assert(*modlua_runtime != NULL); (*modlua_runtime)->resource = resource; /* Validate the runtime. */ assert((*modlua_runtime)->use_count >= 0); assert((*modlua_runtime)->mp != NULL); assert((*modlua_runtime)->resource == resource); return IB_OK; }
{ "pile_set_name": "Github" }
@extends("layouts.default", ['page_title' => 'Quote | View']) @section("head") <style> </style> <link href="{{ asset(mix('/assets/css/slick.css')) }}" rel="stylesheet" type="text/css"> <link href="{{ asset(mix('/assets/css/slick-theme.css')) }}" rel="stylesheet" type="text/css"> @stop @section("content") <div class="wide-container quote-wrapper"> <div id="top-action-container" class="row desktop-only"> <div class="col s12 mtop30 right"> <a href="#" data-id="{{ $quote->id }}" class="quote-share-btn btn btn-link waves-effect waves-dark"> Share </a> <a class="btn btn-link waves-effect waves-dark" href="{{ route('quote.download', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}"> Save PDF </a> <a class="btn btn-link waves-effect waves-dark" href="{{ route('quote.printview', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}"> Print </a> </div> </div> @can('update', $quote) <div id="quote-action-container" class="row mbtm0 desktop-only"> <div class="col s12 right"> @can('update', $quote) <form method="post" action="{{ route('quote.convert', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}" class="null-form"> {{ csrf_field() }} <button class="btn btn-link waves-effect waves-dark null-btn" type="submit">Convert to Invoice</button> </form> @endcan @can('update', $quote) <form method="post" action="{{ route('quote.duplicate', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}" class="null-form"> {{ csrf_field() }} <button class="btn blue darken-3 waves-effect waves-dark null-btn" type="submit">Duplicate</button> </form> @endcan @can('update', $quote) <form method="post" action="{{ route('quote.archive', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}" class="null-form"> {{ method_field('PATCH') }} {{ csrf_field() }} <button class="btn amber darken-2 waves-effect waves-dark null-btn" type="submit">Archive</button> </form> @endcan @can('update', $quote) <a href="@if(is_null($quote->client_id)){{ route('quote.adhoc.edit', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}@else{{ route('quote.edit', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}@endif" class="btn light-blue waves-effect waves-dark"> Edit </a> @endcan @can('delete', $quote) <a href="#" data-id="{{ $quote->id }}" class="quote-delete-btn btn red waves-effect waves-dark"> Delete </a> @endcan </div> </div> @endcan @can('update', $quote) <div class="fixed-action-btn toolbar mobile-only"> <a class="btn-floating btn-large btn-large red"> <i class="large material-icons">menu</i> </a> <ul> <li class="tooltipped" data-position="top" data-tooltip="Duplicate Quote"> <form method="post" action="{{ route('quote.duplicate', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}" class="null-form"> {{ csrf_field() }} <button class="btn blue darken-3 waves-effect waves-dark null-btn" type="submit"> <i class="material-icons">control_point_duplicate</i> </button> </form> </li> <li class="tooltipped" data-position="top" data-tooltip="Archive Quote"> <form method="post" action="{{ route('quote.archive', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}" class="null-form"> {{ method_field('PATCH') }} {{ csrf_field() }} <button class="btn amber darken-2 waves-effect waves-dark null-btn" type="submit"> <i class="material-icons">archive</i> </button> </form> </li> <li class="tooltipped" data-position="top" data-tooltip="Edit Quote"> <a href="{{ route('quote.edit', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ] ) }}" class="btn light-blue waves-effect waves-dark"> <i class="material-icons">edit</i> </a> </li> @can('delete', $quote) <li class="tooltipped" data-position="top" data-tooltip="Delete Quote"> <a href="#" data-id="{{ $quote->id }}" class="quote-delete-btn btn red waves-effect waves-dark"> <i class="material-icons">delete</i> </a> </li> @endcan </ul> </div> @endcan <div class="row"> <div class="col s12 l4"> <h3>Details</h3> <div id="details-panel" class="card-panel"> <dl> <dt>Company Name</dt> <dd>{{ $client->companyname ?? '-' }}</dd> <dt>Company Block</dt> <dd>{{ $client->block ?? '-' }}</dd> <dt>Company Street</dt> <dd>{{ $client->street ?? '-' }}</dd> <dt>Company Unit Number</dt> <dd>{{ $client->unitnumber ?? '-' }}</dd> <dt>Company Postal Code</dt> <dd>{{ $client->postalcode ?? '-' }}</dd> <dt>Company Nickname</dt> <dd>{{ $client->nickname ?? '-' }}</dd> <dt>Company Registration Number</dt> <dd>{{ $client->crn ?? '-' }} <dt>Contact Name</dt> <dd>{{ $client->contactname ?? '-' }}</dd> <dt>Contact Email</dt> <dd>{{ $client->contactemail ?? '-' }}</dd> <dt>Contact Phone</dt> <dd>{{ $client->contactphone ?? '-' }}</dd> <dt>Status</dt> <dd> @if ($quote->status == App\Models\Quote::STATUS_DRAFT) <span class="alt-badge">{{ $quote->statustext() }}</span> @elseif ($quote->status == App\Models\Quote::STATUS_OPEN) <span class="alt-badge warning">{{ $quote->statustext() }}</span> @elseif ($quote->status == App\Models\Quote::STATUS_EXPIRED) <span class="alt-badge error">{{ $quote->statustext() }}</span> @elseif ($quote->status == App\Models\Quote::STATUS_COMPLETED) <span class="alt-badge success">{{ $quote->statustext() }}</span> @endif </dd> </dl> </div> </div> @include('partials/quote') </div> </div> @can('delete', $quote) <div id="delete-confirmation" class="modal"> <div class="modal-content"> <p>Delete Quote?</p> </div> <div class="modal-footer"> <form id="delete-quote-form" method="post" class="null-form"> {{ method_field('DELETE') }} {{ csrf_field() }} <button class="modal-action waves-effect black-text waves-green btn-flat btn-deletemodal quote-confirm-delete-btn" type="submit">Delete</button> </form> <a href="javascript:;" class=" modal-action modal-close waves-effect black-text waves-red btn-flat btn-deletemodal">Cancel</a> </div> </div> @endcan <div id="shared-details" class="modal"> <div class="modal-content"> <div class="left"> <h5>Share</h5> </div> <div class="right"> <a href="#" data-id="{{ $quote->id }}" class="quote-regenerate-btn btn btn-link waves-effect waves-dark"> Regenerate Link </a> </div> <input id="shared-link" type="text" value="{{ route('quote.token', [ 'token' => $quote->share_token] ) }}"> </div> </div> @stop @section("scripts") <script type="text/javascript"> "use strict"; $(function() { $('#change-history-container').on('init', function(event, slick, direction){ let height = $('#change-history-container').outerHeight() + 10; // left }); $('#top-action-container').on('click', '.quote-share-btn', function (event) { event.preventDefault(); if($('#shared-link').val() == "") { getSharedLink(); } else { $('#shared-details').modal('open'); } }); $('#shared-details').on('click', '.quote-regenerate-btn', function (event) { event.preventDefault(); getSharedLink(); }); @can('delete', $quote) Unicorn.initConfirmationTrigger('#quote-action-container', '.quote-delete-btn', '{{ \App\Library\Poowf\Unicorn::getCompanyKey() }}', 'quote', 'destroy', '#delete-confirmation', '#delete-quote-form'); Unicorn.initConfirmationTrigger('.fixed-action-btn', '.quote-delete-btn', '{{ \App\Library\Poowf\Unicorn::getCompanyKey() }}', 'quote', 'destroy', '#delete-confirmation', '#delete-quote-form'); @endcan $('#change-history-container').slick({ // normal options... infinite: false, arrows: false, dots: true, slidesToShow: 2, slidesToScroll: 2, adaptiveHeight: false, responsive: [ { breakpoint: 1750, settings: { slidesToShow: 1, slidesToScroll: 1, dots: true } }, { breakpoint: 993, settings: { slidesToShow: 2, slidesToScroll: 2, dots: true } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); function getSharedLink() { $.ajax({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, method: "PATCH", url: "{{ route('quote.share', [ 'quote' => $quote, 'company' => \App\Library\Poowf\Unicorn::getCompanyKey() ]) }}", }) .done(function(data) { $('#shared-link').val("{{ route('quote.token') }}?token=" + data); $('#shared-details').modal('open'); }); } }); </script> @stop
{ "pile_set_name": "Github" }
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * See LICENSE.txt included in this distribution for the specific * language governing permissions and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at LICENSE.txt. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. */ package opengrok.auth.plugin.util; import java.io.BufferedReader; import java.io.IOException; import java.security.Principal; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Locale; import java.util.Map; import javax.servlet.AsyncContext; import javax.servlet.DispatcherType; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletInputStream; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpUpgradeHandler; import javax.servlet.http.Part; import opengrok.auth.plugin.UserPlugin; import opengrok.auth.plugin.entity.User; import org.opengrok.indexer.util.RandomString; public class DummyHttpServletRequestLdap implements HttpServletRequest { private final Map<String, String> headers = new HashMap<>(); private final Map<String, Object> attrs = new HashMap<>(); private HttpSession sessions = new HttpSession() { private final Map<String, Object> attrs = new HashMap<>(); @Override public long getCreationTime() { return 0; } @Override public String getId() { User user; if ((user = (User) getAttribute(UserPlugin.REQUEST_ATTR)) != null) { return user.getUsername(); } return RandomString.generate(5); } @Override public long getLastAccessedTime() { return 0; } @Override public ServletContext getServletContext() { return (ServletContext) DummyHttpServletRequestLdap.this; } @Override public void setMaxInactiveInterval(int i) { } @Override public int getMaxInactiveInterval() { return 3600; } @Override @SuppressWarnings("deprecation") public javax.servlet.http.HttpSessionContext getSessionContext() { throw new UnsupportedOperationException("Not supported yet."); } @Override public Object getAttribute(String string) { return attrs.get(string); } @Override @SuppressWarnings("deprecation") public Object getValue(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public Enumeration<String> getAttributeNames() { throw new UnsupportedOperationException("Not supported yet."); } @Override @SuppressWarnings("deprecation") public String[] getValueNames() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void setAttribute(String string, Object o) { attrs.put(string, o); } @Override @SuppressWarnings("deprecation") public void putValue(String string, Object o) { } @Override public void removeAttribute(String string) { attrs.remove(string); } @Override @SuppressWarnings("deprecation") public void removeValue(String string) { } @Override public void invalidate() { } @Override public boolean isNew() { return true; } }; @Override public String getAuthType() { throw new UnsupportedOperationException("Not supported yet."); } @Override public Cookie[] getCookies() { throw new UnsupportedOperationException("Not supported yet."); } @Override public long getDateHeader(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getHeader(String string) { return headers.get(string); } @Override public Enumeration<String> getHeaders(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public Enumeration<String> getHeaderNames() { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getIntHeader(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getMethod() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getPathInfo() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getPathTranslated() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getContextPath() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getQueryString() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getRemoteUser() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isUserInRole(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public Principal getUserPrincipal() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getRequestedSessionId() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getRequestURI() { throw new UnsupportedOperationException("Not supported yet."); } @Override public StringBuffer getRequestURL() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getServletPath() { throw new UnsupportedOperationException("Not supported yet."); } @Override public HttpSession getSession(boolean bln) { return sessions; } @Override public HttpSession getSession() { return sessions; } @Override public String changeSessionId() { return null; } @Override public boolean isRequestedSessionIdValid() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isRequestedSessionIdFromCookie() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isRequestedSessionIdFromURL() { throw new UnsupportedOperationException("Not supported yet."); } @Override @Deprecated public boolean isRequestedSessionIdFromUrl() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean authenticate(HttpServletResponse httpServletResponse) { return false; } @Override public void login(String s, String s1) { } @Override public void logout() { } @Override public Collection<Part> getParts() { return null; } @Override public Part getPart(String s) { return null; } @Override public <T extends HttpUpgradeHandler> T upgrade(Class<T> aClass) { return null; } @Override public Object getAttribute(String string) { return attrs.get(string); } @Override public Enumeration<String> getAttributeNames() { return Collections.enumeration(attrs.keySet()); } @Override public String getCharacterEncoding() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void setCharacterEncoding(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getContentLength() { throw new UnsupportedOperationException("Not supported yet."); } @Override public long getContentLengthLong() { return 0; } @Override public String getContentType() { throw new UnsupportedOperationException("Not supported yet."); } @Override public ServletInputStream getInputStream() throws IOException { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getParameter(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public Enumeration<String> getParameterNames() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String[] getParameterValues(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public Map<String, String[]> getParameterMap() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getProtocol() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getScheme() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getServerName() { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getServerPort() { throw new UnsupportedOperationException("Not supported yet."); } @Override public BufferedReader getReader() throws IOException { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getRemoteAddr() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getRemoteHost() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void setAttribute(String name, Object o) { attrs.put(name, o); } @Override public void removeAttribute(String name) { attrs.remove(name); } @Override public Locale getLocale() { throw new UnsupportedOperationException("Not supported yet."); } @Override public Enumeration<Locale> getLocales() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean isSecure() { throw new UnsupportedOperationException("Not supported yet."); } @Override public RequestDispatcher getRequestDispatcher(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override @Deprecated public String getRealPath(String string) { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getRemotePort() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getLocalName() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getLocalAddr() { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getLocalPort() { throw new UnsupportedOperationException("Not supported yet."); } @Override public ServletContext getServletContext() { return null; } @Override public AsyncContext startAsync() throws IllegalStateException { return null; } @Override public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException { return null; } @Override public boolean isAsyncStarted() { return false; } @Override public boolean isAsyncSupported() { return false; } @Override public AsyncContext getAsyncContext() { return null; } @Override public DispatcherType getDispatcherType() { return null; } }
{ "pile_set_name": "Github" }
/* * jQuery.flot.dashes * * options = { * series: { * dashes: { * * // show * // default: false * // Whether to show dashes for the series. * show: <boolean>, * * // lineWidth * // default: 2 * // The width of the dashed line in pixels. * lineWidth: <number>, * * // dashLength * // default: 10 * // Controls the length of the individual dashes and the amount of * // space between them. * // If this is a number, the dashes and spaces will have that length. * // If this is an array, it is read as [ dashLength, spaceLength ] * dashLength: <number> or <array[2]> * } * } * } */ (function($){ function init(plot) { plot.hooks.processDatapoints.push(function(plot, series, datapoints) { if (!series.dashes.show) return; plot.hooks.draw.push(function(plot, ctx) { var plotOffset = plot.getPlotOffset(), axisx = series.xaxis, axisy = series.yaxis; function plotDashes(xoffset, yoffset) { var points = datapoints.points, ps = datapoints.pointsize, prevx = null, prevy = null, dashRemainder = 0, dashOn = true, dashOnLength, dashOffLength; if (series.dashes.dashLength[0]) { dashOnLength = series.dashes.dashLength[0]; if (series.dashes.dashLength[1]) { dashOffLength = series.dashes.dashLength[1]; } else { dashOffLength = dashOnLength; } } else { dashOffLength = dashOnLength = series.dashes.dashLength; } ctx.beginPath(); for (var i = ps; i < points.length; i += ps) { var x1 = points[i - ps], y1 = points[i - ps + 1], x2 = points[i], y2 = points[i + 1]; if (x1 == null || x2 == null) continue; // clip with ymin if (y1 <= y2 && y1 < axisy.min) { if (y2 < axisy.min) continue; // line segment is outside // compute new intersection point x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; y1 = axisy.min; } else if (y2 <= y1 && y2 < axisy.min) { if (y1 < axisy.min) continue; x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; y2 = axisy.min; } // clip with ymax if (y1 >= y2 && y1 > axisy.max) { if (y2 > axisy.max) continue; x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; y1 = axisy.max; } else if (y2 >= y1 && y2 > axisy.max) { if (y1 > axisy.max) continue; x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; y2 = axisy.max; } // clip with xmin if (x1 <= x2 && x1 < axisx.min) { if (x2 < axisx.min) continue; y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; x1 = axisx.min; } else if (x2 <= x1 && x2 < axisx.min) { if (x1 < axisx.min) continue; y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; x2 = axisx.min; } // clip with xmax if (x1 >= x2 && x1 > axisx.max) { if (x2 > axisx.max) continue; y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; x1 = axisx.max; } else if (x2 >= x1 && x2 > axisx.max) { if (x1 > axisx.max) continue; y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; x2 = axisx.max; } if (x1 != prevx || y1 != prevy) { ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset); } var ax1 = axisx.p2c(x1) + xoffset, ay1 = axisy.p2c(y1) + yoffset, ax2 = axisx.p2c(x2) + xoffset, ay2 = axisy.p2c(y2) + yoffset, dashOffset; function lineSegmentOffset(segmentLength) { var c = Math.sqrt(Math.pow(ax2 - ax1, 2) + Math.pow(ay2 - ay1, 2)); if (c <= segmentLength) { return { deltaX: ax2 - ax1, deltaY: ay2 - ay1, distance: c, remainder: segmentLength - c } } else { var xsign = ax2 > ax1 ? 1 : -1, ysign = ay2 > ay1 ? 1 : -1; return { deltaX: xsign * Math.sqrt(Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))), deltaY: ysign * Math.sqrt(Math.pow(segmentLength, 2) - Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))), distance: segmentLength, remainder: 0 }; } } //-end lineSegmentOffset do { dashOffset = lineSegmentOffset( dashRemainder > 0 ? dashRemainder : dashOn ? dashOnLength : dashOffLength); if (dashOffset.deltaX != 0 || dashOffset.deltaY != 0) { if (dashOn) { ctx.lineTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY); } else { ctx.moveTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY); } } dashOn = !dashOn; dashRemainder = dashOffset.remainder; ax1 += dashOffset.deltaX; ay1 += dashOffset.deltaY; } while (dashOffset.distance > 0); prevx = x2; prevy = y2; } ctx.stroke(); } //-end plotDashes ctx.save(); ctx.translate(plotOffset.left, plotOffset.top); ctx.lineJoin = 'round'; var lw = series.dashes.lineWidth, sw = series.shadowSize; // FIXME: consider another form of shadow when filling is turned on if (lw > 0 && sw > 0) { // draw shadow as a thick and thin line with transparency ctx.lineWidth = sw; ctx.strokeStyle = "rgba(0,0,0,0.1)"; // position shadow at angle from the mid of line var angle = Math.PI/18; plotDashes(Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2)); ctx.lineWidth = sw/2; plotDashes(Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4)); } ctx.lineWidth = lw; ctx.strokeStyle = series.color; if (lw > 0) { plotDashes(0, 0); } ctx.restore(); }); //-end draw hook }); //-end processDatapoints hook } //-end init $.plot.plugins.push({ init: init, options: { series: { dashes: { show: false, lineWidth: 2, dashLength: 10 } } }, name: 'dashes', version: '0.1' }); })(jQuery)
{ "pile_set_name": "Github" }
op { name: "PartitionedCall" input_arg { name: "args" type_list_attr: "Tin" } output_arg { name: "output" type_list_attr: "Tout" } attr { name: "Tin" type: "list(type)" has_minimum: true } attr { name: "Tout" type: "list(type)" has_minimum: true } attr { name: "f" type: "func" } } op { name: "PartitionedCall" input_arg { name: "args" type_list_attr: "Tin" } output_arg { name: "output" type_list_attr: "Tout" } attr { name: "Tin" type: "list(type)" has_minimum: true } attr { name: "Tout" type: "list(type)" has_minimum: true } attr { name: "f" type: "func" } attr { name: "config" type: "string" default_value { s: "" } } } op { name: "PartitionedCall" input_arg { name: "args" type_list_attr: "Tin" } output_arg { name: "output" type_list_attr: "Tout" } attr { name: "Tin" type: "list(type)" has_minimum: true } attr { name: "Tout" type: "list(type)" has_minimum: true } attr { name: "f" type: "func" } attr { name: "config" type: "string" default_value { s: "" } } attr { name: "executor_type" type: "string" default_value { s: "" } } } op { name: "PartitionedCall" input_arg { name: "args" type_list_attr: "Tin" } output_arg { name: "output" type_list_attr: "Tout" } attr { name: "Tin" type: "list(type)" has_minimum: true } attr { name: "Tout" type: "list(type)" has_minimum: true } attr { name: "f" type: "func" } attr { name: "config" type: "string" default_value { s: "" } } attr { name: "config_proto" type: "string" default_value { s: "" } } attr { name: "executor_type" type: "string" default_value { s: "" } } }
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * JS bytecode descriptors, disassemblers, and (expression) decompilers. */ #include "jsopcodeinlines.h" #include <ctype.h> #include <stdarg.h> #include <stdio.h> #include <string.h> #include "jsapi.h" #include "jsatom.h" #include "jscntxt.h" #include "jscompartment.h" #include "jsfun.h" #include "jsnum.h" #include "jsobj.h" #include "jsprf.h" #include "jsscript.h" #include "jsstr.h" #include "jstypes.h" #include "jsutil.h" #include "asmjs/AsmJSModule.h" #include "frontend/BytecodeCompiler.h" #include "frontend/SourceNotes.h" #include "js/CharacterEncoding.h" #include "vm/Opcodes.h" #include "vm/ScopeObject.h" #include "vm/Shape.h" #include "vm/StringBuffer.h" #include "jscntxtinlines.h" #include "jscompartmentinlines.h" #include "jsobjinlines.h" #include "jsscriptinlines.h" using namespace js; using namespace js::gc; using JS::AutoCheckCannotGC; using js::frontend::IsIdentifier; /* * Index limit must stay within 32 bits. */ JS_STATIC_ASSERT(sizeof(uint32_t) * JS_BITS_PER_BYTE >= INDEX_LIMIT_LOG2 + 1); const JSCodeSpec js_CodeSpec[] = { #define MAKE_CODESPEC(op,val,name,token,length,nuses,ndefs,format) {length,nuses,ndefs,format}, FOR_EACH_OPCODE(MAKE_CODESPEC) #undef MAKE_CODESPEC }; const unsigned js_NumCodeSpecs = JS_ARRAY_LENGTH(js_CodeSpec); /* * Each element of the array is either a source literal associated with JS * bytecode or null. */ static const char * const CodeToken[] = { #define TOKEN(op, val, name, token, ...) token, FOR_EACH_OPCODE(TOKEN) #undef TOKEN }; /* * Array of JS bytecode names used by PC count JSON, DEBUG-only js_Disassemble * and JIT debug spew. */ const char * const js_CodeName[] = { #define OPNAME(op, val, name, ...) name, FOR_EACH_OPCODE(OPNAME) #undef OPNAME }; /************************************************************************/ #define COUNTS_LEN 16 size_t js_GetVariableBytecodeLength(jsbytecode* pc) { JSOp op = JSOp(*pc); MOZ_ASSERT(js_CodeSpec[op].length == -1); switch (op) { case JSOP_TABLESWITCH: { /* Structure: default-jump case-low case-high case1-jump ... */ pc += JUMP_OFFSET_LEN; int32_t low = GET_JUMP_OFFSET(pc); pc += JUMP_OFFSET_LEN; int32_t high = GET_JUMP_OFFSET(pc); unsigned ncases = unsigned(high - low + 1); return 1 + 3 * JUMP_OFFSET_LEN + ncases * JUMP_OFFSET_LEN; } default: MOZ_CRASH("Unexpected op"); } } unsigned js::StackUses(JSScript* script, jsbytecode* pc) { JSOp op = (JSOp) *pc; const JSCodeSpec& cs = js_CodeSpec[op]; if (cs.nuses >= 0) return cs.nuses; MOZ_ASSERT(js_CodeSpec[op].nuses == -1); switch (op) { case JSOP_POPN: return GET_UINT16(pc); default: /* stack: fun, this, [argc arguments] */ MOZ_ASSERT(op == JSOP_NEW || op == JSOP_CALL || op == JSOP_EVAL || op == JSOP_STRICTEVAL || op == JSOP_FUNCALL || op == JSOP_FUNAPPLY); return 2 + GET_ARGC(pc); } } unsigned js::StackDefs(JSScript* script, jsbytecode* pc) { JSOp op = (JSOp) *pc; const JSCodeSpec& cs = js_CodeSpec[op]; MOZ_ASSERT(cs.ndefs >= 0); return cs.ndefs; } static const char * const countBaseNames[] = { "interp" }; JS_STATIC_ASSERT(JS_ARRAY_LENGTH(countBaseNames) == PCCounts::BASE_LIMIT); static const char * const countAccessNames[] = { "infer_mono", "infer_di", "infer_poly", "infer_barrier", "infer_nobarrier", "observe_undefined", "observe_null", "observe_boolean", "observe_int32", "observe_double", "observe_string", "observe_object" }; JS_STATIC_ASSERT(JS_ARRAY_LENGTH(countBaseNames) + JS_ARRAY_LENGTH(countAccessNames) == PCCounts::ACCESS_LIMIT); static const char * const countElementNames[] = { "id_int", "id_double", "id_other", "id_unknown", "elem_typed", "elem_packed", "elem_dense", "elem_other" }; JS_STATIC_ASSERT(JS_ARRAY_LENGTH(countBaseNames) + JS_ARRAY_LENGTH(countAccessNames) + JS_ARRAY_LENGTH(countElementNames) == PCCounts::ELEM_LIMIT); static const char * const countPropertyNames[] = { "prop_static", "prop_definite", "prop_other" }; JS_STATIC_ASSERT(JS_ARRAY_LENGTH(countBaseNames) + JS_ARRAY_LENGTH(countAccessNames) + JS_ARRAY_LENGTH(countPropertyNames) == PCCounts::PROP_LIMIT); static const char * const countArithNames[] = { "arith_int", "arith_double", "arith_other", "arith_unknown", }; JS_STATIC_ASSERT(JS_ARRAY_LENGTH(countBaseNames) + JS_ARRAY_LENGTH(countArithNames) == PCCounts::ARITH_LIMIT); /* static */ const char* PCCounts::countName(JSOp op, size_t which) { MOZ_ASSERT(which < numCounts(op)); if (which < BASE_LIMIT) return countBaseNames[which]; if (accessOp(op)) { if (which < ACCESS_LIMIT) return countAccessNames[which - BASE_LIMIT]; if (elementOp(op)) return countElementNames[which - ACCESS_LIMIT]; if (propertyOp(op)) return countPropertyNames[which - ACCESS_LIMIT]; MOZ_CRASH("bad op"); } if (arithOp(op)) return countArithNames[which - BASE_LIMIT]; MOZ_CRASH("bad op"); } void js::DumpIonScriptCounts(Sprinter* sp, jit::IonScriptCounts* ionCounts) { Sprint(sp, "IonScript [%lu blocks]:\n", ionCounts->numBlocks()); for (size_t i = 0; i < ionCounts->numBlocks(); i++) { const jit::IonBlockCounts& block = ionCounts->block(i); Sprint(sp, "BB #%lu [%05u]", block.id(), block.offset()); if (block.description()) Sprint(sp, " [inlined %s]", block.description()); for (size_t j = 0; j < block.numSuccessors(); j++) Sprint(sp, " -> #%lu", block.successor(j)); Sprint(sp, " :: %llu hits\n", block.hitCount()); Sprint(sp, "%s\n", block.code()); } } void js_DumpPCCounts(JSContext* cx, HandleScript script, js::Sprinter* sp) { MOZ_ASSERT(script->hasScriptCounts()); #ifdef DEBUG jsbytecode* pc = script->code(); while (pc < script->codeEnd()) { JSOp op = JSOp(*pc); jsbytecode* next = GetNextPc(pc); if (!js_Disassemble1(cx, script, pc, script->pcToOffset(pc), true, sp)) return; size_t total = PCCounts::numCounts(op); double* raw = script->getPCCounts(pc).rawCounts(); Sprint(sp, " {"); bool printed = false; for (size_t i = 0; i < total; i++) { double val = raw[i]; if (val) { if (printed) Sprint(sp, ", "); Sprint(sp, "\"%s\": %.0f", PCCounts::countName(op, i), val); printed = true; } } Sprint(sp, "}\n"); pc = next; } #endif jit::IonScriptCounts* ionCounts = script->getIonCounts(); while (ionCounts) { DumpIonScriptCounts(sp, ionCounts); ionCounts = ionCounts->previous(); } } void js::DumpCompartmentPCCounts(JSContext* cx) { for (ZoneCellIter i(cx->zone(), gc::FINALIZE_SCRIPT); !i.done(); i.next()) { RootedScript script(cx, i.get<JSScript>()); if (script->compartment() != cx->compartment()) continue; if (script->hasScriptCounts()) { Sprinter sprinter(cx); if (!sprinter.init()) return; fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno()); js_DumpPCCounts(cx, script, &sprinter); fputs(sprinter.string(), stdout); fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno()); } } for (unsigned thingKind = FINALIZE_OBJECT0; thingKind < FINALIZE_OBJECT_LIMIT; thingKind++) { for (ZoneCellIter i(cx->zone(), (AllocKind) thingKind); !i.done(); i.next()) { JSObject* obj = i.get<JSObject>(); if (obj->compartment() != cx->compartment()) continue; if (obj->is<AsmJSModuleObject>()) { AsmJSModule& module = obj->as<AsmJSModuleObject>().module(); Sprinter sprinter(cx); if (!sprinter.init()) return; fprintf(stdout, "--- Asm.js Module ---\n"); for (size_t i = 0; i < module.numFunctionCounts(); i++) { jit::IonScriptCounts* counts = module.functionCounts(i); DumpIonScriptCounts(&sprinter, counts); } fputs(sprinter.string(), stdout); fprintf(stdout, "--- END Asm.js Module ---\n"); } } } } ///////////////////////////////////////////////////////////////////// // Bytecode Parser ///////////////////////////////////////////////////////////////////// namespace { class BytecodeParser { class Bytecode { public: Bytecode() { mozilla::PodZero(this); } // Whether this instruction has been analyzed to get its output defines // and stack. bool parsed : 1; // Stack depth before this opcode. uint32_t stackDepth; // Pointer to array of |stackDepth| offsets. An element at position N // in the array is the offset of the opcode that defined the // corresponding stack slot. The top of the stack is at position // |stackDepth - 1|. uint32_t* offsetStack; bool captureOffsetStack(LifoAlloc& alloc, const uint32_t* stack, uint32_t depth) { stackDepth = depth; offsetStack = alloc.newArray<uint32_t>(stackDepth); if (stackDepth) { if (!offsetStack) return false; for (uint32_t n = 0; n < stackDepth; n++) offsetStack[n] = stack[n]; } return true; } // When control-flow merges, intersect the stacks, marking slots that // are defined by different offsets with the UINT32_MAX sentinel. // This is sufficient for forward control-flow. It doesn't grok loops // -- for that you would have to iterate to a fixed point -- but there // shouldn't be operands on the stack at a loop back-edge anyway. void mergeOffsetStack(const uint32_t* stack, uint32_t depth) { MOZ_ASSERT(depth == stackDepth); for (uint32_t n = 0; n < stackDepth; n++) if (offsetStack[n] != stack[n]) offsetStack[n] = UINT32_MAX; } }; JSContext* cx_; LifoAllocScope allocScope_; RootedScript script_; Bytecode** codeArray_; public: BytecodeParser(JSContext* cx, JSScript* script) : cx_(cx), allocScope_(&cx->tempLifoAlloc()), script_(cx, script), codeArray_(nullptr) { } bool parse(); #ifdef DEBUG bool isReachable(uint32_t offset) { return maybeCode(offset); } bool isReachable(const jsbytecode* pc) { return maybeCode(pc); } #endif uint32_t stackDepthAtPC(uint32_t offset) { // Sometimes the code generator in debug mode asks about the stack depth // of unreachable code (bug 932180 comment 22). Assume that unreachable // code has no operands on the stack. return getCode(offset).stackDepth; } uint32_t stackDepthAtPC(const jsbytecode* pc) { return stackDepthAtPC(script_->pcToOffset(pc)); } uint32_t offsetForStackOperand(uint32_t offset, int operand) { Bytecode& code = getCode(offset); if (operand < 0) { operand += code.stackDepth; MOZ_ASSERT(operand >= 0); } MOZ_ASSERT(uint32_t(operand) < code.stackDepth); return code.offsetStack[operand]; } jsbytecode* pcForStackOperand(jsbytecode* pc, int operand) { uint32_t offset = offsetForStackOperand(script_->pcToOffset(pc), operand); if (offset == UINT32_MAX) return nullptr; return script_->offsetToPC(offsetForStackOperand(script_->pcToOffset(pc), operand)); } private: LifoAlloc& alloc() { return allocScope_.alloc(); } void reportOOM() { allocScope_.releaseEarly(); js_ReportOutOfMemory(cx_); } uint32_t numSlots() { return 1 + script_->nfixed() + (script_->functionNonDelazifying() ? script_->functionNonDelazifying()->nargs() : 0); } uint32_t maximumStackDepth() { return script_->nslots() - script_->nfixed(); } Bytecode& getCode(uint32_t offset) { MOZ_ASSERT(offset < script_->length()); MOZ_ASSERT(codeArray_[offset]); return *codeArray_[offset]; } Bytecode& getCode(const jsbytecode* pc) { return getCode(script_->pcToOffset(pc)); } Bytecode* maybeCode(uint32_t offset) { MOZ_ASSERT(offset < script_->length()); return codeArray_[offset]; } Bytecode* maybeCode(const jsbytecode* pc) { return maybeCode(script_->pcToOffset(pc)); } uint32_t simulateOp(JSOp op, uint32_t offset, uint32_t* offsetStack, uint32_t stackDepth); inline bool addJump(uint32_t offset, uint32_t* currentOffset, uint32_t stackDepth, const uint32_t* offsetStack); }; } // anonymous namespace uint32_t BytecodeParser::simulateOp(JSOp op, uint32_t offset, uint32_t* offsetStack, uint32_t stackDepth) { uint32_t nuses = GetUseCount(script_, offset); uint32_t ndefs = GetDefCount(script_, offset); MOZ_ASSERT(stackDepth >= nuses); stackDepth -= nuses; MOZ_ASSERT(stackDepth + ndefs <= maximumStackDepth()); // Mark the current offset as defining its values on the offset stack, // unless it just reshuffles the stack. In that case we want to preserve // the opcode that generated the original value. switch (op) { default: for (uint32_t n = 0; n != ndefs; ++n) offsetStack[stackDepth + n] = offset; break; case JSOP_CASE: /* Keep the switch value. */ MOZ_ASSERT(ndefs == 1); break; case JSOP_DUP: MOZ_ASSERT(ndefs == 2); if (offsetStack) offsetStack[stackDepth + 1] = offsetStack[stackDepth]; break; case JSOP_DUP2: MOZ_ASSERT(ndefs == 4); if (offsetStack) { offsetStack[stackDepth + 2] = offsetStack[stackDepth]; offsetStack[stackDepth + 3] = offsetStack[stackDepth + 1]; } break; case JSOP_DUPAT: { MOZ_ASSERT(ndefs == 1); jsbytecode* pc = script_->offsetToPC(offset); unsigned n = GET_UINT24(pc); MOZ_ASSERT(n < stackDepth); if (offsetStack) offsetStack[stackDepth] = offsetStack[stackDepth - 1 - n]; break; } case JSOP_SWAP: MOZ_ASSERT(ndefs == 2); if (offsetStack) { uint32_t tmp = offsetStack[stackDepth + 1]; offsetStack[stackDepth + 1] = offsetStack[stackDepth]; offsetStack[stackDepth] = tmp; } break; } stackDepth += ndefs; return stackDepth; } bool BytecodeParser::addJump(uint32_t offset, uint32_t* currentOffset, uint32_t stackDepth, const uint32_t* offsetStack) { MOZ_ASSERT(offset < script_->length()); Bytecode*& code = codeArray_[offset]; if (!code) { code = alloc().new_<Bytecode>(); if (!code) return false; if (!code->captureOffsetStack(alloc(), offsetStack, stackDepth)) { reportOOM(); return false; } } else { code->mergeOffsetStack(offsetStack, stackDepth); } if (offset < *currentOffset && !code->parsed) { // Backedge in a while/for loop, whose body has not been parsed due // to a lack of fallthrough at the loop head. Roll back the offset // to analyze the body. *currentOffset = offset; } return true; } bool BytecodeParser::parse() { MOZ_ASSERT(!codeArray_); uint32_t length = script_->length(); codeArray_ = alloc().newArray<Bytecode*>(length); if (!codeArray_) { reportOOM(); return false; } mozilla::PodZero(codeArray_, length); // Fill in stack depth and definitions at initial bytecode. Bytecode* startcode = alloc().new_<Bytecode>(); if (!startcode) { reportOOM(); return false; } // Fill in stack depth and definitions at initial bytecode. uint32_t* offsetStack = alloc().newArray<uint32_t>(maximumStackDepth()); if (maximumStackDepth() && !offsetStack) { reportOOM(); return false; } startcode->stackDepth = 0; codeArray_[0] = startcode; uint32_t offset, nextOffset = 0; while (nextOffset < length) { offset = nextOffset; Bytecode* code = maybeCode(offset); jsbytecode* pc = script_->offsetToPC(offset); JSOp op = (JSOp)*pc; MOZ_ASSERT(op < JSOP_LIMIT); // Immediate successor of this bytecode. uint32_t successorOffset = offset + GetBytecodeLength(pc); // Next bytecode to analyze. This is either the successor, or is an // earlier bytecode if this bytecode has a loop backedge. nextOffset = successorOffset; if (!code) { // Haven't found a path by which this bytecode is reachable. continue; } if (code->parsed) { // No need to reparse. continue; } code->parsed = true; uint32_t stackDepth = simulateOp(op, offset, offsetStack, code->stackDepth); switch (op) { case JSOP_TABLESWITCH: { uint32_t defaultOffset = offset + GET_JUMP_OFFSET(pc); jsbytecode* pc2 = pc + JUMP_OFFSET_LEN; int32_t low = GET_JUMP_OFFSET(pc2); pc2 += JUMP_OFFSET_LEN; int32_t high = GET_JUMP_OFFSET(pc2); pc2 += JUMP_OFFSET_LEN; if (!addJump(defaultOffset, &nextOffset, stackDepth, offsetStack)) return false; for (int32_t i = low; i <= high; i++) { uint32_t targetOffset = offset + GET_JUMP_OFFSET(pc2); if (targetOffset != offset) { if (!addJump(targetOffset, &nextOffset, stackDepth, offsetStack)) return false; } pc2 += JUMP_OFFSET_LEN; } break; } case JSOP_TRY: { // Everything between a try and corresponding catch or finally is conditional. // Note that there is no problem with code which is skipped by a thrown // exception but is not caught by a later handler in the same function: // no more code will execute, and it does not matter what is defined. JSTryNote* tn = script_->trynotes()->vector; JSTryNote* tnlimit = tn + script_->trynotes()->length; for (; tn < tnlimit; tn++) { uint32_t startOffset = script_->mainOffset() + tn->start; if (startOffset == offset + 1) { uint32_t catchOffset = startOffset + tn->length; if (tn->kind == JSTRY_CATCH || tn->kind == JSTRY_FINALLY) { if (!addJump(catchOffset, &nextOffset, stackDepth, offsetStack)) return false; } } } break; } default: break; } // Check basic jump opcodes, which may or may not have a fallthrough. if (IsJumpOpcode(op)) { // Case instructions do not push the lvalue back when branching. uint32_t newStackDepth = stackDepth; if (op == JSOP_CASE) newStackDepth--; uint32_t targetOffset = offset + GET_JUMP_OFFSET(pc); if (!addJump(targetOffset, &nextOffset, newStackDepth, offsetStack)) return false; } // Handle any fallthrough from this opcode. if (BytecodeFallsThrough(op)) { MOZ_ASSERT(successorOffset < script_->length()); Bytecode*& nextcode = codeArray_[successorOffset]; if (!nextcode) { nextcode = alloc().new_<Bytecode>(); if (!nextcode) { reportOOM(); return false; } if (!nextcode->captureOffsetStack(alloc(), offsetStack, stackDepth)) { reportOOM(); return false; } } else { nextcode->mergeOffsetStack(offsetStack, stackDepth); } } } return true; } #ifdef DEBUG bool js::ReconstructStackDepth(JSContext* cx, JSScript* script, jsbytecode* pc, uint32_t* depth, bool* reachablePC) { BytecodeParser parser(cx, script); if (!parser.parse()) return false; *reachablePC = parser.isReachable(pc); if (*reachablePC) *depth = parser.stackDepthAtPC(pc); return true; } /* * If pc != nullptr, include a prefix indicating whether the PC is at the * current line. If showAll is true, include the source note type and the * entry stack depth. */ JS_FRIEND_API(bool) js_DisassembleAtPC(JSContext* cx, JSScript* scriptArg, bool lines, jsbytecode* pc, bool showAll, Sprinter* sp) { RootedScript script(cx, scriptArg); BytecodeParser parser(cx, script); jsbytecode* next, *end; unsigned len; if (showAll && !parser.parse()) return false; if (showAll) Sprint(sp, "%s:%u\n", script->filename(), script->lineno()); if (pc != nullptr) sp->put(" "); if (showAll) sp->put("sn stack "); sp->put("loc "); if (lines) sp->put("line"); sp->put(" op\n"); if (pc != nullptr) sp->put(" "); if (showAll) sp->put("-- ----- "); sp->put("----- "); if (lines) sp->put("----"); sp->put(" --\n"); next = script->code(); end = script->codeEnd(); while (next < end) { if (next == script->main()) sp->put("main:\n"); if (pc != nullptr) { if (pc == next) sp->put("--> "); else sp->put(" "); } if (showAll) { jssrcnote* sn = js_GetSrcNote(cx, script, next); if (sn) { MOZ_ASSERT(!SN_IS_TERMINATOR(sn)); jssrcnote* next = SN_NEXT(sn); while (!SN_IS_TERMINATOR(next) && SN_DELTA(next) == 0) { Sprint(sp, "%02u\n ", SN_TYPE(sn)); sn = next; next = SN_NEXT(sn); } Sprint(sp, "%02u ", SN_TYPE(sn)); } else sp->put(" "); if (parser.isReachable(next)) Sprint(sp, "%05u ", parser.stackDepthAtPC(next)); else Sprint(sp, " "); } len = js_Disassemble1(cx, script, next, script->pcToOffset(next), lines, sp); if (!len) return false; next += len; } return true; } bool js_Disassemble(JSContext* cx, HandleScript script, bool lines, Sprinter* sp) { return js_DisassembleAtPC(cx, script, lines, nullptr, false, sp); } JS_FRIEND_API(bool) js_DumpPC(JSContext* cx) { js::gc::AutoSuppressGC suppressGC(cx); Sprinter sprinter(cx); if (!sprinter.init()) return false; ScriptFrameIter iter(cx); if (iter.done()) { fprintf(stdout, "Empty stack.\n"); return true; } RootedScript script(cx, iter.script()); bool ok = js_DisassembleAtPC(cx, script, true, iter.pc(), false, &sprinter); fprintf(stdout, "%s", sprinter.string()); return ok; } JS_FRIEND_API(bool) js_DumpScript(JSContext* cx, JSScript* scriptArg) { js::gc::AutoSuppressGC suppressGC(cx); Sprinter sprinter(cx); if (!sprinter.init()) return false; RootedScript script(cx, scriptArg); bool ok = js_Disassemble(cx, script, true, &sprinter); fprintf(stdout, "%s", sprinter.string()); return ok; } /* * Useful to debug ReconstructPCStack. */ JS_FRIEND_API(bool) js_DumpScriptDepth(JSContext* cx, JSScript* scriptArg, jsbytecode* pc) { js::gc::AutoSuppressGC suppressGC(cx); Sprinter sprinter(cx); if (!sprinter.init()) return false; RootedScript script(cx, scriptArg); bool ok = js_DisassembleAtPC(cx, script, true, pc, true, &sprinter); fprintf(stdout, "%s", sprinter.string()); return ok; } static char* QuoteString(Sprinter* sp, JSString* str, char16_t quote); static bool ToDisassemblySource(JSContext* cx, HandleValue v, JSAutoByteString* bytes) { if (v.isString()) { Sprinter sprinter(cx); if (!sprinter.init()) return false; char* nbytes = QuoteString(&sprinter, v.toString(), '"'); if (!nbytes) return false; nbytes = JS_sprintf_append(nullptr, "%s", nbytes); if (!nbytes) return false; bytes->initBytes(nbytes); return true; } JSRuntime* rt = cx->runtime(); if (rt->isHeapBusy() || !rt->gc.isAllocAllowed()) { char* source = JS_sprintf_append(nullptr, "<value>"); if (!source) return false; bytes->initBytes(source); return true; } if (v.isObject()) { JSObject& obj = v.toObject(); if (obj.is<StaticBlockObject>()) { Rooted<StaticBlockObject*> block(cx, &obj.as<StaticBlockObject>()); char* source = JS_sprintf_append(nullptr, "depth %d {", block->localOffset()); if (!source) return false; Shape::Range<CanGC> r(cx, block->lastProperty()); while (!r.empty()) { Rooted<Shape*> shape(cx, &r.front()); JSAtom* atom = JSID_IS_INT(shape->propid()) ? cx->names().empty : JSID_TO_ATOM(shape->propid()); JSAutoByteString bytes; if (!AtomToPrintableString(cx, atom, &bytes)) return false; r.popFront(); source = JS_sprintf_append(source, "%s: %d%s", bytes.ptr(), block->shapeToIndex(*shape), !r.empty() ? ", " : ""); if (!source) return false; } source = JS_sprintf_append(source, "}"); if (!source) return false; bytes->initBytes(source); return true; } if (obj.is<JSFunction>()) { RootedFunction fun(cx, &obj.as<JSFunction>()); JSString* str = JS_DecompileFunction(cx, fun, JS_DONT_PRETTY_PRINT); if (!str) return false; return bytes->encodeLatin1(cx, str); } if (obj.is<RegExpObject>()) { JSString* source = obj.as<RegExpObject>().toString(cx); if (!source) return false; return bytes->encodeLatin1(cx, source); } } return !!js_ValueToPrintable(cx, v, bytes, true); } unsigned js_Disassemble1(JSContext* cx, HandleScript script, jsbytecode* pc, unsigned loc, bool lines, Sprinter* sp) { JSOp op = (JSOp)*pc; if (op >= JSOP_LIMIT) { char numBuf1[12], numBuf2[12]; JS_snprintf(numBuf1, sizeof numBuf1, "%d", op); JS_snprintf(numBuf2, sizeof numBuf2, "%d", JSOP_LIMIT); JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BYTECODE_TOO_BIG, numBuf1, numBuf2); return 0; } const JSCodeSpec* cs = &js_CodeSpec[op]; ptrdiff_t len = (ptrdiff_t) cs->length; Sprint(sp, "%05u:", loc); if (lines) Sprint(sp, "%4u", PCToLineNumber(script, pc)); Sprint(sp, " %s", js_CodeName[op]); switch (JOF_TYPE(cs->format)) { case JOF_BYTE: // Scan the trynotes to find the associated catch block // and make the try opcode look like a jump instruction // with an offset. This simplifies code coverage analysis // based on this disassembled output. if (op == JSOP_TRY) { TryNoteArray* trynotes = script->trynotes(); uint32_t i; for(i = 0; i < trynotes->length; i++) { JSTryNote note = trynotes->vector[i]; if (note.kind == JSTRY_CATCH && note.start == loc + 1) { Sprint(sp, " %u (%+d)", (unsigned int) (loc+note.length+1), (int) (note.length+1)); break; } } } break; case JOF_JUMP: { ptrdiff_t off = GET_JUMP_OFFSET(pc); Sprint(sp, " %u (%+d)", loc + (int) off, (int) off); break; } case JOF_SCOPECOORD: { RootedValue v(cx, StringValue(ScopeCoordinateName(cx->runtime()->scopeCoordinateNameCache, script, pc))); JSAutoByteString bytes; if (!ToDisassemblySource(cx, v, &bytes)) return 0; ScopeCoordinate sc(pc); Sprint(sp, " %s (hops = %u, slot = %u)", bytes.ptr(), sc.hops(), sc.slot()); break; } case JOF_ATOM: { RootedValue v(cx, StringValue(script->getAtom(GET_UINT32_INDEX(pc)))); JSAutoByteString bytes; if (!ToDisassemblySource(cx, v, &bytes)) return 0; Sprint(sp, " %s", bytes.ptr()); break; } case JOF_DOUBLE: { RootedValue v(cx, script->getConst(GET_UINT32_INDEX(pc))); JSAutoByteString bytes; if (!ToDisassemblySource(cx, v, &bytes)) return 0; Sprint(sp, " %s", bytes.ptr()); break; } case JOF_OBJECT: { /* Don't call obj.toSource if analysis/inference is active. */ if (script->zone()->types.activeAnalysis) { Sprint(sp, " object"); break; } JSObject* obj = script->getObject(GET_UINT32_INDEX(pc)); { JSAutoByteString bytes; RootedValue v(cx, ObjectValue(*obj)); if (!ToDisassemblySource(cx, v, &bytes)) return 0; Sprint(sp, " %s", bytes.ptr()); } break; } case JOF_REGEXP: { JSObject* obj = script->getRegExp(GET_UINT32_INDEX(pc)); JSAutoByteString bytes; RootedValue v(cx, ObjectValue(*obj)); if (!ToDisassemblySource(cx, v, &bytes)) return 0; Sprint(sp, " %s", bytes.ptr()); break; } case JOF_TABLESWITCH: { int32_t i, low, high; ptrdiff_t off = GET_JUMP_OFFSET(pc); jsbytecode* pc2 = pc + JUMP_OFFSET_LEN; low = GET_JUMP_OFFSET(pc2); pc2 += JUMP_OFFSET_LEN; high = GET_JUMP_OFFSET(pc2); pc2 += JUMP_OFFSET_LEN; Sprint(sp, " defaultOffset %d low %d high %d", int(off), low, high); for (i = low; i <= high; i++) { off = GET_JUMP_OFFSET(pc2); Sprint(sp, "\n\t%d: %d", i, int(off)); pc2 += JUMP_OFFSET_LEN; } len = 1 + pc2 - pc; break; } case JOF_QARG: Sprint(sp, " %u", GET_ARGNO(pc)); break; case JOF_LOCAL: Sprint(sp, " %u", GET_LOCALNO(pc)); break; { int i; case JOF_UINT16: i = (int)GET_UINT16(pc); goto print_int; case JOF_UINT24: MOZ_ASSERT(len == 4); i = (int)GET_UINT24(pc); goto print_int; case JOF_UINT8: i = GET_UINT8(pc); goto print_int; case JOF_INT8: i = GET_INT8(pc); goto print_int; case JOF_INT32: MOZ_ASSERT(op == JSOP_INT32); i = GET_INT32(pc); print_int: Sprint(sp, " %d", i); break; } default: { char numBuf[12]; JS_snprintf(numBuf, sizeof numBuf, "%lx", (unsigned long) cs->format); JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_UNKNOWN_FORMAT, numBuf); return 0; } } sp->put("\n"); return len; } #endif /* DEBUG */ /************************************************************************/ const size_t Sprinter::DefaultSize = 64; bool Sprinter::realloc_(size_t newSize) { MOZ_ASSERT(newSize > (size_t) offset); char* newBuf = (char*) js_realloc(base, newSize); if (!newBuf) { reportOutOfMemory(); return false; } base = newBuf; size = newSize; base[size - 1] = 0; return true; } Sprinter::Sprinter(ExclusiveContext* cx) : context(cx), #ifdef DEBUG initialized(false), #endif base(nullptr), size(0), offset(0), reportedOOM(false) { } Sprinter::~Sprinter() { #ifdef DEBUG if (initialized) checkInvariants(); #endif js_free(base); } bool Sprinter::init() { MOZ_ASSERT(!initialized); base = (char*) js_malloc(DefaultSize); if (!base) { reportOutOfMemory(); return false; } #ifdef DEBUG initialized = true; #endif *base = 0; size = DefaultSize; base[size - 1] = 0; return true; } void Sprinter::checkInvariants() const { MOZ_ASSERT(initialized); MOZ_ASSERT((size_t) offset < size); MOZ_ASSERT(base[size - 1] == 0); } const char* Sprinter::string() const { return base; } const char* Sprinter::stringEnd() const { return base + offset; } char* Sprinter::stringAt(ptrdiff_t off) const { MOZ_ASSERT(off >= 0 && (size_t) off < size); return base + off; } char& Sprinter::operator[](size_t off) { MOZ_ASSERT(off < size); return *(base + off); } char* Sprinter::reserve(size_t len) { InvariantChecker ic(this); while (len + 1 > size - offset) { /* Include trailing \0 */ if (!realloc_(size * 2)) return nullptr; } char* sb = base + offset; offset += len; return sb; } ptrdiff_t Sprinter::put(const char* s, size_t len) { InvariantChecker ic(this); const char* oldBase = base; const char* oldEnd = base + size; ptrdiff_t oldOffset = offset; char* bp = reserve(len); if (!bp) return -1; /* s is within the buffer already */ if (s >= oldBase && s < oldEnd) { /* buffer was realloc'ed */ if (base != oldBase) s = stringAt(s - oldBase); /* this is where it lives now */ memmove(bp, s, len); } else { js_memcpy(bp, s, len); } bp[len] = 0; return oldOffset; } ptrdiff_t Sprinter::put(const char* s) { return put(s, strlen(s)); } ptrdiff_t Sprinter::putString(JSString* s) { InvariantChecker ic(this); size_t length = s->length(); size_t size = length; ptrdiff_t oldOffset = offset; char* buffer = reserve(size); if (!buffer) return -1; JSLinearString* linear = s->ensureLinear(context); if (!linear) return -1; AutoCheckCannotGC nogc; if (linear->hasLatin1Chars()) mozilla::PodCopy(reinterpret_cast<Latin1Char*>(buffer), linear->latin1Chars(nogc), length); else DeflateStringToBuffer(nullptr, linear->twoByteChars(nogc), length, buffer, &size); buffer[size] = 0; return oldOffset; } int Sprinter::printf(const char* fmt, ...) { InvariantChecker ic(this); do { va_list va; va_start(va, fmt); int i = vsnprintf(base + offset, size - offset, fmt, va); va_end(va); if (i > -1 && (size_t) i < size - offset) { offset += i; return i; } } while (realloc_(size * 2)); return -1; } ptrdiff_t Sprinter::getOffset() const { return offset; } void Sprinter::reportOutOfMemory() { if (reportedOOM) return; if (context) js_ReportOutOfMemory(context); reportedOOM = true; } bool Sprinter::hadOutOfMemory() const { return reportedOOM; } ptrdiff_t js::Sprint(Sprinter* sp, const char* format, ...) { va_list ap; char* bp; ptrdiff_t offset; va_start(ap, format); bp = JS_vsmprintf(format, ap); /* XXX vsaprintf */ va_end(ap); if (!bp) { sp->reportOutOfMemory(); return -1; } offset = sp->put(bp); js_free(bp); return offset; } const char js_EscapeMap[] = { '\b', 'b', '\f', 'f', '\n', 'n', '\r', 'r', '\t', 't', '\v', 'v', '"', '"', '\'', '\'', '\\', '\\', '\0' }; template <typename CharT> static char* QuoteString(Sprinter* sp, const CharT* s, size_t length, char16_t quote) { /* Sample off first for later return value pointer computation. */ ptrdiff_t offset = sp->getOffset(); if (quote && Sprint(sp, "%c", char(quote)) < 0) return nullptr; const CharT* end = s + length; /* Loop control variables: end points at end of string sentinel. */ for (const CharT* t = s; t < end; s = ++t) { /* Move t forward from s past un-quote-worthy characters. */ char16_t c = *t; while (c < 127 && isprint(c) && c != quote && c != '\\' && c != '\t') { c = *++t; if (t == end) break; } { ptrdiff_t len = t - s; ptrdiff_t base = sp->getOffset(); if (!sp->reserve(len)) return nullptr; for (ptrdiff_t i = 0; i < len; ++i) (*sp)[base + i] = char(*s++); (*sp)[base + len] = 0; } if (t == end) break; /* Use js_EscapeMap, \u, or \x only if necessary. */ const char* escape; if (!(c >> 8) && c != 0 && (escape = strchr(js_EscapeMap, int(c))) != nullptr) { if (Sprint(sp, "\\%c", escape[1]) < 0) return nullptr; } else { /* * Use \x only if the high byte is 0 and we're in a quoted string, * because ECMA-262 allows only \u, not \x, in Unicode identifiers * (see bug 621814). */ if (Sprint(sp, (quote && !(c >> 8)) ? "\\x%02X" : "\\u%04X", c) < 0) return nullptr; } } /* Sprint the closing quote and return the quoted string. */ if (quote && Sprint(sp, "%c", char(quote)) < 0) return nullptr; /* * If we haven't Sprint'd anything yet, Sprint an empty string so that * the return below gives a valid result. */ if (offset == sp->getOffset() && Sprint(sp, "") < 0) return nullptr; return sp->stringAt(offset); } static char* QuoteString(Sprinter* sp, JSString* str, char16_t quote) { JSLinearString* linear = str->ensureLinear(sp->context); if (!linear) return nullptr; AutoCheckCannotGC nogc; return linear->hasLatin1Chars() ? QuoteString(sp, linear->latin1Chars(nogc), linear->length(), quote) : QuoteString(sp, linear->twoByteChars(nogc), linear->length(), quote); } JSString* js_QuoteString(ExclusiveContext* cx, JSString* str, char16_t quote) { Sprinter sprinter(cx); if (!sprinter.init()) return nullptr; char* bytes = QuoteString(&sprinter, str, quote); if (!bytes) return nullptr; return NewStringCopyZ<CanGC>(cx, bytes); } /************************************************************************/ namespace { /* * The expression decompiler is invoked by error handling code to produce a * string representation of the erroring expression. As it's only a debugging * tool, it only supports basic expressions. For anything complicated, it simply * puts "(intermediate value)" into the error result. * * Here's the basic algorithm: * * 1. Find the stack location of the value whose expression we wish to * decompile. The error handler can explicitly pass this as an * argument. Otherwise, we search backwards down the stack for the offending * value. * * 2. Instantiate and run a BytecodeParser for the current frame. This creates a * stack of pcs parallel to the interpreter stack; given an interpreter stack * location, the corresponding pc stack location contains the opcode that pushed * the value in the interpreter. Now, with the result of step 1, we have the * opcode responsible for pushing the value we want to decompile. * * 3. Pass the opcode to decompilePC. decompilePC is the main decompiler * routine, responsible for a string representation of the expression that * generated a certain stack location. decompilePC looks at one opcode and * returns the JS source equivalent of that opcode. * * 4. Expressions can, of course, contain subexpressions. For example, the * literals "4" and "5" are subexpressions of the addition operator in "4 + * 5". If we need to decompile a subexpression, we call decompilePC (step 2) * recursively on the operands' pcs. The result is a depth-first traversal of * the expression tree. * */ struct ExpressionDecompiler { JSContext* cx; RootedScript script; RootedFunction fun; BytecodeParser parser; Sprinter sprinter; ExpressionDecompiler(JSContext* cx, JSScript* script, JSFunction* fun) : cx(cx), script(cx, script), fun(cx, fun), parser(cx, script), sprinter(cx) {} bool init(); bool decompilePCForStackOperand(jsbytecode* pc, int i); bool decompilePC(jsbytecode* pc); JSAtom* getLocal(uint32_t local, jsbytecode* pc); JSAtom* getArg(unsigned slot); JSAtom* loadAtom(jsbytecode* pc); bool quote(JSString* s, uint32_t quote); bool write(const char* s); bool write(JSString* str); bool getOutput(char** out); }; bool ExpressionDecompiler::decompilePCForStackOperand(jsbytecode* pc, int i) { pc = parser.pcForStackOperand(pc, i); if (!pc) return write("(intermediate value)"); return decompilePC(pc); } bool ExpressionDecompiler::decompilePC(jsbytecode* pc) { MOZ_ASSERT(script->containsPC(pc)); JSOp op = (JSOp)*pc; if (const char* token = CodeToken[op]) { // Handle simple cases of binary and unary operators. switch (js_CodeSpec[op].nuses) { case 2: { jssrcnote* sn = js_GetSrcNote(cx, script, pc); if (!sn || SN_TYPE(sn) != SRC_ASSIGNOP) return write("(") && decompilePCForStackOperand(pc, -2) && write(" ") && write(token) && write(" ") && decompilePCForStackOperand(pc, -1) && write(")"); break; } case 1: return write(token) && write("(") && decompilePCForStackOperand(pc, -1) && write(")"); default: break; } } switch (op) { case JSOP_GETGNAME: case JSOP_GETNAME: case JSOP_GETINTRINSIC: return write(loadAtom(pc)); case JSOP_GETARG: { unsigned slot = GET_ARGNO(pc); JSAtom* atom = getArg(slot); return write(atom); } case JSOP_GETLOCAL: { uint32_t i = GET_LOCALNO(pc); if (JSAtom* atom = getLocal(i, pc)) return write(atom); return write("(intermediate value)"); } case JSOP_GETALIASEDVAR: { JSAtom* atom = ScopeCoordinateName(cx->runtime()->scopeCoordinateNameCache, script, pc); MOZ_ASSERT(atom); return write(atom); } case JSOP_LENGTH: case JSOP_GETPROP: case JSOP_CALLPROP: { RootedAtom prop(cx, (op == JSOP_LENGTH) ? cx->names().length : loadAtom(pc)); if (!decompilePCForStackOperand(pc, -1)) return false; if (IsIdentifier(prop)) { return write(".") && quote(prop, '\0'); } return write("[") && quote(prop, '\'') && write("]"); } case JSOP_GETELEM: case JSOP_CALLELEM: return decompilePCForStackOperand(pc, -2) && write("[") && decompilePCForStackOperand(pc, -1) && write("]"); case JSOP_NULL: return write(js_null_str); case JSOP_TRUE: return write(js_true_str); case JSOP_FALSE: return write(js_false_str); case JSOP_ZERO: case JSOP_ONE: case JSOP_INT8: case JSOP_UINT16: case JSOP_UINT24: case JSOP_INT32: return sprinter.printf("%d", GetBytecodeInteger(pc)) >= 0; case JSOP_STRING: return quote(loadAtom(pc), '"'); case JSOP_SYMBOL: { unsigned i = uint8_t(pc[1]); MOZ_ASSERT(i < JS::WellKnownSymbolLimit); if (i < JS::WellKnownSymbolLimit) return write(cx->names().wellKnownSymbolDescriptions()[i]); break; } case JSOP_UNDEFINED: return write(js_undefined_str); case JSOP_THIS: // |this| could convert to a very long object initialiser, so cite it by // its keyword name. return write(js_this_str); case JSOP_CALL: case JSOP_FUNCALL: return decompilePCForStackOperand(pc, -int32_t(GET_ARGC(pc) + 2)) && write("(...)"); case JSOP_SPREADCALL: return decompilePCForStackOperand(pc, -int32_t(3)) && write("(...)"); case JSOP_NEWARRAY: return write("[]"); case JSOP_REGEXP: case JSOP_OBJECT: case JSOP_NEWARRAY_COPYONWRITE: { JSObject* obj = (op == JSOP_REGEXP) ? script->getRegExp(GET_UINT32_INDEX(pc)) : script->getObject(GET_UINT32_INDEX(pc)); RootedValue objv(cx, ObjectValue(*obj)); JSString* str = ValueToSource(cx, objv); if (!str) return false; return write(str); } default: break; } return write("(intermediate value)"); } bool ExpressionDecompiler::init() { assertSameCompartment(cx, script); if (!sprinter.init()) return false; if (!parser.parse()) return false; return true; } bool ExpressionDecompiler::write(const char* s) { return sprinter.put(s) >= 0; } bool ExpressionDecompiler::write(JSString* str) { return sprinter.putString(str) >= 0; } bool ExpressionDecompiler::quote(JSString* s, uint32_t quote) { return QuoteString(&sprinter, s, quote) != nullptr; } JSAtom* ExpressionDecompiler::loadAtom(jsbytecode* pc) { return script->getAtom(GET_UINT32_INDEX(pc)); } JSAtom* ExpressionDecompiler::getArg(unsigned slot) { MOZ_ASSERT(fun); MOZ_ASSERT(slot < script->bindings.numArgs()); for (BindingIter bi(script); bi; bi++) { MOZ_ASSERT(bi->kind() == Binding::ARGUMENT); if (bi.argIndex() == slot) return bi->name(); } MOZ_CRASH("No binding"); } JSAtom* ExpressionDecompiler::getLocal(uint32_t local, jsbytecode* pc) { MOZ_ASSERT(local < script->nfixed()); if (local < script->nbodyfixed()) { for (BindingIter bi(script); bi; bi++) { if (bi->kind() != Binding::ARGUMENT && !bi->aliased() && bi.frameIndex() == local) return bi->name(); } MOZ_CRASH("No binding"); } for (NestedScopeObject* chain = script->getStaticBlockScope(pc); chain; chain = chain->enclosingNestedScope()) { if (!chain->is<StaticBlockObject>()) continue; StaticBlockObject& block = chain->as<StaticBlockObject>(); if (local < block.localOffset()) continue; local -= block.localOffset(); if (local >= block.numVariables()) return nullptr; for (Shape::Range<NoGC> r(block.lastProperty()); !r.empty(); r.popFront()) { const Shape& shape = r.front(); if (block.shapeToIndex(shape) == local) return JSID_TO_ATOM(shape.propid()); } break; } return nullptr; } bool ExpressionDecompiler::getOutput(char** res) { ptrdiff_t len = sprinter.stringEnd() - sprinter.stringAt(0); *res = cx->pod_malloc<char>(len + 1); if (!*res) return false; js_memcpy(*res, sprinter.stringAt(0), len); (*res)[len] = 0; return true; } } // anonymous namespace static bool FindStartPC(JSContext* cx, const FrameIter& iter, int spindex, int skipStackHits, Value v, jsbytecode** valuepc) { jsbytecode* current = *valuepc; if (spindex == JSDVG_IGNORE_STACK) return true; /* * FIXME: Fall back if iter.isIon(), since the stack snapshot may be for the * previous pc (see bug 831120). */ if (iter.isIon()) return true; *valuepc = nullptr; BytecodeParser parser(cx, iter.script()); if (!parser.parse()) return false; if (spindex < 0 && spindex + int(parser.stackDepthAtPC(current)) < 0) spindex = JSDVG_SEARCH_STACK; if (spindex == JSDVG_SEARCH_STACK) { size_t index = iter.numFrameSlots(); MOZ_ASSERT(index >= size_t(parser.stackDepthAtPC(current))); // We search from fp->sp to base to find the most recently calculated // value matching v under assumption that it is the value that caused // the exception. int stackHits = 0; Value s; do { if (!index) return true; s = iter.frameSlotValue(--index); } while (s != v || stackHits++ != skipStackHits); // If the current PC has fewer values on the stack than the index we are // looking for, the blamed value must be one pushed by the current // bytecode, so restore *valuepc. jsbytecode* pc = nullptr; if (index < size_t(parser.stackDepthAtPC(current))) pc = parser.pcForStackOperand(current, index); *valuepc = pc ? pc : current; } else { jsbytecode* pc = parser.pcForStackOperand(current, spindex); *valuepc = pc ? pc : current; } return true; } static bool DecompileExpressionFromStack(JSContext* cx, int spindex, int skipStackHits, HandleValue v, char** res) { MOZ_ASSERT(spindex < 0 || spindex == JSDVG_IGNORE_STACK || spindex == JSDVG_SEARCH_STACK); *res = nullptr; #ifdef JS_MORE_DETERMINISTIC /* * Give up if we need deterministic behavior for differential testing. * IonMonkey doesn't use InterpreterFrames and this ensures we get the same * error messages. */ return true; #endif FrameIter frameIter(cx); if (frameIter.done() || !frameIter.hasScript()) return true; RootedScript script(cx, frameIter.script()); AutoCompartment ac(cx, &script->global()); jsbytecode* valuepc = frameIter.pc(); RootedFunction fun(cx, frameIter.isFunctionFrame() ? frameIter.calleeTemplate() : nullptr); MOZ_ASSERT(script->containsPC(valuepc)); // Give up if in prologue. if (valuepc < script->main()) return true; if (!FindStartPC(cx, frameIter, spindex, skipStackHits, v, &valuepc)) return false; if (!valuepc) return true; ExpressionDecompiler ed(cx, script, fun); if (!ed.init()) return false; if (!ed.decompilePC(valuepc)) return false; return ed.getOutput(res); } char* js::DecompileValueGenerator(JSContext* cx, int spindex, HandleValue v, HandleString fallbackArg, int skipStackHits) { RootedString fallback(cx, fallbackArg); { char* result; if (!DecompileExpressionFromStack(cx, spindex, skipStackHits, v, &result)) return nullptr; if (result) { if (strcmp(result, "(intermediate value)")) return result; js_free(result); } } if (!fallback) { if (v.isUndefined()) return JS_strdup(cx, js_undefined_str); // Prevent users from seeing "(void 0)" fallback = ValueToSource(cx, v); if (!fallback) return nullptr; } return JS_EncodeString(cx, fallback); } static bool DecompileArgumentFromStack(JSContext* cx, int formalIndex, char** res) { MOZ_ASSERT(formalIndex >= 0); *res = nullptr; #ifdef JS_MORE_DETERMINISTIC /* See note in DecompileExpressionFromStack. */ return true; #endif /* * Settle on the nearest script frame, which should be the builtin that * called the intrinsic. */ FrameIter frameIter(cx); MOZ_ASSERT(!frameIter.done()); /* * Get the second-to-top frame, the caller of the builtin that called the * intrinsic. */ ++frameIter; if (frameIter.done() || !frameIter.hasScript()) return true; RootedScript script(cx, frameIter.script()); AutoCompartment ac(cx, &script->global()); jsbytecode* current = frameIter.pc(); RootedFunction fun(cx, frameIter.isFunctionFrame() ? frameIter.calleeTemplate() : nullptr); MOZ_ASSERT(script->containsPC(current)); if (current < script->main()) return true; /* Don't handle getters, setters or calls from fun.call/fun.apply. */ if (JSOp(*current) != JSOP_CALL || static_cast<unsigned>(formalIndex) >= GET_ARGC(current)) return true; BytecodeParser parser(cx, script); if (!parser.parse()) return false; int formalStackIndex = parser.stackDepthAtPC(current) - GET_ARGC(current) + formalIndex; MOZ_ASSERT(formalStackIndex >= 0); if (uint32_t(formalStackIndex) >= parser.stackDepthAtPC(current)) return true; ExpressionDecompiler ed(cx, script, fun); if (!ed.init()) return false; if (!ed.decompilePCForStackOperand(current, formalStackIndex)) return false; return ed.getOutput(res); } char* js::DecompileArgument(JSContext* cx, int formalIndex, HandleValue v) { { char* result; if (!DecompileArgumentFromStack(cx, formalIndex, &result)) return nullptr; if (result) { if (strcmp(result, "(intermediate value)")) return result; js_free(result); } } if (v.isUndefined()) return JS_strdup(cx, js_undefined_str); // Prevent users from seeing "(void 0)" RootedString fallback(cx, ValueToSource(cx, v)); if (!fallback) return nullptr; return JS_EncodeString(cx, fallback); } bool js::CallResultEscapes(jsbytecode* pc) { /* * If we see any of these sequences, the result is unused: * - call / pop * * If we see any of these sequences, the result is only tested for nullness: * - call / ifeq * - call / not / ifeq */ if (*pc == JSOP_CALL) pc += JSOP_CALL_LENGTH; else if (*pc == JSOP_SPREADCALL) pc += JSOP_SPREADCALL_LENGTH; else return true; if (*pc == JSOP_POP) return false; if (*pc == JSOP_NOT) pc += JSOP_NOT_LENGTH; return *pc != JSOP_IFEQ; } extern bool js::IsValidBytecodeOffset(JSContext* cx, JSScript* script, size_t offset) { // This could be faster (by following jump instructions if the target is <= offset). for (BytecodeRange r(cx, script); !r.empty(); r.popFront()) { size_t here = r.frontOffset(); if (here >= offset) return here == offset; } return false; } /* * There are three possible PCCount profiling states: * * 1. None: Neither scripts nor the runtime have count information. * 2. Profile: Active scripts have count information, the runtime does not. * 3. Query: Scripts do not have count information, the runtime does. * * When starting to profile scripts, counting begins immediately, with all JIT * code discarded and recompiled with counts as necessary. Active interpreter * frames will not begin profiling until they begin executing another script * (via a call or return). * * The below API functions manage transitions to new states, according * to the table below. * * Old State * ------------------------- * Function None Profile Query * -------- * StartPCCountProfiling Profile Profile Profile * StopPCCountProfiling None Query Query * PurgePCCounts None None None */ static void ReleaseScriptCounts(FreeOp* fop) { JSRuntime* rt = fop->runtime(); MOZ_ASSERT(rt->scriptAndCountsVector); ScriptAndCountsVector& vec = *rt->scriptAndCountsVector; for (size_t i = 0; i < vec.length(); i++) vec[i].scriptCounts.destroy(fop); fop->delete_(rt->scriptAndCountsVector); rt->scriptAndCountsVector = nullptr; } JS_FRIEND_API(void) js::StartPCCountProfiling(JSContext* cx) { JSRuntime* rt = cx->runtime(); if (rt->profilingScripts) return; if (rt->scriptAndCountsVector) ReleaseScriptCounts(rt->defaultFreeOp()); ReleaseAllJITCode(rt->defaultFreeOp()); rt->profilingScripts = true; } JS_FRIEND_API(void) js::StopPCCountProfiling(JSContext* cx) { JSRuntime* rt = cx->runtime(); if (!rt->profilingScripts) return; MOZ_ASSERT(!rt->scriptAndCountsVector); ReleaseAllJITCode(rt->defaultFreeOp()); ScriptAndCountsVector* vec = cx->new_<ScriptAndCountsVector>(SystemAllocPolicy()); if (!vec) return; for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) { for (ZoneCellIter i(zone, FINALIZE_SCRIPT); !i.done(); i.next()) { JSScript* script = i.get<JSScript>(); if (script->hasScriptCounts() && script->types()) { ScriptAndCounts sac; sac.script = script; sac.scriptCounts.set(script->releaseScriptCounts()); if (!vec->append(sac)) sac.scriptCounts.destroy(rt->defaultFreeOp()); } } } rt->profilingScripts = false; rt->scriptAndCountsVector = vec; } JS_FRIEND_API(void) js::PurgePCCounts(JSContext* cx) { JSRuntime* rt = cx->runtime(); if (!rt->scriptAndCountsVector) return; MOZ_ASSERT(!rt->profilingScripts); ReleaseScriptCounts(rt->defaultFreeOp()); } JS_FRIEND_API(size_t) js::GetPCCountScriptCount(JSContext* cx) { JSRuntime* rt = cx->runtime(); if (!rt->scriptAndCountsVector) return 0; return rt->scriptAndCountsVector->length(); } enum MaybeComma {NO_COMMA, COMMA}; static void AppendJSONProperty(StringBuffer& buf, const char* name, MaybeComma comma = COMMA) { if (comma) buf.append(','); buf.append('\"'); buf.append(name, strlen(name)); buf.append("\":", 2); } static void AppendArrayJSONProperties(JSContext* cx, StringBuffer& buf, double* values, const char * const* names, unsigned count, MaybeComma& comma) { for (unsigned i = 0; i < count; i++) { if (values[i]) { AppendJSONProperty(buf, names[i], comma); comma = COMMA; NumberValueToStringBuffer(cx, DoubleValue(values[i]), buf); } } } JS_FRIEND_API(JSString*) js::GetPCCountScriptSummary(JSContext* cx, size_t index) { JSRuntime* rt = cx->runtime(); if (!rt->scriptAndCountsVector || index >= rt->scriptAndCountsVector->length()) { JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BUFFER_TOO_SMALL); return nullptr; } const ScriptAndCounts& sac = (*rt->scriptAndCountsVector)[index]; RootedScript script(cx, sac.script); /* * OOM on buffer appends here will not be caught immediately, but since * StringBuffer uses a TempAllocPolicy will trigger an exception on the * context if they occur, which we'll catch before returning. */ StringBuffer buf(cx); buf.append('{'); AppendJSONProperty(buf, "file", NO_COMMA); JSString* str = JS_NewStringCopyZ(cx, script->filename()); if (!str || !(str = StringToSource(cx, str))) return nullptr; buf.append(str); AppendJSONProperty(buf, "line"); NumberValueToStringBuffer(cx, Int32Value(script->lineno()), buf); if (script->functionNonDelazifying()) { JSAtom* atom = script->functionNonDelazifying()->displayAtom(); if (atom) { AppendJSONProperty(buf, "name"); if (!(str = StringToSource(cx, atom))) return nullptr; buf.append(str); } } double baseTotals[PCCounts::BASE_LIMIT] = {0.0}; double accessTotals[PCCounts::ACCESS_LIMIT - PCCounts::BASE_LIMIT] = {0.0}; double elementTotals[PCCounts::ELEM_LIMIT - PCCounts::ACCESS_LIMIT] = {0.0}; double propertyTotals[PCCounts::PROP_LIMIT - PCCounts::ACCESS_LIMIT] = {0.0}; double arithTotals[PCCounts::ARITH_LIMIT - PCCounts::BASE_LIMIT] = {0.0}; for (unsigned i = 0; i < script->length(); i++) { PCCounts& counts = sac.getPCCounts(script->offsetToPC(i)); if (!counts) continue; JSOp op = (JSOp)script->code()[i]; unsigned numCounts = PCCounts::numCounts(op); for (unsigned j = 0; j < numCounts; j++) { double value = counts.get(j); if (j < PCCounts::BASE_LIMIT) { baseTotals[j] += value; } else if (PCCounts::accessOp(op)) { if (j < PCCounts::ACCESS_LIMIT) accessTotals[j - PCCounts::BASE_LIMIT] += value; else if (PCCounts::elementOp(op)) elementTotals[j - PCCounts::ACCESS_LIMIT] += value; else if (PCCounts::propertyOp(op)) propertyTotals[j - PCCounts::ACCESS_LIMIT] += value; else MOZ_CRASH("Bad opcode"); } else if (PCCounts::arithOp(op)) { arithTotals[j - PCCounts::BASE_LIMIT] += value; } else { MOZ_CRASH("Bad opcode"); } } } AppendJSONProperty(buf, "totals"); buf.append('{'); MaybeComma comma = NO_COMMA; AppendArrayJSONProperties(cx, buf, baseTotals, countBaseNames, JS_ARRAY_LENGTH(baseTotals), comma); AppendArrayJSONProperties(cx, buf, accessTotals, countAccessNames, JS_ARRAY_LENGTH(accessTotals), comma); AppendArrayJSONProperties(cx, buf, elementTotals, countElementNames, JS_ARRAY_LENGTH(elementTotals), comma); AppendArrayJSONProperties(cx, buf, propertyTotals, countPropertyNames, JS_ARRAY_LENGTH(propertyTotals), comma); AppendArrayJSONProperties(cx, buf, arithTotals, countArithNames, JS_ARRAY_LENGTH(arithTotals), comma); uint64_t ionActivity = 0; jit::IonScriptCounts* ionCounts = sac.getIonCounts(); while (ionCounts) { for (size_t i = 0; i < ionCounts->numBlocks(); i++) ionActivity += ionCounts->block(i).hitCount(); ionCounts = ionCounts->previous(); } if (ionActivity) { AppendJSONProperty(buf, "ion", comma); NumberValueToStringBuffer(cx, DoubleValue(ionActivity), buf); } buf.append('}'); buf.append('}'); if (cx->isExceptionPending()) return nullptr; return buf.finishString(); } static bool GetPCCountJSON(JSContext* cx, const ScriptAndCounts& sac, StringBuffer& buf) { RootedScript script(cx, sac.script); buf.append('{'); AppendJSONProperty(buf, "text", NO_COMMA); JSString* str = JS_DecompileScript(cx, script, nullptr, 0); if (!str || !(str = StringToSource(cx, str))) return false; buf.append(str); AppendJSONProperty(buf, "line"); NumberValueToStringBuffer(cx, Int32Value(script->lineno()), buf); AppendJSONProperty(buf, "opcodes"); buf.append('['); bool comma = false; SrcNoteLineScanner scanner(script->notes(), script->lineno()); for (jsbytecode* pc = script->code(); pc < script->codeEnd(); pc += GetBytecodeLength(pc)) { size_t offset = script->pcToOffset(pc); JSOp op = (JSOp) *pc; if (comma) buf.append(','); comma = true; buf.append('{'); AppendJSONProperty(buf, "id", NO_COMMA); NumberValueToStringBuffer(cx, Int32Value(offset), buf); scanner.advanceTo(offset); AppendJSONProperty(buf, "line"); NumberValueToStringBuffer(cx, Int32Value(scanner.getLine()), buf); { const char* name = js_CodeName[op]; AppendJSONProperty(buf, "name"); buf.append('\"'); buf.append(name, strlen(name)); buf.append('\"'); } { ExpressionDecompiler ed(cx, script, script->functionDelazifying()); if (!ed.init()) return false; if (!ed.decompilePC(pc)) return false; char* text; if (!ed.getOutput(&text)) return false; AppendJSONProperty(buf, "text"); JSString* str = JS_NewStringCopyZ(cx, text); js_free(text); if (!str || !(str = StringToSource(cx, str))) return false; buf.append(str); } PCCounts& counts = sac.getPCCounts(pc); unsigned numCounts = PCCounts::numCounts(op); AppendJSONProperty(buf, "counts"); buf.append('{'); MaybeComma comma = NO_COMMA; for (unsigned i = 0; i < numCounts; i++) { double value = counts.get(i); if (value > 0) { AppendJSONProperty(buf, PCCounts::countName(op, i), comma); comma = COMMA; NumberValueToStringBuffer(cx, DoubleValue(value), buf); } } buf.append('}'); buf.append('}'); } buf.append(']'); jit::IonScriptCounts* ionCounts = sac.getIonCounts(); if (ionCounts) { AppendJSONProperty(buf, "ion"); buf.append('['); bool comma = false; while (ionCounts) { if (comma) buf.append(','); comma = true; buf.append('['); for (size_t i = 0; i < ionCounts->numBlocks(); i++) { if (i) buf.append(','); const jit::IonBlockCounts& block = ionCounts->block(i); buf.append('{'); AppendJSONProperty(buf, "id", NO_COMMA); NumberValueToStringBuffer(cx, Int32Value(block.id()), buf); AppendJSONProperty(buf, "offset"); NumberValueToStringBuffer(cx, Int32Value(block.offset()), buf); AppendJSONProperty(buf, "successors"); buf.append('['); for (size_t j = 0; j < block.numSuccessors(); j++) { if (j) buf.append(','); NumberValueToStringBuffer(cx, Int32Value(block.successor(j)), buf); } buf.append(']'); AppendJSONProperty(buf, "hits"); NumberValueToStringBuffer(cx, DoubleValue(block.hitCount()), buf); AppendJSONProperty(buf, "code"); JSString* str = JS_NewStringCopyZ(cx, block.code()); if (!str || !(str = StringToSource(cx, str))) return false; buf.append(str); buf.append('}'); } buf.append(']'); ionCounts = ionCounts->previous(); } buf.append(']'); } buf.append('}'); return !cx->isExceptionPending(); } JS_FRIEND_API(JSString*) js::GetPCCountScriptContents(JSContext* cx, size_t index) { JSRuntime* rt = cx->runtime(); if (!rt->scriptAndCountsVector || index >= rt->scriptAndCountsVector->length()) { JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BUFFER_TOO_SMALL); return nullptr; } const ScriptAndCounts& sac = (*rt->scriptAndCountsVector)[index]; JSScript* script = sac.script; StringBuffer buf(cx); { AutoCompartment ac(cx, &script->global()); if (!GetPCCountJSON(cx, sac, buf)) return nullptr; } return buf.finishString(); }
{ "pile_set_name": "Github" }
// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`react-css-modules should create valid app 1`] = ` SCRIPTS: Array [ "/runtime-554e53c2f72903d6f45f.js", "/vendors~main-a5eb7fd24bc26bc5fa6f.js", "/main-5128f173459b76161c32.js", ] CSS: Array [ "/main-fadb2269a374a06075a5.css", ] SOURCE HTML: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> My Awesome Project </title> <meta name="viewport" content="width=device-width, initial-scale=1" > <link data-chunk="main" rel="stylesheet" href="styles[0]" > <link data-chunk="main" rel="preload" as="script" href="scripts[0]" > <link data-chunk="main" rel="preload" as="script" href="scripts[1]" > <link data-chunk="main" rel="preload" as="script" href="scripts[2]" > </head> <body> <div id="app"> <div class="_1brbpTo"> <div class="_3YtmnHj" data-automation-text="true" > Initial render </div> </div> </div> <script id="__LOADABLE_REQUIRED_CHUNKS__" type="application/json" > [] </script> <script async data-chunk="main" src="scripts[0]" > </script> <script async data-chunk="main" src="scripts[1]" > </script> <script async data-chunk="main" src="scripts[2]" > </script> </body> </html> POST HYDRATE DIFFS: <div class="_3YtmnHj" data-automation-text="true" > - Initial render + Updated render </div> </div> </div> `; exports[`react-css-modules should generate the expected files 1`] = ` Object { "index.html": SCRIPTS: Array [ "/runtime-554e53c2f72903d6f45f.js", "/vendors~main-a5eb7fd24bc26bc5fa6f.js", "/main-5128f173459b76161c32.js", ] CSS: Array [ "/main-fadb2269a374a06075a5.css", ] SOURCE HTML: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> My Awesome Project </title> <meta name="viewport" content="width=device-width, initial-scale=1" > <link data-chunk="main" rel="stylesheet" href="styles[0]" > <link data-chunk="main" rel="preload" as="script" href="scripts[0]" > <link data-chunk="main" rel="preload" as="script" href="scripts[1]" > <link data-chunk="main" rel="preload" as="script" href="scripts[2]" > </head> <body> <div id="app"> <div class="_1brbpTo"> <div class="_3YtmnHj" data-automation-text="true" > Initial render </div> </div> </div> <script id="__LOADABLE_REQUIRED_CHUNKS__" type="application/json" > [] </script> <script async data-chunk="main" src="scripts[0]" > </script> <script async data-chunk="main" src="scripts[1]" > </script> <script async data-chunk="main" src="scripts[2]" > </script> </body> </html>, "main-5128f173459b76161c32.js": "CONTENTS IGNORED IN SNAPSHOT TEST", "main-fadb2269a374a06075a5.css": ._1brbpTo { display: -webkit-flex; display: -ms-flexbox; display: flex; } ._1brbpTo ._3YtmnHj { font-size: 32px; } , "runtime-554e53c2f72903d6f45f.js": "CONTENTS IGNORED IN SNAPSHOT TEST", "vendors~main-a5eb7fd24bc26bc5fa6f.js": "CONTENTS IGNORED IN SNAPSHOT TEST", } `;
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """ DO NOT EDIT THIS FILE! It is automatically generated from opcfoundation.org schemas. Date:2020-06-19 17:31:10.391761 """ import datetime from dateutil.tz import tzutc from opcua import ua from opcua.ua import NodeId, QualifiedName, NumericNodeId, StringNodeId, GuidNodeId from opcua.ua import NodeClass, LocalizedText def create_standard_address_space_Part17(server): node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23455, 0) node.BrowseName = QualifiedName('AliasNameType', 0) node.NodeClass = NodeClass.ObjectType node.ParentNodeId = NumericNodeId(58, 0) node.ReferenceTypeId = NumericNodeId(45, 0) attrs = ua.ObjectTypeAttributes() attrs.DisplayName = LocalizedText("AliasNameType") attrs.IsAbstract = False node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(45, 0) ref.SourceNodeId = NumericNodeId(23455, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(58, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23456, 0) node.BrowseName = QualifiedName('AliasNameCategoryType', 0) node.NodeClass = NodeClass.ObjectType node.ParentNodeId = NumericNodeId(61, 0) node.ReferenceTypeId = NumericNodeId(45, 0) attrs = ua.ObjectTypeAttributes() attrs.DisplayName = LocalizedText("AliasNameCategoryType") attrs.IsAbstract = False node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23456, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23457, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23456, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23458, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23456, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23462, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(45, 0) ref.SourceNodeId = NumericNodeId(23456, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(61, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23457, 0) node.BrowseName = QualifiedName('<Alias>', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(23456, 0) node.ReferenceTypeId = NumericNodeId(47, 0) node.TypeDefinition = NumericNodeId(23455, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("<Alias>") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23457, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23455, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23457, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(11508, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23457, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23456, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23458, 0) node.BrowseName = QualifiedName('<SubAliasNameCategories>', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(23456, 0) node.ReferenceTypeId = NumericNodeId(47, 0) node.TypeDefinition = NumericNodeId(23456, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("<SubAliasNameCategories>") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23458, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23459, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23458, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23456, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23458, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(11508, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23458, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23456, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23459, 0) node.BrowseName = QualifiedName('FindAlias', 0) node.NodeClass = NodeClass.Method node.ParentNodeId = NumericNodeId(23458, 0) node.ReferenceTypeId = NumericNodeId(47, 0) attrs = ua.MethodAttributes() attrs.DisplayName = LocalizedText("FindAlias") node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23459, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23460, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23459, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23461, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23459, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(78, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23459, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23458, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23460, 0) node.BrowseName = QualifiedName('InputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23459, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("InputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNameSearchPattern' extobj.DataType = NumericNodeId(12, 0) extobj.ValueRank = -1 value.append(extobj) extobj = ua.Argument() extobj.Name = 'ReferenceTypeFilter' extobj.DataType = NumericNodeId(17, 0) extobj.ValueRank = -1 value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23460, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23460, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(78, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23460, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23459, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23461, 0) node.BrowseName = QualifiedName('OutputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23459, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("OutputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNodeList' extobj.DataType = NumericNodeId(23468, 0) extobj.ValueRank = 1 extobj.ArrayDimensions = [0] value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23461, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23461, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(78, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23461, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23459, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23462, 0) node.BrowseName = QualifiedName('FindAlias', 0) node.NodeClass = NodeClass.Method node.ParentNodeId = NumericNodeId(23456, 0) node.ReferenceTypeId = NumericNodeId(47, 0) attrs = ua.MethodAttributes() attrs.DisplayName = LocalizedText("FindAlias") node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23462, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23463, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23462, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23464, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23462, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(78, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23462, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23456, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23463, 0) node.BrowseName = QualifiedName('InputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23462, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("InputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNameSearchPattern' extobj.DataType = NumericNodeId(12, 0) extobj.ValueRank = -1 value.append(extobj) extobj = ua.Argument() extobj.Name = 'ReferenceTypeFilter' extobj.DataType = NumericNodeId(17, 0) extobj.ValueRank = -1 value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23463, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23463, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(78, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23463, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23462, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23464, 0) node.BrowseName = QualifiedName('OutputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23462, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("OutputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNodeList' extobj.DataType = NumericNodeId(23468, 0) extobj.ValueRank = 1 extobj.ArrayDimensions = [0] value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23464, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(37, 0) ref.SourceNodeId = NumericNodeId(23464, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(78, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23464, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23462, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23468, 0) node.BrowseName = QualifiedName('AliasNameDataType', 0) node.NodeClass = NodeClass.DataType node.ParentNodeId = NumericNodeId(22, 0) node.ReferenceTypeId = NumericNodeId(45, 0) attrs = ua.DataTypeAttributes() attrs.DisplayName = LocalizedText("AliasNameDataType") node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(45, 0) ref.SourceNodeId = NumericNodeId(23468, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(22, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23469, 0) node.BrowseName = QualifiedName('AliasFor', 0) node.NodeClass = NodeClass.ReferenceType node.ParentNodeId = NumericNodeId(32, 0) node.ReferenceTypeId = NumericNodeId(45, 0) attrs = ua.ReferenceTypeAttributes() attrs.DisplayName = LocalizedText("AliasFor") attrs.InverseName = LocalizedText("HasAlias") node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(45, 0) ref.SourceNodeId = NumericNodeId(23469, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(32, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23470, 0) node.BrowseName = QualifiedName('Aliases', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(85, 0) node.ReferenceTypeId = NumericNodeId(35, 0) node.TypeDefinition = NumericNodeId(23456, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("Aliases") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23470, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23476, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(35, 0) ref.SourceNodeId = NumericNodeId(23470, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(85, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23470, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23456, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23476, 0) node.BrowseName = QualifiedName('FindAlias', 0) node.NodeClass = NodeClass.Method node.ParentNodeId = NumericNodeId(23470, 0) node.ReferenceTypeId = NumericNodeId(47, 0) attrs = ua.MethodAttributes() attrs.DisplayName = LocalizedText("FindAlias") node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23476, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23477, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23476, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23478, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23476, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23470, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23477, 0) node.BrowseName = QualifiedName('InputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23476, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("InputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNameSearchPattern' extobj.DataType = NumericNodeId(12, 0) extobj.ValueRank = -1 value.append(extobj) extobj = ua.Argument() extobj.Name = 'ReferenceTypeFilter' extobj.DataType = NumericNodeId(17, 0) extobj.ValueRank = -1 value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23477, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23477, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23476, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23478, 0) node.BrowseName = QualifiedName('OutputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23476, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("OutputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNodeList' extobj.DataType = NumericNodeId(23468, 0) extobj.ValueRank = 1 extobj.ArrayDimensions = [0] value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23478, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23478, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23476, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23479, 0) node.BrowseName = QualifiedName('TagVariables', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(23470, 0) node.ReferenceTypeId = NumericNodeId(35, 0) node.TypeDefinition = NumericNodeId(23456, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("TagVariables") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23479, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23485, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(35, 0) ref.SourceNodeId = NumericNodeId(23479, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23470, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23479, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23456, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23485, 0) node.BrowseName = QualifiedName('FindAlias', 0) node.NodeClass = NodeClass.Method node.ParentNodeId = NumericNodeId(23479, 0) node.ReferenceTypeId = NumericNodeId(47, 0) attrs = ua.MethodAttributes() attrs.DisplayName = LocalizedText("FindAlias") node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23485, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23486, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23485, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23487, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23485, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23479, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23486, 0) node.BrowseName = QualifiedName('InputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23485, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("InputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNameSearchPattern' extobj.DataType = NumericNodeId(12, 0) extobj.ValueRank = -1 value.append(extobj) extobj = ua.Argument() extobj.Name = 'ReferenceTypeFilter' extobj.DataType = NumericNodeId(17, 0) extobj.ValueRank = -1 value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23486, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23486, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23485, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23487, 0) node.BrowseName = QualifiedName('OutputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23485, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("OutputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNodeList' extobj.DataType = NumericNodeId(23468, 0) extobj.ValueRank = 1 extobj.ArrayDimensions = [0] value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23487, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23487, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23485, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23488, 0) node.BrowseName = QualifiedName('Topics', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(23470, 0) node.ReferenceTypeId = NumericNodeId(35, 0) node.TypeDefinition = NumericNodeId(23456, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("Topics") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23488, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23494, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(35, 0) ref.SourceNodeId = NumericNodeId(23488, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23470, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23488, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23456, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23494, 0) node.BrowseName = QualifiedName('FindAlias', 0) node.NodeClass = NodeClass.Method node.ParentNodeId = NumericNodeId(23488, 0) node.ReferenceTypeId = NumericNodeId(47, 0) attrs = ua.MethodAttributes() attrs.DisplayName = LocalizedText("FindAlias") node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23494, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23495, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23494, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23496, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(47, 0) ref.SourceNodeId = NumericNodeId(23494, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23488, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23495, 0) node.BrowseName = QualifiedName('InputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23494, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("InputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNameSearchPattern' extobj.DataType = NumericNodeId(12, 0) extobj.ValueRank = -1 value.append(extobj) extobj = ua.Argument() extobj.Name = 'ReferenceTypeFilter' extobj.DataType = NumericNodeId(17, 0) extobj.ValueRank = -1 value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23495, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23495, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23494, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23496, 0) node.BrowseName = QualifiedName('OutputArguments', 0) node.NodeClass = NodeClass.Variable node.ParentNodeId = NumericNodeId(23494, 0) node.ReferenceTypeId = NumericNodeId(46, 0) node.TypeDefinition = NumericNodeId(68, 0) attrs = ua.VariableAttributes() attrs.DisplayName = LocalizedText("OutputArguments") attrs.DataType = NumericNodeId(296, 0) value = [] extobj = ua.Argument() extobj.Name = 'AliasNodeList' extobj.DataType = NumericNodeId(23468, 0) extobj.ValueRank = 1 extobj.ArrayDimensions = [0] value.append(extobj) attrs.Value = ua.Variant(value, ua.VariantType.ExtensionObject) attrs.ValueRank = 1 attrs.ArrayDimensions = [0] node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23496, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(68, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(46, 0) ref.SourceNodeId = NumericNodeId(23496, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23494, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23499, 0) node.BrowseName = QualifiedName('Default Binary', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(23468, 0) node.ReferenceTypeId = NumericNodeId(38, 0) node.TypeDefinition = NumericNodeId(76, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("Default Binary") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(38, 0) ref.SourceNodeId = NumericNodeId(23499, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23468, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(39, 0) ref.SourceNodeId = NumericNodeId(23499, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23502, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23499, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(76, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23505, 0) node.BrowseName = QualifiedName('Default XML', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(23468, 0) node.ReferenceTypeId = NumericNodeId(38, 0) node.TypeDefinition = NumericNodeId(76, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("Default XML") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(38, 0) ref.SourceNodeId = NumericNodeId(23505, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23468, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(39, 0) ref.SourceNodeId = NumericNodeId(23505, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23508, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23505, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(76, 0) refs.append(ref) server.add_references(refs) node = ua.AddNodesItem() node.RequestedNewNodeId = NumericNodeId(23511, 0) node.BrowseName = QualifiedName('Default JSON', 0) node.NodeClass = NodeClass.Object node.ParentNodeId = NumericNodeId(23468, 0) node.ReferenceTypeId = NumericNodeId(38, 0) node.TypeDefinition = NumericNodeId(76, 0) attrs = ua.ObjectAttributes() attrs.DisplayName = LocalizedText("Default JSON") attrs.EventNotifier = 0 node.NodeAttributes = attrs server.add_nodes([node]) refs = [] ref = ua.AddReferencesItem() ref.IsForward = False ref.ReferenceTypeId = NumericNodeId(38, 0) ref.SourceNodeId = NumericNodeId(23511, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(23468, 0) refs.append(ref) ref = ua.AddReferencesItem() ref.IsForward = True ref.ReferenceTypeId = NumericNodeId(40, 0) ref.SourceNodeId = NumericNodeId(23511, 0) ref.TargetNodeClass = NodeClass.DataType ref.TargetNodeId = NumericNodeId(76, 0) refs.append(ref) server.add_references(refs)
{ "pile_set_name": "Github" }
## 0.9.1 (Dec 15, 2017) * Fix PropsPicker match (#21) ## 0.9.0 (Dec 13, 2017) * Add typescript support (#13) * Separate animition hoc to other repository (#15) * Change propsPicker for typescript type inferring (#18) * Add relative level popspicker (#20) ## 0.8.0 (Oct 16, 2017) * Move async bundle loading of ArenaScene to ArenaSceneLoadMotion * Rename ArenaSceneMotion to ArenaSceneLoadMotion * Remove asyncBundleToComponent and asyncBundleToElement in tools * Add state tree description in redux store and asyncBundleToElement in tools * Fix unmounted component's child null reference issue ## 0.7.1 (Oct 10, 2017) * Add ReducerDictOverrider HOC ## 0.7.0 (Oct 2, 2017) * Sub-module bug fixed ## 0.7.0-beta (Sep 29, 2017) * Support redux-arena-router and redux-arena-form * Add react-motion animation support * Remove deprecated helpers and sagaOps * Add bundleToElement/asyncBundleToElement tools ## 0.6.3 (Sep 18, 2017) * Fix isNotifyOn props pass down bug * Remove props SceneLoadingComponent in SceneBulde component ## 0.6.0 (Sep 12, 2017) * RouteScene and SoloScene is refactored * Fix bundle hot reload bugs ## 0.5.1 (Sep 12, 2017) * Fixed state illusion bug after bundle reload ## 0.5.0 (Aug 20, 2017) * Bug fixed and API update ## 0.4.1 (Aug 20, 2017) * Virtual reducer key support ## 0.3.0 (Aug 20, 2017) * Rename IndependentScene to SoloScene * Rename SceneSwitch to ArenaScene * Fix some bugs ## 0.2.3 (Aug 20, 2017) * Add IndependentScene * Add annotations * Add route infomation in scene actions ## 0.2.0 (Aug 19, 2017) * Support react-hot-loader * Support redux-devtools ## 0.1.0 (Aug 03, 2017) * Initial public release
{ "pile_set_name": "Github" }
/* Localized versions of Info.plist keys */
{ "pile_set_name": "Github" }
import { CommonModule } from '@angular/common'; import { NgModule, Component, AfterViewInit, Input, ElementRef } from '@angular/core'; import { DomRenderer } from '../common/dom'; @Component({ selector: 'free-badge', template: `<span class="free-badge free-badge-{{theme}}" [ngStyle]="style" [ngClass]="{'free-badge-outline': outline, 'free-badge-circle': circle}" [class.free-badge-up]="up">{{content}}</span>`, providers: [DomRenderer] }) export class BadgeComponent implements AfterViewInit { @Input() content: string; @Input() up: boolean; @Input() circle: boolean; @Input() outline: boolean; @Input() theme: string; @Input() style: any; constructor(public domRenderer: DomRenderer, public er: ElementRef) { this.circle = true; this.theme = 'default'; } ngAfterViewInit() { const container = this.er.nativeElement; const parent = this.domRenderer.parentNode(container); const position = this.domRenderer.getStyle(container, 'position'); if (!position || position === 'static') { this.domRenderer.css(parent, {'position': 'relative'}); } } } @NgModule({ imports: [CommonModule], declarations: [BadgeComponent], exports: [BadgeComponent] }) export class BadgeModule {}
{ "pile_set_name": "Github" }
<div> <span class="required validation-message">{$message}</span> <table id="questionTable" class="table table-bordered"> <tr> <th> Question </th> <th> Text </th> <th> Type </th> </tr> {foreach from=$questions item=question} <tr> <td> Q{$question.sort_order+1} </td> <td> {$question.name} </td> <td> {$question.type} </td> </tr> {/foreach} </table> </div>
{ "pile_set_name": "Github" }
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package eu.europa.esig.dss.cades; import eu.europa.esig.dss.AbstractSignatureParameters; import eu.europa.esig.dss.cades.signature.CAdESTimestampParameters; public class CAdESSignatureParameters extends AbstractSignatureParameters<CAdESTimestampParameters> { private boolean en319122 = true; private String contentHintsType; private String contentHintsDescription; private String contentIdentifierPrefix; private String contentIdentifierSuffix; public boolean isEn319122() { return en319122; } public void setEn319122(boolean en319122) { this.en319122 = en319122; } public String getContentHintsType() { return contentHintsType; } public void setContentHintsType(String contentHintsType) { this.contentHintsType = contentHintsType; } public String getContentHintsDescription() { return contentHintsDescription; } public void setContentHintsDescription(String contentHintsDescription) { this.contentHintsDescription = contentHintsDescription; } /** * THIS VALUE WILL BE SET AUTOMATICALLY IF LEFT BLANK * * ETSI TS 101 733 V2.2.1 (2013-04) * * 5.10.2 content-identifier Attribute * The content-identifier attribute provides an identifier for the signed content, for use when a reference may be * later required to that content; for example, in the content-reference attribute in other signed data sent later. * The * content-identifier shall be a signed attribute. * content-identifier attribute type values for the ES have an ASN.1 type ContentIdentifier, as defined in * ESS (RFC 2634 [5]). * * The minimal content-identifier attribute should contain a concatenation of user-specific identification * information (such as a user name or public keying material identification information), a GeneralizedTime string, * and a random number. * * @return */ public String getContentIdentifierSuffix() { return contentIdentifierSuffix; } /** * @param contentIdentifierSuffix * @see #getContentIdentifierSuffix() */ public void setContentIdentifierSuffix(String contentIdentifierSuffix) { this.contentIdentifierSuffix = contentIdentifierSuffix; } /** * ETSI TS 101 733 V2.2.1 (2013-04) * * 5.10.2 content-identifier Attribute * The content-identifier attribute provides an identifier for the signed content, for use when a reference may be * later required to that content; for example, in the content-reference attribute in other signed data sent later. * The * content-identifier shall be a signed attribute. * content-identifier attribute type values for the ES have an ASN.1 type ContentIdentifier, as defined in * ESS (RFC 2634 [5]). * * The minimal content-identifier attribute should contain a concatenation of user-specific identification * information (such as a user name or public keying material identification information), a GeneralizedTime string, * and a random number. * * @return */ public String getContentIdentifierPrefix() { return contentIdentifierPrefix; } /** * @param contentIdentifierPrefix * @see #getContentIdentifierPrefix() */ public void setContentIdentifierPrefix(String contentIdentifierPrefix) { this.contentIdentifierPrefix = contentIdentifierPrefix; } @Override public CAdESTimestampParameters getContentTimestampParameters() { if (contentTimestampParameters == null) { contentTimestampParameters = new CAdESTimestampParameters(); } return contentTimestampParameters; } @Override public CAdESTimestampParameters getSignatureTimestampParameters() { if (signatureTimestampParameters == null) { signatureTimestampParameters = new CAdESTimestampParameters(); } return signatureTimestampParameters; } @Override public CAdESTimestampParameters getArchiveTimestampParameters() { if (archiveTimestampParameters == null) { archiveTimestampParameters = new CAdESTimestampParameters(); } return archiveTimestampParameters; } }
{ "pile_set_name": "Github" }
// =-=-=-=-=-=-=- // irods includes #include "apiHandler.hpp" #include "irods_load_plugin.hpp" #include "irods_plugin_name_generator.hpp" #include "irods_pack_table.hpp" #include "irods_client_api_table.hpp" #include <boost/filesystem.hpp> #include <algorithm> namespace irods { // =-=-=-=-=-=-=- // public - ctor api_entry::api_entry( apidef_t& _def ) : plugin_base( "api_instance", "api_context" ) , apiNumber( _def.apiNumber ) , apiVersion( _def.apiVersion ) , clientUserAuth( _def.clientUserAuth ) , proxyUserAuth( _def.proxyUserAuth ) , inPackInstruct( _def.inPackInstruct ) , inBsFlag( _def.inBsFlag ) , outPackInstruct( _def.outPackInstruct ) , outBsFlag( _def.outBsFlag ) , call_wrapper(_def.call_wrapper) , operation_name(_def.operation_name) , clearInStruct( _def.clearInStruct ) { operations_[ _def.operation_name ] = _def.svrHandler; } // ctor // =-=-=-=-=-=-=- // public - copy ctor api_entry::api_entry( const api_entry& _rhs ) : plugin_base( _rhs ) , apiNumber( _rhs.apiNumber ) , apiVersion( _rhs.apiVersion ) , clientUserAuth( _rhs.clientUserAuth ) , proxyUserAuth( _rhs.proxyUserAuth ) , inPackInstruct( _rhs.inPackInstruct ) , inBsFlag( _rhs.inBsFlag ) , outPackInstruct( _rhs.outPackInstruct ) , outBsFlag( _rhs.outBsFlag ) , call_wrapper(_rhs.call_wrapper) , in_pack_key(_rhs.in_pack_key) , out_pack_key(_rhs.out_pack_key) , in_pack_value(_rhs.in_pack_value) , out_pack_value(_rhs.out_pack_value) , operation_name(_rhs.operation_name) , extra_pack_struct(_rhs.extra_pack_struct) , clearInStruct( _rhs.clearInStruct ) { } // cctor // =-=-=-=-=-=-=- // public - assignment operator api_entry& api_entry::operator=( const api_entry& _rhs ) { if ( this == &_rhs ) { return *this; } plugin_base::operator=(_rhs); apiNumber = _rhs.apiNumber; apiVersion = _rhs.apiVersion; clientUserAuth = _rhs.clientUserAuth; proxyUserAuth = _rhs.proxyUserAuth; inPackInstruct = _rhs.inPackInstruct; inBsFlag = _rhs.inBsFlag; outPackInstruct = _rhs.outPackInstruct; outBsFlag = _rhs.outBsFlag; return *this; } // assignment op // =-=-=-=-=-=-=- // public - ctor for api entry table api_entry_table::api_entry_table(apidef_t defs[], size_t num) : loaded_plugins_{} { for (size_t i = 0; i < num; ++i) { table_[defs[i].apiNumber] = api_entry_ptr(new api_entry(defs[i])); } } // ctor auto api_entry_table::is_plugin_loaded(std::string_view plugin_name) -> bool { const auto end = std::cend(loaded_plugins_); return std::find(std::cbegin(loaded_plugins_), end, plugin_name) != end; } auto api_entry_table::mark_plugin_as_loaded(std::string_view plugin_name) -> void { if (!is_plugin_loaded(plugin_name)) { loaded_plugins_.push_back(plugin_name.data()); } } // =-=-=-=-=-=-=- // public - load api plugins error init_api_table(api_entry_table& _api_tbl, pack_entry_table& _pack_tbl, bool _cli_flg) { // =-=-=-=-=-=-=- // resolve plugin directory std::string plugin_home; error ret = resolve_plugin_path( irods::PLUGIN_TYPE_API, plugin_home ); if ( !ret.ok() ) { return PASS( ret ); } namespace fs = boost::filesystem; // =-=-=-=-=-=-=- // iterate over the API_HOME directory entries if (const fs::path so_dir(plugin_home); fs::exists(so_dir)) { for (fs::directory_iterator it(so_dir); it != fs::directory_iterator(); ++it) { const auto path = it->path(); // Skip the API plugin if it was loaded before. if (_api_tbl.is_plugin_loaded(path.c_str())) { const auto* msg = "init_api_table :: API plugin [%s] has already been loaded. Skipping ..."; rodsLog(LOG_DEBUG, msg, path.stem().c_str()); continue; } // =-=-=-=-=-=-=- // given a shared object, load the plugin from it std::string name = path.stem().string(); // =-=-=-=-=-=-=- // if client side, skip server plugins, etc. if (std::string::npos != name.find(_cli_flg ? "_server" : "_client")) { continue; } // =-=-=-=-=-=-=- // clip off the lib to remain compliant with // load_plugin's expected behavior size_t pos = name.find( "lib" ); if ( std::string::npos == pos ) { continue; } name = name.substr( 3 ); api_entry* entry = nullptr; error ret = load_plugin<api_entry>( entry, name, PLUGIN_TYPE_API, "api_instance", "api_context"); if (ret.ok() && entry) { rodsLog( LOG_DEBUG, "init_api_table :: adding %d - [%s] - [%s]", entry->apiNumber, entry->operation_name.c_str(), name.c_str() ); // =-=-=-=-=-=-=- // ask the plugin to fill in the api and pack // tables with its appropriate values _api_tbl[ entry->apiNumber ] = api_entry_ptr( entry ); // =-=-=-=-=-=-=- // add the in struct if ( !entry->in_pack_key.empty() ) { _pack_tbl[ entry->in_pack_key ].packInstruct = entry->in_pack_value; entry->inPackInstruct = entry->in_pack_key.c_str(); } // =-=-=-=-=-=-=- // add the out struct if ( !entry->out_pack_key.empty() ) { _pack_tbl[ entry->out_pack_key ].packInstruct = entry->out_pack_value; entry->outPackInstruct = entry->out_pack_key.c_str(); } // =-=-=-=-=-=-=- // some plugins may define additional packinstructions // which are composites of the in or out structs if (!entry->extra_pack_struct.empty()) { for (auto&& [key, value] : entry->extra_pack_struct) { _pack_tbl[key].packInstruct = value; } } // Remember that the current plugin has been loaded. // This keeps the server from wasting resources loading the same // plugin multiple times. _api_tbl.mark_plugin_as_loaded(path.c_str()); } else { irods::log( PASS( ret ) ); } } // for itr } // if exists return SUCCESS(); } // init_api_table } // namespace irods
{ "pile_set_name": "Github" }
/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * DataVisualizerCustomizer.java * Copyright (C) 2011-2012 University of Waikato, Hamilton, New Zealand * */ package weka.gui.beans; import java.awt.BorderLayout; import java.awt.Font; import java.awt.GridLayout; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Set; import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.SwingConstants; import weka.core.Environment; import weka.core.EnvironmentHandler; /** * GUI customizer for data visualizer. Allows the customization of * options for offscreen chart rendering (i.e. the payload of "ImageEvent" * connections). * * @author Mark Hall (mhall{[at]}pentaho{[dot]}com) * @version $Revision: 8034 $ */ public class DataVisualizerCustomizer extends JPanel implements BeanCustomizer, EnvironmentHandler, CustomizerClosingListener, CustomizerCloseRequester { /** * For serialization */ private static final long serialVersionUID = 27802741348090392L; private DataVisualizer m_dataVis; private Environment m_env = Environment.getSystemWide(); private ModifyListener m_modifyListener; private Window m_parent; private String m_rendererNameBack; private String m_xAxisBack; private String m_yAxisBack; private String m_widthBack; private String m_heightBack; private String m_optsBack; private JComboBox m_rendererCombo; private EnvironmentField m_xAxis; private EnvironmentField m_yAxis; private EnvironmentField m_width; private EnvironmentField m_height; private EnvironmentField m_opts; /** * Constructor */ public DataVisualizerCustomizer() { setLayout(new BorderLayout()); } /** * Set the model performance chart object to customize * * @param object the model performance chart to customize */ public void setObject(Object object) { m_dataVis = (DataVisualizer)object; m_rendererNameBack = m_dataVis.getOffscreenRendererName(); m_xAxisBack = m_dataVis.getOffscreenXAxis(); m_yAxisBack = m_dataVis.getOffscreenYAxis(); m_widthBack = m_dataVis.getOffscreenWidth(); m_heightBack = m_dataVis.getOffscreenHeight(); m_optsBack = m_dataVis.getOffscreenAdditionalOpts(); setup(); } private void setup() { JPanel holder = new JPanel(); holder.setLayout(new GridLayout(6, 2)); Vector<String> comboItems = new Vector<String>(); comboItems.add("Weka Chart Renderer"); Set<String> pluginRenderers = PluginManager.getPluginNamesOfType("weka.gui.beans.OffscreenChartRenderer"); if (pluginRenderers != null) { for (String plugin : pluginRenderers) { comboItems.add(plugin); } } JLabel rendererLab = new JLabel("Renderer", SwingConstants.RIGHT); holder.add(rendererLab); m_rendererCombo = new JComboBox(comboItems); holder.add(m_rendererCombo); JLabel xLab = new JLabel("X-axis attribute", SwingConstants.RIGHT); xLab.setToolTipText("Attribute name or /first or /last or /<index>"); m_xAxis = new EnvironmentField(m_env); m_xAxis.setText(m_xAxisBack); JLabel yLab = new JLabel("Y-axis attribute", SwingConstants.RIGHT); yLab.setToolTipText("Attribute name or /first or /last or /<index>"); m_yAxis = new EnvironmentField(m_env); m_yAxis.setText(m_yAxisBack); JLabel widthLab = new JLabel("Chart width (pixels)", SwingConstants.RIGHT); m_width = new EnvironmentField(m_env); m_width.setText(m_widthBack); JLabel heightLab = new JLabel("Chart height (pixels)", SwingConstants.RIGHT); m_height = new EnvironmentField(m_env); m_height.setText(m_heightBack); final JLabel optsLab = new JLabel("Renderer options", SwingConstants.RIGHT); m_opts = new EnvironmentField(m_env); m_opts.setText(m_optsBack); holder.add(xLab); holder.add(m_xAxis); holder.add(yLab); holder.add(m_yAxis); holder.add(widthLab); holder.add(m_width); holder.add(heightLab); holder.add(m_height); holder.add(optsLab); holder.add(m_opts); add(holder, BorderLayout.CENTER); String globalInfo = m_dataVis.globalInfo(); globalInfo += " This dialog allows you to configure offscreen " + "rendering options. Offscreen images are passed via" + " 'image' connections."; JTextArea jt = new JTextArea(); jt.setColumns(30); jt.setFont(new Font("SansSerif", Font.PLAIN,12)); jt.setEditable(false); jt.setLineWrap(true); jt.setWrapStyleWord(true); jt.setText(globalInfo); jt.setBackground(getBackground()); JPanel jp = new JPanel(); jp.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("About"), BorderFactory.createEmptyBorder(5, 5, 5, 5) )); jp.setLayout(new BorderLayout()); jp.add(jt, BorderLayout.CENTER); add(jp, BorderLayout.NORTH); addButtons(); m_rendererCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setupRendererOptsTipText(optsLab); } }); m_rendererCombo.setSelectedItem(m_rendererNameBack); setupRendererOptsTipText(optsLab); } private void setupRendererOptsTipText(JLabel optsLab) { String renderer = m_rendererCombo.getSelectedItem().toString(); if (renderer.equalsIgnoreCase("weka chart renderer")) { // built-in renderer WekaOffscreenChartRenderer rcr = new WekaOffscreenChartRenderer(); String tipText = rcr.optionsTipTextHTML(); tipText = tipText.replace("<html>", "<html>Comma separated list of options:<br>"); optsLab.setToolTipText(tipText); } else { try { Object rendererO = PluginManager.getPluginInstance("weka.gui.beans.OffscreenChartRenderer", renderer); if (rendererO != null) { String tipText = ((OffscreenChartRenderer)rendererO).optionsTipTextHTML(); if (tipText != null && tipText.length() > 0) { optsLab.setToolTipText(tipText); } } } catch (Exception ex) { } } } private void addButtons() { JButton okBut = new JButton("OK"); JButton cancelBut = new JButton("Cancel"); JPanel butHolder = new JPanel(); butHolder.setLayout(new GridLayout(1, 2)); butHolder.add(okBut); butHolder.add(cancelBut); add(butHolder, BorderLayout.SOUTH); okBut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { m_dataVis.setOffscreenXAxis(m_xAxis.getText()); m_dataVis.setOffscreenYAxis(m_yAxis.getText()); m_dataVis.setOffscreenWidth(m_width.getText()); m_dataVis.setOffscreenHeight(m_height.getText()); m_dataVis.setOffscreenAdditionalOpts(m_opts.getText()); m_dataVis.setOffscreenRendererName(m_rendererCombo. getSelectedItem().toString()); if (m_modifyListener != null) { m_modifyListener. setModifiedStatus(DataVisualizerCustomizer.this, true); } if (m_parent != null) { m_parent.dispose(); } } }); cancelBut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { customizerClosing(); if (m_parent != null) { m_parent.dispose(); } } }); } /** * Set the parent window of this dialog * * @param parent the parent window */ public void setParentWindow(Window parent) { m_parent = parent; } /** * Gets called if the use closes the dialog via the * close widget on the window - is treated as cancel, * so restores the ImageSaver to its previous state. */ public void customizerClosing() { m_dataVis.setOffscreenXAxis(m_xAxisBack); m_dataVis.setOffscreenYAxis(m_yAxisBack); m_dataVis.setOffscreenWidth(m_widthBack); m_dataVis.setOffscreenHeight(m_heightBack); m_dataVis.setOffscreenAdditionalOpts(m_optsBack); m_dataVis.setOffscreenRendererName(m_rendererNameBack); } /** * Set the environment variables to use * * @param env the environment variables to use */ public void setEnvironment(Environment env) { m_env = env; } /** * Set a listener interested in whether we've modified * the ImageSaver that we're customizing * * @param l the listener */ public void setModifiedListener(ModifyListener l) { m_modifyListener = l; } }
{ "pile_set_name": "Github" }
package isolated import ( . "code.cloudfoundry.org/cli/cf/util/testhelpers/matchers" "code.cloudfoundry.org/cli/integration/helpers" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" . "github.com/onsi/gomega/gexec" ) var _ = Describe("create-space command", func() { var ( orgName string otherOrgName string spaceName string spaceNameNew string ) BeforeEach(func() { orgName = helpers.NewOrgName() otherOrgName = helpers.NewOrgName() spaceName = helpers.NewSpaceName() spaceNameNew = helpers.PrefixedRandomName("space") }) Describe("help", func() { When("--help flag is set", func() { It("appears in cf help -a", func() { session := helpers.CF("help", "-a") Eventually(session).Should(Exit(0)) Expect(session).To(HaveCommandInCategoryWithDescription("create-space", "SPACES", "Create a space")) }) It("Displays command usage to output", func() { session := helpers.CF("create-space", "--help") Eventually(session).Should(Say("NAME:")) Eventually(session).Should(Say("create-space - Create a space")) Eventually(session).Should(Say("USAGE:")) Eventually(session).Should(Say(`cf create-space SPACE \[-o ORG\]`)) Eventually(session).Should(Say("ALIAS:")) Eventually(session).Should(Say(`csp`)) Eventually(session).Should(Say("OPTIONS:")) Eventually(session).Should(Say(`-o\s+Organization`)) Eventually(session).Should(Say(`--quota, -q\s+Quota to assign to the newly created space`)) Eventually(session).Should(Say("SEE ALSO:")) Eventually(session).Should(Say("set-space-isolation-segment, space-quotas, spaces, target")) Eventually(session).Should(Exit(0)) }) }) }) When("the space name is not provided", func() { It("tells the user that the space name is required, prints help text, and exits 1", func() { session := helpers.CF("create-space") Eventually(session.Err).Should(Say("Incorrect Usage: the required argument `SPACE` was not provided")) Eventually(session).Should(Say("NAME:")) Eventually(session).Should(Exit(1)) }) }) When("the environment is not setup correctly", func() { It("fails with the appropriate errors", func() { helpers.CheckEnvironmentTargetedCorrectly(false, false, ReadOnlyOrg, "create-space", spaceNameNew) }) }) When("the environment is set up correctly", func() { BeforeEach(func() { helpers.SetupCF(orgName, spaceName) }) AfterEach(func() { helpers.QuickDeleteOrg(orgName) }) When("org does not exist", func() { It("tells the user that the org does not exist, prints help text, and exits 1", func() { session := helpers.CF("create-space", spaceNameNew, "-o", "not-an-org") Eventually(session.Err).Should(Say("Organization 'not-an-org' not found.")) Eventually(session).Should(Exit(1)) }) }) When("the space does not exist", func() { When("the actor is a user", func() { It("creates the space in the targeted org", func() { session := helpers.CF("create-space", spaceNameNew) userName, _ := helpers.GetCredentials() Eventually(session).Should(Say("Creating space %s in org %s as %s...", spaceNameNew, orgName, userName)) Eventually(session).Should(Say("OK")) Eventually(session).Should(Say(`TIP: Use 'cf target -o "%s" -s "%s"' to target new space`, orgName, spaceNameNew)) Eventually(session).Should(Exit(0)) session = helpers.CF("space", spaceNameNew) Eventually(session).Should(Say(`name:\s+%s`, spaceNameNew)) Eventually(session).Should(Exit(0)) }) }) When("the actor is a client", func() { var clientID string BeforeEach(func() { clientID = helpers.LoginCFWithClientCredentials() helpers.TargetOrg(orgName) }) It("creates the space in the targeted org", func() { session := helpers.CF("create-space", spaceNameNew) Eventually(session).Should(Say("Creating space %s in org %s as %s...", spaceNameNew, orgName, clientID)) Eventually(session).Should(Say("OK")) Eventually(session).Should(Say(`TIP: Use 'cf target -o "%s" -s "%s"' to target new space`, orgName, spaceNameNew)) Eventually(session).Should(Exit(0)) session = helpers.CF("space", spaceNameNew) Eventually(session).Should(Say(`name:\s+%s`, spaceNameNew)) Eventually(session).Should(Exit(0)) session = helpers.CF("space-users", orgName, spaceNameNew) Eventually(session).Should(Say("SPACE MANAGER")) Eventually(session).Should(Say(`\s+%s \(client\)`, clientID)) Eventually(session).Should(Say("SPACE DEVELOPER")) Eventually(session).Should(Say(`\s+%s \(client\)`, clientID)) }) }) When("org is specified", func() { BeforeEach(func() { helpers.CreateOrg(otherOrgName) }) AfterEach(func() { helpers.QuickDeleteOrg(otherOrgName) }) It("creates the space in the specified org and assigns roles to the user", func() { session := helpers.CF("create-space", spaceNameNew, "-o", otherOrgName) userName, _ := helpers.GetCredentials() Eventually(session).Should(Say("Creating space %s in org %s as %s...", spaceNameNew, otherOrgName, userName)) Eventually(session).Should(Say("OK")) Eventually(session).Should(Say(`Assigning role SpaceManager to user %s in org %s / space %s as %s\.\.\.`, userName, otherOrgName, spaceNameNew, userName)) Eventually(session).Should(Say(`OK\n`)) Eventually(session).Should(Say(`Assigning role SpaceDeveloper to user %s in org %s / space %s as %s\.\.\.`, userName, otherOrgName, spaceNameNew, userName)) Eventually(session).Should(Say(`OK\n\n`)) Eventually(session).Should(Say(`TIP: Use 'cf target -o "%s" -s "%s"' to target new space`, otherOrgName, spaceNameNew)) Eventually(session).Should(Exit(0)) helpers.TargetOrg(otherOrgName) session = helpers.CF("space", spaceNameNew) Eventually(session).Should(Say(`name:\s+%s`, spaceNameNew)) Eventually(session).Should(Exit(0)) session = helpers.CF("space-users", otherOrgName, spaceNameNew) Eventually(session).Should(Say("SPACE MANAGER")) Eventually(session).Should(Say(`\s+%s`, userName)) Eventually(session).Should(Say("SPACE DEVELOPER")) Eventually(session).Should(Say(`\s+%s`, userName)) }) }) When("the --quota flag is passed", func() { When("the quota does not exist", func() { var ( quotaName = "garb-quota" ) It("makes a space and informs the user setting the quota has failed", func() { session := helpers.CF("create-space", spaceNameNew, "-q", quotaName) userName, _ := helpers.GetCredentials() Eventually(session).Should(Say("Creating space %s in org %s as %s...", spaceNameNew, orgName, userName)) Eventually(session).Should(Say("OK")) Eventually(session).Should(Say("Setting space quota %s to space %s as %s...", quotaName, spaceNameNew, userName)) Eventually(session.Err).Should(Say("Space quota with name '%s' not found.", quotaName)) Eventually(session).Should(Say("FAILED")) session = helpers.CF("space", spaceNameNew) Eventually(session).Should(Say(`name:\s+%s`, spaceNameNew)) Eventually(session).Should(Exit(0)) }) }) When("the quota exists", func() { var ( quotaName = helpers.QuotaName() ) BeforeEach(func() { Eventually(helpers.CF("create-space-quota", quotaName)).Should(Exit(0)) }) It("makes an org with the given quota", func() { session := helpers.CF("create-space", spaceNameNew, "-q", quotaName) userName, _ := helpers.GetCredentials() Eventually(session).Should(Say("Creating space %s in org %s as %s...", spaceNameNew, orgName, userName)) Eventually(session).Should(Say("OK")) Eventually(session).Should(Say("Setting space quota %s to space %s as %s...", quotaName, spaceNameNew, userName)) Eventually(session).Should(Say("OK")) Eventually(session).Should(Say(`Assigning role SpaceManager to user %s in org %s / space %s as %s\.\.\.`, userName, orgName, spaceNameNew, userName)) Eventually(session).Should(Say(`OK\n`)) Eventually(session).Should(Say(`Assigning role SpaceDeveloper to user %s in org %s / space %s as %s\.\.\.`, userName, orgName, spaceNameNew, userName)) Eventually(session).Should(Say(`OK\n\n`)) Eventually(session).Should(Say(`TIP: Use 'cf target -o "%s" -s "%s"' to target new space`, orgName, spaceNameNew)) Eventually(session).Should(Exit(0)) session = helpers.CF("space", spaceNameNew) Eventually(session).Should(Say(`name:\s+%s`, spaceNameNew)) Eventually(session).Should(Exit(0)) }) }) }) }) When("the space already exists", func() { BeforeEach(func() { Eventually(helpers.CF("create-space", spaceNameNew)).Should(Exit(0)) }) It("fails to create the space", func() { session := helpers.CF("create-space", spaceNameNew) userName, _ := helpers.GetCredentials() Eventually(session).Should(Say("Creating space %s in org %s as %s...", spaceNameNew, orgName, userName)) Eventually(session).Should(Say(`Space '%s' already exists\.`, spaceNameNew)) Eventually(session).Should(Say("OK")) Eventually(session).Should(Exit(0)) }) }) }) })
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.eagle.service.alert.resolver.impl; import org.apache.eagle.common.DateTimeUtil; import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity; import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity; import org.apache.eagle.log.entity.meta.EntityDefinition; import org.apache.eagle.log.entity.meta.EntityDefinitionManager; import org.apache.eagle.service.alert.resolver.AttributeResolvable; import org.apache.eagle.service.alert.resolver.AttributeResolveException; import org.apache.eagle.service.alert.resolver.BadAttributeResolveRequestException; import org.apache.eagle.service.alert.resolver.GenericAttributeResolveRequest; import org.apache.eagle.service.generic.GenericEntityServiceResource; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * @since 6/16/15. */ public class EntityAttributeResolver implements AttributeResolvable<EntityAttributeResolver.EntityAttributeResolveRequest, String> { private static final GenericEntityServiceResource entityServiceResource = new GenericEntityServiceResource(); @Override public List<String> resolve(EntityAttributeResolveRequest request) throws AttributeResolveException { if (request.getFieldName() == null) { throw new AttributeResolveException("fieldName is required"); } String attributeName = request.getFieldName(); EntityDefinition entityDefinition; try { if (request.getServiceName() != null) { entityDefinition = EntityDefinitionManager.getEntityByServiceName(request.getServiceName()); } else if (request.getEntityClassName() != null) { Class<? extends TaggedLogAPIEntity> entityClass = (Class<? extends TaggedLogAPIEntity>) Class.forName(request.getEntityClassName()); entityDefinition = EntityDefinitionManager.getEntityDefinitionByEntityClass(entityClass); } else { throw new AttributeResolveException("At least serviceName or entityClassName is required, but neither found"); } } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new AttributeResolveException(e); } List<String> filterCondition = new ArrayList<>(); if (request.getTags() != null) { for (Map.Entry<String, String> tag : request.getTags().entrySet()) { filterCondition.add("@" + tag.getKey() + " = \"" + tag.getValue() + "\""); } } if (request.getQuery() != null) { filterCondition.add("@" + attributeName + "~= \".*" + request.getQuery() + ".*\""); } String query = entityDefinition.getService() + "[" + StringUtils.join(filterCondition, " AND ") + "]<@" + attributeName + ">{count}"; return aggregateQuery(query, DateTimeUtil.millisecondsToHumanDateWithSeconds(0), DateTimeUtil.millisecondsToHumanDateWithSeconds(System.currentTimeMillis()), request.getMetricName()); } @Override public Class<EntityAttributeResolveRequest> getRequestClass() { return EntityAttributeResolveRequest.class; } @Override public void validateRequest(EntityAttributeResolver.EntityAttributeResolveRequest request) throws BadAttributeResolveRequestException { } private List<String> aggregateQuery(String query, String startTime, String endTime, String metricName) throws AttributeResolveException { List<String> result = new ArrayList<>(); GenericServiceAPIResponseEntity response = entityServiceResource.search(query, startTime, endTime, Integer.MAX_VALUE, null, false, false, 0, Integer.MAX_VALUE, true, 0, metricName, false); if (response.isSuccess()) { List objs = response.getObj(); for (Object item : objs) { // TODO: get keys as result throw new IllegalArgumentException("not implemented yet"); } } else { throw new AttributeResolveException(response.getException()); } return result; } public static class EntityAttributeResolveRequest extends GenericAttributeResolveRequest { public Map<String, String> getTags() { return tags; } private final Map<String, String> tags; public String getMetricName() { return metricName; } private final String metricName; @JsonCreator public EntityAttributeResolveRequest( @JsonProperty("query") String query, @JsonProperty("site") String site, @JsonProperty("serviceName") String serviceName, @JsonProperty("entityClassName") String entityClassName, @JsonProperty("metricName") String metricName, @JsonProperty("fieldName") String fieldName, @JsonProperty("tags") Map<String, String> tags ) { super(query, site); this.serviceName = serviceName; this.entityClassName = entityClassName; this.fieldName = fieldName; this.metricName = metricName; this.tags = tags; } private final String serviceName; public String getEntityClassName() { return entityClassName; } public String getServiceName() { return serviceName; } public String getFieldName() { return fieldName; } private final String entityClassName; private final String fieldName; } }
{ "pile_set_name": "Github" }
{ "about_opensource_title": "Это приложение с открытым исходным кодом", "about_opensource_message": "Мы приветствуем ваше участие в развитии этого приложения. Если вы заинтересованы, присоединяйтесь к нам на Github по адресу", "about_opensource_link": "https://github.com/greymass/anchor", "about_message_1": "Anchor - автономное настольное приложение, которое напрямую подключается к блокцепи EOS через конечную точку API по вашему выбору.", "about_message_2": "Ваши ключи никогда не покидают приложение и хранятся только в зашифрованном виде, обеспечивая высокий уровень безопасности.", "about_more": "Пожалуйста, посетите https://greymass.com, если хотите больше узнать о нас.", "about_issues": "Если у вас возникли проблемы с самим приложением, напишите нам о проблеме на github по адресу:", "about_issues_link": "https://github.com/greymass/anchor/issues", "about_greymass_message_1": "Это приложение является инициативой, возглавляемой Greymass.", "about_greymass_message_2": "Если вы хотите узнать больше о нашей команде и других проектах, которые мы запланировали для EOS, мы приглашаем вас посетить нас по адресу:", "about_license_type": "Лицензия MIT (MIT)", "about_license_body_1": "Copyright (c) 2018-настоящее время Greymass", "about_license_body_2": "Данная лицензия разрешает, безвозмездно, лицам, получившим копию данного программного обеспечения и сопутствующей документации (в дальнейшем именуемыми \"Программное Обеспечение\"), использовать Программное Обеспечение без ограничений, включая неограниченное право на использование, копирование, изменение, объединение, публикацию, распространение, сублицензирование и/или продажу копий Программного Обеспечения, также как и лицам, которым предоставляется данное Программное Обеспечение, при соблюдении следующих условий:", "about_license_body_3": "Вышеупомянутое уведомление об авторских правах и данные условия должны быть включены во все копии или значимые части данного Программного Обеспечения.", "about_license_body_4": "ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ ЛЮБОГО ВИДА ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ГАРАНТИЯМИ ТОВАРНОЙ ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И НЕНАРУШЕНИЯ ПРАВ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО ИСКАМ О ВОЗМЕЩЕНИИ УЩЕРБА, УБЫТКОВ ИЛИ ДРУГИХ ТРЕБОВАНИЙ ПО ДЕЙСТВУЮЩИМ КОНТРАКТАМ, ДЕЛИКТАМ ИЛИ ИНОМУ, ВОЗНИКШИМ ИЗ, ИМЕЮЩИМ ПРИЧИНОЙ ИЛИ СВЯЗАННЫМ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ ИЛИ ИСПОЛЬЗОВАНИЕМ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫМИ ДЕЙСТВИЯМИ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ." }
{ "pile_set_name": "Github" }
# -*- mode: python -*- Import("env") env = env.Clone() env.Library( target='repl_server_parameters', source=[ env.Idlc('repl_server_parameters.idl')[0] ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/client/read_preference', '$BUILD_DIR/mongo/idl/server_parameter', ] ) env.Library( target='local_oplog_info', source=[ 'local_oplog_info.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/collection', '$BUILD_DIR/mongo/db/logical_time', '$BUILD_DIR/mongo/db/storage/flow_control', '$BUILD_DIR/mongo/db/vector_clock_mutable', 'optime', 'repl_coordinator_interface', ], ) env.Library( target='oplog', source=[ 'apply_ops.cpp', 'oplog.cpp', 'oplog_entry_or_grouped_inserts.cpp', 'tenant_migration_decoration.cpp', 'transaction_oplog_application.cpp', env.Idlc('apply_ops.idl')[0], ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/database_holder', '$BUILD_DIR/mongo/db/catalog/index_build_oplog_entry', '$BUILD_DIR/mongo/db/catalog/multi_index_block', '$BUILD_DIR/mongo/db/commands/feature_compatibility_parsers', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/op_observer', '$BUILD_DIR/mongo/db/s/resharding_util', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/db/stats/server_read_concern_write_concern_metrics', '$BUILD_DIR/mongo/db/transaction', '$BUILD_DIR/mongo/idl/idl_parser', '$BUILD_DIR/mongo/rpc/command_status', 'dbcheck', 'local_oplog_info', 'repl_coordinator_interface', 'repl_server_parameters', 'repl_settings', 'tenant_migration_donor', 'timestamp_block', ], ) env.Library( target='replication_auth', source=[ 'replication_auth.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/client/authentication', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', ], ) env.Library( target='timestamp_block', source=[ 'timestamp_block.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/storage/storage_options', ], ) env.Library( target='rollback_source_impl', source=[ 'rollback_source_impl.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/index/index_descriptor', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/util/fail_point', 'oplog', 'oplog_interface_remote', 'repl_coordinator_interface', ], LIBDEPS_PRIVATE=[ 'replication_auth', ] ) env.Library( target='bgsync', source=[ 'bgsync.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/client/connection_pool', '$BUILD_DIR/mongo/client/fetcher', '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/util/concurrency/thread_pool', 'abstract_async_component', 'data_replicator_external_state_impl', 'oplog', 'oplog_fetcher', 'oplog_interface_local', 'oplog_interface_remote', 'repl_coordinator_interface', 'rollback_impl', 'rollback_source_impl', 'rs_rollback', 'storage_interface', 'sync_source_resolver', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/executor/thread_pool_task_executor', 'repl_server_parameters', ], ) env.Library( target='repl_settings', source=[ 'repl_settings.cpp', env.Idlc('repl_settings.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/idl/server_parameter', ], ) env.Library( target='abstract_async_component', source=[ 'abstract_async_component.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/executor/task_executor_interface', ], ) env.Library( target='dbcheck', source=[ 'dbcheck.cpp', "dbcheck_idl.cpp", env.Idlc('dbcheck.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/catalog/health_log', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/idl/idl_parser', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/util/md5', ], ) env.Library( target='rollback_idl', source=[ env.Idlc('rollback.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/idl/idl_parser', 'optime', ], ) env.Library( target='storage_interface', source=[ 'storage_interface.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/service_context', 'optime', ], ) env.Library( target='storage_interface_impl', source=[ 'storage_interface_impl.cpp', 'collection_bulk_loader_impl.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/multi_index_block', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/query_exec', 'oplog', 'rollback_idl', 'storage_interface', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/database_holder', '$BUILD_DIR/mongo/db/storage/oplog_cap_maintainer_thread', '$BUILD_DIR/mongo/db/storage/storage_control', '$BUILD_DIR/mongo/db/vector_clock', 'repl_server_parameters', ], ) env.Library( target='replication_consistency_markers_idl', source=[ env.Idlc('replication_consistency_markers.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/idl/idl_parser', 'optime', ], ) env.Library( target='replication_consistency_markers_impl', source=[ 'replication_consistency_markers_impl.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/server_options', 'optime', 'repl_coordinator_interface', 'replication_consistency_markers_idl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog_raii', '$BUILD_DIR/mongo/db/storage/journal_flusher', ], ) env.Library( target='replication_recovery', source=[ 'replication_recovery.cpp', ], LIBDEPS=[ ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/storage/journal_flusher', '$BUILD_DIR/mongo/db/storage/storage_options', 'oplog', 'oplog_application', 'oplog_interface_local', ], ) env.Library( target='replication_process', source=[ 'replication_consistency_markers.cpp', 'replication_process.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/service_context', 'optime', 'rollback_idl', 'storage_interface', ], ) env.Library( target='drop_pending_collection_reaper', source=[ 'drop_pending_collection_reaper.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/db/service_context', 'optime', 'storage_interface', ], ) env.Library( target='scatter_gather', source=[ 'scatter_gather_algorithm.cpp', 'scatter_gather_runner.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/executor/task_executor_interface', ], ) env.Library( target='oplog_buffer_blocking_queue', source=[ 'oplog_buffer_blocking_queue.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ], ) env.Library( target='oplog_buffer_collection', source=[ 'oplog_buffer_collection.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/service_context', 'storage_interface', ], ) env.Library( target='oplog_buffer_proxy', source=[ 'oplog_buffer_proxy.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ], ) env.Library( target='oplog_interface_local', source=[ 'oplog_interface_local.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/db/transaction', ], ) env.Library( target='oplog_interface_mock', source=[ 'oplog_interface_mock.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/util/net/network', 'oplog_entry', ], ) env.Library( target='oplog_interface_remote', source=[ 'oplog_interface_remote.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/client/clientdriver_network', ], ) env.Library( target='rs_rollback', source=[ 'rs_rollback.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/catalog/database_holder', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/db/s/sharding_runtime_d', '$BUILD_DIR/mongo/db/storage/remove_saver', '$BUILD_DIR/mongo/util/fail_point', 'drop_pending_collection_reaper', 'oplog', 'replication_process', 'roll_back_local_operations', 'rollback_impl', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/index_build_oplog_entry', '$BUILD_DIR/mongo/db/storage/journal_flusher', ], ) env.Library( target="isself", source=[ 'isself.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/util/net/network', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/authorization_manager_global', ], ) env.Library( target='task_executor_mock', source=[ 'task_executor_mock.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/unittest/task_executor_proxy', ], ) env.Library( target='rollback_test_fixture', source=[ 'rollback_test_fixture.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/db/read_write_concern_defaults_mock', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/service_context_d_test_fixture', 'drop_pending_collection_reaper', 'oplog_interface_mock', 'optime', 'replication_process', 'replication_recovery', 'replmocks', 'rs_rollback', 'storage_interface_impl', ], ) env.Library( target='rollback_impl', source=[ 'rollback_impl.cpp', env.Idlc('rollback_impl.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/kill_sessions_local', '$BUILD_DIR/mongo/db/s/sharding_runtime_d', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/write_ops', '$BUILD_DIR/mongo/util/net/network', 'optime', 'repl_coordinator_interface', 'roll_back_local_operations', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/idl/server_parameter', 'drop_pending_collection_reaper', ], ) env.Library( target='oplog_entry', source=[ 'oplog_entry.cpp', env.Idlc('oplog_entry.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/exec/document_value/document_value', '$BUILD_DIR/mongo/idl/idl_parser', 'optime', 'optime_and_wall_time_base', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/namespace_string', ], ) env.Library( target='optime_and_wall_time_base', source=[ env.Idlc('optime_and_wall_time_base.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/idl/idl_parser', ], ) env.Library( target='oplog_application_interface', source=[ 'oplog_applier.cpp', 'oplog_batcher.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/executor/task_executor_interface', '$BUILD_DIR/mongo/util/concurrency/thread_pool', 'oplog_entry', ], LIBDEPS_PRIVATE=[ 'repl_server_parameters', ], ) env.Library( target='oplog_application', source=[ 'insert_group.cpp', 'oplog_applier_impl.cpp', 'oplog_applier_utils.cpp', 'session_update_tracker.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authorization_manager_global', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception', '$BUILD_DIR/mongo/db/curop', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/db/s/sharding_runtime_d', '$BUILD_DIR/mongo/db/stats/timer_stats', '$BUILD_DIR/mongo/db/storage/storage_options', '$BUILD_DIR/mongo/util/concurrency/thread_pool', '$BUILD_DIR/mongo/util/net/network', 'initial_syncer', 'oplog', 'oplog_application_interface', 'oplog_entry', 'repl_coordinator_interface', 'repl_settings', 'replication_metrics', 'storage_interface', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/mongod_fsync', '$BUILD_DIR/mongo/db/storage/storage_control', 'repl_server_parameters', 'replication_auth', ], ) env.Library( target='oplog_entry_test_helpers', source=[ 'oplog_entry_test_helpers.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/logical_session_id', '$BUILD_DIR/mongo/db/namespace_string', 'oplog_entry', 'optime', ] ) env.Library( target='idempotency_test_fixture', source=[ 'idempotency_test_fixture.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/catalog/collection_validation', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', 'oplog_applier_impl_test_fixture', 'oplog_entry_test_helpers', ], ) env.Library( target='oplog_applier_impl_test_fixture', source=[ 'oplog_applier_impl_test_fixture.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/catalog/document_validation', '$BUILD_DIR/mongo/db/service_context_d_test_fixture', '$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger', 'drop_pending_collection_reaper', 'oplog_application', 'replmocks', 'storage_interface_impl', ], ) env.Library( target='idempotency_test_util', source=[ 'idempotency_document_structure.cpp', 'idempotency_scalar_generator.cpp', 'idempotency_update_sequence.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/exec/document_value/document_value' ], ) env.Library( target='split_horizon', source=[ 'split_horizon.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/util/net/network', ], ) env.Library( target='member_data', source=[ 'member_data.cpp', ], LIBDEPS=[ 'replica_set_messages', ] ) env.Library( target='topology_coordinator', source=[ 'heartbeat_response_action.cpp', 'topology_coordinator.cpp', env.Idlc('topology_coordinator.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/db/audit', '$BUILD_DIR/mongo/rpc/metadata', '$BUILD_DIR/mongo/util/fail_point', 'isself', 'member_data', 'repl_coordinator_interface', 'repl_settings', 'replica_set_messages', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/commit_quorum_options', '$BUILD_DIR/mongo/idl/server_parameter', 'repl_server_parameters', ] ) env.Library( target='repl_coordinator_impl', source=[ 'check_quorum_for_config_change.cpp', 'repl_set_config_checks.cpp', 'replication_coordinator_impl.cpp', 'replication_coordinator_impl_elect_v1.cpp', 'replication_coordinator_impl_heartbeat.cpp', 'vote_requester.cpp', env.Idlc('replication_coordinator_impl.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/index/index_descriptor', '$BUILD_DIR/mongo/db/kill_sessions_local', '$BUILD_DIR/mongo/db/mongod_options', '$BUILD_DIR/mongo/db/prepare_conflict_tracker', '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/executor/task_executor_interface', '$BUILD_DIR/mongo/rpc/command_status', '$BUILD_DIR/mongo/rpc/metadata', '$BUILD_DIR/mongo/transport/transport_layer_common', '$BUILD_DIR/mongo/util/fail_point', 'data_replicator_external_state_initial_sync', 'initial_syncer', 'repl_coordinator_interface', 'repl_settings', 'replica_set_messages', 'replication_metrics', 'replication_process', 'reporter', 'scatter_gather', 'tenant_migration_cloners', 'topology_coordinator', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/collection_catalog', '$BUILD_DIR/mongo/db/commands/test_commands_enabled', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/db/storage/journal_flusher', '$BUILD_DIR/mongo/idl/server_parameter', 'local_oplog_info', 'repl_server_parameters', 'replica_set_aware_service', 'split_horizon', ], ) env.Library( target='repl_coordinator_test_fixture', source=[ 'replication_coordinator_test_fixture.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', '$BUILD_DIR/mongo/db/service_context_d_test_fixture', '$BUILD_DIR/mongo/executor/network_interface_factory', '$BUILD_DIR/mongo/executor/network_interface_mock', '$BUILD_DIR/mongo/executor/network_interface_thread_pool', '$BUILD_DIR/mongo/executor/thread_pool_task_executor', '$BUILD_DIR/mongo/unittest/unittest', 'repl_coordinator_impl', 'replmocks', 'topology_coordinator', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/storage/ephemeral_for_test/storage_ephemeral_for_test', '$BUILD_DIR/mongo/db/storage/storage_engine_common', ], ) env.Library( target='repl_coordinator_interface', source=[ 'always_allow_non_local_writes.cpp', 'repl_client_info.cpp', 'replication_coordinator.cpp', 'replication_coordinator_noop.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/util/net/network', 'optime', 'replication_process', ], ) env.Library( target='replica_set_aware_service', source=[ 'replica_set_aware_service.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/service_context', ], ) env.Library( target='replmocks', source=[ 'replication_consistency_markers_mock.cpp', 'replication_coordinator_external_state_mock.cpp', 'replication_coordinator_mock.cpp', 'storage_interface_mock.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/executor/network_interface_mock', 'isself', 'oplog_buffer_blocking_queue', 'repl_coordinator_interface', 'repl_settings', 'replica_set_messages', 'storage_interface', ], ) env.Library('read_concern_args', [ 'read_concern_args.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/db/logical_time', '$BUILD_DIR/mongo/db/read_write_concern_provenance', 'optime', ]) env.Library('speculative_majority_read_info', [ 'speculative_majority_read_info.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'optime', ]) env.Library( target='replica_set_messages', source=[ 'is_master_response.cpp', 'member_config.cpp', 'repl_set_config.cpp', 'repl_set_config_validators.cpp', 'repl_set_heartbeat_args_v1.cpp', 'repl_set_heartbeat_response.cpp', 'repl_set_request_votes_args.cpp', 'repl_set_tag.cpp', 'repl_set_write_concern_mode_definitions.cpp', 'update_position_args.cpp', 'last_vote.cpp', env.Idlc('member_config.idl')[0], env.Idlc('repl_set_config.idl')[0], env.Idlc('repl_set_config_params.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/client/connection_string', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/rpc/command_status', '$BUILD_DIR/mongo/rpc/metadata', '$BUILD_DIR/mongo/transport/transport_layer_common', '$BUILD_DIR/mongo/util/net/network', 'optime', 'read_concern_args', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/idl/server_parameter', 'repl_server_parameters', 'split_horizon', ] ) env.Library( target='repl_set_status_commands', source=[ 'repl_set_command.cpp', 'repl_set_get_status_cmd.cpp', 'repl_set_test_egress.cpp', env.Idlc('repl_set_test_egress.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/auth/authprivilege', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/commands/test_commands_enabled', '$BUILD_DIR/mongo/db/lasterror', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/executor/connection_pool_executor', '$BUILD_DIR/mongo/executor/network_interface', '$BUILD_DIR/mongo/executor/network_interface_factory', '$BUILD_DIR/mongo/executor/network_interface_tl', ], ) env.Library( target='repl_set_commands', source=[ 'repl_set_commands.cpp', 'repl_set_request_votes.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/commands', '$BUILD_DIR/mongo/db/commands/test_commands_enabled', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/lasterror', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/storage/storage_options', 'drop_pending_collection_reaper', 'repl_server_parameters', 'repl_set_status_commands', 'repl_settings', 'replica_set_messages', 'replication_process', 'serveronly_repl', ], ) env.Library( target='oplog_fetcher', source=[ 'oplog_fetcher.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/db/logical_time_metadata_hook', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/db/stats/timer_stats', '$BUILD_DIR/mongo/executor/task_executor_interface', 'abstract_async_component', 'repl_coordinator_interface', 'replica_set_messages', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/server_status_core', '$BUILD_DIR/mongo/db/matcher/expressions', 'repl_server_parameters', 'replication_auth', ], ) env.Library( target='reporter', source=[ 'reporter.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/executor/remote_command', '$BUILD_DIR/mongo/executor/task_executor_interface', '$BUILD_DIR/mongo/rpc/command_status', 'replica_set_messages', ], ) env.Library( target='sync_source_resolver', source=[ 'sync_source_resolver.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/fetcher', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/executor/task_executor_interface', '$BUILD_DIR/mongo/rpc/metadata', '$BUILD_DIR/mongo/util/net/network', 'oplog_entry', 'optime', 'read_concern_args', ], ) env.Library( target='sync_source_selector_mock', source=[ 'sync_source_selector_mock.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/rpc/metadata', '$BUILD_DIR/mongo/util/net/network', 'optime', ], ) env.Library( target='initial_sync_cloners', source=[ 'all_database_cloner.cpp', 'collection_cloner.cpp', 'database_cloner.cpp', 'initial_sync_base_cloner.cpp', ], LIBDEPS = [ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/util/concurrency/thread_pool', '$BUILD_DIR/mongo/util/net/network', 'base_cloner', 'cloner_utils', 'member_data', 'repl_sync_shared_data', 'replication_consistency_markers_impl', 'task_runner', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/list_collections_filter', '$BUILD_DIR/mongo/db/index_build_entry_helpers', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/util/progress_meter', 'repl_server_parameters', 'replication_auth', ] ) env.Library( target='tenant_migration_cloners', source=[ 'tenant_all_database_cloner.cpp', 'tenant_collection_cloner.cpp', 'tenant_database_cloner.cpp', 'tenant_base_cloner.cpp', ], LIBDEPS = [ '$BUILD_DIR/mongo/base', 'base_cloner', 'cloner_utils', 'repl_sync_shared_data', 'task_runner', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/list_collections_filter', '$BUILD_DIR/mongo/rpc/metadata', '$BUILD_DIR/mongo/util/progress_meter', 'repl_server_parameters', ] ) env.Library( target='task_runner', source=[ 'task_runner.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/util/concurrency/thread_pool', ], ) env.Library( target='optime', source=[ 'bson_extract_optime.cpp', 'optime.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/bson/util/bson_extract', 'optime_and_wall_time_base', ], ) env.Library( target='multiapplier', source=[ 'multiapplier.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/executor/task_executor_interface', 'oplog_entry', ], ) env.Library( target='data_replicator_external_state_impl', source=[ 'data_replicator_external_state_impl.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'oplog_application', 'oplog_buffer_blocking_queue', 'oplog_buffer_collection', 'oplog_buffer_proxy', 'optime', 'repl_coordinator_interface', 'storage_interface', ], LIBDEPS_PRIVATE=[ 'repl_server_parameters', ], ) env.Library( target='data_replicator_external_state_initial_sync', source=[ 'data_replicator_external_state_initial_sync.cpp', ], LIBDEPS=[ 'data_replicator_external_state_impl', ], ) env.Library( target='data_replicator_external_state_mock', source=[ 'data_replicator_external_state_mock.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/util/net/network', 'oplog_application_interface', 'oplog_buffer_blocking_queue', 'oplog_entry', 'optime', 'replica_set_messages', ], ) env.Library( target='repl_sync_shared_data', source=[ 'repl_sync_shared_data.cpp', 'initial_sync_shared_data.cpp', 'tenant_migration_shared_data.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ] ) env.Library( target='base_cloner', source=[ 'base_cloner.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/util/fail_point', 'repl_sync_shared_data', ], LIBDEPS_PRIVATE=[ 'repl_server_parameters', 'replication_consistency_markers_impl', ] ) env.Library( target='cloner_utils', source=[ 'cloner_utils.cpp', 'database_cloner_common.cpp', env.Idlc('database_cloner.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/namespace_string', '$BUILD_DIR/mongo/idl/idl_parser', 'read_concern_args', ] ) env.Library( target='initial_syncer', source=[ 'initial_syncer.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/client/fetcher', '$BUILD_DIR/mongo/db/commands/server_status_core', '$BUILD_DIR/mongo/db/transaction', 'initial_sync_cloners', 'multiapplier', 'oplog', 'oplog_application_interface', 'oplog_buffer_blocking_queue', 'oplog_entry', 'oplog_fetcher', 'optime', 'repl_sync_shared_data', 'rollback_checker', 'storage_interface', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/feature_compatibility_parsers', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/executor/scoped_task_executor', 'repl_server_parameters', ] ) env.Library( target='rollback_checker', source=[ 'rollback_checker.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/executor/task_executor_interface', ], ) env.Library( target='roll_back_local_operations', source=[ 'roll_back_local_operations.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/util/fail_point', 'oplog_entry', 'optime', ], ) env.Library( target="replication_info", source=[ "replication_info.cpp", ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/auth/saslauth', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/query_exec', "$BUILD_DIR/mongo/util/fail_point", 'oplog', 'repl_coordinator_interface', 'repl_settings', 'replica_set_messages', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/server_status', '$BUILD_DIR/mongo/db/repl/speculative_authenticate', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/transport/message_compressor', 'primary_only_service', 'replication_auth', 'split_horizon', ], ) env.Library( target='tenant_migration_conflict_info', source= [ 'tenant_migration_conflict_info.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', ], ) env.Library( target='tenant_migration_state_machine_idl', source=[ env.Idlc('tenant_migration_state_machine.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/read_preference', '$BUILD_DIR/mongo/idl/idl_parser', 'optime', ], ) env.Library( target='tenant_migration_recipient_utils', source=[ "tenant_migration_recipient_entry_helpers.cpp", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/base", "$BUILD_DIR/mongo/db/catalog_raii", "$BUILD_DIR/mongo/db/dbhelpers", "$BUILD_DIR/mongo/db/namespace_string", '$BUILD_DIR/mongo/db/service_context', "$BUILD_DIR/mongo/db/storage/write_unit_of_work", "tenant_migration_state_machine_idl", ], ) env.Library( target='tenant_migration_recipient_service', source= [ 'tenant_migration_recipient_service.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/client/read_preference', 'primary_only_service', 'tenant_migration_recipient_utils', 'wait_for_majority_service', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/db/transaction', 'oplog_entry', 'tenant_migration_state_machine_idl', ] ) env.Library( target='tenant_migration_donor', source=[ 'tenant_migration_access_blocker.cpp', 'tenant_migration_access_blocker_by_prefix.cpp', 'tenant_migration_access_blocker_server_status_section.cpp', 'tenant_migration_donor_op_observer.cpp', 'tenant_migration_donor_util.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/remote_command_targeter', '$BUILD_DIR/mongo/db/catalog_raii', '$BUILD_DIR/mongo/db/commands/server_status', '$BUILD_DIR/mongo/db/commands/tenant_migration_cmds_request', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/executor/network_interface_factory', '$BUILD_DIR/mongo/executor/thread_pool_task_executor', 'local_oplog_info', 'optime', 'repl_coordinator_interface', 'tenant_migration_conflict_info', 'tenant_migration_state_machine_idl' ], ) env.Library( target='tenant_migration_donor_service', source=[ 'tenant_migration_donor_service.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/util/future_util', 'primary_only_service', 'repl_server_parameters', 'tenant_migration_donor', 'wait_for_majority_service', ], ) env.Library( target="serveronly_repl", source=[ 'noop_writer.cpp', "replication_coordinator_external_state_impl.cpp", "sync_source_feedback.cpp", ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/clientdriver_network', '$BUILD_DIR/mongo/db/auth/auth', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/cloner', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/curop', '$BUILD_DIR/mongo/db/free_mon/free_mon_mongod', '$BUILD_DIR/mongo/db/kill_sessions_local', '$BUILD_DIR/mongo/db/lasterror', '$BUILD_DIR/mongo/db/logical_time', '$BUILD_DIR/mongo/db/op_observer', '$BUILD_DIR/mongo/db/query_exec', '$BUILD_DIR/mongo/db/repl/oplog_buffer_proxy', '$BUILD_DIR/mongo/db/repl/replication_metrics', '$BUILD_DIR/mongo/db/s/balancer', '$BUILD_DIR/mongo/db/s/sharding_runtime_d', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/db/system_index', '$BUILD_DIR/mongo/db/vector_clock', '$BUILD_DIR/mongo/rpc/client_metadata', '$BUILD_DIR/mongo/util/fail_point', 'bgsync', 'drop_pending_collection_reaper', 'oplog_application', 'oplog_buffer_collection', 'oplog_interface_remote', 'optime', 'primary_only_service', 'repl_coordinator_interface', 'repl_settings', 'replication_consistency_markers_impl', 'replication_info', 'replication_process', 'replication_recovery', 'reporter', 'rollback_source_impl', 'tenant_migration_donor', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/mongod_fcv', '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/db/storage/flow_control', '$BUILD_DIR/mongo/db/storage/storage_control', 'local_oplog_info', 'repl_server_parameters', ], ) env.Library( target='mock_repl_coord_server_fixture', source=[ 'mock_repl_coord_server_fixture.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/catalog_raii', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/service_context_d_test_fixture', 'drop_pending_collection_reaper', 'oplog', 'oplog_entry', 'replmocks', ] ) env.CppUnitTest( target='db_repl_test', source=[ 'abstract_async_component_test.cpp', 'apply_ops_test.cpp', 'check_quorum_for_config_change_test.cpp', 'drop_pending_collection_reaper_test.cpp', 'idempotency_document_structure_test.cpp', 'idempotency_test.cpp', 'idempotency_update_sequence_test.cpp', 'initial_syncer_test.cpp', 'isself_test.cpp', 'member_config_test.cpp', 'multiapplier_test.cpp', 'oplog_applier_impl_test.cpp', 'oplog_applier_test.cpp', 'oplog_batcher_test_fixture.cpp', 'oplog_buffer_collection_test.cpp', 'oplog_buffer_proxy_test.cpp', 'oplog_entry_test.cpp', 'oplog_fetcher_mock.cpp', 'oplog_fetcher_test.cpp', 'oplog_test.cpp', 'optime_extract_test.cpp', 'primary_only_service_test.cpp', 'read_concern_args_test.cpp', 'repl_set_config_checks_test.cpp', 'repl_set_config_test.cpp', 'repl_set_heartbeat_response_test.cpp', 'repl_set_tag_test.cpp', 'repl_set_write_concern_mode_definitions_test.cpp', 'replication_consistency_markers_impl_test.cpp', 'replication_process_test.cpp', 'replication_recovery_test.cpp', 'reporter_test.cpp', 'roll_back_local_operations_test.cpp', 'rollback_checker_test.cpp', 'rollback_impl_test.cpp', 'rs_rollback_test.cpp', 'scatter_gather_test.cpp', 'speculative_majority_read_info_test.cpp', 'split_horizon_test.cpp', 'storage_interface_impl_test.cpp', 'sync_source_resolver_test.cpp', 'task_runner_test.cpp', 'task_runner_test_fixture.cpp', 'tenant_oplog_applier_test.cpp', 'tenant_oplog_batcher_test.cpp', 'vote_requester_test.cpp', 'wait_for_majority_service_test.cpp', 'tenant_migration_recipient_service_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/bson/mutable/mutable_bson', '$BUILD_DIR/mongo/client/replica_set_monitor_protocol_test_util', '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/auth/authorization_manager_global', '$BUILD_DIR/mongo/db/catalog_raii', '$BUILD_DIR/mongo/db/commands/feature_compatibility_parsers', '$BUILD_DIR/mongo/db/commands/mongod_fcv', '$BUILD_DIR/mongo/db/commands/txn_cmd_request', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/index/index_access_methods', '$BUILD_DIR/mongo/db/index_builds_coordinator_mongod', '$BUILD_DIR/mongo/db/logical_session_id_helpers', '$BUILD_DIR/mongo/db/logical_time', '$BUILD_DIR/mongo/db/op_observer', '$BUILD_DIR/mongo/db/query/command_request_response', '$BUILD_DIR/mongo/db/service_context_d', '$BUILD_DIR/mongo/db/service_context_d_test_fixture', '$BUILD_DIR/mongo/db/service_context_test_fixture', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/db/storage/ephemeral_for_test/storage_ephemeral_for_test_core', '$BUILD_DIR/mongo/db/transaction', '$BUILD_DIR/mongo/db/update/update_test_helpers', '$BUILD_DIR/mongo/dbtests/mocklib', '$BUILD_DIR/mongo/executor/network_interface_factory', '$BUILD_DIR/mongo/executor/network_interface_mock', '$BUILD_DIR/mongo/executor/network_interface_thread_pool', '$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture', '$BUILD_DIR/mongo/rpc/command_status', '$BUILD_DIR/mongo/transport/transport_layer_mock', '$BUILD_DIR/mongo/unittest/task_executor_proxy', '$BUILD_DIR/mongo/unittest/unittest', '$BUILD_DIR/mongo/util/clock_source_mock', '$BUILD_DIR/mongo/util/concurrency/thread_pool', 'abstract_async_component', 'data_replicator_external_state_mock', 'drop_pending_collection_reaper', 'idempotency_test_fixture', 'idempotency_test_util', 'initial_syncer', 'isself', 'multiapplier', 'oplog', 'oplog_application_interface', 'oplog_applier_impl_test_fixture', 'oplog_buffer_collection', 'oplog_buffer_proxy', 'oplog_entry', 'oplog_entry_test_helpers', 'oplog_fetcher', 'oplog_interface_local', 'oplog_interface_mock', 'oplog_interface_remote', 'optime', 'primary_only_service', 'repl_coordinator_impl', 'repl_server_parameters', 'replica_set_messages', 'replication_consistency_markers_impl', 'replication_process', 'replication_recovery', 'replmocks', 'reporter', 'roll_back_local_operations', 'rollback_checker', 'rollback_impl', 'rollback_test_fixture', 'rs_rollback', 'scatter_gather', 'speculative_majority_read_info', 'split_horizon', 'storage_interface_impl', 'sync_source_resolver', 'sync_source_selector_mock', 'task_executor_mock', 'task_runner', 'tenant_migration_recipient_service', 'tenant_oplog_processing', 'wait_for_majority_service', ], ) # The following two tests appear to clash when combined with the above list. env.CppUnitTest( target='db_repl_coordinator_test', source=[ 'replication_coordinator_impl_elect_v1_test.cpp', 'replication_coordinator_impl_heartbeat_v1_test.cpp', 'replication_coordinator_impl_reconfig_test.cpp', 'replication_coordinator_impl_test.cpp', 'topology_coordinator_v1_test.cpp', ], LIBDEPS=[ 'isself', 'repl_coordinator_impl', 'repl_coordinator_test_fixture', 'repl_server_parameters', 'topology_coordinator', ] ) env.CppUnitTest( target='topology_version_observer_test', source=[ 'topology_version_observer_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/util/clock_sources', 'repl_coordinator_impl', 'repl_coordinator_test_fixture', 'topology_version_observer', ] ) env.CppUnitTest( target='db_repl_cloners_test', source=[ 'all_database_cloner_test.cpp', 'cloner_test_fixture.cpp', 'collection_cloner_test.cpp', 'database_cloner_test.cpp', 'initial_sync_cloner_test_fixture.cpp', 'initial_sync_shared_data_test.cpp', 'tenant_all_database_cloner_test.cpp', 'tenant_collection_cloner_test.cpp', 'tenant_database_cloner_test.cpp', 'tenant_cloner_test_fixture.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', # Required for service context test fixture '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/service_context_d_test_fixture', '$BUILD_DIR/mongo/dbtests/mocklib', '$BUILD_DIR/mongo/util/clock_source_mock', 'initial_sync_cloners', 'repl_server_parameters', 'repl_sync_shared_data', 'replmocks', 'tenant_migration_cloners' ], ) env.CppUnitTest( target='db_repl_set_aware_service_test', source=[ 'replica_set_aware_service_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/service_context_test_fixture', 'repl_coordinator_impl', 'repl_coordinator_test_fixture', 'replica_set_aware_service', ], ) env.Library( target='replication_metrics', source=[ 'replication_metrics.cpp', env.Idlc('replication_metrics.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/commands/server_status', '$BUILD_DIR/mongo/db/service_context', 'election_reason_counter', 'election_reason_counter_parser', 'topology_coordinator', ], ) env.Library( target='election_reason_counter', source=[ 'election_reason_counter.cpp', env.Idlc('election_reason_counter.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/idl/idl_parser', ], ) env.Library( target='election_reason_counter_parser', source=[ 'election_reason_counter_parser.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'election_reason_counter', ], ) env.Library( target='topology_version_observer', source=[ 'topology_version_observer.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/service_context', 'repl_coordinator_interface', 'replica_set_messages', ], ) env.Library( target='speculative_authenticate', source=[ 'speculative_auth.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/auth/authservercommon', '$BUILD_DIR/mongo/db/commands/authentication_commands', ], ) env.Library( target='wait_for_majority_service', source=[ 'wait_for_majority_service.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/rw_concern_d', ], ) env.Library( target='primary_only_service', source=[ 'primary_only_service.cpp', 'primary_only_service_op_observer.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/executor/task_executor_interface', 'replica_set_aware_service', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/logical_time_metadata_hook', '$BUILD_DIR/mongo/executor/connection_pool_executor', '$BUILD_DIR/mongo/executor/network_interface', '$BUILD_DIR/mongo/executor/network_interface_factory', '$BUILD_DIR/mongo/executor/network_interface_thread_pool', '$BUILD_DIR/mongo/executor/network_interface_tl', '$BUILD_DIR/mongo/executor/scoped_task_executor', '$BUILD_DIR/mongo/executor/thread_pool_task_executor', '$BUILD_DIR/mongo/util/concurrency/thread_pool', 'repl_coordinator_interface', 'wait_for_majority_service', ], ) env.Library( target='tenant_oplog_processing', source=[ 'tenant_oplog_batcher.cpp', 'tenant_oplog_applier.cpp' ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception', 'abstract_async_component', 'cloner_utils', 'oplog', 'oplog_application', 'oplog_application_interface', ], )
{ "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.poi.hssf.usermodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.TimeZone; import org.apache.poi.hssf.HSSFTestDataSamples; import org.apache.poi.hssf.model.InternalWorkbook; import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.util.LocaleUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; /** * Class TestHSSFDateUtil */ public class TestHSSFDateUtil { static TimeZone userTimeZone; @BeforeClass public static void setCEST() { userTimeZone = LocaleUtil.getUserTimeZone(); LocaleUtil.setUserTimeZone(TimeZone.getTimeZone("CEST")); } @AfterClass public static void resetTimeZone() { LocaleUtil.setUserTimeZone(userTimeZone); } /** * Test that against a real, test file, we still do everything * correctly * @throws IOException */ @Test public void onARealFile() throws IOException { HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook("DateFormats.xls"); HSSFSheet sheet = workbook.getSheetAt(0); InternalWorkbook wb = workbook.getWorkbook(); assertNotNull(wb); HSSFRow row; HSSFCell cell; HSSFCellStyle style; double aug_10_2007 = 39304.0; // Should have dates in 2nd column // All of them are the 10th of August // 2 US dates, 3 UK dates row = sheet.getRow(0); cell = row.getCell(1); style = cell.getCellStyle(); assertEquals(aug_10_2007, cell.getNumericCellValue(), 0.0001); assertEquals("d-mmm-yy", style.getDataFormatString()); assertTrue(DateUtil.isInternalDateFormat(style.getDataFormat())); assertTrue(DateUtil.isADateFormat(style.getDataFormat(), style.getDataFormatString())); assertTrue(DateUtil.isCellDateFormatted(cell)); row = sheet.getRow(1); cell = row.getCell(1); style = cell.getCellStyle(); assertEquals(aug_10_2007, cell.getNumericCellValue(), 0.0001); assertFalse(DateUtil.isInternalDateFormat(cell.getCellStyle().getDataFormat())); assertTrue(DateUtil.isADateFormat(style.getDataFormat(), style.getDataFormatString())); assertTrue(DateUtil.isCellDateFormatted(cell)); row = sheet.getRow(2); cell = row.getCell(1); style = cell.getCellStyle(); assertEquals(aug_10_2007, cell.getNumericCellValue(), 0.0001); assertTrue(DateUtil.isInternalDateFormat(cell.getCellStyle().getDataFormat())); assertTrue(DateUtil.isADateFormat(style.getDataFormat(), style.getDataFormatString())); assertTrue(DateUtil.isCellDateFormatted(cell)); row = sheet.getRow(3); cell = row.getCell(1); style = cell.getCellStyle(); assertEquals(aug_10_2007, cell.getNumericCellValue(), 0.0001); assertFalse(DateUtil.isInternalDateFormat(cell.getCellStyle().getDataFormat())); assertTrue(DateUtil.isADateFormat(style.getDataFormat(), style.getDataFormatString())); assertTrue(DateUtil.isCellDateFormatted(cell)); row = sheet.getRow(4); cell = row.getCell(1); style = cell.getCellStyle(); assertEquals(aug_10_2007, cell.getNumericCellValue(), 0.0001); assertFalse(DateUtil.isInternalDateFormat(cell.getCellStyle().getDataFormat())); assertTrue(DateUtil.isADateFormat(style.getDataFormat(), style.getDataFormatString())); assertTrue(DateUtil.isCellDateFormatted(cell)); workbook.close(); } }
{ "pile_set_name": "Github" }
# Python Libraries import numpy as np import cv2 from PIL import Image import os # PyTorch Libraries import torch import torch.nn as nn import torch.nn.functional as F import torchvision.datasets as dsets import torchvision.transforms as transforms from torch.autograd import Variable import torch.backends.cudnn as cudnn def weights_init(m): classname = m.__class__.__name__ if classname.find('Conv') != -1: m.weight.data.normal_(0.0, 0.02) m.bias.data.fill_(0) elif classname.find('BatchNorm') != -1: m.weight.data.normal_(1.0, 0.02) m.bias.data.fill_(0) # print(m) # print("weights") class TextEncoding(nn.Module): def __init__(self, nt, batch_size, vocab): super(TextEncoding, self).__init__() self.nt = nt self.batch_size = batch_size self.vocab = vocab self.sparse_layer = nn.Embedding(self.vocab, self.nt) self.sparse_layer.cuda() # self.rnn_model = nn.LSTM(40, 256, self.batch_size).cuda() max_length = 1024 hidden_size = 256 n_layers = 2 # self.embedding = nn.Embedding(self.batch_size) # self.linear_layer = # self.linear_layer = nn.Linear() self.rnn = nn.LSTM(max_length, hidden_size, n_layers, batch_first=True) self.rnn.cuda() # self.rnn.cuda() # self.sparse_layer = nn.Embedding(self.batch_size * self.cap_length + 1, self.nt).cuda() # self.linear_layer = nn.Linear( (self.cap_length + 1)*self.nt, self.nt ).cuda() # self.leaky_relu = nn.LeakyReLU(0.1).cuda() def forward(self, original_text, cap_length, h0): # original_text = self.sparse_layer(original_text) # original_text = original_text.float() original_text = original_text.cuda() original_text = self.sparse_layer(original_text) # print(original_text) packed_captions = torch.nn.utils.rnn.pack_padded_sequence(original_text, cap_length, batch_first=True) # print(cap_length) # packed_captions, lengths_padded = torch.nn.utils.rnn.pad_packed_sequence(packed_captions, batch_first=True) # print('original text') # print(packed_captions) # packed_captions = packed_captions # packed_captions = packed_captions.float() output, h0 = self.rnn(packed_captions) output = output.data first_dim = len(output) noise_z = torch.rand(128, 256) noise_z = Variable(noise_z).cuda() output = torch.cat([output, noise_z], 0) return output, h0 # text encoding def text_encoding(vocab_len, original_text, nt, nz,cap_length, batch_size): # initialization of pytorch functions # Word embedding here text_embedding = nn.Embedding(batch_size * cap_length + 1, nt).cuda() # RNN layers # rnn = nn.LSTM(cap_length + 1, 256, batch_size).cuda() # FC layer linear_layer = nn.Linear((cap_length + 1) * nt, nt).cuda() leaky_relu = nn.LeakyReLU(0.1).cuda() # pass to fully connected layer original_text = Variable(original_text).cuda() original_text = text_embedding(original_text) # print(original_text) # original_text = original_text.float() # print(original_text) original_text = original_text.view(batch_size, nt, cap_length + 1) # print(original_text) # original_text = original_text.view(args.batch_size, ) # print(original_text) # out, hidden_state = rnn(original_text) # print(out) # original_text = original_text.view(batch_size, (cap_length + 1) * nt ) # print(original_text) output = linear_layer(original_text) output = leaky_relu(output) # print(output) # noise concatenation dim_a = len(output) dim_b = len(output[0][:]) dim_c = len(output[:][0][0]) noise_z = torch.rand(dim_a, nz, dim_c) noise_z = Variable(noise_z).cuda() # print(noise_z) output = torch.cat([output, noise_z], 1) # print(output) return output # def image_encoding(image, batch_size) # TODO: Text Decoder for sanity check # def text_decoding(vocab, encoded_text): # print("Decode for sanity-check") # rnn_1 = nn.LSTM() # return caption # generator model class Generator(nn.Module): def __init__(self, nz, nt, ngf, batch_size): # n_z -> no. of dim for noise # n_t -> no. of dim for text features # ngf -> no. of dim for gen filters in first conv layer super(Generator, self).__init__() self.batch_size = batch_size self.nt = nt self.nz = nz self.model = nn.Sequential( #TODO: Change conv to transpconv # print(nz+nt), # weights_init(Generator), nn.ConvTranspose2d(4608, ngf * 8, 4), # 356, 1024 nn.BatchNorm2d(ngf * 8), # 1024 # Feature learning # 1 # for big images nn.Conv2d(ngf * 8, ngf * 2, 1, 1, 0), # 1024, 256 nn.BatchNorm2d(ngf * 2), # 256 nn.ReLU(True), # # nn.ReLU(True), nn.Conv2d(ngf * 2, ngf * 2, 3, 1, 1), # 256, 256 nn.BatchNorm2d(ngf * 2), # 256 nn.ReLU(True), nn.Conv2d(ngf * 2, ngf * 8, 3, 1, 1), # 256, 1024 nn.BatchNorm2d(ngf * 8), # 1024 nn.ReLU(True), # nn.LeakyReLU(0.1, True), # # TODO: conv again for bigger image # #### start to turn into image~~~~ # # for big images # # state size : (ngf * 8) * 4 * 4 nn.ConvTranspose2d(ngf * 8, ngf * 4, 4, 2, 1), # 1024, 512 nn.BatchNorm2d(ngf * 4), # 512 # nn.LeakyReLU(0.1, True), # Feature learning # 2 # # # state size: (ngf * 4) * 8 * 8 nn.Conv2d(ngf * 4, ngf * 1, 1, 1, 0), # 512, 128 nn.BatchNorm2d(ngf * 1), # 128 nn.ReLU(True), nn.Conv2d(ngf * 1, ngf * 1, 3, 1, 1), # 128, 128 nn.BatchNorm2d(ngf * 1), # 128 nn.ReLU(True), nn.Conv2d(ngf * 1, ngf * 4, 3, 1, 1), # 128, 512 nn.BatchNorm2d(ngf * 4), # 512 nn.ReLU(True), # # # TODO: conv again for bigger image # # state size: (ngf * 4) * 8 * 8 nn.ConvTranspose2d(ngf * 4, ngf * 2, 4, 2, 1), # # nn.Conv2d(ngf * 4, ngf * 2, 1, 1), # 512, 256 nn.BatchNorm2d(ngf * 2), # 256 nn.LeakyReLU(0.1, True), # Feature learning # 3 # nn.Conv2d(ngf * 2, ngf * 1, 1, 1, 0), # 512, 128 # nn.BatchNorm2d(ngf * 1), # 128 # nn.ReLU(True), # nn.Conv2d(ngf * 1, ngf * 1, 3, 1, 1), # 128, 128 # nn.BatchNorm2d(ngf * 1), # 128 # nn.ReLU(True), # nn.Conv2d(ngf * 1, ngf * 2, 3, 1, 1), # 128, 512 # nn.BatchNorm2d(ngf * 2), # 512 # nn.ReLU(True), # # state size: (ngf * 2) * 16 * 16 nn.ConvTranspose2d(ngf * 2, ngf * 1, 4, 2, 1), # 256, 128 nn.BatchNorm2d(ngf * 1), # 128 nn.LeakyReLU(0.1, True), # # # # state size: (ngf) * 32 * 32, 2nd param is no. of channel(hardcoded) # nn.ConvTranspose2d(ngf * 1, 3, 1, 1, 1), # 128, 3 nn.ConvTranspose2d(ngf * 1, ngf * 1, 4, 2, 1), nn.BatchNorm2d(ngf), nn.LeakyReLU(0.1, True), # nn.ConvTranspose2d(ngf * 1, 3, 4, 2, 1), nn.ConvTranspose2d(ngf * 1, 3, 1), # # # # state size: (num_of_channel) * 64 * 64 (Imageeee~~~baby~~) # weights_init(Generator), # # # # activation nn.Tanh(), # weights_init(Generator) ) def forward(self, x): # a_c_dim has to match with the first conv layer x = x.view(self.batch_size, 4608, 1, 1).cuda() # print("Launch Generator!") # print(x) out = self.model(x) # print(out) out = out.view(self.batch_size, 3, 64, 64).cuda() # out = out.view(16, 3, 64, 64).cuda() return out # discriminator model class Discriminator(nn.Module): def __init__(self, nz, nt, ngf, ndf, batch_size): self.nt = nt self.batch_size = batch_size # n_z -> no. of dim for noise # n_t -> no. of dim for text features # ngf -> no. of dim for gen filters in first conv layer # ndf -> no. of dim for discriminator filters in first conv layer super(Discriminator, self).__init__() # weights_init(Discriminator) self.model = nn.Sequential( # nn.Conv2d(3, ndf * 1, 4, 2, 1), nn.Conv2d(3, ndf * 1, 1), nn.LeakyReLU(0.2, True), nn.Conv2d(ndf * 1, ndf * 2, 4, 2, 1), nn.BatchNorm2d(ndf * 2), nn.LeakyReLU(0.2, True), nn.Conv2d(ndf * 2, ndf * 4, 4, 2, 1), nn.BatchNorm2d(ndf * 4), # nn.LeakyReLU(0.1, True), nn.Conv2d(ndf * 4, ndf * 8, 4, 2, 1), nn.BatchNorm2d(ndf * 8), # nn.Conv2d(ndf * 4, ndf * 8, 4, 2, 1), # nn.BatchNorm2d(ndf * 8), # bigger image possibly nn.Conv2d(ndf * 8, ndf * 2, 1, 1, 0), nn.BatchNorm2d(ndf * 2), nn.LeakyReLU(0.2, True), nn.Conv2d(ndf * 2, ndf * 2, 3, 1, 1), nn.BatchNorm2d(ndf * 2), nn.LeakyReLU(0.2, True), nn.Conv2d(ndf * 2, ndf * 8, 6), # nn.Conv2d(ndf * 2, ndf * 8, 2), # nn.Conv2d(ndf * 2, ndf * 8, 3, 3, 1), nn.BatchNorm2d(ndf * 8), nn.LeakyReLU(0.2, True), ) self.model2 = nn.Sequential( nn.Conv2d(ndf * 8 + nt, ndf * 8, 1), nn.BatchNorm2d(ndf * 8), nn.LeakyReLU(0.2, True), # nn.Conv2d(ndf * 8, ndf * 4, 1), # nn.BatchNorm2d(ndf * 4), # nn.LeakyReLU(0.2, True), nn.Conv2d(ndf * 8, 1, 3), # nn.BatchNorm2d(1), # nn.LeakyReLU(0.2, True), # nn.Conv2d(ndf * 1, 1, 4), nn.Sigmoid() ) def forward(self, x, text, cap_length): # a_c_dim has to match with the first conv layer x = x.view(self.batch_size, 3, 64, 64) ###### model 1 ####### # text that describes generated image out = self.model(x) # print(out) # out = out.view(4, 8192, 1, 1) # print(out) # text input layers linear_layer2 = nn.Linear(cap_length + 1, self.nt) linear_layer2.cuda() # batch_norm2 = nn.BatchNorm2d(self.nt) leaky2 = nn.LeakyReLU(0.2, True) ####### text input ########## # print(text) # print(cap_length) # text_v = Variable(text) text_v = text text_v = text_v.float().cuda() text_input = linear_layer2(text_v) # text_input = batch_norm2() text_input = leaky2(text_input) # print(text_input) # print("text input") # print(len(text_input[0])) reshape_len = len(text_input[1]) # hardcoded # print(reshape_len) text_input = text_input.view(self.batch_size, 1024, 1, 1).cuda() # hardcoded batchsize padded_text = nn.functional.pad(text_input, (1, 1, 1, 1), 'replicate').cuda() ####### concat text and output from model1 ######### # print(out) # print(padded_text) _cat = torch.cat((padded_text, out), 1) # print(_cat) ####### TODO: pass whole concatenated structure to model2 ######## out = self.model2(_cat) return out
{ "pile_set_name": "Github" }
package wifi import ( "fmt" "runtime" ) var ( // errUnimplemented is returned by all functions on platforms that // do not have package wifi implemented. errUnimplemented = fmt.Errorf("package wifi not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) ) // A Client is a type which can access WiFi device actions and statistics // using operating system-specific operations. type Client struct { c osClient } // New creates a new Client. func New() (*Client, error) { c, err := newClient() if err != nil { return nil, err } return &Client{ c: c, }, nil } // Close releases resources used by a Client. func (c *Client) Close() error { return c.c.Close() } // Interfaces returns a list of the system's WiFi network interfaces. func (c *Client) Interfaces() ([]*Interface, error) { return c.c.Interfaces() } // BSS retrieves the BSS associated with a WiFi interface. func (c *Client) BSS(ifi *Interface) (*BSS, error) { return c.c.BSS(ifi) } // StationInfo retrieves all station statistics about a WiFi interface. func (c *Client) StationInfo(ifi *Interface) ([]*StationInfo, error) { return c.c.StationInfo(ifi) } // An osClient is the operating system-specific implementation of Client. type osClient interface { Close() error Interfaces() ([]*Interface, error) BSS(ifi *Interface) (*BSS, error) StationInfo(ifi *Interface) ([]*StationInfo, error) }
{ "pile_set_name": "Github" }
<h1 class="title" data-bind="title"></h1> <h3 data-bind="text"></h3> <p class="more-info" data-bind="moreinfo"></p> <p class="updated-at" data-bind="updatedAtMessage"></p>
{ "pile_set_name": "Github" }
module Landrush module Cap module Debian module InstallIptables def self.install_iptables(machine) machine.communicate.tap do |c| c.sudo('apt-get update') c.sudo('apt-get install -y iptables') end end end end end end
{ "pile_set_name": "Github" }
semmle-extractor-options: --max-import-depth=3
{ "pile_set_name": "Github" }
// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. package common import ( "testing" checker "gopkg.in/check.v1" ) func Test(t *testing.T) { checker.TestingT(t) }
{ "pile_set_name": "Github" }
/* vi: ts=8 sw=8 * * TI 3410/5052 USB Serial Driver Header * * Copyright (C) 2004 Texas Instruments * * This driver is based on the Linux io_ti driver, which is * Copyright (C) 2000-2002 Inside Out Networks * Copyright (C) 2001-2002 Greg Kroah-Hartman * * 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. * * For questions or problems with this driver, contact Texas Instruments * technical support, or Al Borchers <[email protected]>, or * Peter Berger <[email protected]>. */ #ifndef _TI_3410_5052_H_ #define _TI_3410_5052_H_ /* Configuration ids */ #define TI_BOOT_CONFIG 1 #define TI_ACTIVE_CONFIG 2 /* Vendor and product ids */ #define TI_VENDOR_ID 0x0451 #define IBM_VENDOR_ID 0x04b3 #define TI_3410_PRODUCT_ID 0x3410 #define IBM_4543_PRODUCT_ID 0x4543 #define IBM_454B_PRODUCT_ID 0x454b #define IBM_454C_PRODUCT_ID 0x454c #define TI_3410_EZ430_ID 0xF430 /* TI ez430 development tool */ #define TI_5052_BOOT_PRODUCT_ID 0x5052 /* no EEPROM, no firmware */ #define TI_5152_BOOT_PRODUCT_ID 0x5152 /* no EEPROM, no firmware */ #define TI_5052_EEPROM_PRODUCT_ID 0x505A /* EEPROM, no firmware */ #define TI_5052_FIRMWARE_PRODUCT_ID 0x505F /* firmware is running */ #define FRI2_PRODUCT_ID 0x5053 /* Fish River Island II */ /* Multi-Tech vendor and product ids */ #define MTS_VENDOR_ID 0x06E0 #define MTS_GSM_NO_FW_PRODUCT_ID 0xF108 #define MTS_CDMA_NO_FW_PRODUCT_ID 0xF109 #define MTS_CDMA_PRODUCT_ID 0xF110 #define MTS_GSM_PRODUCT_ID 0xF111 #define MTS_EDGE_PRODUCT_ID 0xF112 #define MTS_MT9234MU_PRODUCT_ID 0xF114 #define MTS_MT9234ZBA_PRODUCT_ID 0xF115 #define MTS_MT9234ZBAOLD_PRODUCT_ID 0x0319 /* Abbott Diabetics vendor and product ids */ #define ABBOTT_VENDOR_ID 0x1a61 #define ABBOTT_STEREO_PLUG_ID 0x3410 #define ABBOTT_PRODUCT_ID ABBOTT_STEREO_PLUG_ID #define ABBOTT_STRIP_PORT_ID 0x3420 /* Honeywell vendor and product IDs */ #define HONEYWELL_VENDOR_ID 0x10ac #define HONEYWELL_HGI80_PRODUCT_ID 0x0102 /* Honeywell HGI80 */ /* Commands */ #define TI_GET_VERSION 0x01 #define TI_GET_PORT_STATUS 0x02 #define TI_GET_PORT_DEV_INFO 0x03 #define TI_GET_CONFIG 0x04 #define TI_SET_CONFIG 0x05 #define TI_OPEN_PORT 0x06 #define TI_CLOSE_PORT 0x07 #define TI_START_PORT 0x08 #define TI_STOP_PORT 0x09 #define TI_TEST_PORT 0x0A #define TI_PURGE_PORT 0x0B #define TI_RESET_EXT_DEVICE 0x0C #define TI_WRITE_DATA 0x80 #define TI_READ_DATA 0x81 #define TI_REQ_TYPE_CLASS 0x82 /* Module identifiers */ #define TI_I2C_PORT 0x01 #define TI_IEEE1284_PORT 0x02 #define TI_UART1_PORT 0x03 #define TI_UART2_PORT 0x04 #define TI_RAM_PORT 0x05 /* Modem status */ #define TI_MSR_DELTA_CTS 0x01 #define TI_MSR_DELTA_DSR 0x02 #define TI_MSR_DELTA_RI 0x04 #define TI_MSR_DELTA_CD 0x08 #define TI_MSR_CTS 0x10 #define TI_MSR_DSR 0x20 #define TI_MSR_RI 0x40 #define TI_MSR_CD 0x80 #define TI_MSR_DELTA_MASK 0x0F #define TI_MSR_MASK 0xF0 /* Line status */ #define TI_LSR_OVERRUN_ERROR 0x01 #define TI_LSR_PARITY_ERROR 0x02 #define TI_LSR_FRAMING_ERROR 0x04 #define TI_LSR_BREAK 0x08 #define TI_LSR_ERROR 0x0F #define TI_LSR_RX_FULL 0x10 #define TI_LSR_TX_EMPTY 0x20 /* Line control */ #define TI_LCR_BREAK 0x40 /* Modem control */ #define TI_MCR_LOOP 0x04 #define TI_MCR_DTR 0x10 #define TI_MCR_RTS 0x20 /* Mask settings */ #define TI_UART_ENABLE_RTS_IN 0x0001 #define TI_UART_DISABLE_RTS 0x0002 #define TI_UART_ENABLE_PARITY_CHECKING 0x0008 #define TI_UART_ENABLE_DSR_OUT 0x0010 #define TI_UART_ENABLE_CTS_OUT 0x0020 #define TI_UART_ENABLE_X_OUT 0x0040 #define TI_UART_ENABLE_XA_OUT 0x0080 #define TI_UART_ENABLE_X_IN 0x0100 #define TI_UART_ENABLE_DTR_IN 0x0800 #define TI_UART_DISABLE_DTR 0x1000 #define TI_UART_ENABLE_MS_INTS 0x2000 #define TI_UART_ENABLE_AUTO_START_DMA 0x4000 /* Parity */ #define TI_UART_NO_PARITY 0x00 #define TI_UART_ODD_PARITY 0x01 #define TI_UART_EVEN_PARITY 0x02 #define TI_UART_MARK_PARITY 0x03 #define TI_UART_SPACE_PARITY 0x04 /* Stop bits */ #define TI_UART_1_STOP_BITS 0x00 #define TI_UART_1_5_STOP_BITS 0x01 #define TI_UART_2_STOP_BITS 0x02 /* Bits per character */ #define TI_UART_5_DATA_BITS 0x00 #define TI_UART_6_DATA_BITS 0x01 #define TI_UART_7_DATA_BITS 0x02 #define TI_UART_8_DATA_BITS 0x03 /* 232/485 modes */ #define TI_UART_232 0x00 #define TI_UART_485_RECEIVER_DISABLED 0x01 #define TI_UART_485_RECEIVER_ENABLED 0x02 /* Pipe transfer mode and timeout */ #define TI_PIPE_MODE_CONTINOUS 0x01 #define TI_PIPE_MODE_MASK 0x03 #define TI_PIPE_TIMEOUT_MASK 0x7C #define TI_PIPE_TIMEOUT_ENABLE 0x80 /* Config struct */ struct ti_uart_config { __u16 wBaudRate; __u16 wFlags; __u8 bDataBits; __u8 bParity; __u8 bStopBits; char cXon; char cXoff; __u8 bUartMode; } __attribute__((packed)); /* Get port status */ struct ti_port_status { __u8 bCmdCode; __u8 bModuleId; __u8 bErrorCode; __u8 bMSR; __u8 bLSR; } __attribute__((packed)); /* Purge modes */ #define TI_PURGE_OUTPUT 0x00 #define TI_PURGE_INPUT 0x80 /* Read/Write data */ #define TI_RW_DATA_ADDR_SFR 0x10 #define TI_RW_DATA_ADDR_IDATA 0x20 #define TI_RW_DATA_ADDR_XDATA 0x30 #define TI_RW_DATA_ADDR_CODE 0x40 #define TI_RW_DATA_ADDR_GPIO 0x50 #define TI_RW_DATA_ADDR_I2C 0x60 #define TI_RW_DATA_ADDR_FLASH 0x70 #define TI_RW_DATA_ADDR_DSP 0x80 #define TI_RW_DATA_UNSPECIFIED 0x00 #define TI_RW_DATA_BYTE 0x01 #define TI_RW_DATA_WORD 0x02 #define TI_RW_DATA_DOUBLE_WORD 0x04 struct ti_write_data_bytes { __u8 bAddrType; __u8 bDataType; __u8 bDataCounter; __be16 wBaseAddrHi; __be16 wBaseAddrLo; __u8 bData[0]; } __attribute__((packed)); struct ti_read_data_request { __u8 bAddrType; __u8 bDataType; __u8 bDataCounter; __be16 wBaseAddrHi; __be16 wBaseAddrLo; } __attribute__((packed)); struct ti_read_data_bytes { __u8 bCmdCode; __u8 bModuleId; __u8 bErrorCode; __u8 bData[0]; } __attribute__((packed)); /* Interrupt struct */ struct ti_interrupt { __u8 bICode; __u8 bIInfo; } __attribute__((packed)); /* Interrupt codes */ #define TI_GET_PORT_FROM_CODE(c) (((c) >> 6) & 0x01) #define TI_GET_FUNC_FROM_CODE(c) ((c) & 0x0f) #define TI_CODE_HARDWARE_ERROR 0xFF #define TI_CODE_DATA_ERROR 0x03 #define TI_CODE_MODEM_STATUS 0x04 /* Download firmware max packet size */ #define TI_DOWNLOAD_MAX_PACKET_SIZE 64 /* Firmware image header */ struct ti_firmware_header { __le16 wLength; __u8 bCheckSum; } __attribute__((packed)); /* UART addresses */ #define TI_UART1_BASE_ADDR 0xFFA0 /* UART 1 base address */ #define TI_UART2_BASE_ADDR 0xFFB0 /* UART 2 base address */ #define TI_UART_OFFSET_LCR 0x0002 /* UART MCR register offset */ #define TI_UART_OFFSET_MCR 0x0004 /* UART MCR register offset */ #endif /* _TI_3410_5052_H_ */
{ "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_Vision_GoogleCloudVisionV1p1beta1Block extends Google_Collection { protected $collection_key = 'paragraphs'; public $blockType; protected $boundingBoxType = 'Google_Service_Vision_GoogleCloudVisionV1p1beta1BoundingPoly'; protected $boundingBoxDataType = ''; public $confidence; protected $paragraphsType = 'Google_Service_Vision_GoogleCloudVisionV1p1beta1Paragraph'; protected $paragraphsDataType = 'array'; protected $propertyType = 'Google_Service_Vision_GoogleCloudVisionV1p1beta1TextAnnotationTextProperty'; protected $propertyDataType = ''; public function setBlockType($blockType) { $this->blockType = $blockType; } public function getBlockType() { return $this->blockType; } /** * @param Google_Service_Vision_GoogleCloudVisionV1p1beta1BoundingPoly */ public function setBoundingBox(Google_Service_Vision_GoogleCloudVisionV1p1beta1BoundingPoly $boundingBox) { $this->boundingBox = $boundingBox; } /** * @return Google_Service_Vision_GoogleCloudVisionV1p1beta1BoundingPoly */ public function getBoundingBox() { return $this->boundingBox; } public function setConfidence($confidence) { $this->confidence = $confidence; } public function getConfidence() { return $this->confidence; } /** * @param Google_Service_Vision_GoogleCloudVisionV1p1beta1Paragraph */ public function setParagraphs($paragraphs) { $this->paragraphs = $paragraphs; } /** * @return Google_Service_Vision_GoogleCloudVisionV1p1beta1Paragraph */ public function getParagraphs() { return $this->paragraphs; } /** * @param Google_Service_Vision_GoogleCloudVisionV1p1beta1TextAnnotationTextProperty */ public function setProperty(Google_Service_Vision_GoogleCloudVisionV1p1beta1TextAnnotationTextProperty $property) { $this->property = $property; } /** * @return Google_Service_Vision_GoogleCloudVisionV1p1beta1TextAnnotationTextProperty */ public function getProperty() { return $this->property; } }
{ "pile_set_name": "Github" }
// Copyright 2014 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 "components/storage_monitor/mock_removable_storage_observer.h" namespace storage_monitor { MockRemovableStorageObserver::MockRemovableStorageObserver() : attach_calls_(0), detach_calls_(0) { } MockRemovableStorageObserver::~MockRemovableStorageObserver() { } void MockRemovableStorageObserver::OnRemovableStorageAttached( const StorageInfo& info) { attach_calls_++; last_attached_ = info; } void MockRemovableStorageObserver::OnRemovableStorageDetached( const StorageInfo& info) { detach_calls_++; last_detached_ = info; } } // namespace storage_monitor
{ "pile_set_name": "Github" }
#ifndef POCOLIB_H #define POCOLIB_H #ifndef LINKLIST_H #include "linklist.h" #endif #ifndef STDTYPES_H #include "stdtypes.h" #endif #ifdef PUBLIC_CODE #include "rexlib.h" #endif #include "stdarg.h" /****************************************************************************** * Basic poco data structures everyone needs to know about... *****************************************************************************/ typedef struct popot /* The poco bounds-checked pointer type */ { void *pt; void *min; void *max; } Popot; typedef struct string_ref { Dlnode node; int ref_count; Popot string; } String_ref; typedef String_ref *PoString; /* Macro to extract the char * from a poString */ #define PoStringBuf(s) ((*(s))->string.pt) typedef union pt_num /* Overlap popular datatypes in the same space */ { int i; int inty; short s; UBYTE *bpt; char c; long l; ULONG ul; float f; double d; void *p; int doff; /* data offset */ int (*func)(); /* code pointer */ Popot ppt; PoString postring; } Pt_num; typedef struct lib_proto /* Poco library prototype lines */ { void *func; char *proto; } Lib_proto; typedef struct poco_lib /* Poco library main control structure */ { struct poco_lib *next; char *name; Lib_proto *lib; int count; Errcode (*init)(struct poco_lib *lib); void (*cleanup)(struct poco_lib *lib); void *local_data; Dlheader resources; void *rexhead; char reserved[12]; } Poco_lib; #define RNODE_FIELDS \ Dlnode node; \ void *resource; typedef struct rnode /* Used for resource tracking in builtin libs */ { RNODE_FIELDS } Rnode; /***************************************************************************** * handy macros for library and poe routines... * * Popot_bufsize - Evaluates to the number of bytes available between the * current pointer location and the end of the buffer. * Popot_bufcheck - Evaluates to Err_null_ref if the pointer is NULL, to * Err_buf_too_small if there aren't at least 'length' * bytes available in the buffer, or Success if all is well. * Sets builtin_err. * Popot_make_null - Set a Popot to NULL. ****************************************************************************/ #define Popot_bufsize(p) ((char *)((p)->max)-(char *)((p)->pt)+1) #define Popot_bufcheck(p,length) (builtin_err = (((p)->pt == NULL) ?\ Err_null_ref :\ ((Popot_bufsize((p)) < (length)) ? \ Err_buf_too_small :\ Success))) #define Popot_make_null(p) ((p)->pt = (p)->min = (p)->max = NULL) #ifndef PUBLIC_CODE /****************************************************************************** * Private prototypes for PJ's use... *****************************************************************************/ extern Errcode po_init_libs(Poco_lib *lib); extern void po_cleanup_libs(Poco_lib *lib); extern Errcode poco_cont_ops(void *code_pt, Pt_num *pret, int argslen, ...); extern Errcode po_check_formatf(int maxlen, int vargcount, int vargsize, char *fmt, va_list pargs); extern void po_free(Popot ppt); extern Popot po_malloc(int size); extern Popot poco_lmalloc(long size); extern Popot po_calloc(int size_el, int el_count); extern void poco_freez(Popot *pt); extern char *po_fuf_name(void *fuf); extern void *po_fuf_code(void *fuf); extern Rnode *po_in_rlist(Dlheader *sfi, void *f); extern Errcode pj_load_pocorex(Poco_lib **lib, char *name,char *id_str); extern void pj_free_pocorexes(Poco_lib **libs); extern int po_findpoe(char *libname, Lib_proto **plibreturn); extern Errcode po_poe_overtime(void *effect, void *data); extern Errcode po_poe_oversegment(void *effect, void *data); extern Errcode po_poe_overall(void *effect, void *data); extern Popot po_ptr2ppt(void *ptr, int bytes); extern void *po_ppt2ptr(Popot ppt); extern Poco_lib po_load_save_lib; extern Poco_lib po_turtle_lib; extern Poco_lib po_draw_lib; extern Poco_lib po_blit_lib; extern Poco_lib po_alt_lib; extern Poco_lib po_cel_lib; extern Poco_lib po_user_lib; extern Poco_lib po_str_lib; extern Poco_lib po_mem_lib; extern Poco_lib po_FILE_lib; extern Poco_lib po_misc_lib; extern Poco_lib po_mode_lib; extern Poco_lib po_text_lib; extern Poco_lib po_time_lib; extern Poco_lib po_dos_lib; extern Poco_lib po_math_lib; extern Poco_lib po_optics_lib; extern Poco_lib po_globalv_lib; extern Poco_lib po_title_lib; extern Poco_lib po_tween_lib; extern Poco_lib po_flicplay_lib; extern Errcode builtin_err; /* ndef PUBLIC_CODE */ #endif #ifndef POCO_H /* the poco subsytem doesn't want to see all the following... */ /***************************************************************************** * Stuctures for the Poco builtin library and poe runtime library interfaces. * * The host treats these structures as arrays of Lib_proto structures. * From the host side, these arrays are used internally to provide poco with * prototypes and pointers for each of the builtin library routine. * * The poe interface is interested in the function pointers, but is blind * to the prototype strings, which is why the strings are casually named. * On the library side, these structures provide the jump tables used to * access the poco builtin library functions from within a poe module. ****************************************************************************/ /*---------------------------------------------------------------------------- * Optics libarary *--------------------------------------------------------------------------*/ typedef struct polib_optics { void (*plOptClearState)(void); char *protostr1; void (*plOptSetState)(Popot optState); char *protostr2; void (*plOptGetState)(Popot optState); char *protostr3; void (*plOptFreeState)(Popot optState); char *protostr4; void (*plOptClearPos)(void); char *protostr5; void (*plOptSetPos)(Popot optPos); char *protostr6; void (*plOptGetPos)(Popot optPos); char *protostr7; void (*plOptClearPath)(void); char *protostr8; void (*plOptSetPath)(int ptcount, Popot x, Popot y); char *protostr9; int (*plOptGetPath)(Popot x, Popot y); char *protostr10; void (*plOptFreePath)(Popot x, Popot y); char *protostr11; void (*plOptDefaultCenters)(void); char *protostr12; void (*plOptContinue)(void); char *protostr13; int (*plOptGetElement)(void); char *protostr14; Errcode (*plOptSetElement)(int el); char *protostr15; Errcode (*plOptToFrame)(double time); char *protostr16; Errcode (*plOptToSegment)(int start, int stop); char *protostr17; Errcode (*plOptToAll)(void); char *protostr18; } PolibOptics; /*---------------------------------------------------------------------------- * SwapScreen library *--------------------------------------------------------------------------*/ typedef struct polib_swap { Boolean (*plSwapExists)(void); char *protostr1; void (*plSwapClip)(void); char *protostr2; void (*plSwapRelease)(void); char *protostr3; Errcode (*plSwapTrade)(void); char *protostr4; } PolibSwap; /*---------------------------------------------------------------------------- * Screen library *--------------------------------------------------------------------------*/ typedef struct polib_screen { Popot (*plGetPicScreen)(void); char *protostr1; Popot (*plGetSwapScreen)(void); char *protostr2; Popot (*plGetUndoScreen)(void); char *protostr3; Popot (*plGetCelScreen)(void); char *protostr3a; Errcode (*plAllocScreen)(Popot screen, int width, int height); char *protostr4; void (*plFreeScreen)(Popot screen); char *protostr5; void (*plGetScreenSize)(Popot s, Popot x, Popot y); char *protostr6; void (*plSetPixel)(Popot s, int color, int x, int y); char *protostr7; int (*plGetPixel)(Popot s, int x, int y); char *protostr8; void (*plSetBlock)(Popot s, Popot pixbuf, int x, int y, int width, int height); char *protostr9; void (*plGetBlock)(Popot s, Popot pixbuf, int x, int y, int width, int height); char *protostr10; void (*plIconBlit)(Popot source, int snext, int sx, int sy, int width, int height, Popot dest, int dx, int dy, int color); char *protostr11; void (*plBlit)(Popot source, int sx, int sy, int width, int height, Popot dest, int dx, int dy); char *protostr12; void (*plKeyBlit)(Popot source, int sx, int sy, int width, int height, Popot dest, int dx, int dy, int key_color); char *protostr13; void (*plCopyScreen)(Popot source, Popot dest); char *protostr14; void (*plTradeScreen)(Popot a, Popot b); char *protostr15; void (*plPicDirtied)(void); char *protostr16; /* New with Ani Pro 1.5 */ Popot (*plGetPhysicalScreen)(void); char *protostr17; void (*plSetBox)(Popot screen, int color, int x, int y, int width, int height); char *protostr18; void (*plMenuText)(Popot screen, int color, int x, int y, Popot text); char *protostr19; int (*plMenuTextWidth)(Popot text); char *protostr20; int (*plMenuTextHeight)(void); char *protostr21; void (*plGetMenuColors)(Popot black, Popot grey, Popot light, Popot bright, Popot red); char *protostr22; } PolibScreen; /*---------------------------------------------------------------------------- * Cel library *--------------------------------------------------------------------------*/ typedef struct polib_cel { Boolean (*plCelExists)(void); char *protostr1; void (*plCelPaste)(void); char *protostr2; void (*plCelMove)(int dx, int dy); char *protostr3; void (*plCelMoveTo)(int x, int y); char *protostr4; void (*plCelTurn)(double angle); char *protostr5; void (*plCelTurnTo)(double angle); char *protostr6; Errcode (*plCelNextFrame)(void); char *protostr7; Errcode (*plCelBackFrame)(void); char *protostr8; Errcode (*plCelSetFrame)(int frame); char *protostr9; int (*plCelGetFrame)(void); char *protostr10; int (*plCelFrameCount)(void); char *protostr11; Errcode (*plCelWhere)(Popot x, Popot y, Popot angle); char *protostr12; Errcode (*plCelGet)(int x, int y, int width, int height); char *protostr13; Errcode (*plCelClip)(void); char *protostr14; Errcode (*plCelRelease)(void); char *protostr15; Errcode (*plCelClipChanges)(void); char *protostr16; } PolibCel; /*---------------------------------------------------------------------------- * DOS library *--------------------------------------------------------------------------*/ typedef struct polib_dos { Errcode (*plfnsplit)(Popot path, Popot device, Popot dir, Popot file, Popot suf); char *protostr1; Errcode (*plfnmerge)(Popot path, Popot device, Popot dir, Popot file, Popot suf); char *protostr2; Boolean (*plDosExists)(Popot filename); char *protostr3; Errcode (*plDosCopy)(Popot source, Popot dest); char *protostr4; Errcode (*plDosDelete)(Popot filename); char *protostr5; Errcode (*plDosRename)(Popot old, Popot new); char *protostr6; Errcode (*plSetDir)(Popot dir); char *protostr7; Errcode (*plGetDir)(Popot dir); char *protostr8; int (*plDirList)(Popot list, Popot wild, Boolean get_dirs); char *protostr9; void (*plFreeDirList)(Popot list); char *protostr10; void (*plGetResourceDir)(Popot dir); char *protostr11; void (*plGetProgramDir)(Popot dir); char *protostr12; } PolibDos; /*---------------------------------------------------------------------------- * Drawing library *--------------------------------------------------------------------------*/ typedef struct polib_draw { void (*plGetSize)(Popot width, Popot height); char *protostr1; void (*plGetAspectRatio)(Popot x, Popot y); char *protostr2; int (*plGetColor)(void); char *protostr3; void (*plSetColor)(int color); char *protostr4; void (*plClear)(void); char *protostr5; void (*plDot)(int x, int y); char *protostr6; int (*plGetDot)(int x, int y); char *protostr7; void (*plLine)(int x1, int y1, int x2, int y2); char *protostr8; void (*plBox)(int x, int y, int w, int h); char *protostr9; void (*plCircle)(int cx, int cy, int radius); char *protostr10; Errcode (*plPoly)(int ptcount, Popot x, Popot y); char *protostr11; Errcode (*plSpline)(int ptcount, Popot x, Popot y); char *protostr12; Errcode (*plOval)(double angle, int xcen, int ycen, int xrad, int yrad); char *protostr13; Errcode (*plStar)(double angle, int xcen, int ycen, int rad); char *protostr14; Errcode (*plPetal)(double angle, int xcen, int ycen, int rad); char *protostr15; Errcode (*plRpoly)(double angle, int xcen, int ycen, int rad); char *protostr16; Errcode (*plSpiral)(double angle, int xcen, int ycen, int rad, double turns); char *protostr17; Errcode (*plFill)(int x, int y); char *protostr18; Errcode (*plFillTo)(int x, int y, int to_color); char *protostr19; Errcode (*plEdge)(int color); char *protostr20; void (*plSetColorMap)(int index, int r, int g, int b); char *protostr21; void (*plGetColorMap)(int index, Popot r, Popot g, Popot b); char *protostr22; void (*plGetScreenColorMap)(Popot screen, Popot maparray); char *protostr23; void (*plSetScreenColorMap)(Popot screen, Popot maparray); char *protostr24; /* New with AniPro 1.5 */ void (*plGetPhysicalSize)(Popot width, Popot height); char *protostr25; int (*plGetBoxBevel)(void); char *protostr26; void (*plSetBoxBevel)(int new_bevel); char *protostr27; void (*plSetCluster)(int cluster_size, Popot cluster); char *protostr28; Errcode (*plGetCluster)(Popot cluster_size, Popot cluster); char *protostr29; void (*plHLStoRGB)(int h, int l, int s, Popot r, Popot g, Popot b); char *protostr30; void (*plRGBtoHLS)(int r, int g, int b, Popot h, Popot l, Popot s); char *protostr31; int (*plClosestColorInScreen)(Popot screen, int r, int g, int b); char *protostr32; Errcode (*plSqueezeColors)(Popot source_map, int source_count, int *dest_map, int dest_count); char *protostr33; ErrCode (*plFitScreenToColorMap)(Popot s, Popot new_colors, Boolean keep_key); char *protostr34; } PolibDraw; /*---------------------------------------------------------------------------- * AA file library *--------------------------------------------------------------------------*/ typedef struct polib_aafile { Errcode (*plLoadFlic)(Popot name); char *protostr1; Errcode (*plSaveFlic)(Popot name); char *protostr2; Errcode (*plLoadPic)(Popot name); char *protostr3; Errcode (*plSavePic)(Popot name); char *protostr4; Errcode (*plLoadCel)(Popot name); char *protostr5; Errcode (*plSaveCel)(Popot name); char *protostr6; Errcode (*plLoadPath)(Popot name); char *protostr7; Errcode (*plSavePath)(Popot name); char *protostr8; Errcode (*plLoadPoly)(Popot name); char *protostr9; Errcode (*plSavePoly)(Popot name); char *protostr10; Errcode (*plLoadColors)(Popot name); char *protostr11; Errcode (*plSaveColors)(Popot name); char *protostr12; Errcode (*plLoadTitles)(Popot name); char *protostr13; Errcode (*plSaveTitles)(Popot name); char *protostr14; Errcode (*plLoadMask)(Popot name); char *protostr15; Errcode (*plSaveMask)(Popot name); char *protostr16; Errcode (*plSaveScreenPic)(Popot screen, Popot name); char *protostr17; Errcode (*plLoadScreenPic)(Popot screen, Popot name); char *protostr18; } PolibAAFile; /*---------------------------------------------------------------------------- * Misc library *--------------------------------------------------------------------------*/ typedef struct polib_misc { void (*plexit)(Errcode err); char *protostr1; void (*plNewFlic)(void); char *protostr2; Errcode (*plReset)(void); char *protostr3; Errcode (*plResizeReset)(int width, int height); char *protostr4; int (*plGetChangeCount)(void); char *protostr4a; int (*plPocoVersion)(void); char *protostr5; void (*plRedo)(void); char *protostr6; void (*plRestore)(void); char *protostr7; int (*plrnd)(int max); char *protostr8; int (*plrand)(void); char *protostr9; void (*plsrand)(int seed); char *protostr10; long (*plclock)(void); char *protostr11; Boolean (*plIsBatchRun)(void); char *protostr12; Boolean (*plPocoChainTo)(Popot program_path); char *protostr13; Errcode (*plsystem)(Popot command_line); /* new with v1.5 */ char *protostr14; } PolibMisc; /*---------------------------------------------------------------------------- * Mode library *--------------------------------------------------------------------------*/ typedef struct polib_mode { Errcode (*plSetInk)(Popot name); char *protostr1; void (*plGetInk)(Popot buf); char *protostr2; void (*plSetInkStrength)(int percent); char *protostr3; int (*plGetInkStrength)(void); char *protostr4; void (*plSetInkDither)(Boolean dither); char *protostr5; Boolean (*plGetInkDither)(void); char *protostr6; void (*plSetFilled)(Boolean fill); char *protostr7; Boolean (*plGetFilled)(void); char *protostr8; void (*plSetBrushSize)(int size); char *protostr9; int (*plGetBrushSize)(void); char *protostr10; void (*plSetKeyMode)(Boolean clear); char *protostr11; Boolean (*plGetKeyMode)(void); char *protostr12; void (*plSetKeyColor)(int color); char *protostr13; int (*plGetKeyColor)(void); char *protostr14; void (*plSetMaskUse)(Boolean use_it); char *protostr15; Boolean (*plGetMaskUse)(void); char *protostr16; void (*plSetMaskCreate)(Boolean make_it); char *protostr17; Boolean (*plGetMaskCreate)(void); char *protostr18; void (*plSetStarPoints)(int points); char *protostr19; int (*plGetStarPoints)(void); char *protostr20; void (*plSetStarRatio)(int ratio); char *protostr21; int (*plGetStarRatio)(void); char *protostr22; void (*plSetSplineTCB)(int t, int c, int b); char *protostr23; void (*plGetSplineTCB)(Popot t, Popot c, Popot b); char *protostr24; void (*plSetTwoColorOn)(Boolean setit); char *protostr25; Boolean (*plGetTwoColorOn)(void); char *protostr26; void (*plSetTwoColor)(int color); char *protostr27; int (*plGetTwoColor)(void); char *protostr28; void (*plSetClosed)(Boolean closed); char *protostr29; Boolean (*plGetClosed)(void); char *protostr30; void (*plSetCycleDraw)(Boolean cycle); char *protostr31; Boolean (*plGetCycleDraw)(void); char *protostr32; Boolean (*plGetMultiFrame)(void); char *protostr33; void (*plSetMultiFrame)(Boolean multi); char *protostr34; } PolibMode; /*---------------------------------------------------------------------------- * Text library *--------------------------------------------------------------------------*/ typedef struct polib_text { void (*plText)(int x, int y, Popot string); char *protostr1; void (*plWordWrap)(int x, int y, int width, int height, Popot text); char *protostr2; void (*plSetJustify)(int just); char *protostr3; int (*plGetJustify)(void); char *protostr4; int (*plStringWidth)(Popot string); char *protostr5; int (*plFontHeight)(void); char *protostr6; int (*plTallestChar)(void); char *protostr7; void (*plGetFontName)(Popot name); char *protostr8; Errcode (*plLoadFont)(Popot name); char *protostr9; void (*plGetFontDir)(Popot dir); char *protostr10; void (*plQfont)(void); char *protostr11; /* From here on down new with Ani 1.5 */ Boolean (*plCanScaleFont)(void); char *protostr12; Errcode (*plScaleFont)(int height); char *protostr13; void (*plSetFontSpacing)(int spacing); char *protostr14; int (*plGetFontSpacing)(void); char *protostr15; void (*plSetFontLeading)(int leadint); char *protostr16; int (*plGetFontLeading)(void); char *protostr17; int (*plWordWrapCountLines)(int width, Popot text); char *protostr18; } PolibText; /*---------------------------------------------------------------------------- * Time library *--------------------------------------------------------------------------*/ typedef struct polib_time { long (*plClock1000)(void); char *protostr1; void (*plsleep)(double seconds); char *protostr2; void (*plNextFrame)(void); char *protostr3; void (*plBackFrame)(void); char *protostr4; void (*plSetFrame)(int frame); char *protostr5; int (*plGetFrame)(void); char *protostr6; Errcode (*plSetFrameCount)(int count); char *protostr7; int (*plGetFrameCount)(void); char *protostr8; void (*plPlayFlic)(long frames); char *protostr9; void (*plSetSpeed)(int speed); char *protostr10; int (*plGetSpeed)(void); char *protostr11; Errcode (*plInsertFrames)(int count); char *protostr12; Errcode (*plDeleteFrames)(int count); char *protostr13; void *plOverTime; /* not accessible to poe modules */ char *protostr14; void *plOverAll; /* not accessible to poe modules */ char *protostr15; void *plOverSegment; /* not accessible to poe modules */ char *protostr16; void (*plSetTimeSelect)(Boolean is_multi); char *protstr17; Boolean (*plGetTimeSelect)(void); char *protstr18; void (*plSetFSA)(int fsa); char *protstr19; int (*plGetFSA)(void); char *protstr20; void (*plSetSegStart)(int frame); char *protstr21; int (*plGetSegStart)(void); char *protstr22; void (*plSetSegEnd)(int frame); char *protstr23; int (*plGetSegEnd)(void); char *protstr24; void (*plSetStill)(Boolean still); char *protstr25; Boolean (*plGetStill)(void); char *protstr26; void (*plSetInSlow)(Boolean InSlow); char *protstr27; Boolean (*plGetInSlow)(void); char *protstr28; void (*plSetOutSlow)(Boolean OutSlow); char *protstr29; Boolean (*plGetOutSlow)(void); char *protstr30; void (*plSetPingPong)(Boolean PingPong); char *protstr31; Boolean (*plGetPingPong)(void); char *protstr32; void (*plSetReverse)(Boolean reverse); char *protstr33; Boolean (*plGetReverse)(void); char *protstr34; void (*plSetComplete)(Boolean complete); char *protstr35; Boolean (*plGetComplete)(void); char *protstr36; } PolibTime; /*---------------------------------------------------------------------------- * Turtle library *--------------------------------------------------------------------------*/ typedef struct polib_turtle { void (*plMove)(double amount); char *protostr1; void (*plBack)(double amount); char *protostr2; void (*plLeft)(double angle); char *protostr3; void (*plRight)(double angle); char *protostr4; void (*plPenUp)(void); char *protostr5; void (*plPenDown)(void); char *protostr6; Boolean (*plIsDown)(void); char *protostr7; void (*plMoveTo)(double x, double y, double angle); char *protostr8; void (*plWhere)(Popot x, Popot y, Popot angle); char *protostr9; void (*plHome)(void); char *protostr10; } PolibTurtle; /*---------------------------------------------------------------------------- * User interface library *--------------------------------------------------------------------------*/ typedef struct polib_user { int (*plprintf)(long vcount, long vsize, Popot format, ...); char *protostr1; void (*plunprintf)(void); char *protostr2; void (*plQtext)(long vcount, long vsize, Popot format, ...); char *protostr3; int (*plQchoice)(long vcount, long vsize, Popot buttons, int bcount, Popot header, ...); char *protostr4; int (*plQmenu)(Popot choices, int ccount, Popot header); char *protostr5; Boolean (*plQquestion)(long vcount, long vsize, Popot question, ...); char *protostr6; Boolean (*plQnumber)(Popot num, int min, int max, Popot header); char *protostr7; Boolean (*plQstring)(Popot string, int size, Popot header); char *protostr8; Boolean (*plQfile)(Popot suffix, Popot button, Popot inpath, Popot outpath, Boolean force_suffix, Popot header); char *protostr9; Boolean (*plQlist)(Popot choicestr, Popot choice, Popot items, int icount, Popot ipos, Popot header); char *protostr10; int (*plQcolor)(void); char *protostr11; Errcode (*plQerror)(long vcount, long vsize, Errcode err, Popot format, ...); char *protostr12; Boolean (*plRubBox)(Popot x, Popot y, Popot w, Popot h); char *protostr13; Boolean (*plRubCircle)(Popot x, Popot y, Popot rad); char *protostr14; Boolean (*plRubLine)(int x1, int y1, Popot x2, Popot y2); char *protostr15; int (*plRubPoly)(Popot x, Popot y); char *protostr16; Boolean (*plDragBox)(Popot x, Popot y, Popot w, Popot h); char *protostr16a; void (*plWaitClick)(Popot x, Popot y, Popot left, Popot right, Popot key); char *protostr17; void (*plPollInput)(Popot x, Popot y, Popot left, Popot right, Popot key); char *protostr18; void (*plWaitInput)(Popot x, Popot y, Popot left, Popot right, Popot key); char *protostr19; Boolean (*plGetAbort)(void); char *protostr20; Boolean (*plSetAbort)(Boolean abort); char *protostr21; void *plSetAbortHandler; /* Not accessible to poe modules */ char *protostr22; Boolean (*plHideCursor)(void); char *protostr23; Boolean (*plShowCursor)(void); char *protostr24; Boolean (*plQscroll)(Popot choice, Popot items, int icount, Popot ipos, Popot button_texts, Popot hdr); char *protostr25; Boolean (*plUdQnumber)(long vcount, long vsize, Popot inum, int min, int max, Popot update, Popot data, Popot pofmt, ...); char *protostr26; int (*plQedit)(Popot ptext, int max_size, Popot cursor_position, Popot top_line); char *protostr27; int (*plQeditFile)(Popot pop_file_name, Popot cursor_position, Popot top_line); char *protostr28; void (*plPhysicalWaitClick)(Popot x, Popot y, Popot left, Popot right, Popot key); char *protostr29; void (*plPhysicalPollInput)(Popot x, Popot y, Popot left, Popot right, Popot key); char *protostr30; void (*plPhysicalWaitInput)(Popot x, Popot y, Popot left, Popot right, Popot key); char *protostr31; Boolean (*plPhysicalRubMoveBox)(Popot x, Popot y, Popot width, Popot height, Boolean clip_to_screen); char *protostr32; int (*plQmenuWithFlags)(Popot pchoices, int ccount, Popot pflags, Popot header); char *protostr33; } PolibUser; /*---------------------------------------------------------------------------- * Global Variable Library *--------------------------------------------------------------------------*/ typedef struct polib_globalv { Errcode (*plGlobalVarGet)(Popot name, Popot value); char *protostr1; Errcode (*plGlobalVarSet)(Popot name, Popot value); char *protostr2; Errcode (*plGlobalVarDelete)(Popot name); char *protostr3; Errcode (*plGlobalVarFlush)(void); char *protostr4; Errcode (*plGlobalVarFirst)(Popot nameptr, Popot valueptr); char *protostr5; Errcode (*plGlobalVarNext)(Popot nameptr, Popot valueptr); char *protostr6; } PolibGlobalv; /*---------------------------------------------------------------------------- * Titling library *--------------------------------------------------------------------------*/ typedef struct polib_title { void (*plTitleSetMovement)(int movement); char *protostr3; int (*plTitleGetMovement)(void); char *protostr4; void (*plTitleSetScrolling)(int scrolling); char *protostr5; int (*plTitleGetScrolling)(void); char *protostr6; Errcode (*plTitleSetText)(char *text); char *protostr7; Errcode (*plTitleSetTextFromFile)(char *file_name); char *protostr8; char (*plTitleGetText)(void); char *protostr9; Boolean (*plTitleHasText)(void); char *protostr10; void (*plTitleSetPosition)(int x, int y, int w, int h); char *protostr11; void (*plTitleGetPosition)(int *x, int *y, int *w, int *h); char *protostr12; void (*plTitleEdit)(void); char *protostr13; Errcode (*plTitleRender)(void); char *protostr14; } PolibTitle; /*---------------------------------------------------------------------------- * Tween library *--------------------------------------------------------------------------*/ typedef struct polib_tween { Errcode (*plTweenLoad)(Popot pop_file_name); char *protostr1; Errcode (*plTweenSave)(Popot pop_file_name); char *protostr2; Boolean (*plTweenExists)(void); char *protostr3; void (*plTweenClear)(void); char *protostr4; Errcode (*plTweenSetStart)(int ptcount, Popot pop_x, Popot pop_y); char *protostr5; Errcode (*plTweenGetStart)(Popot pop_ptcount, Popot pop_x, Popot pop_y); char *protostr6; Errcode (*plTweenSetEnd)(int ptcount, Popot pop_x, Popot pop_y); char *protostr7; Errcode (*plTweenGetEnd)(Popot pop_ptcount, Popot pop_x, Popot pop_y); char *protostr8; void (*plTweenSwapEnds)(void); char *protostr9; Errcode (*plTweenEndToStart)(void); char *protostr10; Errcode (*plTweenOneLink)(int start_point, int end_point); char *protostr11; Errcode (*plTweenSetLinks)(int link_count, Popot pop_starts, Popot pop_ends); char *protostr12; Errcode (*plTweenGetLinks)(Popot pop_link_count, Popot pop_starts, Popot pop_ends); char *protostr13; void (*plTweenClearLinks)(void); char *protostr14; void (*plTweenSetSplined)(Boolean is_splined); char *protostr15; Boolean (*plTweenGetSplined)(void); char *protostr16; Errcode (*plTweenTrails)(int steps); char *protostr17; Errcode (*plTweenMakePoly)(double time, Popot pop_ptcount, Popot pop_x, Popot pop_y); char *protostr18; Errcode (*plTweenRender)(void); char *protostr19; } PolibTween; /*---------------------------------------------------------------------------- * FlicPlay library *--------------------------------------------------------------------------*/ typedef struct polib_flicplay { void * reserved1; /* typedef appears here */ char *protostr00; Errcode (*plFlicInfo)(Popot path, Popot width, Popot height, Popot speed, Popot frames); char *protostr01; Popot (*plFlicOpenInfo)(Popot path, Popot width, Popot height, Popot speed, Popot frames); char *protostr02; Popot (*plFlicOpen)(Popot path); char *protostr03; void (*plFlicClose)(Popot theflic); char *protostr04; void (*plFlicRewind)(Popot theflic); char *protostr05; void (*plFlicSeekFrame)(Popot theflic, int theframe); char *protostr06; void (*plFlicOptions)(Popot theflic, int speed, int keyit_stops_playback, Popot playback_screen, int xoffset, int yoffset); char *protostr07; void (*plFlicPlay)(Popot theflic); char *protostr08; void (*plFlicPlayOnce)(Popot theflic); char *protostr09; void (*plFlicPlayTimed)(Popot theflic, int milliseconds); char *protostr10; void (*plFlicPlayCount)(Popot theflic, int frame_count); char *protostr11; void *plFlicPlayUntil; /* not accessible to poe modules */ char *protostr12; } PolibFlicPlay; /*---------------------------------------------------------------------------- * Macros defining the number of entries in each of the builtin libs... *--------------------------------------------------------------------------*/ #define SIZEOF_POLIB_ENTRY (sizeof(char *)+sizeof(void (*)())) #define POLIB_OPTICS_SIZE (sizeof(PolibOptics )/SIZEOF_POLIB_ENTRY) #define POLIB_SWAP_SIZE (sizeof(PolibSwap )/SIZEOF_POLIB_ENTRY) #define POLIB_SCREEN_SIZE (sizeof(PolibScreen )/SIZEOF_POLIB_ENTRY) #define POLIB_CEL_SIZE (sizeof(PolibCel )/SIZEOF_POLIB_ENTRY) #define POLIB_DOS_SIZE (sizeof(PolibDos )/SIZEOF_POLIB_ENTRY) #define POLIB_DRAW_SIZE (sizeof(PolibDraw )/SIZEOF_POLIB_ENTRY) #define POLIB_AAFILE_SIZE (sizeof(PolibAAFile )/SIZEOF_POLIB_ENTRY) #define POLIB_MISC_SIZE (sizeof(PolibMisc )/SIZEOF_POLIB_ENTRY) #define POLIB_MODE_SIZE (sizeof(PolibMode )/SIZEOF_POLIB_ENTRY) #define POLIB_TEXT_SIZE (sizeof(PolibText )/SIZEOF_POLIB_ENTRY) #define POLIB_TIME_SIZE (sizeof(PolibTime )/SIZEOF_POLIB_ENTRY) #define POLIB_TURTLE_SIZE (sizeof(PolibTurtle )/SIZEOF_POLIB_ENTRY) #define POLIB_USER_SIZE (sizeof(PolibUser )/SIZEOF_POLIB_ENTRY) #define POLIB_GLOBALV_SIZE (sizeof(PolibGlobalv )/SIZEOF_POLIB_ENTRY) #define POLIB_TITLE_SIZE (sizeof(PolibTitle )/SIZEOF_POLIB_ENTRY) #define POLIB_TWEEN_SIZE (sizeof(PolibTween )/SIZEOF_POLIB_ENTRY) #define POLIB_FLICPLAY_SIZE (sizeof(PolibFlicPlay)/SIZEOF_POLIB_ENTRY) #ifdef REXLIB_INTERNALS /***************************************************************************** * The Porexlib structure (the host<->poe interface for AA_POCOLIB usage.) ****************************************************************************/ struct rgb3; /* just enough to allow its use in prototypes */ typedef Errcode OTFunc(void *data, int ix, int total, int scale); typedef struct porexlib { Libhead hdr; Errcode *pl_builtin_err; void *(*pl_getpicscreen)(void); void *(*pl_ppt2ptr)(Popot ppt); Popot (*pl_ptr2ppt)(void *ptr, int bytes); int (*pl_getmucolors)(Pixel **indicies, struct rgb3 **lastrgbs, struct rgb3 **idealrgbs); int (*pl_findpoe)(char *poename, Lib_proto **plibreturn); Errcode (*pl_overtime)(OTFunc *effect, void *data); Boolean (*pl_checkabort)(void *data); Errcode (*pl_oversegment)(OTFunc *effect, void *data); Errcode (*pl_overall)(OTFunc *effect, void *data); char *vb; /* for internal bugfix/patch usage only! */ char *vs; /* for internal bugfix/patch usage only! */ long reserved1[4]; PolibUser *pluser; PolibOptics *ploptics; PolibSwap *plswap; PolibScreen *plscreen; PolibCel *plcel; PolibDos *pldos; PolibDraw *pldraw; PolibAAFile *plaafile; PolibMisc *plmisc; PolibMode *plmode; PolibText *pltext; PolibTime *pltime; PolibTurtle *plturtle; PolibGlobalv *plglobalv; PolibTitle *pltitle; PolibTween *pltween; PolibFlicPlay *plflicplay; long reserved2[1]; } Porexlib; /* REXLIB_INTERNALS */ #endif #ifdef PUBLIC_CODE /***************************************************************************** * For the poe side only: * Prototypes for functions that live in rexlib\pocolib.lib... * Macros to provide a poe module indirect access to builtin poco libs... ****************************************************************************/ #ifndef SCALE_ONE #define SCALE_ONE (1<<14) /* used by overtime effects routines */ #endif extern Hostlib _a_a_pocolib; /* this helps multi-source-module POE code */ #define _plptr ((Porexlib *)_a_a_pocolib.next) #define poeprintf _plptr->pluser->plprintf #define poeunprintf _plptr->pluser->plunprintf #define poeQtext _plptr->pluser->plQtext #define poeQchoice _plptr->pluser->plQchoice #define poeQmenu _plptr->pluser->plQmenu #define poeQquestion _plptr->pluser->plQquestion #define poeQnumber _plptr->pluser->plQnumber #define poeQstring _plptr->pluser->plQstring #define poeQfile _plptr->pluser->plQfile #define poeQlist _plptr->pluser->plQlist #define poeQcolor _plptr->pluser->plQcolor #define poeQerror _plptr->pluser->plQerror #define poeRubBox _plptr->pluser->plRubBox #define poeRubCircle _plptr->pluser->plRubCircle #define poeRubLine _plptr->pluser->plRubLine #define poeRubPoly _plptr->pluser->plRubPoly #define poeDragBox _plptr->pluser->plDragBox #define poeWaitClick _plptr->pluser->plWaitClick #define poePollInput _plptr->pluser->plPollInput #define poeWaitInput _plptr->pluser->plWaitInput #define poeGetAbort _plptr->pluser->plGetAbort #define poeSetAbort _plptr->pluser->plSetAbort #define poeHideCursor _plptr->pluser->plHideCursor #define poeShowCursor _plptr->pluser->plShowCursor #define poeQscroll _plptr->pluser->plQscroll /* Next ones are new with Ani Pro 1.5 */ #define poeQedit _plptr->pluser->plQedit #define poeQeditFile _plptr->pluser->plQeditFile #define poePhysicalWaitClick _plptr->pluser->plPhysicalWaitClick #define poePhysicalPollInput _plptr->pluser->plPhysicalPollInput #define poePhysicalWaitInput _plptr->pluser->plPhysicalWaitInput #define poePhysicalRubMoveBox _plptr->pluser->plPhysicalRubMoveBox #define poeQmenuWithFlags _plptr->pluser->plQmenuWithFlags #define poeOptClearState _plptr->ploptics->plOptClearState #define poeOptSetState _plptr->ploptics->plOptSetState #define poeOptGetState _plptr->ploptics->plOptGetState #define poeOptFreeState _plptr->ploptics->plOptFreeState #define poeOptClearPos _plptr->ploptics->plOptClearPos #define poeOptSetPos _plptr->ploptics->plOptSetPos #define poeOptGetPos _plptr->ploptics->plOptGetPos #define poeOptClearPath _plptr->ploptics->plOptClearPath #define poeOptSetPath _plptr->ploptics->plOptSetPath #define poeOptGetPath _plptr->ploptics->plOptGetPath #define poeOptFreePath _plptr->ploptics->plOptFreePath #define poeOptDefaultCenters _plptr->ploptics->plOptDefaultCenters #define poeOptContinue _plptr->ploptics->plOptContinue #define poeOptGetElement _plptr->ploptics->plOptGetElement #define poeOptSetElement _plptr->ploptics->plOptSetElement #define poeOptToFrame _plptr->ploptics->plOptToFrame #define poeOptToSegment _plptr->ploptics->plOptToSegment #define poeOptToAll _plptr->ploptics->plOptToAll #define poeSwapExists _plptr->plswap->plSwapExists #define poeSwapClip _plptr->plswap->plSwapClip #define poeSwapRelease _plptr->plswap->plSwapRelease #define poeSwapTrade _plptr->plswap->plSwapTrade #define poeGetPicScreen _plptr->plscreen->plGetPicScreen #define poeGetSwapScreen _plptr->plscreen->plGetSwapScreen #define poeGetUndoScreen _plptr->plscreen->plGetUndoScreen #define poeGetCelScreen _plptr->plscreen->plGetCelScreen #define poeAllocScreen _plptr->plscreen->plAllocScreen #define poeFreeScreen _plptr->plscreen->plFreeScreen #define poeGetScreenSize _plptr->plscreen->plGetScreenSize #define poeSetPixel _plptr->plscreen->plSetPixel #define poeGetPixel _plptr->plscreen->plGetPixel #define poeSetBlock _plptr->plscreen->plSetBlock #define poeGetBlock _plptr->plscreen->plGetBlock #define poeIconBlit _plptr->plscreen->plIconBlit #define poeBlit _plptr->plscreen->plBlit #define poeKeyBlit _plptr->plscreen->plKeyBlit #define poeCopyScreen _plptr->plscreen->plCopyScreen #define poeTradeScreen _plptr->plscreen->plTradeScreen #define poePicDirtied _plptr->plscreen->plPicDirtied /* New with Ani Pro 1.5 */ #define poeGetPhysicalScreen _plptr->plscreen->plGetPhysicalScreen #define poeSetBox _plptr->plscreen->plSetBox #define poeMenuText _plptr->plscreen->plMenuText #define poeMenuTextWidth _plptr->plscreen->plMenuTextWidth #define poeMenuTextHeight _plptr->plscreen->plMenuTextHeight #define poeGetMenuColors _plptr->plscreen->plGetMenuColors #define poeCelExists _plptr->plcel->plCelExists #define poeCelPaste _plptr->plcel->plCelPaste #define poeCelMove _plptr->plcel->plCelMove #define poeCelMoveTo _plptr->plcel->plCelMoveTo #define poeCelTurn _plptr->plcel->plCelTurn #define poeCelTurnTo _plptr->plcel->plCelTurnTo #define poeCelNextFrame _plptr->plcel->plCelNextFrame #define poeCelBackFrame _plptr->plcel->plCelBackFrame #define poeCelSetFrame _plptr->plcel->plCelSetFrame #define poeCelGetFrame _plptr->plcel->plCelGetFrame #define poeCelFrameCount _plptr->plcel->plCelFrameCount #define poeCelWhere _plptr->plcel->plCelWhere #define poeCelGet _plptr->plcel->plCelGet #ifndef PATCH10A_H /* if PATCH10A_H is defined, this has been set already */ #define poeCelRelease() _plptr->plcel->plCelRelease(); /* new: v178 */ #endif #define poeCelClipChanges _plptr->plcel->plCelClipChanges #define poefnsplit _plptr->pldos->plfnsplit #define poefnmerge _plptr->pldos->plfnmerge #define poeDosExists _plptr->pldos->plDosExists #define poeDosCopy _plptr->pldos->plDosCopy #define poeDosDelete _plptr->pldos->plDosDelete #define poeDosRename _plptr->pldos->plDosRename #define poeSetDir _plptr->pldos->plSetDir #define poeGetDir _plptr->pldos->plGetDir #define poeDirList _plptr->pldos->plDirList #define poeFreeDirList _plptr->pldos->plFreeDirList #define poeGetResourceDir _plptr->pldos->plGetResourceDir #define poeGetProgramDir _plptr->pldos->plGetProgramDir #define poeGetSize _plptr->pldraw->plGetSize #define poeGetAspectRatio _plptr->pldraw->plGetAspectRatio #define poeGetColor _plptr->pldraw->plGetColor #define poeSetColor _plptr->pldraw->plSetColor #define poeClear _plptr->pldraw->plClear #define poeDot _plptr->pldraw->plDot #define poeGetDot _plptr->pldraw->plGetDot #define poeLine _plptr->pldraw->plLine #define poeBox _plptr->pldraw->plBox #define poeCircle _plptr->pldraw->plCircle #define poePoly _plptr->pldraw->plPoly #define poeSpline _plptr->pldraw->plSpline #define poeOval _plptr->pldraw->plOval #define poeStar _plptr->pldraw->plStar #define poePetal _plptr->pldraw->plPetal #define poeRpoly _plptr->pldraw->plRpoly #define poeSpiral _plptr->pldraw->plSpiral #define poeFill _plptr->pldraw->plFill #define poeFillTo _plptr->pldraw->plFillTo #define poeEdge _plptr->pldraw->plEdge #define poeSetColorMap _plptr->pldraw->plSetColorMap #define poeGetColorMap _plptr->pldraw->plGetColorMap #define poeGetScreenColorMap _plptr->pldraw->plGetScreenColorMap #define poeGetScreenColorMap _plptr->pldraw->plGetScreenColorMap #define poeGetPhysicalSize _plptr->pldraw->plGetPhysicalSize #ifndef PATCH10A_H /* if PATCH10A_H is defined, these have been set already */ #define poeGetBoxBevel _plptr->pldraw->plGetBoxBevel /* new: v179 */ #define poeSetBoxBevel _plptr->pldraw->plSetBoxBevel /* new: v179 */ #endif /* New to Ani Pro 1.5 */ #define poeSetCluster _plptr->pldraw->plSetCluster #define poeGetCluster _plptr->pldraw->plGetCluster #define poeHLStoRGB _plptr->pldraw->plHLStoRGB #define poeRGBtoHLS _plptr->pldraw->plRGBtoHLS #define poeClosestColorInScreen _plptr->pldraw->plClosestColorInScreen #define poeSqueezeColors _plptr->pldraw->plSqueezeColors #define poeFitScreenToColorMap _plptr->pldraw->plFitScreenToColorMap #define poeLoadFlic _plptr->plaafile->plLoadFlic #define poeSaveFlic _plptr->plaafile->plSaveFlic #define poeLoadPic _plptr->plaafile->plLoadPic #define poeSavePic _plptr->plaafile->plSavePic #define poeLoadCel _plptr->plaafile->plLoadCel #define poeSaveCel _plptr->plaafile->plSaveCel #define poeLoadPath _plptr->plaafile->plLoadPath #define poeSavePath _plptr->plaafile->plSavePath #define poeLoadPoly _plptr->plaafile->plLoadPoly #define poeSavePoly _plptr->plaafile->plSavePoly #define poeLoadColors _plptr->plaafile->plLoadColors #define poeSaveColors _plptr->plaafile->plSaveColors #define poeLoadTitles _plptr->plaafile->plLoadTitles #define poeSaveTitles _plptr->plaafile->plSaveTitles #define poeLoadMask _plptr->plaafile->plLoadMask #define poeSaveMask _plptr->plaafile->plSaveMask #define poeSaveScreenPic _plptr->plaafile->plSaveScreenPic #define poeLoadScreenPic _plptr->plaafile->plLoadScreenPic #define poeexit _plptr->plmisc->plexit #define poeNewFlic _plptr->plmisc->plNewFlic #define poeReset _plptr->plmisc->plReset #define poeResizeReset _plptr->plmisc->plResizeReset #define poeGetChangeCount _plptr->plmisc->plGetChangeCount #define poePocoVersion _plptr->plmisc->plPocoVersion #define poeRedo _plptr->plmisc->plRedo #define poeRestore _plptr->plmisc->plRestore #define poernd _plptr->plmisc->plrnd #define poerand _plptr->plmisc->plrand #define poesrand _plptr->plmisc->plsrand #define poeclock _plptr->plmisc->plclock #define poeIsBatchRun _plptr->plmisc->plIsBatchRun #define poePocoChainTo _plptr->plmisc->plPocoChainTo #define poesystem _plptr->plmisc->plsystem /* new: v1.5 */ #define poeSetInk _plptr->plmode->plSetInk #define poeGetInk _plptr->plmode->plGetInk #define poeSetInkStrength _plptr->plmode->plSetInkStrength #define poeGetInkStrength _plptr->plmode->plGetInkStrength #define poeSetInkDither _plptr->plmode->plSetInkDither #define poeGetInkDither _plptr->plmode->plGetInkDither #define poeSetFilled _plptr->plmode->plSetFilled #define poeGetFilled _plptr->plmode->plGetFilled #define poeSetBrushSize _plptr->plmode->plSetBrushSize #define poeGetBrushSize _plptr->plmode->plGetBrushSize #define poeSetKeyMode _plptr->plmode->plSetKeyMode #define poeGetKeyMode _plptr->plmode->plGetKeyMode #define poeSetKeyColor _plptr->plmode->plSetKeyColor #define poeGetKeyColor _plptr->plmode->plGetKeyColor #define poeSetMaskUse _plptr->plmode->plSetMaskUse #define poeGetMaskUse _plptr->plmode->plGetMaskUse #define poeSetMaskCreate _plptr->plmode->plSetMaskCreate #define poeGetMaskCreate _plptr->plmode->plGetMaskCreate #define poeSetStarPoints _plptr->plmode->plSetStarPoints #define poeGetStarPoints _plptr->plmode->plGetStarPoints #define poeSetStarRatio _plptr->plmode->plSetStarRatio #define poeGetStarRatio _plptr->plmode->plGetStarRatio #define poeSetSplineTCB _plptr->plmode->plSetSplineTCB #define poeGetSplineTCB _plptr->plmode->plGetSplineTCB #define poeSetTwoColorOn _plptr->plmode->plSetTwoColorOn #define poeGetTwoColorOn _plptr->plmode->plGetTwoColorOn #define poeSetTwoColor _plptr->plmode->plSetTwoColor #define poeGetTwoColor _plptr->plmode->plGetTwoColor #define poeSetClosed _plptr->plmode->plSetClosed #define poeGetClosed _plptr->plmode->plGetClosed #define poeSetCycleDraw _plptr->plmode->plSetCycleDraw #define poeGetCycleDraw _plptr->plmode->plGetCycleDraw #define poeGetMultiFrame _plptr->plmode->plGetMultiFrame #define poeSetMultiFrame _plptr->plmode->plSetMultiFrame #define poeText _plptr->pltext->plText #define poeWordWrap _plptr->pltext->plWordWrap #define poeSetJustify _plptr->pltext->plSetJustify #define poeGetJustify _plptr->pltext->plGetJustify #define poeStringWidth _plptr->pltext->plStringWidth #define poeFontHeight _plptr->pltext->plFontHeight #define poeTallestChar _plptr->pltext->plTallestChar #define poeGetFontName _plptr->pltext->plGetFontName #define poeLoadFont _plptr->pltext->plLoadFont #define poeGetFontDir _plptr->pltext->plGetFontDir #define poeQfont _plptr->pltext->plQfont /* Next are new with Ani Pro 1.5 */ #define poeCanScaleFont _plptr->pltext->plCanScaleFont #define poeScaleFont _plptr->pltext->plScaleFont #define poeSetFontSpacing _plptr->pltext->plSetFontSpacing #define poeGetFontSpacing _plptr->pltext->plGetFontSpacing #define poeSetFontLeading _plptr->pltext->plSetFontLeading #define poeGetFontLeading _plptr->pltext->plGetFontLeading #define poeWordWrapCountLines _plptr->pltext->plWordWrapCountLines #define poeClock1000 _plptr->pltime->plClock1000 #define poesleep _plptr->pltime->plsleep #define poeNextFrame _plptr->pltime->plNextFrame #define poeBackFrame _plptr->pltime->plBackFrame #define poeSetFrame _plptr->pltime->plSetFrame #define poeGetFrame _plptr->pltime->plGetFrame #define poeSetFrameCount _plptr->pltime->plSetFrameCount #define poeGetFrameCount _plptr->pltime->plGetFrameCount #define poePlayFlic _plptr->pltime->plPlayFlic #define poeSetSpeed _plptr->pltime->plSetSpeed #define poeGetSpeed _plptr->pltime->plGetSpeed #define poeInsertFrames _plptr->pltime->plInsertFrames #define poeDeleteFrames _plptr->pltime->plDeleteFrames #define poeSetTimeSelect _plptr->pltime->plSetTimeSelect #define poeGetTimeSelect _plptr->pltime->plGetTimeSelect #define poeSetFSA _plptr->pltime->plSetFSA #define poeGetFSA _plptr->pltime->plGetFSA #define poeSetSegStart _plptr->pltime->plSetSegStart #define poeGetSegStart _plptr->pltime->plGetSegStart #define poeSetSegEnd _plptr->pltime->plSetSegEnd #define poeGetSegEnd _plptr->pltime->plGetSegEnd #define poeSetStill _plptr->pltime->plSetStill #define poeGetStill _plptr->pltime->plGetStill #define poeSetInSlow _plptr->pltime->plSetInSlow #define poeGetInSlow _plptr->pltime->plGetInSlow #define poeSetOutSlow _plptr->pltime->plSetOutSlow #define poeGetOutSlow _plptr->pltime->plGetOutSlow #define poeSetPingPong _plptr->pltime->plSetPingPong #define poeGetPingPong _plptr->pltime->plGetPingPong #define poeSetReverse _plptr->pltime->plSetReverse #define poeGetReverse _plptr->pltime->plGetReverse #define poeSetComplete _plptr->pltime->plSetComplete #define poeGetComplete _plptr->pltime->plGetComplete #define poeMove _plptr->plturtle->plMove #define poeBack _plptr->plturtle->plBack #define poeLeft _plptr->plturtle->plLeft #define poeRight _plptr->plturtle->plRight #define poePenUp _plptr->plturtle->plPenUp #define poePenDown _plptr->plturtle->plPenDown #define poeIsDown _plptr->plturtle->plIsDown #define poeMoveTo _plptr->plturtle->plMoveTo #define poeWhere _plptr->plturtle->plWhere #define poeHome _plptr->plturtle->plHome #define poeGlobalVarGet _plptr->plglobalv->plGlobalVarGet #define poeGlobalVarSet _plptr->plglobalv->plGlobalVarSet #define poeGlobalVarDelete _plptr->plglobalv->plGlobalVarDelete #define poeGlobalVarFlush _plptr->plglobalv->plGlobalVarFlush #define poeGlobalVarFirst _plptr->plglobalv->plGlobalVarFirst #define poeGlobalVarNext _plptr->plglobalv->plGlobalVarNext /* This whole library new with Ani Pro 1.5 */ #define poeTitleSetMovement _plptr->pltitle->plTitleSetMovement #define poeTitleGetMovement _plptr->pltitle->plTitleGetMovement #define poeTitleSetScrolling _plptr->pltitle->plTitleSetScrolling #define poeTitleGetScrolling _plptr->pltitle->plTitleGetScrolling #define poeTitleSetText _plptr->pltitle->plTitleSetText #define poeTitleSetTextFromFile _plptr->pltitle->plTitleSetTextFromFile #define poeTitleGetText _plptr->pltitle->plTitleGetText #define poeTitleHasText _plptr->pltitle->plTitleHasText #define poeTitleSetPosition _plptr->pltitle->plTitleSetPosition #define poeTitleGetPosition _plptr->pltitle->plTitleGetPosition #define poeTitleEdit _plptr->pltitle->plTitleEdit #define poeTitleRender _plptr->pltitle->plTitleRender /* Likewise this whole library new with Ani Pro 1.5 */ #define poeTweenLoad _plptr->pltween->plTweenLoad #define poeTweenSave _plptr->pltween->plTweenSave #define poeTweenExists _plptr->pltween->plTweenExists #define poeTweenClear _plptr->pltween->plTweenClear #define poeTweenSetStart _plptr->pltween->plTweenSetStart #define poeTweenGetStart _plptr->pltween->plTweenGetStart #define poeTweenSetEnd _plptr->pltween->plTweenSetEnd #define poeTweenGetEnd _plptr->pltween->plTweenGetEnd #define poeTweenSwapEnds _plptr->pltween->plTweenSwapEnds #define poeTweenEndToStart _plptr->pltween->plTweenEndToStart #define poeTweenOneLink _plptr->pltween->plTweenOneLink #define poeTweenSetLinks _plptr->pltween->plTweenSetLinks #define poeTweenGetLinks _plptr->pltween->plTweenGetLinks #define poeTweenClearLinks _plptr->pltween->plTweenClearLinks #define poeTweenSetSplined _plptr->pltween->plTweenSetSplined #define poeTweenGetSplined _plptr->pltween->plTweenGetSplined #define poeTweenTrails _plptr->pltween->plTweenTrails #define poeTweenMakePoly _plptr->pltween->plTweenMakePoly #define poeTweenRender _plptr->pltween->plTweenRender /* This whole library also new with Ani Pro 1.5 */ #define poeFlicInfo _plptr->plflicplay->plFlicInfo #define poeFlicOpenInfo _plptr->plflicplay->plFlicOpenInfo #define poeFlicOpen _plptr->plflicplay->plFlicOpen #define poeFlicClose _plptr->plflicplay->plFlicClose #define poeFlicRewind _plptr->plflicplay->plFlicRewind #define poeFlicSeekFrame _plptr->plflicplay->plFlicSeekFrame #define poeFlicOptions _plptr->plflicplay->plFlicOptions #define poeFlicPlay _plptr->plflicplay->plFlicPlay #define poeFlicPlayOnce _plptr->plflicplay->plFlicPlayOnce #define poeFlicPlayTimed _plptr->plflicplay->plFlicPlayTimed #define poeFlicPlayCount _plptr->plflicplay->plFlicPlayCount /*---------------------------------------------------------------------------- * POE-specific functions... * these are available to POE modules, but not to Poco programs. *--------------------------------------------------------------------------*/ #define builtin_err (*(_plptr->pl_builtin_err)) #define ptr2ppt _plptr->pl_ptr2ppt #define ppt2ptr _plptr->pl_ppt2ptr #define GetPicScreen _plptr->pl_getpicscreen #define GetMenuColors _plptr->pl_getmucolors #define FindPoe _plptr->pl_findpoe #define OverTime _plptr->pl_overtime #define OverSegment _plptr->pl_oversegment #define OverAll _plptr->pl_overall #define CheckAbort _plptr->pl_checkabort /*---------------------------------------------------------------------------- * new functions... * to use these functions, you must be running under a v1.1 or higher * Ani Pro host, or you must call apply_poe_patches_1_0a() from your POE's * rex-layer init function. *--------------------------------------------------------------------------*/ #define GetPhysicalScreen() (*(void**)(_plptr->vb+0x62)) /*---------------------------------------------------------------------------- * these macros provide a shorthand call for common uses of ptr2ppt... *--------------------------------------------------------------------------*/ #define array2ppt(ary) ptr2ppt(ary, sizeof(ary)) #define str2ppt(str) ptr2ppt(str, sizeof(str)) #define var2ppt(var) ptr2ppt(&var, sizeof(var)) #else /* ie, not PUBLIC_CODE */ /***************************************************************************** * For the host side only: * Declarations of the library proto/ptr structures * found in poco*.c modules in the host root directory... ****************************************************************************/ extern PolibOptics po_liboptics; extern PolibSwap po_libswap; extern PolibScreen po_libscreen; extern PolibCel po_libcel; extern PolibDos po_libdos; extern PolibDraw po_libdraw; extern PolibAAFile po_libaafile; extern PolibMisc po_libmisc; extern PolibMode po_libmode; extern PolibText po_libtext; extern PolibTime po_libtime; extern PolibTurtle po_libturtle; extern PolibUser po_libuser; extern PolibGlobalv po_libglobalv; extern PolibTitle po_libtitle; extern PolibTween po_libtween; extern PolibFlicPlay po_libflicplay; /* not PUBLIC_CODE */ #endif /* not POCO_H */ #endif #endif /* POCOLIB_H */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- 邮箱注册激活页面 --> <com.qihoo360.accounts.ui.v.RegisterEmailActiveView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/register_email_active_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:padding="@dimen/qihoo_accounts_padding" > <!-- 激活消息提示 --> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/register_email_tip" android:text="@string/qihoo_accounts_register_email_tips" style="@style/qihoo_accounts_note_text_style" android:layout_gravity="center_horizontal" /> <TextView android:id="@+id/register_email_addr" style="@style/qihoo_accounts_account_text_style" android:layout_gravity="center_horizontal" android:layout_marginTop="@dimen/qihoo_accounts_input_boxs_margin"/> <TextView android:id="@+id/rigster_email_active_tip" android:layout_marginTop="@dimen/qihoo_accounts_input_boxs_margin" android:text="@string/qihoo_accounts_register_email_active_tips" style="@style/qihoo_accounts_tip_text_style" android:gravity="left" android:layout_gravity="center_horizontal|clip_vertical" /> <!-- 进入邮箱收信 --> <Button android:id="@+id/register_email_submit" style="@style/qihoo_accounts_main_btn_style" android:layout_width="fill_parent" android:layout_marginTop="@dimen/qihoo_accounts_input_boxs_margin" android:text="@string/qihoo_accounts_register_email_commit" /> </LinearLayout> </com.qihoo360.accounts.ui.v.RegisterEmailActiveView>
{ "pile_set_name": "Github" }
// Copyright (C) 2001-2003 // William E. Kempf // Copyright (C) 2007-9 Anthony Williams // (C) Copyright 2011-2012 Vicente J. Botet Escriba // // 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) #ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H #define BOOST_THREAD_EXCEPTIONS_PDM070801_H #include <boost/thread/detail/config.hpp> // pdm: Sorry, but this class is used all over the place & I end up // with recursive headers if I don't separate it // wek: Not sure why recursive headers would cause compilation problems // given the include guards, but regardless it makes sense to // seperate this out any way. #include <string> #include <stdexcept> #include <boost/system/system_error.hpp> #include <boost/system/error_code.hpp> #include <boost/config/abi_prefix.hpp> namespace boost { #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS class BOOST_SYMBOL_VISIBLE thread_interrupted {}; #endif class BOOST_SYMBOL_VISIBLE thread_exception: public system::system_error //public std::exception { typedef system::system_error base_type; public: thread_exception() : base_type(0,system::system_category()) {} thread_exception(int sys_error_code) : base_type(sys_error_code, system::system_category()) {} thread_exception( int ev, const char * what_arg ) : base_type(system::error_code(ev, system::system_category()), what_arg) { } thread_exception( int ev, const std::string & what_arg ) : base_type(system::error_code(ev, system::system_category()), what_arg) { } ~thread_exception() throw() {} int native_error() const { return code().value(); } }; class BOOST_SYMBOL_VISIBLE condition_error: public system::system_error //public std::exception { typedef system::system_error base_type; public: condition_error() : base_type(system::error_code(0, system::system_category()), "Condition error") {} condition_error( int ev ) : base_type(system::error_code(ev, system::system_category()), "Condition error") { } condition_error( int ev, const char * what_arg ) : base_type(system::error_code(ev, system::system_category()), what_arg) { } condition_error( int ev, const std::string & what_arg ) : base_type(system::error_code(ev, system::system_category()), what_arg) { } }; class BOOST_SYMBOL_VISIBLE lock_error: public thread_exception { typedef thread_exception base_type; public: lock_error() : base_type(0, "boost::lock_error") {} lock_error( int ev ) : base_type(ev, "boost::lock_error") { } lock_error( int ev, const char * what_arg ) : base_type(ev, what_arg) { } lock_error( int ev, const std::string & what_arg ) : base_type(ev, what_arg) { } ~lock_error() throw() {} }; class BOOST_SYMBOL_VISIBLE thread_resource_error: public thread_exception { typedef thread_exception base_type; public: thread_resource_error() : base_type(static_cast<int>(system::errc::resource_unavailable_try_again), "boost::thread_resource_error") {} thread_resource_error( int ev ) : base_type(ev, "boost::thread_resource_error") { } thread_resource_error( int ev, const char * what_arg ) : base_type(ev, what_arg) { } thread_resource_error( int ev, const std::string & what_arg ) : base_type(ev, what_arg) { } ~thread_resource_error() throw() {} }; class BOOST_SYMBOL_VISIBLE unsupported_thread_option: public thread_exception { typedef thread_exception base_type; public: unsupported_thread_option() : base_type(static_cast<int>(system::errc::invalid_argument), "boost::unsupported_thread_option") {} unsupported_thread_option( int ev ) : base_type(ev, "boost::unsupported_thread_option") { } unsupported_thread_option( int ev, const char * what_arg ) : base_type(ev, what_arg) { } unsupported_thread_option( int ev, const std::string & what_arg ) : base_type(ev, what_arg) { } }; class BOOST_SYMBOL_VISIBLE invalid_thread_argument: public thread_exception { typedef thread_exception base_type; public: invalid_thread_argument() : base_type(static_cast<int>(system::errc::invalid_argument), "boost::invalid_thread_argument") {} invalid_thread_argument( int ev ) : base_type(ev, "boost::invalid_thread_argument") { } invalid_thread_argument( int ev, const char * what_arg ) : base_type(ev, what_arg) { } invalid_thread_argument( int ev, const std::string & what_arg ) : base_type(ev, what_arg) { } }; class BOOST_SYMBOL_VISIBLE thread_permission_error: public thread_exception { typedef thread_exception base_type; public: thread_permission_error() : base_type(static_cast<int>(system::errc::permission_denied), "boost::thread_permission_error") {} thread_permission_error( int ev ) : base_type(ev, "boost::thread_permission_error") { } thread_permission_error( int ev, const char * what_arg ) : base_type(ev, what_arg) { } thread_permission_error( int ev, const std::string & what_arg ) : base_type(ev, what_arg) { } }; } // namespace boost #include <boost/config/abi_suffix.hpp> #endif
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.myimooc</groupId> <artifactId>45-java-sms</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> <artifactId>45-java-sms-runtime</artifactId> <version>1.0.0-SNAPSHOT</version> <packaging>jar</packaging> <dependencies> <dependency> <groupId>com.myimooc</groupId> <artifactId>45-java-sms-service</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> <dependency> <groupId>com.myimooc</groupId> <artifactId>45-java-sms-file</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>3.1.0</version> <configuration> <descriptors> <descriptor>src/assembly/runtime.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
DELETE FROM `spell_chain` WHERE `spell_id` IN (33736); INSERT INTO `spell_chain` VALUES (33736,24398,24398,2);
{ "pile_set_name": "Github" }