text stringlengths 2 99k | meta dict |
|---|---|
import { IEyeglass } from "../IEyeglass";
import { SassImplementation } from "../util/SassImplementation";
import type { FunctionDeclarations } from "node-sass";
export type EyeglassFunctions =
(eyeglass: IEyeglass, sass: SassImplementation) => FunctionDeclarations; | {
"pile_set_name": "Github"
} |
/**
******************************************************************************
* @file stm32f4xx_hal_ltdc.h
* @author MCD Application Team
* @version V1.7.0
* @date 17-February-2017
* @brief Header file of LTDC HAL module.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics 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 HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_HAL_LTDC_H
#define __STM32F4xx_HAL_LTDC_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal_def.h"
/** @addtogroup STM32F4xx_HAL_Driver
* @{
*/
/** @defgroup LTDC LTDC
* @brief LTDC HAL module driver
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup LTDC_Exported_Types LTDC Exported Types
* @{
*/
#define MAX_LAYER 2U
/**
* @brief LTDC color structure definition
*/
typedef struct
{
uint8_t Blue; /*!< Configures the blue value.
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
uint8_t Green; /*!< Configures the green value.
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
uint8_t Red; /*!< Configures the red value.
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
uint8_t Reserved; /*!< Reserved 0xFF */
} LTDC_ColorTypeDef;
/**
* @brief LTDC Init structure definition
*/
typedef struct
{
uint32_t HSPolarity; /*!< configures the horizontal synchronization polarity.
This parameter can be one value of @ref LTDC_HS_POLARITY */
uint32_t VSPolarity; /*!< configures the vertical synchronization polarity.
This parameter can be one value of @ref LTDC_VS_POLARITY */
uint32_t DEPolarity; /*!< configures the data enable polarity.
This parameter can be one of value of @ref LTDC_DE_POLARITY */
uint32_t PCPolarity; /*!< configures the pixel clock polarity.
This parameter can be one of value of @ref LTDC_PC_POLARITY */
uint32_t HorizontalSync; /*!< configures the number of Horizontal synchronization width.
This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
uint32_t VerticalSync; /*!< configures the number of Vertical synchronization height.
This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
uint32_t AccumulatedHBP; /*!< configures the accumulated horizontal back porch width.
This parameter must be a number between Min_Data = LTDC_HorizontalSync and Max_Data = 0xFFF. */
uint32_t AccumulatedVBP; /*!< configures the accumulated vertical back porch height.
This parameter must be a number between Min_Data = LTDC_VerticalSync and Max_Data = 0x7FF. */
uint32_t AccumulatedActiveW; /*!< configures the accumulated active width.
This parameter must be a number between Min_Data = LTDC_AccumulatedHBP and Max_Data = 0xFFF. */
uint32_t AccumulatedActiveH; /*!< configures the accumulated active height.
This parameter must be a number between Min_Data = LTDC_AccumulatedVBP and Max_Data = 0x7FF. */
uint32_t TotalWidth; /*!< configures the total width.
This parameter must be a number between Min_Data = LTDC_AccumulatedActiveW and Max_Data = 0xFFF. */
uint32_t TotalHeigh; /*!< configures the total height.
This parameter must be a number between Min_Data = LTDC_AccumulatedActiveH and Max_Data = 0x7FF. */
LTDC_ColorTypeDef Backcolor; /*!< Configures the background color. */
} LTDC_InitTypeDef;
/**
* @brief LTDC Layer structure definition
*/
typedef struct
{
uint32_t WindowX0; /*!< Configures the Window Horizontal Start Position.
This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
uint32_t WindowX1; /*!< Configures the Window Horizontal Stop Position.
This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
uint32_t WindowY0; /*!< Configures the Window vertical Start Position.
This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
uint32_t WindowY1; /*!< Configures the Window vertical Stop Position.
This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x7FF. */
uint32_t PixelFormat; /*!< Specifies the pixel format.
This parameter can be one of value of @ref LTDC_Pixelformat */
uint32_t Alpha; /*!< Specifies the constant alpha used for blending.
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
uint32_t Alpha0; /*!< Configures the default alpha value.
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
uint32_t BlendingFactor1; /*!< Select the blending factor 1.
This parameter can be one of value of @ref LTDC_BlendingFactor1 */
uint32_t BlendingFactor2; /*!< Select the blending factor 2.
This parameter can be one of value of @ref LTDC_BlendingFactor2 */
uint32_t FBStartAdress; /*!< Configures the color frame buffer address */
uint32_t ImageWidth; /*!< Configures the color frame buffer line length.
This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x1FFF. */
uint32_t ImageHeight; /*!< Specifies the number of line in frame buffer.
This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
LTDC_ColorTypeDef Backcolor; /*!< Configures the layer background color. */
} LTDC_LayerCfgTypeDef;
/**
* @brief HAL LTDC State structures definition
*/
typedef enum
{
HAL_LTDC_STATE_RESET = 0x00U, /*!< LTDC not yet initialized or disabled */
HAL_LTDC_STATE_READY = 0x01U, /*!< LTDC initialized and ready for use */
HAL_LTDC_STATE_BUSY = 0x02U, /*!< LTDC internal process is ongoing */
HAL_LTDC_STATE_TIMEOUT = 0x03U, /*!< LTDC Timeout state */
HAL_LTDC_STATE_ERROR = 0x04U /*!< LTDC state error */
}HAL_LTDC_StateTypeDef;
/**
* @brief LTDC handle Structure definition
*/
typedef struct
{
LTDC_TypeDef *Instance; /*!< LTDC Register base address */
LTDC_InitTypeDef Init; /*!< LTDC parameters */
LTDC_LayerCfgTypeDef LayerCfg[MAX_LAYER]; /*!< LTDC Layers parameters */
HAL_LockTypeDef Lock; /*!< LTDC Lock */
__IO HAL_LTDC_StateTypeDef State; /*!< LTDC state */
__IO uint32_t ErrorCode; /*!< LTDC Error code */
} LTDC_HandleTypeDef;
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup LTDC_Exported_Constants LTDC Exported Constants
* @{
*/
/** @defgroup LTDC_Error_Code LTDC Error Code
* @{
*/
#define HAL_LTDC_ERROR_NONE 0x00000000U /*!< LTDC No error */
#define HAL_LTDC_ERROR_TE 0x00000001U /*!< LTDC Transfer error */
#define HAL_LTDC_ERROR_FU 0x00000002U /*!< LTDC FIFO Underrun */
#define HAL_LTDC_ERROR_TIMEOUT 0x00000020U /*!< LTDC Timeout error */
/**
* @}
*/
/** @defgroup LTDC_Layer LTDC Layer
* @{
*/
#define LTDC_LAYER_1 0x00000000U /*!< LTDC Layer 1 */
#define LTDC_LAYER_2 0x00000001U /*!< LTDC Layer 2 */
/**
* @}
*/
/** @defgroup LTDC_HS_POLARITY LTDC HS POLARITY
* @{
*/
#define LTDC_HSPOLARITY_AL 0x00000000U /*!< Horizontal Synchronization is active low. */
#define LTDC_HSPOLARITY_AH LTDC_GCR_HSPOL /*!< Horizontal Synchronization is active high. */
/**
* @}
*/
/** @defgroup LTDC_VS_POLARITY LTDC VS POLARITY
* @{
*/
#define LTDC_VSPOLARITY_AL 0x00000000U /*!< Vertical Synchronization is active low. */
#define LTDC_VSPOLARITY_AH LTDC_GCR_VSPOL /*!< Vertical Synchronization is active high. */
/**
* @}
*/
/** @defgroup LTDC_DE_POLARITY LTDC DE POLARITY
* @{
*/
#define LTDC_DEPOLARITY_AL 0x00000000U /*!< Data Enable, is active low. */
#define LTDC_DEPOLARITY_AH LTDC_GCR_DEPOL /*!< Data Enable, is active high. */
/**
* @}
*/
/** @defgroup LTDC_PC_POLARITY LTDC PC POLARITY
* @{
*/
#define LTDC_PCPOLARITY_IPC 0x00000000U /*!< input pixel clock. */
#define LTDC_PCPOLARITY_IIPC LTDC_GCR_PCPOL /*!< inverted input pixel clock. */
/**
* @}
*/
/** @defgroup LTDC_SYNC LTDC SYNC
* @{
*/
#define LTDC_HORIZONTALSYNC (LTDC_SSCR_HSW >> 16U) /*!< Horizontal synchronization width. */
#define LTDC_VERTICALSYNC LTDC_SSCR_VSH /*!< Vertical synchronization height. */
/**
* @}
*/
/** @defgroup LTDC_BACK_COLOR LTDC BACK COLOR
* @{
*/
#define LTDC_COLOR 0x000000FFU /*!< Color mask */
/**
* @}
*/
/** @defgroup LTDC_BlendingFactor1 LTDC Blending Factor1
* @{
*/
#define LTDC_BLENDING_FACTOR1_CA 0x00000400U /*!< Blending factor : Cte Alpha */
#define LTDC_BLENDING_FACTOR1_PAxCA 0x00000600U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
/**
* @}
*/
/** @defgroup LTDC_BlendingFactor2 LTDC Blending Factor2
* @{
*/
#define LTDC_BLENDING_FACTOR2_CA 0x00000005U /*!< Blending factor : Cte Alpha */
#define LTDC_BLENDING_FACTOR2_PAxCA 0x00000007U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
/**
* @}
*/
/** @defgroup LTDC_Pixelformat LTDC Pixel format
* @{
*/
#define LTDC_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */
#define LTDC_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */
#define LTDC_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */
#define LTDC_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */
#define LTDC_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */
#define LTDC_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */
#define LTDC_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */
#define LTDC_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */
/**
* @}
*/
/** @defgroup LTDC_Alpha LTDC Alpha
* @{
*/
#define LTDC_ALPHA LTDC_LxCACR_CONSTA /*!< LTDC Constant Alpha mask */
/**
* @}
*/
/** @defgroup LTDC_LAYER_Config LTDC LAYER Config
* @{
*/
#define LTDC_STOPPOSITION (LTDC_LxWHPCR_WHSPPOS >> 16U) /*!< LTDC Layer stop position */
#define LTDC_STARTPOSITION LTDC_LxWHPCR_WHSTPOS /*!< LTDC Layer start position */
#define LTDC_COLOR_FRAME_BUFFER LTDC_LxCFBLR_CFBLL /*!< LTDC Layer Line length */
#define LTDC_LINE_NUMBER LTDC_LxCFBLNR_CFBLNBR /*!< LTDC Layer Line number */
/**
* @}
*/
/** @defgroup LTDC_Interrupts LTDC Interrupts
* @{
*/
#define LTDC_IT_LI LTDC_IER_LIE /*!< LTDC Line Interrupt */
#define LTDC_IT_FU LTDC_IER_FUIE /*!< LTDC FIFO Underrun Interrupt */
#define LTDC_IT_TE LTDC_IER_TERRIE /*!< LTDC Transfer Error Interrupt */
#define LTDC_IT_RR LTDC_IER_RRIE /*!< LTDC Register Reload Interrupt */
/**
* @}
*/
/** @defgroup LTDC_Flags LTDC Flags
* @{
*/
#define LTDC_FLAG_LI LTDC_ISR_LIF /*!< LTDC Line Interrupt Flag */
#define LTDC_FLAG_FU LTDC_ISR_FUIF /*!< LTDC FIFO Underrun interrupt Flag */
#define LTDC_FLAG_TE LTDC_ISR_TERRIF /*!< LTDC Transfer Error interrupt Flag */
#define LTDC_FLAG_RR LTDC_ISR_RRIF /*!< LTDC Register Reload interrupt Flag */
/**
* @}
*/
/** @defgroup LTDC_Reload_Type LTDC Reload Type
* @{
*/
#define LTDC_RELOAD_IMMEDIATE LTDC_SRCR_IMR /*!< Immediate Reload */
#define LTDC_RELOAD_VERTICAL_BLANKING LTDC_SRCR_VBR /*!< Vertical Blanking Reload */
/**
* @}
*/
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/** @defgroup LTDC_Exported_Macros LTDC Exported Macros
* @{
*/
/** @brief Reset LTDC handle state.
* @param __HANDLE__ LTDC handle
* @retval None
*/
#define __HAL_LTDC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LTDC_STATE_RESET)
/**
* @brief Enable the LTDC.
* @param __HANDLE__ LTDC handle
* @retval None.
*/
#define __HAL_LTDC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR |= LTDC_GCR_LTDCEN)
/**
* @brief Disable the LTDC.
* @param __HANDLE__ LTDC handle
* @retval None.
*/
#define __HAL_LTDC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR &= ~(LTDC_GCR_LTDCEN))
/**
* @brief Enable the LTDC Layer.
* @param __HANDLE__ LTDC handle
* @param __LAYER__ Specify the layer to be enabled.
* This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
* @retval None.
*/
#define __HAL_LTDC_LAYER_ENABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR |= (uint32_t)LTDC_LxCR_LEN)
/**
* @brief Disable the LTDC Layer.
* @param __HANDLE__ LTDC handle
* @param __LAYER__ Specify the layer to be disabled.
* This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
* @retval None.
*/
#define __HAL_LTDC_LAYER_DISABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR &= ~(uint32_t)LTDC_LxCR_LEN)
/**
* @brief Reload immediately all LTDC Layers.
* @param __HANDLE__ LTDC handle
* @retval None.
*/
#define __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_IMR)
/**
* @brief Reload during vertical blanking period all LTDC Layers.
* @param __HANDLE__ LTDC handle
* @retval None.
*/
#define __HAL_LTDC_VERTICAL_BLANKING_RELOAD_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_VBR)
/* Interrupt & Flag management */
/**
* @brief Get the LTDC pending flags.
* @param __HANDLE__ LTDC handle
* @param __FLAG__ Get the specified flag.
* This parameter can be any combination of the following values:
* @arg LTDC_FLAG_LI: Line Interrupt flag
* @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
* @arg LTDC_FLAG_TE: Transfer Error interrupt flag
* @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
* @retval The state of FLAG (SET or RESET).
*/
#define __HAL_LTDC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__))
/**
* @brief Clears the LTDC pending flags.
* @param __HANDLE__ LTDC handle
* @param __FLAG__ Specify the flag to clear.
* This parameter can be any combination of the following values:
* @arg LTDC_FLAG_LI: Line Interrupt flag
* @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
* @arg LTDC_FLAG_TE: Transfer Error interrupt flag
* @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
* @retval None
*/
#define __HAL_LTDC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
/**
* @brief Enables the specified LTDC interrupts.
* @param __HANDLE__ LTDC handle
* @param __INTERRUPT__ Specify the LTDC interrupt sources to be enabled.
* This parameter can be any combination of the following values:
* @arg LTDC_IT_LI: Line Interrupt flag
* @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
* @arg LTDC_IT_TE: Transfer Error interrupt flag
* @arg LTDC_IT_RR: Register Reload Interrupt Flag
* @retval None
*/
#define __HAL_LTDC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
/**
* @brief Disables the specified LTDC interrupts.
* @param __HANDLE__ LTDC handle
* @param __INTERRUPT__ Specify the LTDC interrupt sources to be disabled.
* This parameter can be any combination of the following values:
* @arg LTDC_IT_LI: Line Interrupt flag
* @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
* @arg LTDC_IT_TE: Transfer Error interrupt flag
* @arg LTDC_IT_RR: Register Reload Interrupt Flag
* @retval None
*/
#define __HAL_LTDC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
/**
* @brief Check whether the specified LTDC interrupt has occurred or not.
* @param __HANDLE__ LTDC handle
* @param __INTERRUPT__ Specify the LTDC interrupt source to check.
* This parameter can be one of the following values:
* @arg LTDC_IT_LI: Line Interrupt flag
* @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
* @arg LTDC_IT_TE: Transfer Error interrupt flag
* @arg LTDC_IT_RR: Register Reload Interrupt Flag
* @retval The state of INTERRUPT (SET or RESET).
*/
#define __HAL_LTDC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__))
/**
* @}
*/
/* Include LTDC HAL Extension module */
#include "stm32f4xx_hal_ltdc_ex.h"
/* Exported functions --------------------------------------------------------*/
/** @addtogroup LTDC_Exported_Functions
* @{
*/
/** @addtogroup LTDC_Exported_Functions_Group1
* @{
*/
/* Initialization and de-initialization functions *****************************/
HAL_StatusTypeDef HAL_LTDC_Init(LTDC_HandleTypeDef *hltdc);
HAL_StatusTypeDef HAL_LTDC_DeInit(LTDC_HandleTypeDef *hltdc);
void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc);
void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc);
void HAL_LTDC_ErrorCallback(LTDC_HandleTypeDef *hltdc);
void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef *hltdc);
void HAL_LTDC_ReloadEventCallback(LTDC_HandleTypeDef *hltdc);
/**
* @}
*/
/** @addtogroup LTDC_Exported_Functions_Group2
* @{
*/
/* IO operation functions *****************************************************/
void HAL_LTDC_IRQHandler(LTDC_HandleTypeDef *hltdc);
/**
* @}
*/
/** @addtogroup LTDC_Exported_Functions_Group3
* @{
*/
/* Peripheral Control functions ***********************************************/
HAL_StatusTypeDef HAL_LTDC_ConfigLayer(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetWindowSize(LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetWindowPosition(LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetPixelFormat(LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetAlpha(LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetAddress(LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetPitch(LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_ConfigCLUT(LTDC_HandleTypeDef *hltdc, uint32_t *pCLUT, uint32_t CLUTSize, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_EnableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_DisableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_EnableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_DisableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_ProgramLineEvent(LTDC_HandleTypeDef *hltdc, uint32_t Line);
HAL_StatusTypeDef HAL_LTDC_EnableDither(LTDC_HandleTypeDef *hltdc);
HAL_StatusTypeDef HAL_LTDC_DisableDither(LTDC_HandleTypeDef *hltdc);
HAL_StatusTypeDef HAL_LTDC_Reload(LTDC_HandleTypeDef *hltdc, uint32_t ReloadType);
HAL_StatusTypeDef HAL_LTDC_ConfigLayer_NoReload(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetWindowSize_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetWindowPosition_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetPixelFormat_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetAlpha_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetAddress_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_SetPitch_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_EnableColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_DisableColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_EnableCLUT_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
HAL_StatusTypeDef HAL_LTDC_DisableCLUT_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
/**
* @}
*/
/** @addtogroup LTDC_Exported_Functions_Group4
* @{
*/
/* Peripheral State functions *************************************************/
HAL_LTDC_StateTypeDef HAL_LTDC_GetState(LTDC_HandleTypeDef *hltdc);
uint32_t HAL_LTDC_GetError(LTDC_HandleTypeDef *hltdc);
/**
* @}
*/
/**
* @}
*/
/* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/
/** @defgroup LTDC_Private_Macros LTDC Private Macros
* @{
*/
#define LTDC_LAYER(__HANDLE__, __LAYER__) ((LTDC_Layer_TypeDef *)((uint32_t)(((uint32_t)((__HANDLE__)->Instance)) + 0x84U + (0x80U*(__LAYER__)))))
#define IS_LTDC_LAYER(__LAYER__) ((__LAYER__) < MAX_LAYER)
#define IS_LTDC_HSPOL(__HSPOL__) (((__HSPOL__) == LTDC_HSPOLARITY_AL) || ((__HSPOL__) == LTDC_HSPOLARITY_AH))
#define IS_LTDC_VSPOL(__VSPOL__) (((__VSPOL__) == LTDC_VSPOLARITY_AL) || ((__VSPOL__) == LTDC_VSPOLARITY_AH))
#define IS_LTDC_DEPOL(__DEPOL__) (((__DEPOL__) == LTDC_DEPOLARITY_AL) || ((__DEPOL__) == LTDC_DEPOLARITY_AH))
#define IS_LTDC_PCPOL(__PCPOL__) (((__PCPOL__) == LTDC_PCPOLARITY_IPC) || ((__PCPOL__) == LTDC_PCPOLARITY_IIPC))
#define IS_LTDC_HSYNC(__HSYNC__) ((__HSYNC__) <= LTDC_HORIZONTALSYNC)
#define IS_LTDC_VSYNC(__VSYNC__) ((__VSYNC__) <= LTDC_VERTICALSYNC)
#define IS_LTDC_AHBP(__AHBP__) ((__AHBP__) <= LTDC_HORIZONTALSYNC)
#define IS_LTDC_AVBP(__AVBP__) ((__AVBP__) <= LTDC_VERTICALSYNC)
#define IS_LTDC_AAW(__AAW__) ((__AAW__) <= LTDC_HORIZONTALSYNC)
#define IS_LTDC_AAH(__AAH__) ((__AAH__) <= LTDC_VERTICALSYNC)
#define IS_LTDC_TOTALW(__TOTALW__) ((__TOTALW__) <= LTDC_HORIZONTALSYNC)
#define IS_LTDC_TOTALH(__TOTALH__) ((__TOTALH__) <= LTDC_VERTICALSYNC)
#define IS_LTDC_BLUEVALUE(__BBLUE__) ((__BBLUE__) <= LTDC_COLOR)
#define IS_LTDC_GREENVALUE(__BGREEN__) ((__BGREEN__) <= LTDC_COLOR)
#define IS_LTDC_REDVALUE(__BRED__) ((__BRED__) <= LTDC_COLOR)
#define IS_LTDC_BLENDING_FACTOR1(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_CA) || \
((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_PAxCA))
#define IS_LTDC_BLENDING_FACTOR2(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_CA) || \
((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_PAxCA))
#define IS_LTDC_PIXEL_FORMAT(__PIXEL_FORMAT__) (((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB8888) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB888) || \
((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB565) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB1555) || \
((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB4444) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_L8) || \
((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL44) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL88))
#define IS_LTDC_ALPHA(__ALPHA__) ((__ALPHA__) <= LTDC_ALPHA)
#define IS_LTDC_HCONFIGST(__HCONFIGST__) ((__HCONFIGST__) <= LTDC_STARTPOSITION)
#define IS_LTDC_HCONFIGSP(__HCONFIGSP__) ((__HCONFIGSP__) <= LTDC_STOPPOSITION)
#define IS_LTDC_VCONFIGST(__VCONFIGST__) ((__VCONFIGST__) <= LTDC_STARTPOSITION)
#define IS_LTDC_VCONFIGSP(__VCONFIGSP__) ((__VCONFIGSP__) <= LTDC_STOPPOSITION)
#define IS_LTDC_CFBP(__CFBP__) ((__CFBP__) <= LTDC_COLOR_FRAME_BUFFER)
#define IS_LTDC_CFBLL(__CFBLL__) ((__CFBLL__) <= LTDC_COLOR_FRAME_BUFFER)
#define IS_LTDC_CFBLNBR(__CFBLNBR__) ((__CFBLNBR__) <= LTDC_LINE_NUMBER)
#define IS_LTDC_LIPOS(__LIPOS__) ((__LIPOS__) <= 0x7FFU)
#define IS_LTDC_RELOAD(__RELOADTYPE__) (((__RELOADTYPE__) == LTDC_RELOAD_IMMEDIATE) || ((__RELOADTYPE__) == LTDC_SRCR_VBR))
/**
* @}
*/
/* Private functions ---------------------------------------------------------*/
/** @defgroup LTDC_Private_Functions LTDC Private Functions
* @{
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#endif /* STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_HAL_LTDC_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| {
"pile_set_name": "Github"
} |
// Copyright (c) Stride contributors (https://stride3d.net) and Sean Boettger <sean@whypenguins.com>
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using Stride.Graphics;
using Stride.Core;
using Stride.Core.Annotations;
using Stride.Core.Collections;
using Stride.Core.Extensions;
using Stride.Core.Mathematics;
using Stride.Shaders;
using Stride.Rendering.Images;
using Stride.Rendering.Voxels;
using Stride.Rendering.Lights;
using Stride.Rendering.Skyboxes;
using System.Linq;
using Stride.Rendering.Compositing;
namespace Stride.Rendering.Voxels.Debug
{
[DataContract("VoxelDebug")]
public class VoxelDebug : ImageEffect
{
[DataMemberIgnore]
public IVoxelRenderer VoxelRenderer;
protected override void InitializeCore()
{
base.InitializeCore();
}
protected override void DrawCore(RenderDrawContext context)
{
if (!Initialized)
Initialize(context.RenderContext);
if (VoxelRenderer == null)
{
return;
}
Dictionary<VoxelVolumeComponent, ProcessedVoxelVolume> datas = VoxelRenderer.GetProcessedVolumes();
if (datas == null)
{
return;
}
foreach (var datapairs in datas)
{
var data = datapairs.Value;
if (!data.VisualizeVoxels || data.VoxelVisualization == null || data.VisualizationAttribute == null)
continue;
ImageEffectShader shader = data.VoxelVisualization.GetShader(context, data.VisualizationAttribute);
if (shader == null)
continue;
shader.SetOutput(GetSafeOutput(0));
shader.Draw(context);
}
}
public void Draw(RenderDrawContext drawContext, Texture output)
{
SetOutput(output);
DrawCore(drawContext);
}
}
}
| {
"pile_set_name": "Github"
} |
import CheckBoxField from '../../form/field/CheckBox.mjs';
import Container from '../../container/Base.mjs';
/**
* @class Neo.calendar.view.CalendarsContainer
* @extends Neo.container.Base
*/
class CalendarsContainer extends Container {
static getConfig() {return {
/**
* @member {String} className='Neo.calendar.view.CalendarsContainer'
* @protected
*/
className: 'Neo.calendar.view.CalendarsContainer',
/**
* @member {String} ntype='calendar-calendarscontainer'
* @protected
*/
ntype: 'calendar-calendarscontainer',
/**
* @member {Neo.calendar.store.Calendars|null} calendarStore_=null
*/
calendarStore_: null,
/**
* @member {String[]} cls=['neo-calendar-calendarscontainer', 'neo-container']
*/
cls: ['neo-calendar-calendarscontainer', 'neo-container'],
/**
* @member {Object} itemDefaults
* @protected
*/
itemDefaults: {
module : CheckBoxField,
flex : 'none',
hideLabel : true,
hideValueLabel: false,
},
/**
* @member {Object} layout={ntype:'vbox',align:'stretch'}
* @protected
*/
layout: {ntype: 'vbox', align: 'stretch'}
}}
/**
*
* @param {Object[]} data
*/
onStoreLoad(data) {
let me = this,
items = [];
if (!me.mounted && me.rendering) {
const listenerId = me.on('rendered', () => {
me.un('rendered', listenerId);
me.onStoreLoad(data);
});
} else {
data.forEach(item => {
items.push({
checked : item.active,
valueLabelText: item.name
});
});
me._items = items;
me.parseItemConfigs(items);
me.createItems();
}
}
}
Neo.applyClassConfig(CalendarsContainer);
export {CalendarsContainer as default}; | {
"pile_set_name": "Github"
} |
Pod::Spec.new do |s|
s.name = "MMPulseView"
s.version = "1.0"
s.summary = "A simple view to show circle pulse repeatly."
s.homepage = "https://github.com/adad184/MMPulseView"
s.license = { :type => 'MIT License', :file => 'LICENSE' }
s.author = { "adad184" => "adad184@gmail.com" }
s.source = { :git => "https://github.com/adad184/MMPulseView.git", :tag => "1.0" }
s.platform = :ios, '7.0'
s.source_files = 'Classes/*.{h,m}'
s.requires_arc = true
end
| {
"pile_set_name": "Github"
} |
require 'spec_helper'
describe RestClient do
describe "API" do
it "GET" do
RestClient::Request.should_receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => {})
RestClient.get('http://some/resource')
end
it "POST" do
RestClient::Request.should_receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'payload', :headers => {})
RestClient.post('http://some/resource', 'payload')
end
it "PUT" do
RestClient::Request.should_receive(:execute).with(:method => :put, :url => 'http://some/resource', :payload => 'payload', :headers => {})
RestClient.put('http://some/resource', 'payload')
end
it "PATCH" do
RestClient::Request.should_receive(:execute).with(:method => :patch, :url => 'http://some/resource', :payload => 'payload', :headers => {})
RestClient.patch('http://some/resource', 'payload')
end
it "DELETE" do
RestClient::Request.should_receive(:execute).with(:method => :delete, :url => 'http://some/resource', :headers => {})
RestClient.delete('http://some/resource')
end
it "HEAD" do
RestClient::Request.should_receive(:execute).with(:method => :head, :url => 'http://some/resource', :headers => {})
RestClient.head('http://some/resource')
end
it "OPTIONS" do
RestClient::Request.should_receive(:execute).with(:method => :options, :url => 'http://some/resource', :headers => {})
RestClient.options('http://some/resource')
end
end
describe "logging" do
after do
RestClient.log = nil
end
it "uses << if the log is not a string" do
log = RestClient.log = []
log.should_receive(:<<).with('xyz')
RestClient.log << 'xyz'
end
it "displays the log to stdout" do
RestClient.log = 'stdout'
STDOUT.should_receive(:puts).with('xyz')
RestClient.log << 'xyz'
end
it "displays the log to stderr" do
RestClient.log = 'stderr'
STDERR.should_receive(:puts).with('xyz')
RestClient.log << 'xyz'
end
it "append the log to the requested filename" do
RestClient.log = '/tmp/restclient.log'
f = double('file handle')
File.should_receive(:open).with('/tmp/restclient.log', 'a').and_yield(f)
f.should_receive(:puts).with('xyz')
RestClient.log << 'xyz'
end
end
describe 'version' do
it 'has a version ~> 1.7.0.alpha' do
ver = Gem::Version.new(RestClient.version)
Gem::Requirement.new('~> 1.7.0.alpha').should be_satisfied_by(ver)
end
end
end
| {
"pile_set_name": "Github"
} |
<!doctype html>
<html>
<head>
<title><%= title %></title>
<link rel="shortcut icon" href="/favicon.ico">
<style type="text/css">
body {
background-color: #EEEEEE;
margin: 0;
}
.iframe-wrapper {
height: 500vh;
margin: auto;
max-width: 834px;
width: 100%;
background: white;
box-shadow: 0 0 0 0.75pt #d1d1d1,0 0 3pt 0.75pt #ccc;
padding-top: 20px;
}
iframe {
margin: auto;
max-width: 794px;
width: 100%;
height: 100%;
border: none;
display: block;
}
p {
text-align: center;
padding: 15px;
margin: 0;
font-size: 12px;
font-family: 'Helvetica';
max-width: 700px;
margin: auto;
line-height: 1.4em;
}
p.warning {
font-size: 0.7em;
}
@media print {
body {
background: none;
}
p {
display: none;
}
.iframe-wrapper {
height: auto;
max-width: none;
box-shadow: none;
padding-top: 0;
width: 100%;
}
iframe {
width: 100%;
}
}
</style>
</head>
<body>
<div class="iframe-wrapper">
<iframe id="googledoc" src="/<%= hash %>/raw"></iframe>
<p>Published with <a href="http://gdoc.pub" target="_blank">The Google Doc Publisher</a></p>
<p class="warning">
Be aware that <a href="http://gdoc.pub" target="_blank">gdoc.pub</a> is <strong>not</strong> responsible for the document's content.<br/>
Something malicious? <a href="https://docs.google.com/abuse?id=<%=hash%>" target="_blank">Report abuse to Google</a> to block the access to the document.
</p>
</div>
<script type="text/javascript">
var iframe = document.getElementById('googledoc');
iframe.addEventListener('load', function(e){
document.title = iframe.contentWindow.document.title;
setTimeout(function(){
var height = iframe.contentWindow.document.body.offsetHeight+50;
document.getElementsByClassName('iframe-wrapper')[0].setAttribute('style', 'height: '+height+'px;');
}, 1000);
});
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36223212-9', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<style>
.Polaris-Heading {
font-size:1.7rem;
font-weight:600;
line-height:2.4rem;
margin:0;
}
@media (min-width: 40em) {
.Polaris-Heading {
font-size:1.6rem;
}
}
.Polaris-DisplayText {
margin:0;
}
.Polaris-DisplayText--sizeMedium {
font-size:2.1rem;
font-weight:400;
line-height:2.8rem;
}
@media (min-width: 40em) {
.Polaris-DisplayText--sizeMedium {
font-size:2.6rem;
line-height:3.2rem;
}
}
.Polaris-TextContainer > * + * {
margin-top:1.6rem;
}
</style> | {
"pile_set_name": "Github"
} |
package com.jvm.external.jvm_export;
public class Main {
public static void main(String[] args) {
System.out.printf(
"List is: %s\n",
new Dependency().createImmutableList("Hello", "World!"));
}
}
| {
"pile_set_name": "Github"
} |
function sum (a, b) {
return a + b
}
function sub (a, b) {
return a - b
}
function nestCompute () {
const a = sub(sum(1, 3), 5)
return a * 100
}
function mapSum () {
return [1, 2, 3, 4, 5].map(x => sum(x, 1)).filter(x => x > 3)
}
async function asyncSum (a, b) {
return a + b
}
function error () {
throw new Error('hello, error')
}
function reject () {
return Promise.reject('hello, reject')
}
// console.log(nestCompute())
// console.log(mapSum())
// asyncSum()
// error()
// reject().catch(e => console.log(e))
// process.on('unhandledRejection', e => console.trace(e))
// function sleep () {
// return new Promise(resolve => {
// setTimeout(resolve, 3000)
// })
// }
// async function main () {
// await sum(3, 4)
// await asyncSum(3, 4)
// console.log('hello, world')
// }
// main()
Promise.resolve(3).then(o => {
console.log(o)
})
console.log('hello, world')
| {
"pile_set_name": "Github"
} |
/*
* This file is a part of the open source stm32plus library.
* Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk>
* Please see website for licensing terms.
*/
#pragma once
namespace stm32plus
{
namespace ili9325
{
namespace HorizontalRAMPositionEndCmd
{
enum
{
Opcode = 0x51
};
}
}
}
| {
"pile_set_name": "Github"
} |
//
// Copyright 2020 Electronic Arts Inc.
//
// TiberianDawn.DLL and RedAlert.dll and corresponding source code 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.
// TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
// in the hope that it will be useful, but with permitted additional restrictions
// under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
// distributed with this program. You should have received a copy of the
// GNU General Public License along with permitted additional restrictions
// with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
/* $Header: /CounterStrike/STRAW.H 1 3/03/97 10:25a Joe_bostic $ */
/***********************************************************************************************
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
***********************************************************************************************
* *
* Project Name : Command & Conquer *
* *
* File Name : STRAW.H *
* *
* Programmer : Joe L. Bostic *
* *
* Start Date : 07/02/96 *
* *
* Last Update : July 2, 1996 [JLB] *
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef STRAW_H
#define STRAW_H
#include <stdlib.h>
/*
** The "bool" integral type was defined by the C++ committee in
** November of '94. Until the compiler supports this, use the following
** definition.
*/
#ifndef __BORLANDC__
#ifndef TRUE_FALSE_DEFINED
#define TRUE_FALSE_DEFINED
enum {false=0,true=1};
typedef int bool;
#endif
#endif
/*
** This is a demand driven data carrier. It will retrieve the byte request by passing
** the request down the chain (possibly processing on the way) in order to fulfill the
** data request. Without being derived, this class merely passes the data through. Derived
** versions are presumed to modify the data in some useful way or monitor the data
** flow.
*/
class Straw
{
public:
Straw(void) : ChainTo(0), ChainFrom(0) {}
virtual ~Straw(void);
virtual void Get_From(Straw * pipe);
void Get_From(Straw & pipe) {Get_From(&pipe);}
virtual int Get(void * buffer, int slen);
/*
** Pointer to the next pipe segment in the chain.
*/
Straw * ChainTo;
Straw * ChainFrom;
private:
/*
** Disable the copy constructor and assignment operator.
*/
Straw(Straw & rvalue);
Straw & operator = (Straw const & pipe);
};
#endif
| {
"pile_set_name": "Github"
} |
var baseSetData = require('./baseSetData'),
now = require('../date/now');
/** Used to detect when a function becomes hot. */
var HOT_COUNT = 150,
HOT_SPAN = 16;
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity function
* to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = (function() {
var count = 0,
lastCalled = 0;
return function(key, value) {
var stamp = now(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return key;
}
} else {
count = 0;
}
return baseSetData(key, value);
};
}());
module.exports = setData;
| {
"pile_set_name": "Github"
} |
/*
*
* Copyright 2015 gRPC 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.
*
*/
#ifndef GRPC_CORE_LIB_PROFILING_TIMERS_H
#define GRPC_CORE_LIB_PROFILING_TIMERS_H
#ifdef __cplusplus
extern "C" {
#endif
void gpr_timers_global_init(void);
void gpr_timers_global_destroy(void);
void gpr_timer_add_mark(const char *tagstr, int important, const char *file,
int line);
void gpr_timer_begin(const char *tagstr, int important, const char *file,
int line);
void gpr_timer_end(const char *tagstr, int important, const char *file,
int line);
void gpr_timers_set_log_filename(const char *filename);
void gpr_timer_set_enabled(int enabled);
#if !(defined(GRPC_STAP_PROFILER) + defined(GRPC_BASIC_PROFILER) + \
defined(GRPC_CUSTOM_PROFILER))
/* No profiling. No-op all the things. */
#define GPR_TIMER_MARK(tag, important) \
do { \
} while (0)
#define GPR_TIMER_BEGIN(tag, important) \
do { \
} while (0)
#define GPR_TIMER_END(tag, important) \
do { \
} while (0)
#else /* at least one profiler requested... */
/* ... hopefully only one. */
#if defined(GRPC_STAP_PROFILER) && defined(GRPC_BASIC_PROFILER)
#error "GRPC_STAP_PROFILER and GRPC_BASIC_PROFILER are mutually exclusive."
#endif
#if defined(GRPC_STAP_PROFILER) && defined(GRPC_CUSTOM_PROFILER)
#error "GRPC_STAP_PROFILER and GRPC_CUSTOM_PROFILER are mutually exclusive."
#endif
#if defined(GRPC_CUSTOM_PROFILER) && defined(GRPC_BASIC_PROFILER)
#error "GRPC_CUSTOM_PROFILER and GRPC_BASIC_PROFILER are mutually exclusive."
#endif
/* Generic profiling interface. */
#define GPR_TIMER_MARK(tag, important) \
gpr_timer_add_mark(tag, important, __FILE__, __LINE__);
#define GPR_TIMER_BEGIN(tag, important) \
gpr_timer_begin(tag, important, __FILE__, __LINE__);
#define GPR_TIMER_END(tag, important) \
gpr_timer_end(tag, important, __FILE__, __LINE__);
#ifdef GRPC_STAP_PROFILER
/* Empty placeholder for now. */
#endif /* GRPC_STAP_PROFILER */
#ifdef GRPC_BASIC_PROFILER
/* Empty placeholder for now. */
#endif /* GRPC_BASIC_PROFILER */
#endif /* at least one profiler requested. */
#ifdef __cplusplus
}
#if (defined(GRPC_STAP_PROFILER) + defined(GRPC_BASIC_PROFILER) + \
defined(GRPC_CUSTOM_PROFILER))
namespace grpc {
class ProfileScope {
public:
ProfileScope(const char *desc, bool important, const char *file, int line)
: desc_(desc) {
gpr_timer_begin(desc_, important ? 1 : 0, file, line);
}
~ProfileScope() { gpr_timer_end(desc_, 0, "n/a", 0); }
private:
const char *const desc_;
};
} // namespace grpc
#define GPR_TIMER_SCOPE(tag, important) \
::grpc::ProfileScope _profile_scope_##__LINE__((tag), (important), __FILE__, \
__LINE__)
#else
#define GPR_TIMER_SCOPE(tag, important) \
do { \
} while (false)
#endif
#endif
#endif /* GRPC_CORE_LIB_PROFILING_TIMERS_H */
| {
"pile_set_name": "Github"
} |
#include "Etterna/Globals/global.h"
#include "EmergencyShutdown.h"
#include "RageUtil/Utils/RageUtil.h"
typedef void (*Callback)();
static Callback g_pEmergencyFunc[5];
static unsigned g_iNumEmergencyFuncs = 0;
void
RegisterEmergencyShutdownCallback(void (*pFunc)())
{
ASSERT(g_iNumEmergencyFuncs + 1 < ARRAYLEN(g_pEmergencyFunc));
g_pEmergencyFunc[g_iNumEmergencyFuncs++] = pFunc;
}
void
DoEmergencyShutdown()
{
for (unsigned i = 0; i < g_iNumEmergencyFuncs; ++i)
g_pEmergencyFunc[i]();
}
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Behat Gherkin.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Behat\Gherkin\Exception;
use RuntimeException;
class ParserException extends RuntimeException implements Exception
{
}
| {
"pile_set_name": "Github"
} |
package com.sina.util.dnscache.tab;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.ImageButton;
import com.sina.util.dnscache.tab.R;
public class DNSCacheTestActivityTabMain extends FragmentActivity {
protected static final String TAG = "MainActivity";
private View currentButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initComponents();
}
private void initComponents() {
ImageButton btn_simulation_task = (ImageButton) findViewById(R.id.buttom_simulation_task);
ImageButton btn_task_setting = (ImageButton) findViewById(R.id.buttom_task_setting);
ImageButton btn_data_graph = (ImageButton) findViewById(R.id.buttom_data_graph);
ImageButton btn_cache_data = (ImageButton) findViewById(R.id.buttom_cache_data);
btn_simulation_task.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
SimulationTaskFragment fragment_one = new SimulationTaskFragment();
ft.replace(R.id.fl_content, fragment_one, DNSCacheTestActivityTabMain.TAG);
ft.commit();
setButton(v);
}
});
btn_task_setting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
TaskSettingFragment fragment_two = new TaskSettingFragment();
ft.replace(R.id.fl_content, fragment_two, DNSCacheTestActivityTabMain.TAG);
ft.commit();
setButton(v);
}
});
btn_data_graph.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
DataGraphFragment fragment_three = new DataGraphFragment();
ft.replace(R.id.fl_content, fragment_three, DNSCacheTestActivityTabMain.TAG);
ft.commit();
setButton(v);
}
});
btn_cache_data.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
DataGraphFragment fragment_three = new DataGraphFragment();
ft.replace(R.id.fl_content, fragment_three, DNSCacheTestActivityTabMain.TAG);
ft.commit();
setButton(v);
}
});
/**
* 默认第一个按钮点击
*/
btn_simulation_task.performClick();
}
/**
* 设置按钮的背景图片
*
* @param v
*/
private void setButton(View v) {
if (currentButton != null && currentButton.getId() != v.getId()) {
currentButton.setEnabled(true);
}
v.setEnabled(false);
currentButton = v;
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2018 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"bytes"
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"io"
"strings"
)
// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC
// 4122.
type UUID [16]byte
// A Version represents a UUID's version.
type Version byte
// A Variant represents a UUID's variant.
type Variant byte
// Constants returned by Variant.
const (
Invalid = Variant(iota) // Invalid UUID
RFC4122 // The variant specified in RFC4122
Reserved // Reserved, NCS backward compatibility.
Microsoft // Reserved, Microsoft Corporation backward compatibility.
Future // Reserved for future definition.
)
var rander = rand.Reader // random function
// Parse decodes s into a UUID or returns an error. Both the standard UUID
// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the
// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex
// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
func Parse(s string) (UUID, error) {
var uuid UUID
switch len(s) {
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
case 36:
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
case 36 + 9:
if strings.ToLower(s[:9]) != "urn:uuid:" {
return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
}
s = s[9:]
// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
case 36 + 2:
s = s[1:]
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
case 32:
var ok bool
for i := range uuid {
uuid[i], ok = xtob(s[i*2], s[i*2+1])
if !ok {
return uuid, errors.New("invalid UUID format")
}
}
return uuid, nil
default:
return uuid, fmt.Errorf("invalid UUID length: %d", len(s))
}
// s is now at least 36 bytes long
// it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
return uuid, errors.New("invalid UUID format")
}
for i, x := range [16]int{
0, 2, 4, 6,
9, 11,
14, 16,
19, 21,
24, 26, 28, 30, 32, 34} {
v, ok := xtob(s[x], s[x+1])
if !ok {
return uuid, errors.New("invalid UUID format")
}
uuid[i] = v
}
return uuid, nil
}
// ParseBytes is like Parse, except it parses a byte slice instead of a string.
func ParseBytes(b []byte) (UUID, error) {
var uuid UUID
switch len(b) {
case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) {
return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
}
b = b[9:]
case 36 + 2: // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
b = b[1:]
case 32: // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
var ok bool
for i := 0; i < 32; i += 2 {
uuid[i/2], ok = xtob(b[i], b[i+1])
if !ok {
return uuid, errors.New("invalid UUID format")
}
}
return uuid, nil
default:
return uuid, fmt.Errorf("invalid UUID length: %d", len(b))
}
// s is now at least 36 bytes long
// it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
if b[8] != '-' || b[13] != '-' || b[18] != '-' || b[23] != '-' {
return uuid, errors.New("invalid UUID format")
}
for i, x := range [16]int{
0, 2, 4, 6,
9, 11,
14, 16,
19, 21,
24, 26, 28, 30, 32, 34} {
v, ok := xtob(b[x], b[x+1])
if !ok {
return uuid, errors.New("invalid UUID format")
}
uuid[i] = v
}
return uuid, nil
}
// MustParse is like Parse but panics if the string cannot be parsed.
// It simplifies safe initialization of global variables holding compiled UUIDs.
func MustParse(s string) UUID {
uuid, err := Parse(s)
if err != nil {
panic(`uuid: Parse(` + s + `): ` + err.Error())
}
return uuid
}
// FromBytes creates a new UUID from a byte slice. Returns an error if the slice
// does not have a length of 16. The bytes are copied from the slice.
func FromBytes(b []byte) (uuid UUID, err error) {
err = uuid.UnmarshalBinary(b)
return uuid, err
}
// Must returns uuid if err is nil and panics otherwise.
func Must(uuid UUID, err error) UUID {
if err != nil {
panic(err)
}
return uuid
}
// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
// , or "" if uuid is invalid.
func (uuid UUID) String() string {
var buf [36]byte
encodeHex(buf[:], uuid)
return string(buf[:])
}
// URN returns the RFC 2141 URN form of uuid,
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid.
func (uuid UUID) URN() string {
var buf [36 + 9]byte
copy(buf[:], "urn:uuid:")
encodeHex(buf[9:], uuid)
return string(buf[:])
}
func encodeHex(dst []byte, uuid UUID) {
hex.Encode(dst, uuid[:4])
dst[8] = '-'
hex.Encode(dst[9:13], uuid[4:6])
dst[13] = '-'
hex.Encode(dst[14:18], uuid[6:8])
dst[18] = '-'
hex.Encode(dst[19:23], uuid[8:10])
dst[23] = '-'
hex.Encode(dst[24:], uuid[10:])
}
// Variant returns the variant encoded in uuid.
func (uuid UUID) Variant() Variant {
switch {
case (uuid[8] & 0xc0) == 0x80:
return RFC4122
case (uuid[8] & 0xe0) == 0xc0:
return Microsoft
case (uuid[8] & 0xe0) == 0xe0:
return Future
default:
return Reserved
}
}
// Version returns the version of uuid.
func (uuid UUID) Version() Version {
return Version(uuid[6] >> 4)
}
func (v Version) String() string {
if v > 15 {
return fmt.Sprintf("BAD_VERSION_%d", v)
}
return fmt.Sprintf("VERSION_%d", v)
}
func (v Variant) String() string {
switch v {
case RFC4122:
return "RFC4122"
case Reserved:
return "Reserved"
case Microsoft:
return "Microsoft"
case Future:
return "Future"
case Invalid:
return "Invalid"
}
return fmt.Sprintf("BadVariant%d", int(v))
}
// SetRand sets the random number generator to r, which implements io.Reader.
// If r.Read returns an error when the package requests random data then
// a panic will be issued.
//
// Calling SetRand with nil sets the random number generator to the default
// generator.
func SetRand(r io.Reader) {
if r == nil {
rander = rand.Reader
return
}
rander = r
}
| {
"pile_set_name": "Github"
} |
/*
* Racal-Interlan ni5010 Ethernet definitions
*
* This is an extension to the Linux operating system, and is covered by the
* same GNU General Public License that covers that work.
*
* copyrights (c) 1996 by Jan-Pascal van Best (jvbest@wi.leidenuniv.nl)
*
* I have done a look in the following sources:
* crynwr-packet-driver by Russ Nelson
*/
#define NI5010_BUFSIZE 2048 /* number of bytes in a buffer */
#define NI5010_MAGICVAL0 0x00 /* magic-values for ni5010 card */
#define NI5010_MAGICVAL1 0x55
#define NI5010_MAGICVAL2 0xAA
#define SA_ADDR0 0x02
#define SA_ADDR1 0x07
#define SA_ADDR2 0x01
/* The number of low I/O ports used by the ni5010 ethercard. */
#define NI5010_IO_EXTENT 32
#define PRINTK(x) if (NI5010_DEBUG) printk x
#define PRINTK2(x) if (NI5010_DEBUG>=2) printk x
#define PRINTK3(x) if (NI5010_DEBUG>=3) printk x
/* The various IE command registers */
#define EDLC_XSTAT (ioaddr + 0x00) /* EDLC transmit csr */
#define EDLC_XCLR (ioaddr + 0x00) /* EDLC transmit "Clear IRQ" */
#define EDLC_XMASK (ioaddr + 0x01) /* EDLC transmit "IRQ Masks" */
#define EDLC_RSTAT (ioaddr + 0x02) /* EDLC receive csr */
#define EDLC_RCLR (ioaddr + 0x02) /* EDLC receive "Clear IRQ" */
#define EDLC_RMASK (ioaddr + 0x03) /* EDLC receive "IRQ Masks" */
#define EDLC_XMODE (ioaddr + 0x04) /* EDLC transmit Mode */
#define EDLC_RMODE (ioaddr + 0x05) /* EDLC receive Mode */
#define EDLC_RESET (ioaddr + 0x06) /* EDLC RESET register */
#define EDLC_TDR1 (ioaddr + 0x07) /* "Time Domain Reflectometry" reg1 */
#define EDLC_ADDR (ioaddr + 0x08) /* EDLC station address, 6 bytes */
/* 0x0E doesn't exist for r/w */
#define EDLC_TDR2 (ioaddr + 0x0f) /* "Time Domain Reflectometry" reg2 */
#define IE_GP (ioaddr + 0x10) /* GP pointer (word register) */
/* 0x11 is 2nd byte of GP Pointer */
#define IE_RCNT (ioaddr + 0x10) /* Count of bytes in rcv'd packet */
/* 0x11 is 2nd byte of "Byte Count" */
#define IE_MMODE (ioaddr + 0x12) /* Memory Mode register */
#define IE_DMA_RST (ioaddr + 0x13) /* IE DMA Reset. write only */
#define IE_ISTAT (ioaddr + 0x13) /* IE Interrupt Status. read only */
#define IE_RBUF (ioaddr + 0x14) /* IE Receive Buffer port */
#define IE_XBUF (ioaddr + 0x15) /* IE Transmit Buffer port */
#define IE_SAPROM (ioaddr + 0x16) /* window on station addr prom */
#define IE_RESET (ioaddr + 0x17) /* any write causes Board Reset */
/* bits in EDLC_XSTAT, interrupt clear on write, status when read */
#define XS_TPOK 0x80 /* transmit packet successful */
#define XS_CS 0x40 /* carrier sense */
#define XS_RCVD 0x20 /* transmitted packet received */
#define XS_SHORT 0x10 /* transmission media is shorted */
#define XS_UFLW 0x08 /* underflow. iff failed board */
#define XS_COLL 0x04 /* collision occurred */
#define XS_16COLL 0x02 /* 16th collision occurred */
#define XS_PERR 0x01 /* parity error */
#define XS_CLR_UFLW 0x08 /* clear underflow */
#define XS_CLR_COLL 0x04 /* clear collision */
#define XS_CLR_16COLL 0x02 /* clear 16th collision */
#define XS_CLR_PERR 0x01 /* clear parity error */
/* bits in EDLC_XMASK, mask/enable transmit interrupts. register is r/w */
#define XM_TPOK 0x80 /* =1 to enable Xmt Pkt OK interrupts */
#define XM_RCVD 0x20 /* =1 to enable Xmt Pkt Rcvd ints */
#define XM_UFLW 0x08 /* =1 to enable Xmt Underflow ints */
#define XM_COLL 0x04 /* =1 to enable Xmt Collision ints */
#define XM_COLL16 0x02 /* =1 to enable Xmt 16th Coll ints */
#define XM_PERR 0x01 /* =1 to enable Xmt Parity Error ints */
/* note: always clear this bit */
#define XM_ALL (XM_TPOK | XM_RCVD | XM_UFLW | XM_COLL | XM_COLL16)
/* bits in EDLC_RSTAT, interrupt clear on write, status when read */
#define RS_PKT_OK 0x80 /* received good packet */
#define RS_RST_PKT 0x10 /* RESET packet received */
#define RS_RUNT 0x08 /* Runt Pkt rcvd. Len < 64 Bytes */
#define RS_ALIGN 0x04 /* Alignment error. not 8 bit aligned */
#define RS_CRC_ERR 0x02 /* Bad CRC on rcvd pkt */
#define RS_OFLW 0x01 /* overflow for rcv FIFO */
#define RS_VALID_BITS ( RS_PKT_OK | RS_RST_PKT | RS_RUNT | RS_ALIGN | RS_CRC_ERR | RS_OFLW )
/* all valid RSTAT bits */
#define RS_CLR_PKT_OK 0x80 /* clear rcvd packet interrupt */
#define RS_CLR_RST_PKT 0x10 /* clear RESET packet received */
#define RS_CLR_RUNT 0x08 /* clear Runt Pckt received */
#define RS_CLR_ALIGN 0x04 /* clear Alignment error */
#define RS_CLR_CRC_ERR 0x02 /* clear CRC error */
#define RS_CLR_OFLW 0x01 /* clear rcv FIFO Overflow */
/* bits in EDLC_RMASK, mask/enable receive interrupts. register is r/w */
#define RM_PKT_OK 0x80 /* =1 to enable rcvd good packet ints */
#define RM_RST_PKT 0x10 /* =1 to enable RESET packet ints */
#define RM_RUNT 0x08 /* =1 to enable Runt Pkt rcvd ints */
#define RM_ALIGN 0x04 /* =1 to enable Alignment error ints */
#define RM_CRC_ERR 0x02 /* =1 to enable Bad CRC error ints */
#define RM_OFLW 0x01 /* =1 to enable overflow error ints */
/* bits in EDLC_RMODE, set Receive Packet mode. register is r/w */
#define RMD_TEST 0x80 /* =1 for Chip testing. normally 0 */
#define RMD_ADD_SIZ 0x10 /* =1 5-byte addr match. normally 0 */
#define RMD_EN_RUNT 0x08 /* =1 enable runt rcv. normally 0 */
#define RMD_EN_RST 0x04 /* =1 to rcv RESET pkt. normally 0 */
#define RMD_PROMISC 0x03 /* receive *all* packets. unusual */
#define RMD_MULTICAST 0x02 /* receive multicasts too. unusual */
#define RMD_BROADCAST 0x01 /* receive broadcasts & normal. usual */
#define RMD_NO_PACKETS 0x00 /* don't receive any packets. unusual */
/* bits in EDLC_XMODE, set Transmit Packet mode. register is r/w */
#define XMD_COLL_CNT 0xf0 /* coll's since success. read-only */
#define XMD_IG_PAR 0x08 /* =1 to ignore parity. ALWAYS set */
#define XMD_T_MODE 0x04 /* =1 to power xcvr. ALWAYS set this */
#define XMD_LBC 0x02 /* =1 for loopbakc. normally set */
#define XMD_DIS_C 0x01 /* =1 disables contention. normally 0 */
/* bits in EDLC_RESET, write only */
#define RS_RESET 0x80 /* =1 to hold EDLC in reset state */
/* bits in IE_MMODE, write only */
#define MM_EN_DMA 0x80 /* =1 begin DMA xfer, Cplt clrs it */
#define MM_EN_RCV 0x40 /* =1 allows Pkt rcv. clr'd by rcv */
#define MM_EN_XMT 0x20 /* =1 begin Xmt pkt. Cplt clrs it */
#define MM_BUS_PAGE 0x18 /* =00 ALWAYS. Used when MUX=1 */
#define MM_NET_PAGE 0x06 /* =00 ALWAYS. Used when MUX=0 */
#define MM_MUX 0x01 /* =1 means Rcv Buff on system bus */
/* =0 means Xmt Buff on system bus */
/* bits in IE_ISTAT, read only */
#define IS_TDIAG 0x80 /* =1 if Diagnostic problem */
#define IS_EN_RCV 0x20 /* =1 until frame is rcv'd cplt */
#define IS_EN_XMT 0x10 /* =1 until frame is xmt'd cplt */
#define IS_EN_DMA 0x08 /* =1 until DMA is cplt or aborted */
#define IS_DMA_INT 0x04 /* =0 iff DMA done interrupt. */
#define IS_R_INT 0x02 /* =0 iff unmasked Rcv interrupt */
#define IS_X_INT 0x01 /* =0 iff unmasked Xmt interrupt */
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 8f693fd4dde274c95abfc5dbf96cf2b9
folderAsset: yes
timeCreated: 1426089820
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import contextlib
from oslo_config import cfg
from oslo_log import log
from oslo_messaging import exceptions as oslo_msg_exc
from oslo_utils import excutils
from oslo_versionedobjects import exception as oslo_vo_exc
from ironic.api import types as atypes
from ironic.common import exception
from ironic.common.i18n import _
from ironic.objects import allocation as allocation_objects
from ironic.objects import chassis as chassis_objects
from ironic.objects import deploy_template as deploy_template_objects
from ironic.objects import fields
from ironic.objects import node as node_objects
from ironic.objects import notification
from ironic.objects import port as port_objects
from ironic.objects import portgroup as portgroup_objects
from ironic.objects import volume_connector as volume_connector_objects
from ironic.objects import volume_target as volume_target_objects
LOG = log.getLogger(__name__)
CONF = cfg.CONF
CRUD_NOTIFY_OBJ = {
'allocation': (allocation_objects.AllocationCRUDNotification,
allocation_objects.AllocationCRUDPayload),
'chassis': (chassis_objects.ChassisCRUDNotification,
chassis_objects.ChassisCRUDPayload),
'deploytemplate': (deploy_template_objects.DeployTemplateCRUDNotification,
deploy_template_objects.DeployTemplateCRUDPayload),
'node': (node_objects.NodeCRUDNotification,
node_objects.NodeCRUDPayload),
'port': (port_objects.PortCRUDNotification,
port_objects.PortCRUDPayload),
'portgroup': (portgroup_objects.PortgroupCRUDNotification,
portgroup_objects.PortgroupCRUDPayload),
'volumeconnector':
(volume_connector_objects.VolumeConnectorCRUDNotification,
volume_connector_objects.VolumeConnectorCRUDPayload),
'volumetarget':
(volume_target_objects.VolumeTargetCRUDNotification,
volume_target_objects.VolumeTargetCRUDPayload),
}
def _emit_api_notification(context, obj, action, level, status, **kwargs):
"""Helper for emitting API notifications.
:param context: request context.
:param obj: resource rpc object.
:param action: Action string to go in the EventType.
:param level: Notification level. One of
`ironic.objects.fields.NotificationLevel.ALL`
:param status: Status to go in the EventType. One of
`ironic.objects.fields.NotificationStatus.ALL`
:param kwargs: kwargs to use when creating the notification payload.
"""
resource = obj.__class__.__name__.lower()
# value atypes.Unset can be passed from API representation of resource
extra_args = {k: (v if v != atypes.Unset else None)
for k, v in kwargs.items()}
try:
try:
if action == 'maintenance_set':
notification_method = node_objects.NodeMaintenanceNotification
payload_method = node_objects.NodePayload
elif resource not in CRUD_NOTIFY_OBJ:
notification_name = payload_name = _("is not defined")
raise KeyError(_("Unsupported resource: %s") % resource)
else:
notification_method, payload_method = CRUD_NOTIFY_OBJ[resource]
notification_name = notification_method.__name__
payload_name = payload_method.__name__
finally:
# Prepare our exception message just in case
exception_values = {"resource": resource,
"uuid": obj.uuid,
"action": action,
"status": status,
"level": level,
"notification_method": notification_name,
"payload_method": payload_name}
exception_message = (_("Failed to send baremetal.%(resource)s."
"%(action)s.%(status)s notification for "
"%(resource)s %(uuid)s with level "
"%(level)s, notification method "
"%(notification_method)s, payload method "
"%(payload_method)s, error %(error)s"))
payload = payload_method(obj, **extra_args)
if resource == 'node':
notification.mask_secrets(payload)
notification_method(
publisher=notification.NotificationPublisher(
service='ironic-api', host=CONF.host),
event_type=notification.EventType(
object=resource, action=action, status=status),
level=level,
payload=payload).emit(context)
except (exception.NotificationSchemaObjectError,
exception.NotificationSchemaKeyError,
exception.NotificationPayloadError,
oslo_msg_exc.MessageDeliveryFailure,
oslo_vo_exc.VersionedObjectsException) as e:
exception_values['error'] = e
LOG.warning(exception_message, exception_values)
except Exception as e:
exception_values['error'] = e
LOG.exception(exception_message, exception_values)
def emit_start_notification(context, obj, action, **kwargs):
"""Helper for emitting API 'start' notifications.
:param context: request context.
:param obj: resource rpc object.
:param action: Action string to go in the EventType.
:param kwargs: kwargs to use when creating the notification payload.
"""
_emit_api_notification(context, obj, action,
fields.NotificationLevel.INFO,
fields.NotificationStatus.START,
**kwargs)
@contextlib.contextmanager
def handle_error_notification(context, obj, action, **kwargs):
"""Context manager to handle any error notifications.
:param context: request context.
:param obj: resource rpc object.
:param action: Action string to go in the EventType.
:param kwargs: kwargs to use when creating the notification payload.
"""
try:
yield
except Exception:
with excutils.save_and_reraise_exception():
_emit_api_notification(context, obj, action,
fields.NotificationLevel.ERROR,
fields.NotificationStatus.ERROR,
**kwargs)
def emit_end_notification(context, obj, action, **kwargs):
"""Helper for emitting API 'end' notifications.
:param context: request context.
:param obj: resource rpc object.
:param action: Action string to go in the EventType.
:param kwargs: kwargs to use when creating the notification payload.
"""
_emit_api_notification(context, obj, action,
fields.NotificationLevel.INFO,
fields.NotificationStatus.END,
**kwargs)
| {
"pile_set_name": "Github"
} |
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
dnl Copyright (c) 2015 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OPAL_SETUP_COMPONENT_PACKAGE(1: framework_name,
# 2: component_name,
# 3: option_name,
# 4: withdir_dir_check_file,
# 5: withdir_libdir_check_file,
# 6: header,
# 7: library,
# 8: function,
# 9: extra-libraries,
# 10: [action-if-found],
# 11: [action-if-not-found])
# ------------------------------------------------
# Many components need to just check for one package, and if it's all
# good, set themselves up with appropriate CPPFLAGS, LDFLAGS, and
# LIBS. This macro templates all of that for the common case.
#
# This macro does the following:
#
# - Assumes that this component should be built by default if all
# headers and libraries can be found
# - Adds --with-<name> and --with-<name>-libdir options to configure
# - Sanity checks directory names given to the above options (i.e.,
# look for a token file in each, but only if the directory argument
# is given)
# - Assumes that if --with-<name> is supplied and we can't build the
# component, it's a fatal error.
# - Assumes that if --with-<name> is NOT supplied and we can't build
# the component, it's NOT a fatal error.
# - Run OPAL_CHECK_PACKAGE (check for the specific presence of header
# files and/or libraries) to determine if the package is available
# - Set and AC_SUBST <framework>_<component>_CPPFLAGS
# - Set and AC_SUBST <framework>_<component>_CFLAGS
# - Set and AC_SUBST <framework>_<component>_LDFLAGS
# - Set and AC_SUBST <framework>_<component>_LIBS
#
# Enjoy.
#
AC_DEFUN([OPAL_SETUP_COMPONENT_PACKAGE],[
AC_ARG_WITH([$3],
[AC_HELP_STRING([--with-$3(=DIR)],
[Build $3 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
OPAL_CHECK_WITHDIR([$3], [$with_$3], [$4])
AC_ARG_WITH([$3-libdir],
[AC_HELP_STRING([--with-$3-libdir=DIR],
[Search for the $3 libraries in DIR])])
OPAL_CHECK_WITHDIR([$3-libdir], [$with_$3_libdir], [$5])
AS_IF([test ! -z "$with_$3" && test "$with_$3" != "yes"],
[$1_$2_dir="$with_$3"])
AS_IF([test ! -z "$with_$3_libdir" && test "$with_$3_libdir" != "yes"],
[$1_$2_libdir="$with_$3_libdir"])
AS_IF([test "$with_$3" = "no"],
[$1_$2_happy="no"],
[$1_$2_happy="yes"])
AS_IF([test "$$1_$2_happy" = "yes"],
[OPAL_CHECK_PACKAGE([$1_$2],
[$6],
[$7],
[$8],
[$9],
[$$1_$2_dir],
[$$1_$2_libdir],
[$1_$2_happy="yes"],
[$1_$2_happy="no"])])
AS_IF([test "$$1_$2_happy" = "yes"],
[$10],
[$11])
# sanity check
AS_IF([test "$$1_$2_happy" = "no"],
[AS_IF([test "$with_$3" != "no" && test ! -z "$with_$3"],
[AC_MSG_WARN([$1:$2 requested but not found])
AC_MSG_ERROR([Cannot continue])])])
AC_SUBST([$1_$2_CFLAGS])
AC_SUBST([$1_$2_CPPFLAGS])
AC_SUBST([$1_$2_LDFLAGS])
AC_SUBST([$1_$2_LIBS])
])
| {
"pile_set_name": "Github"
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
namespace Microsoft.CSharp.RuntimeBinder.Semantics
{
[Flags]
internal enum EXPRFLAG
{
// These are specific to various node types.
// Order these by value. If you need a new flag, search for the first value that isn't currently valid on your expr kind.
// 0x1
EXF_BINOP = 0x1, // On** Many Non Statement Exprs!** This gets its own BIT!
// 0x2
EXF_CTOR = 0x2, // Only on EXPRMEMGRP, indicates a constructor.
EXF_NEEDSRET = 0x2, // Only on EXPRBLOCK
EXF_ASLEAVE = 0x2, // Only on EXPRGOTO, EXPRRETURN, means use leave instead of br instruction
EXF_ISFAULT = 0x2, // Only on EXPRTRY, used for fabricated try/fault (no user code)
EXF_HASHTABLESWITCH = 0x2, // Only on EXPRFlatSwitch
EXF_BOX = 0x2, // Only on EXPRCAST, indicates a boxing operation (value type -> object)
EXF_ARRAYCONST = 0x2, // Only on EXPRARRINIT, indicates that we should init using a memory block
EXF_MEMBERSET = 0x2, // Only on EXPRFIELD, indicates that the reference is for set purposes
EXF_OPENTYPE = 0x2, // Only on EXPRTYPEOF. Indicates that the type is an open type.
EXF_LABELREFERENCED = 0x2, // Only on EXPRLABEL. Indicates the label was targeted by a goto.
EXF_GENERATEDQMARK = 0x2, // only on EK_QMARK
// 0x4
EXF_INDEXER = 0x4, // Only on EXPRMEMGRP, indicates an indexer.
EXF_GOTOCASE = 0x4, // Only on EXPRGOTO, means goto case or goto default
EXF_REMOVEFINALLY = 0x4, // Only on EXPRTRY, means that the try-finally should be converted to normal code
EXF_UNBOX = 0x4, // Only on EXPRCAST, indicates a unboxing operation (object -> value type)
EXF_ARRAYALLCONST = 0x4, // Only on EXPRARRINIT, indicated that all elems are constant (must also have ARRAYCONST set)
EXF_CTORPREAMBLE = 0x4, // Only on EXPRBLOCK, indicates that the block is the preamble of a constructor - contains field inits and base ctor call
EXF_USERLABEL = 0x4, // Only on EXPRLABEL, indicates that this is a source-code label, not a compiler-generated label
// 0x8
EXF_OPERATOR = 0x8, // Only on EXPRMEMGRP, indicates an operator.
EXF_ISPOSTOP = 0x8, // Only on EXPRMULTI, indicates <x>++
EXF_FINALLYBLOCKED = 0x8, // Only on EXPRTRY, EXPRGOTO, EXPRRETURN, means that FINALLY block end is unreachable
EXF_REFCHECK = 0x8, // Only on EXPRCAST, indicates an reference checked cast is required
EXF_WRAPASTEMP = 0x8, // Only on EXPRWRAP, indicates that this wrap represents an actual local
// 0x10
EXF_LITERALCONST = 0x10, // Only on EXPRCONSTANT, means this was not a folded constant
EXF_BADGOTO = 0x10, // Only on EXPRGOTO, indicates an unrealizable goto
EXF_RETURNISYIELD = 0x10, // Only on EXPRRETURN, means this is really a yield, and flow continues
EXF_ISFINALLY = 0x10, // Only on EXPRTRY
EXF_NEWOBJCALL = 0x10, // Only on EXPRCALL and EXPRMEMGRP, to indicate new <...>(...)
EXF_INDEXEXPR = 0x10, // Only on EXPRCAST, indicates a special cast for array indexing
EXF_REPLACEWRAP = 0x10, // Only on EXPRWRAP, it means the wrap should be replaced with its expr (during rewriting)
// 0x20
EXF_UNREALIZEDGOTO = 0x20, // Only on EXPRGOTO, means target unknown
EXF_CONSTRAINED = 0x20, // Only on EXPRCALL, EXPRPROP, indicates a call through a method or prop on a type variable or value type
EXF_FORCE_BOX = 0x20, // Only on EXPRCAST, GENERICS: indicates a "forcing" boxing operation (if type parameter boxed then nop, i.e. object -> object, else value type -> object)
EXF_SIMPLENAME = 0x20, // Only on EXPRMEMGRP, We're binding a dynamic simple name.
// 0x40
EXF_ASFINALLYLEAVE = 0x40, // Only on EXPRGOTO, EXPRRETURN, means leave through a finally, ASLEAVE must also be set
EXF_BASECALL = 0x40, // Only on EXPRCALL, EXPRFNCPTR, EXPRPROP, EXPREVENT, and EXPRMEMGRP, indicates a "base.XXXX" call
EXF_FORCE_UNBOX = 0x40, // Only on EXPRCAST, GENERICS: indicates a "forcing" unboxing operation (if type parameter boxed then castclass, i.e. object -> object, else object -> value type)
EXF_ADDRNOCONV = 0x40, // Only on EXPRBINOP, with kind == EK_ADDR, indicates that a conv.u should NOT be emitted.
// 0x80
EXF_GOTONOTBLOCKED = 0x80, // Only on EXPRGOTO, means the goto is known to not pass through a finally which does not terminate
EXF_DELEGATE = 0x80, // Only on EXPRMEMGRP, indicates an implicit invocation of a delegate: d() vs d.Invoke().
EXF_STATIC_CAST = 0x80, // Only on EXPRCAST, indicates a static cast is required. We implement with stloc, ldloc to a temp of the correct type.
// 0x100
EXF_USERCALLABLE = 0x100, // Only on EXPRMEMGRP, indicates a user callable member group.
EXF_UNBOXRUNTIME = 0x100, // Only on EXPRCAST, indicates that the runtime binder should unbox this.
// 0x200
EXF_NEWSTRUCTASSG = 0x200, // Only on EXPRCALL, indicates that this is a constructor call which assigns to object
EXF_GENERATEDSTMT = 0x200, // Only on statement exprs. Indicates that the statement is compiler generated
// so we shouldn't report things like "unreachable code" on it.
// 0x400
EXF_IMPLICITSTRUCTASSG = 0x400, // Only on EXPRCALL, indicates that this an implicit struct assg call
EXF_MARKING = 0x400, // Only on statement exprs. Indicates that we're currently marking
// its children for reachability (it's up the stack).
//*** The following are usable on multiple node types.***
// 0x000800 and above
EXF_UNREACHABLEBEGIN = 0x000800, // indicates an unreachable statement
EXF_UNREACHABLEEND = 0x001000, // indicates the end of the statement is unreachable
EXF_USEORIGDEBUGINFO = 0x002000, // Only set on EXPRDEBUGNOOP, but tested generally. Indicates foreach node should not be overridden to in token
EXF_LASTBRACEDEBUGINFO = 0x004000, // indicates override tree to set debuginfo on last brace
EXF_NODEBUGINFO = 0x008000, // indicates no debug info for this statement
EXF_IMPLICITTHIS = 0x010000, // indicates a compiler provided this pointer (in the EE, when doing autoexp, this can be anything)
EXF_CANTBENULL = 0x020000, // indicate this expression can't ever be null (e.g., "this").
EXF_CHECKOVERFLOW = 0x040000, // indicates that operation should be checked for overflow
EXF_PUSH_OP_FIRST = 0x100000, // On any expr, indicates that the first operand must be placed on the stack before
// anything else - this is needed for multi-ops involving string concat.
EXF_ASSGOP = 0x200000, // On any non stmt exprs, indicates assignment node...
EXF_LVALUE = 0x400000, // On any exprs. An lvalue - whether it's legal to assign.
// THIS IS THE HIGHEST FLAG:
// Indicates that the expression came from a LocalVariableSymbol, FieldSymbol, or PropertySymbol whose type has the same name so
// it's OK to use the type instead of the element if using the element would generate an error.
EXF_SAMENAMETYPE = 0x800000,
EXF_MASK_ANY = EXF_UNREACHABLEBEGIN | EXF_UNREACHABLEEND |
EXF_USEORIGDEBUGINFO | EXF_LASTBRACEDEBUGINFO | EXF_NODEBUGINFO |
EXF_IMPLICITTHIS | EXF_CANTBENULL | EXF_CHECKOVERFLOW |
EXF_PUSH_OP_FIRST | EXF_ASSGOP | EXF_LVALUE | EXF_SAMENAMETYPE,
// Used to mask the cast flags off an EXPRCAST.
EXF_CAST_ALL = EXF_BOX | EXF_UNBOX | EXF_REFCHECK | EXF_INDEXEXPR | EXF_FORCE_BOX | EXF_FORCE_UNBOX | EXF_STATIC_CAST
}
}
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2016 PHYTEC Messtechnik GmbH
* Author: Christian Hemp <c.hemp@phytec.de>
*/
/dts-v1/;
#include "imx6ul.dtsi"
#include "imx6ul-phytec-phycore-som.dtsi"
#include "imx6ul-phytec-segin.dtsi"
#include "imx6ul-phytec-segin-peb-eval-01.dtsi"
/ {
model = "PHYTEC phyBOARD-Segin i.MX6 UltraLite Full Featured with NAND";
compatible = "phytec,imx6ul-pbacd10-nand", "phytec,imx6ul-pbacd10",
"phytec,imx6ul-pcl063", "fsl,imx6ul";
};
&adc1 {
status = "okay";
};
&can1 {
status = "okay";
};
&tlv320 {
status = "okay";
};
&ecspi3 {
status = "okay";
};
ðphy1 {
status = "okay";
};
ðphy2 {
status = "okay";
};
&fec1 {
status = "okay";
};
&fec2 {
status = "okay";
};
&gpmi {
status = "okay";
};
&i2c_rtc {
status = "okay";
};
®_can1_en {
status = "okay";
};
®_sound_1v8 {
status = "okay";
};
®_sound_3v3 {
status = "okay";
};
&sai2 {
status = "okay";
};
&sound {
status = "okay";
};
&uart5 {
status = "okay";
};
&usbotg1 {
status = "okay";
};
&usbotg2 {
status = "okay";
};
&usdhc1 {
status = "okay";
};
| {
"pile_set_name": "Github"
} |
Search results:
Solution 1:
S:String -->
""
| {
"pile_set_name": "Github"
} |
\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning}
\tikzset{
%Define standard arrow tip
>=stealth',
% Define arrow style
pil/.style={->,thick}
}
\tikzstyle{vertex}=[draw,fill=black,circle,minimum size=10pt,inner sep=0pt]
\begin{document}
\begin{tikzpicture}
\node (a)[vertex] at (0,3) {};
\node (b)[vertex] at (0,1) {};
\node (c)[vertex] at (1,0) {};
\node (d)[vertex] at (2,0) {};
\node (e)[vertex] at (3,0) {};
\node (f)[vertex] at (4,1) {};
\node (g)[vertex] at (4,3) {};
\foreach \from/\to in {b/c,c/d,d/e,e/f}
\draw[line width=2pt] (\from) -- (\to);
\path[line width=2pt] (d) edge[ out=140, in=50
, looseness=0.8, loop
, distance=2cm]
node[above=3pt] {$k$} (d);
\end{tikzpicture}
\end{document}
| {
"pile_set_name": "Github"
} |
#include <quiz.h>
#include <setjmp.h>
#include <assert.h>
QUIZ_CASE(set_jmp_long_jmp) {
jmp_buf env;
int res = setjmp(env);
if (res == 1) {
return;
}
int newres = (0 == res) ? res : res + 1;
longjmp(env, newres);
quiz_assert(false);
}
| {
"pile_set_name": "Github"
} |
SoftwareRegister.label.register=Register your Software
SoftwareRegister.label.warning=The registration process {1}. Please try again or contact the
SoftwareRegister.label.warning_cancelled=has been cancelled
SoftwareRegister.label.support=support.
SoftwareRegister.label.warning_not_complete=could not complete
SoftwareRegister.label.sign_in_regist=Sign in and register your software on the eXo Tribe
SoftwareRegister.label.about_that=Well, about that...
SoftwareRegister.label.cannot_reach=It seems we cannot reach the eXo Tribe at the moment. You can skip this step and register your software at the next start.
SoftwareRegister.label.sign_in=Sign in to the eXo Tribe
SoftwareRegister.label.continue=Continue
SoftwareRegister.label.skip=Skip
PLFRegistrationIntro.label.intro=The {1} provides support and discussions for eXo Platform users and developers. By registering your installation in the tribe, you will contribute to anonymous statistics published on the tribe website and help improving the product.
SoftwareRegisterSuccess.label.thanks=Thank you!
SoftwareRegisterSuccess.label.successfully_registered=Your software has been successfully registered!
| {
"pile_set_name": "Github"
} |
using BizHawk.Common;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
// Bonza (R)
// Bonza is some kind of gambling game requiring an outside interface of some kind
// this is not implemented
// Magic Jewelry 2 (Unl)
internal sealed class Bonza : NesBoardBase
{
private int _chrReg;
private int _prgReg;
public override bool Configure(EDetectionOrigin origin)
{
switch (Cart.BoardType)
{
case "MAPPER216":
break;
default:
return false;
}
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("chrReg", ref _chrReg);
ser.Sync("prgReg", ref _prgReg);
}
public override void WritePrg(int addr, byte value)
{
_prgReg = addr & 1;
_chrReg = (addr >> 1) & 7;
}
public override byte ReadExp(int addr)
{
if (addr == 0x1000)
{
return 0;
}
return base.ReadExp(addr);
}
public override byte ReadPrg(int addr)
{
return Rom[(_prgReg * 0x8000) + (addr & 0x7FFF)];
}
public override byte ReadPpu(int addr)
{
// Magic Jewelry has no VROM and does not write chr regs
if (addr < 0x2000 && Vrom != null)
{
return Vrom[(_chrReg * 0x2000) + (addr & 0x1FFF)];
}
return base.ReadPpu(addr);
}
}
}
| {
"pile_set_name": "Github"
} |
#ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
#define BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// boost/throw_exception.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
//
// 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)
#include <boost/config.hpp>
#ifndef BOOST_NO_EXCEPTIONS
#include <exception>
#endif
namespace boost {
namespace serialization {
#ifdef BOOST_NO_EXCEPTIONS
inline void throw_exception(std::exception const & e) {
::boost::throw_exception(e);
}
#else
template<class E> inline void throw_exception(E const & e){
throw e;
}
#endif
} // namespace serialization
} // namespace boost
#endif // #ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
<?php
namespace net\authorize\api\contract\v1\TransactionResponseType;
/**
* Class representing SecureAcceptanceAType
*/
class SecureAcceptanceAType implements \JsonSerializable
{
/**
* @property string $secureAcceptanceUrl
*/
private $secureAcceptanceUrl = null;
/**
* @property string $payerID
*/
private $payerID = null;
/**
* @property string $payerEmail
*/
private $payerEmail = null;
/**
* Gets as secureAcceptanceUrl
*
* @return string
*/
public function getSecureAcceptanceUrl()
{
return $this->secureAcceptanceUrl;
}
/**
* Sets a new secureAcceptanceUrl
*
* @param string $secureAcceptanceUrl
* @return self
*/
public function setSecureAcceptanceUrl($secureAcceptanceUrl)
{
$this->secureAcceptanceUrl = $secureAcceptanceUrl;
return $this;
}
/**
* Gets as payerID
*
* @return string
*/
public function getPayerID()
{
return $this->payerID;
}
/**
* Sets a new payerID
*
* @param string $payerID
* @return self
*/
public function setPayerID($payerID)
{
$this->payerID = $payerID;
return $this;
}
/**
* Gets as payerEmail
*
* @return string
*/
public function getPayerEmail()
{
return $this->payerEmail;
}
/**
* Sets a new payerEmail
*
* @param string $payerEmail
* @return self
*/
public function setPayerEmail($payerEmail)
{
$this->payerEmail = $payerEmail;
return $this;
}
// Json Serialize Code
public function jsonSerialize(){
$values = array_filter((array)get_object_vars($this),
function ($val){
return !is_null($val);
});
$mapper = \net\authorize\util\Mapper::Instance();
foreach($values as $key => $value){
$classDetails = $mapper->getClass(get_class() , $key);
if (isset($value)){
if ($classDetails->className === 'Date'){
$dateTime = $value->format('Y-m-d');
$values[$key] = $dateTime;
}
else if ($classDetails->className === 'DateTime'){
$dateTime = $value->format('Y-m-d\TH:i:s\Z');
$values[$key] = $dateTime;
}
if (is_array($value)){
if (!$classDetails->isInlineArray){
$subKey = $classDetails->arrayEntryname;
$subArray = [$subKey => $value];
$values[$key] = $subArray;
}
}
}
}
if (get_parent_class() == ""){
return $values;
}
else{
return array_merge(parent::jsonSerialize(), $values);
}
}
// Json Set Code
public function set($data)
{
if(is_array($data) || is_object($data)) {
$mapper = \net\authorize\util\Mapper::Instance();
foreach($data AS $key => $value) {
$classDetails = $mapper->getClass(get_class() , $key);
if($classDetails !== NULL ) {
if ($classDetails->isArray) {
if ($classDetails->isCustomDefined) {
foreach($value AS $keyChild => $valueChild) {
$type = new $classDetails->className;
$type->set($valueChild);
$this->{'addTo' . $key}($type);
}
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
foreach($value AS $keyChild => $valueChild) {
$type = new \DateTime($valueChild);
$this->{'addTo' . $key}($type);
}
}
else {
foreach($value AS $keyChild => $valueChild) {
$this->{'addTo' . $key}($valueChild);
}
}
}
else {
if ($classDetails->isCustomDefined){
$type = new $classDetails->className;
$type->set($value);
$this->{'set' . $key}($type);
}
else if ($classDetails->className === 'DateTime' || $classDetails->className === 'Date' ) {
$type = new \DateTime($value);
$this->{'set' . $key}($type);
}
else {
$this->{'set' . $key}($value);
}
}
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
{
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
/* global $, JitsiMeetJS */
const options = {
hosts: {
domain: 'jitsi-meet.example.com',
muc: 'conference.jitsi-meet.example.com' // FIXME: use XEP-0030
},
bosh: '//jitsi-meet.example.com/http-bind', // FIXME: use xep-0156 for that
// The name of client node advertised in XEP-0115 'c' stanza
clientNode: 'http://jitsi.org/jitsimeet'
};
const confOptions = {
openBridgeChannel: true
};
let connection = null;
let isJoined = false;
let room = null;
let localTracks = [];
const remoteTracks = {};
/**
* Handles local tracks.
* @param tracks Array with JitsiTrack objects
*/
function onLocalTracks(tracks) {
localTracks = tracks;
for (let i = 0; i < localTracks.length; i++) {
localTracks[i].addEventListener(
JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
audioLevel => console.log(`Audio Level local: ${audioLevel}`));
localTracks[i].addEventListener(
JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
() => console.log('local track muted'));
localTracks[i].addEventListener(
JitsiMeetJS.events.track.LOCAL_TRACK_STOPPED,
() => console.log('local track stoped'));
localTracks[i].addEventListener(
JitsiMeetJS.events.track.TRACK_AUDIO_OUTPUT_CHANGED,
deviceId =>
console.log(
`track audio output device was changed to ${deviceId}`));
if (localTracks[i].getType() === 'video') {
$('body').append(`<video autoplay='1' id='localVideo${i}' />`);
localTracks[i].attach($(`#localVideo${i}`)[0]);
} else {
$('body').append(
`<audio autoplay='1' muted='true' id='localAudio${i}' />`);
localTracks[i].attach($(`#localAudio${i}`)[0]);
}
if (isJoined) {
room.addTrack(localTracks[i]);
}
}
}
/**
* Handles remote tracks
* @param track JitsiTrack object
*/
function onRemoteTrack(track) {
if (track.isLocal()) {
return;
}
const participant = track.getParticipantId();
if (!remoteTracks[participant]) {
remoteTracks[participant] = [];
}
const idx = remoteTracks[participant].push(track);
track.addEventListener(
JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
audioLevel => console.log(`Audio Level remote: ${audioLevel}`));
track.addEventListener(
JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
() => console.log('remote track muted'));
track.addEventListener(
JitsiMeetJS.events.track.LOCAL_TRACK_STOPPED,
() => console.log('remote track stoped'));
track.addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_OUTPUT_CHANGED,
deviceId =>
console.log(
`track audio output device was changed to ${deviceId}`));
const id = participant + track.getType() + idx;
if (track.getType() === 'video') {
$('body').append(
`<video autoplay='1' id='${participant}video${idx}' />`);
} else {
$('body').append(
`<audio autoplay='1' id='${participant}audio${idx}' />`);
}
track.attach($(`#${id}`)[0]);
}
/**
* That function is executed when the conference is joined
*/
function onConferenceJoined() {
console.log('conference joined!');
isJoined = true;
for (let i = 0; i < localTracks.length; i++) {
room.addTrack(localTracks[i]);
}
}
/**
*
* @param id
*/
function onUserLeft(id) {
console.log('user left');
if (!remoteTracks[id]) {
return;
}
const tracks = remoteTracks[id];
for (let i = 0; i < tracks.length; i++) {
tracks[i].detach($(`#${id}${tracks[i].getType()}`));
}
}
/**
* That function is called when connection is established successfully
*/
function onConnectionSuccess() {
room = connection.initJitsiConference('conference', confOptions);
room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);
room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, track => {
console.log(`track removed!!!${track}`);
});
room.on(
JitsiMeetJS.events.conference.CONFERENCE_JOINED,
onConferenceJoined);
room.on(JitsiMeetJS.events.conference.USER_JOINED, id => {
console.log('user join');
remoteTracks[id] = [];
});
room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
room.on(JitsiMeetJS.events.conference.TRACK_MUTE_CHANGED, track => {
console.log(`${track.getType()} - ${track.isMuted()}`);
});
room.on(
JitsiMeetJS.events.conference.DISPLAY_NAME_CHANGED,
(userID, displayName) => console.log(`${userID} - ${displayName}`));
room.on(
JitsiMeetJS.events.conference.TRACK_AUDIO_LEVEL_CHANGED,
(userID, audioLevel) => console.log(`${userID} - ${audioLevel}`));
room.on(
JitsiMeetJS.events.conference.PHONE_NUMBER_CHANGED,
() => console.log(`${room.getPhoneNumber()} - ${room.getPhonePin()}`));
room.join();
}
/**
* This function is called when the connection fail.
*/
function onConnectionFailed() {
console.error('Connection Failed!');
}
/**
* This function is called when the connection fail.
*/
function onDeviceListChanged(devices) {
console.info('current devices', devices);
}
/**
* This function is called when we disconnect.
*/
function disconnect() {
console.log('disconnect!');
connection.removeEventListener(
JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
onConnectionSuccess);
connection.removeEventListener(
JitsiMeetJS.events.connection.CONNECTION_FAILED,
onConnectionFailed);
connection.removeEventListener(
JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
disconnect);
}
/**
*
*/
function unload() {
for (let i = 0; i < localTracks.length; i++) {
localTracks[i].dispose();
}
room.leave();
connection.disconnect();
}
let isVideo = true;
/**
*
*/
function switchVideo() { // eslint-disable-line no-unused-vars
isVideo = !isVideo;
if (localTracks[1]) {
localTracks[1].dispose();
localTracks.pop();
}
JitsiMeetJS.createLocalTracks({
devices: [ isVideo ? 'video' : 'desktop' ]
})
.then(tracks => {
localTracks.push(tracks[0]);
localTracks[1].addEventListener(
JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
() => console.log('local track muted'));
localTracks[1].addEventListener(
JitsiMeetJS.events.track.LOCAL_TRACK_STOPPED,
() => console.log('local track stoped'));
localTracks[1].attach($('#localVideo1')[0]);
room.addTrack(localTracks[1]);
})
.catch(error => console.log(error));
}
/**
*
* @param selected
*/
function changeAudioOutput(selected) { // eslint-disable-line no-unused-vars
JitsiMeetJS.mediaDevices.setAudioOutputDevice(selected.value);
}
$(window).bind('beforeunload', unload);
$(window).bind('unload', unload);
// JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
const initOptions = {
disableAudioLevels: true
};
JitsiMeetJS.init(initOptions);
connection = new JitsiMeetJS.JitsiConnection(null, null, options);
connection.addEventListener(
JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
onConnectionSuccess);
connection.addEventListener(
JitsiMeetJS.events.connection.CONNECTION_FAILED,
onConnectionFailed);
connection.addEventListener(
JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
disconnect);
JitsiMeetJS.mediaDevices.addEventListener(
JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,
onDeviceListChanged);
connection.connect();
JitsiMeetJS.createLocalTracks({ devices: [ 'audio', 'video' ] })
.then(onLocalTracks)
.catch(error => {
throw error;
});
if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
JitsiMeetJS.mediaDevices.enumerateDevices(devices => {
const audioOutputDevices
= devices.filter(d => d.kind === 'audiooutput');
if (audioOutputDevices.length > 1) {
$('#audioOutputSelect').html(
audioOutputDevices
.map(
d =>
`<option value="${d.deviceId}">${d.label}</option>`)
.join('\n'));
$('#audioOutputSelectWrapper').show();
}
});
}
| {
"pile_set_name": "Github"
} |
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,16c0,0.88 0.39,1.67 1,2.22L5,20c0,0.55 0.45,1 1,1h1c0.55,0 1,-0.45 1,-1v-1h8v1c0,0.55 0.45,1 1,1h1c0.55,0 1,-0.45 1,-1v-1.78c0.61,-0.55 1,-1.34 1,-2.22L20,6c0,-3.5 -3.58,-4 -8,-4s-8,0.5 -8,4v10zM7.5,17c-0.83,0 -1.5,-0.67 -1.5,-1.5S6.67,14 7.5,14s1.5,0.67 1.5,1.5S8.33,17 7.5,17zM16.5,17c-0.83,0 -1.5,-0.67 -1.5,-1.5s0.67,-1.5 1.5,-1.5 1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5zM18,11L6,11L6,6h12v5z"/>
</vector>
| {
"pile_set_name": "Github"
} |
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This 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 software 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 software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.ejb3.deployment.processors.annotation;
import org.jboss.as.ee.metadata.ClassAnnotationInformationFactory;
import org.jboss.ejb3.annotation.SecurityDomain;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.metadata.property.PropertyReplacer;
/**
* Processes the {@link org.jboss.ejb3.annotation.SecurityDomain} annotation on a session bean
*
* @author Stuart Douglas
*/
public class SecurityDomainAnnotationInformationFactory extends ClassAnnotationInformationFactory<SecurityDomain, String> {
protected SecurityDomainAnnotationInformationFactory() {
super(SecurityDomain.class, null);
}
@Override
protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) {
return propertyReplacer.replaceProperties(annotationInstance.value().asString());
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright Andrey Semashev 2007 - 2015.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file log/trivial.hpp
* \author Andrey Semashev
* \date 07.11.2009
*
* This header defines tools for trivial logging support
*/
#ifndef BOOST_LOG_TRIVIAL_HPP_INCLUDED_
#define BOOST_LOG_TRIVIAL_HPP_INCLUDED_
#include <iosfwd>
#include <ostream>
#include <boost/log/detail/config.hpp>
#include <boost/log/keywords/severity.hpp>
#include <boost/log/sources/severity_logger.hpp>
#include <boost/log/sources/record_ostream.hpp>
#include <boost/log/detail/header.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined(BOOST_LOG_USE_CHAR)
#error Boost.Log: Trivial logging is available for narrow-character builds only. Use advanced initialization routines to setup wide-character logging.
#endif
namespace boost {
BOOST_LOG_OPEN_NAMESPACE
namespace trivial {
//! Trivial severity levels
enum severity_level
{
trace,
debug,
info,
warning,
error,
fatal
};
//! Returns stringized enumeration value or \c NULL, if the value is not valid
BOOST_LOG_API const char* to_string(severity_level lvl);
//! Outputs stringized representation of the severity level to the stream
template< typename CharT, typename TraitsT >
inline std::basic_ostream< CharT, TraitsT >& operator<< (
std::basic_ostream< CharT, TraitsT >& strm, severity_level lvl)
{
const char* str = boost::log::trivial::to_string(lvl);
if (str)
strm << str;
else
strm << static_cast< int >(lvl);
return strm;
}
//! Reads stringized representation of the severity level from the stream
template< typename CharT, typename TraitsT >
BOOST_LOG_API std::basic_istream< CharT, TraitsT >& operator>> (
std::basic_istream< CharT, TraitsT >& strm, severity_level& lvl);
//! Trivial logger type
#if !defined(BOOST_LOG_NO_THREADS)
typedef sources::severity_logger_mt< severity_level > logger_type;
#else
typedef sources::severity_logger< severity_level > logger_type;
#endif
/*!
* \brief Trivial logger tag
*
* This tag can be used to acquire the logger that is used with lrivial logging macros.
* This may be useful when the logger is used with other macros which require a logger.
*/
struct logger
{
//! Logger type
typedef trivial::logger_type logger_type;
/*!
* Returns a reference to the trivial logger instance
*/
static BOOST_LOG_API logger_type& get();
// Implementation details - never use these
#if !defined(BOOST_LOG_DOXYGEN_PASS)
enum registration_line_t { registration_line = __LINE__ };
static const char* registration_file() { return __FILE__; }
static BOOST_LOG_API logger_type construct_logger();
#endif
};
/*!
* The macro is used to initiate logging. The \c lvl argument of the macro specifies one of the following
* severity levels: \c trace, \c debug, \c info, \c warning, \c error or \c fatal (see \c severity_level enum).
* Following the macro, there may be a streaming expression that composes the record message string. For example:
*
* \code
* BOOST_LOG_TRIVIAL(info) << "Hello, world!";
* \endcode
*/
#define BOOST_LOG_TRIVIAL(lvl)\
BOOST_LOG_STREAM_WITH_PARAMS(::boost::log::trivial::logger::get(),\
(::boost::log::keywords::severity = ::boost::log::trivial::lvl))
} // namespace trivial
BOOST_LOG_CLOSE_NAMESPACE // namespace log
} // namespace boost
#include <boost/log/detail/footer.hpp>
#if defined(BOOST_LOG_EXPRESSIONS_KEYWORD_HPP_INCLUDED_)
#include <boost/log/detail/trivial_keyword.hpp>
#endif
#endif // BOOST_LOG_TRIVIAL_HPP_INCLUDED_
| {
"pile_set_name": "Github"
} |
//
// MCError.h
// MultipeerConnectivity
//
// Copyright (c) 2013 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifndef MC_EXTERN
#ifdef __cplusplus
#define MC_EXTERN extern "C" __attribute__((visibility("default")))
#else
#define MC_EXTERN extern __attribute__((visibility("default")))
#endif
#endif
#define MC_EXTERN_CLASS __attribute__((visibility("default")))
#ifndef MC_EXTERN_WEAK
#define MC_EXTERN_WEAK MC_EXTERN __attribute__((weak_import))
#endif
MC_EXTERN_WEAK NSString *const MCErrorDomain;
typedef NS_ENUM (NSInteger, MCErrorCode) {
MCErrorUnknown = 0,
MCErrorNotConnected = 1,
MCErrorInvalidParameter = 2,
MCErrorUnsupported = 3,
MCErrorTimedOut = 4,
MCErrorCancelled = 5,
MCErrorUnavailable = 6,
} NS_ENUM_AVAILABLE (10_10, 7_0);
| {
"pile_set_name": "Github"
} |
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='strict'):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
class StreamWriter(Codec,codecs.StreamWriter):
pass
class StreamReader(Codec,codecs.StreamReader):
pass
### encodings module API
def getregentry():
return codecs.CodecInfo(
name='iso8859-10',
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
incrementaldecoder=IncrementalDecoder,
streamreader=StreamReader,
streamwriter=StreamWriter,
)
### Decoding Table
decoding_table = (
'\x00' # 0x00 -> NULL
'\x01' # 0x01 -> START OF HEADING
'\x02' # 0x02 -> START OF TEXT
'\x03' # 0x03 -> END OF TEXT
'\x04' # 0x04 -> END OF TRANSMISSION
'\x05' # 0x05 -> ENQUIRY
'\x06' # 0x06 -> ACKNOWLEDGE
'\x07' # 0x07 -> BELL
'\x08' # 0x08 -> BACKSPACE
'\t' # 0x09 -> HORIZONTAL TABULATION
'\n' # 0x0A -> LINE FEED
'\x0b' # 0x0B -> VERTICAL TABULATION
'\x0c' # 0x0C -> FORM FEED
'\r' # 0x0D -> CARRIAGE RETURN
'\x0e' # 0x0E -> SHIFT OUT
'\x0f' # 0x0F -> SHIFT IN
'\x10' # 0x10 -> DATA LINK ESCAPE
'\x11' # 0x11 -> DEVICE CONTROL ONE
'\x12' # 0x12 -> DEVICE CONTROL TWO
'\x13' # 0x13 -> DEVICE CONTROL THREE
'\x14' # 0x14 -> DEVICE CONTROL FOUR
'\x15' # 0x15 -> NEGATIVE ACKNOWLEDGE
'\x16' # 0x16 -> SYNCHRONOUS IDLE
'\x17' # 0x17 -> END OF TRANSMISSION BLOCK
'\x18' # 0x18 -> CANCEL
'\x19' # 0x19 -> END OF MEDIUM
'\x1a' # 0x1A -> SUBSTITUTE
'\x1b' # 0x1B -> ESCAPE
'\x1c' # 0x1C -> FILE SEPARATOR
'\x1d' # 0x1D -> GROUP SEPARATOR
'\x1e' # 0x1E -> RECORD SEPARATOR
'\x1f' # 0x1F -> UNIT SEPARATOR
' ' # 0x20 -> SPACE
'!' # 0x21 -> EXCLAMATION MARK
'"' # 0x22 -> QUOTATION MARK
'#' # 0x23 -> NUMBER SIGN
'$' # 0x24 -> DOLLAR SIGN
'%' # 0x25 -> PERCENT SIGN
'&' # 0x26 -> AMPERSAND
"'" # 0x27 -> APOSTROPHE
'(' # 0x28 -> LEFT PARENTHESIS
')' # 0x29 -> RIGHT PARENTHESIS
'*' # 0x2A -> ASTERISK
'+' # 0x2B -> PLUS SIGN
',' # 0x2C -> COMMA
'-' # 0x2D -> HYPHEN-MINUS
'.' # 0x2E -> FULL STOP
'/' # 0x2F -> SOLIDUS
'0' # 0x30 -> DIGIT ZERO
'1' # 0x31 -> DIGIT ONE
'2' # 0x32 -> DIGIT TWO
'3' # 0x33 -> DIGIT THREE
'4' # 0x34 -> DIGIT FOUR
'5' # 0x35 -> DIGIT FIVE
'6' # 0x36 -> DIGIT SIX
'7' # 0x37 -> DIGIT SEVEN
'8' # 0x38 -> DIGIT EIGHT
'9' # 0x39 -> DIGIT NINE
':' # 0x3A -> COLON
';' # 0x3B -> SEMICOLON
'<' # 0x3C -> LESS-THAN SIGN
'=' # 0x3D -> EQUALS SIGN
'>' # 0x3E -> GREATER-THAN SIGN
'?' # 0x3F -> QUESTION MARK
'@' # 0x40 -> COMMERCIAL AT
'A' # 0x41 -> LATIN CAPITAL LETTER A
'B' # 0x42 -> LATIN CAPITAL LETTER B
'C' # 0x43 -> LATIN CAPITAL LETTER C
'D' # 0x44 -> LATIN CAPITAL LETTER D
'E' # 0x45 -> LATIN CAPITAL LETTER E
'F' # 0x46 -> LATIN CAPITAL LETTER F
'G' # 0x47 -> LATIN CAPITAL LETTER G
'H' # 0x48 -> LATIN CAPITAL LETTER H
'I' # 0x49 -> LATIN CAPITAL LETTER I
'J' # 0x4A -> LATIN CAPITAL LETTER J
'K' # 0x4B -> LATIN CAPITAL LETTER K
'L' # 0x4C -> LATIN CAPITAL LETTER L
'M' # 0x4D -> LATIN CAPITAL LETTER M
'N' # 0x4E -> LATIN CAPITAL LETTER N
'O' # 0x4F -> LATIN CAPITAL LETTER O
'P' # 0x50 -> LATIN CAPITAL LETTER P
'Q' # 0x51 -> LATIN CAPITAL LETTER Q
'R' # 0x52 -> LATIN CAPITAL LETTER R
'S' # 0x53 -> LATIN CAPITAL LETTER S
'T' # 0x54 -> LATIN CAPITAL LETTER T
'U' # 0x55 -> LATIN CAPITAL LETTER U
'V' # 0x56 -> LATIN CAPITAL LETTER V
'W' # 0x57 -> LATIN CAPITAL LETTER W
'X' # 0x58 -> LATIN CAPITAL LETTER X
'Y' # 0x59 -> LATIN CAPITAL LETTER Y
'Z' # 0x5A -> LATIN CAPITAL LETTER Z
'[' # 0x5B -> LEFT SQUARE BRACKET
'\\' # 0x5C -> REVERSE SOLIDUS
']' # 0x5D -> RIGHT SQUARE BRACKET
'^' # 0x5E -> CIRCUMFLEX ACCENT
'_' # 0x5F -> LOW LINE
'`' # 0x60 -> GRAVE ACCENT
'a' # 0x61 -> LATIN SMALL LETTER A
'b' # 0x62 -> LATIN SMALL LETTER B
'c' # 0x63 -> LATIN SMALL LETTER C
'd' # 0x64 -> LATIN SMALL LETTER D
'e' # 0x65 -> LATIN SMALL LETTER E
'f' # 0x66 -> LATIN SMALL LETTER F
'g' # 0x67 -> LATIN SMALL LETTER G
'h' # 0x68 -> LATIN SMALL LETTER H
'i' # 0x69 -> LATIN SMALL LETTER I
'j' # 0x6A -> LATIN SMALL LETTER J
'k' # 0x6B -> LATIN SMALL LETTER K
'l' # 0x6C -> LATIN SMALL LETTER L
'm' # 0x6D -> LATIN SMALL LETTER M
'n' # 0x6E -> LATIN SMALL LETTER N
'o' # 0x6F -> LATIN SMALL LETTER O
'p' # 0x70 -> LATIN SMALL LETTER P
'q' # 0x71 -> LATIN SMALL LETTER Q
'r' # 0x72 -> LATIN SMALL LETTER R
's' # 0x73 -> LATIN SMALL LETTER S
't' # 0x74 -> LATIN SMALL LETTER T
'u' # 0x75 -> LATIN SMALL LETTER U
'v' # 0x76 -> LATIN SMALL LETTER V
'w' # 0x77 -> LATIN SMALL LETTER W
'x' # 0x78 -> LATIN SMALL LETTER X
'y' # 0x79 -> LATIN SMALL LETTER Y
'z' # 0x7A -> LATIN SMALL LETTER Z
'{' # 0x7B -> LEFT CURLY BRACKET
'|' # 0x7C -> VERTICAL LINE
'}' # 0x7D -> RIGHT CURLY BRACKET
'~' # 0x7E -> TILDE
'\x7f' # 0x7F -> DELETE
'\x80' # 0x80 -> <control>
'\x81' # 0x81 -> <control>
'\x82' # 0x82 -> <control>
'\x83' # 0x83 -> <control>
'\x84' # 0x84 -> <control>
'\x85' # 0x85 -> <control>
'\x86' # 0x86 -> <control>
'\x87' # 0x87 -> <control>
'\x88' # 0x88 -> <control>
'\x89' # 0x89 -> <control>
'\x8a' # 0x8A -> <control>
'\x8b' # 0x8B -> <control>
'\x8c' # 0x8C -> <control>
'\x8d' # 0x8D -> <control>
'\x8e' # 0x8E -> <control>
'\x8f' # 0x8F -> <control>
'\x90' # 0x90 -> <control>
'\x91' # 0x91 -> <control>
'\x92' # 0x92 -> <control>
'\x93' # 0x93 -> <control>
'\x94' # 0x94 -> <control>
'\x95' # 0x95 -> <control>
'\x96' # 0x96 -> <control>
'\x97' # 0x97 -> <control>
'\x98' # 0x98 -> <control>
'\x99' # 0x99 -> <control>
'\x9a' # 0x9A -> <control>
'\x9b' # 0x9B -> <control>
'\x9c' # 0x9C -> <control>
'\x9d' # 0x9D -> <control>
'\x9e' # 0x9E -> <control>
'\x9f' # 0x9F -> <control>
'\xa0' # 0xA0 -> NO-BREAK SPACE
'\u0104' # 0xA1 -> LATIN CAPITAL LETTER A WITH OGONEK
'\u0112' # 0xA2 -> LATIN CAPITAL LETTER E WITH MACRON
'\u0122' # 0xA3 -> LATIN CAPITAL LETTER G WITH CEDILLA
'\u012a' # 0xA4 -> LATIN CAPITAL LETTER I WITH MACRON
'\u0128' # 0xA5 -> LATIN CAPITAL LETTER I WITH TILDE
'\u0136' # 0xA6 -> LATIN CAPITAL LETTER K WITH CEDILLA
'\xa7' # 0xA7 -> SECTION SIGN
'\u013b' # 0xA8 -> LATIN CAPITAL LETTER L WITH CEDILLA
'\u0110' # 0xA9 -> LATIN CAPITAL LETTER D WITH STROKE
'\u0160' # 0xAA -> LATIN CAPITAL LETTER S WITH CARON
'\u0166' # 0xAB -> LATIN CAPITAL LETTER T WITH STROKE
'\u017d' # 0xAC -> LATIN CAPITAL LETTER Z WITH CARON
'\xad' # 0xAD -> SOFT HYPHEN
'\u016a' # 0xAE -> LATIN CAPITAL LETTER U WITH MACRON
'\u014a' # 0xAF -> LATIN CAPITAL LETTER ENG
'\xb0' # 0xB0 -> DEGREE SIGN
'\u0105' # 0xB1 -> LATIN SMALL LETTER A WITH OGONEK
'\u0113' # 0xB2 -> LATIN SMALL LETTER E WITH MACRON
'\u0123' # 0xB3 -> LATIN SMALL LETTER G WITH CEDILLA
'\u012b' # 0xB4 -> LATIN SMALL LETTER I WITH MACRON
'\u0129' # 0xB5 -> LATIN SMALL LETTER I WITH TILDE
'\u0137' # 0xB6 -> LATIN SMALL LETTER K WITH CEDILLA
'\xb7' # 0xB7 -> MIDDLE DOT
'\u013c' # 0xB8 -> LATIN SMALL LETTER L WITH CEDILLA
'\u0111' # 0xB9 -> LATIN SMALL LETTER D WITH STROKE
'\u0161' # 0xBA -> LATIN SMALL LETTER S WITH CARON
'\u0167' # 0xBB -> LATIN SMALL LETTER T WITH STROKE
'\u017e' # 0xBC -> LATIN SMALL LETTER Z WITH CARON
'\u2015' # 0xBD -> HORIZONTAL BAR
'\u016b' # 0xBE -> LATIN SMALL LETTER U WITH MACRON
'\u014b' # 0xBF -> LATIN SMALL LETTER ENG
'\u0100' # 0xC0 -> LATIN CAPITAL LETTER A WITH MACRON
'\xc1' # 0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
'\xc2' # 0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
'\xc3' # 0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
'\xc4' # 0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
'\xc5' # 0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
'\xc6' # 0xC6 -> LATIN CAPITAL LETTER AE
'\u012e' # 0xC7 -> LATIN CAPITAL LETTER I WITH OGONEK
'\u010c' # 0xC8 -> LATIN CAPITAL LETTER C WITH CARON
'\xc9' # 0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
'\u0118' # 0xCA -> LATIN CAPITAL LETTER E WITH OGONEK
'\xcb' # 0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
'\u0116' # 0xCC -> LATIN CAPITAL LETTER E WITH DOT ABOVE
'\xcd' # 0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
'\xce' # 0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
'\xcf' # 0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
'\xd0' # 0xD0 -> LATIN CAPITAL LETTER ETH (Icelandic)
'\u0145' # 0xD1 -> LATIN CAPITAL LETTER N WITH CEDILLA
'\u014c' # 0xD2 -> LATIN CAPITAL LETTER O WITH MACRON
'\xd3' # 0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
'\xd4' # 0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
'\xd5' # 0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
'\xd6' # 0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
'\u0168' # 0xD7 -> LATIN CAPITAL LETTER U WITH TILDE
'\xd8' # 0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
'\u0172' # 0xD9 -> LATIN CAPITAL LETTER U WITH OGONEK
'\xda' # 0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
'\xdb' # 0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
'\xdc' # 0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
'\xdd' # 0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
'\xde' # 0xDE -> LATIN CAPITAL LETTER THORN (Icelandic)
'\xdf' # 0xDF -> LATIN SMALL LETTER SHARP S (German)
'\u0101' # 0xE0 -> LATIN SMALL LETTER A WITH MACRON
'\xe1' # 0xE1 -> LATIN SMALL LETTER A WITH ACUTE
'\xe2' # 0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
'\xe3' # 0xE3 -> LATIN SMALL LETTER A WITH TILDE
'\xe4' # 0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
'\xe5' # 0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
'\xe6' # 0xE6 -> LATIN SMALL LETTER AE
'\u012f' # 0xE7 -> LATIN SMALL LETTER I WITH OGONEK
'\u010d' # 0xE8 -> LATIN SMALL LETTER C WITH CARON
'\xe9' # 0xE9 -> LATIN SMALL LETTER E WITH ACUTE
'\u0119' # 0xEA -> LATIN SMALL LETTER E WITH OGONEK
'\xeb' # 0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
'\u0117' # 0xEC -> LATIN SMALL LETTER E WITH DOT ABOVE
'\xed' # 0xED -> LATIN SMALL LETTER I WITH ACUTE
'\xee' # 0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
'\xef' # 0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
'\xf0' # 0xF0 -> LATIN SMALL LETTER ETH (Icelandic)
'\u0146' # 0xF1 -> LATIN SMALL LETTER N WITH CEDILLA
'\u014d' # 0xF2 -> LATIN SMALL LETTER O WITH MACRON
'\xf3' # 0xF3 -> LATIN SMALL LETTER O WITH ACUTE
'\xf4' # 0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
'\xf5' # 0xF5 -> LATIN SMALL LETTER O WITH TILDE
'\xf6' # 0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
'\u0169' # 0xF7 -> LATIN SMALL LETTER U WITH TILDE
'\xf8' # 0xF8 -> LATIN SMALL LETTER O WITH STROKE
'\u0173' # 0xF9 -> LATIN SMALL LETTER U WITH OGONEK
'\xfa' # 0xFA -> LATIN SMALL LETTER U WITH ACUTE
'\xfb' # 0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
'\xfc' # 0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
'\xfd' # 0xFD -> LATIN SMALL LETTER Y WITH ACUTE
'\xfe' # 0xFE -> LATIN SMALL LETTER THORN (Icelandic)
'\u0138' # 0xFF -> LATIN SMALL LETTER KRA
)
### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
| {
"pile_set_name": "Github"
} |
// OpenVPN 3 Linux client -- Next generation OpenVPN client
//
// Copyright (C) 2019 OpenVPN Inc <sales@openvpn.net>
// Copyright (C) 2019 David Sommerseth <davids@openvpn.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, version 3 of the
// License.
//
// 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
/**
* @file netcfg.cpp
*
* @brief Management commands for the net.openvpn.v3.netcfg service
*/
#include "dbus/core.hpp"
#include "common/cmdargparser.hpp"
#include "common/configfileparser.hpp"
#include "common/lookup.hpp"
#include "netcfg/netcfg-changeevent.hpp"
#include "netcfg/netcfg-configfile.hpp"
#include "netcfg/proxy-netcfg.hpp"
int cmd_netcfg_service(ParsedArgs::Ptr args)
{
DBus dbuscon(G_BUS_TYPE_SYSTEM);
dbuscon.Connect();
NetCfgProxy::Manager::Ptr prx;
try
{
prx = new NetCfgProxy::Manager(dbuscon.GetConnection());
}
catch(const DBusException&)
{
// If --config-file-override is present, we expect
// the user to want to do configuration changes directly
// and do not depend on a connection to the
// netcfg D-Bus service
if (!args->Present("config-file-override"))
{
std::cerr << "Could not connect to the OpenVPN 3 "
<< "Network Configuration service"
<< std::endl;
return 3;
}
}
try
{
DBusConnectionCreds creds(dbuscon.GetConnection());
args->CheckExclusiveOptions({{"unsubscribe", "list-subscribers",
"config-show", "config-set",
"config-unset"}});
if (args->Present("unsubscribe"))
{
std::string sub = args->GetValue("unsubscribe", 0);
prx->NotificationUnsubscribe(sub);
std::cout << "Unsubscribed '" << sub << "'" << std::endl;
return 0;
}
if (args->Present("list-subscribers"))
{
std::cout << "Current subsribers: " << std::endl;
for (const auto& sub : prx->NotificationSubscriberList())
{
std::cout << "- " << sub.first
<< " (PID "
<< std::to_string(creds.GetPID(sub.first)) << ")"
<< std::endl;
for (const auto& e : NetCfgChangeEvent::FilterMaskList(sub.second))
{
std::cout << " " << e << std::endl;
}
std::cout << std::endl;
}
return 0;
}
//
// Options for managing the netcfg configuration file
//
try
{
std::vector<std::string> cfgopts = {"config-show",
"config-set", "config-unset"};
std::string cfgmode = args->Present(cfgopts);
std::string config_file{};
NetCfgConfigFile config;
try
{
if (!args->Present("config-file-override"))
{
config_file = prx->GetConfigFile();
}
else
{
config_file = args->GetLastValue("config-file-override");
}
std::cout << "Loading configuration file: " << config_file
<< std::endl;
config.Load(config_file);
}
catch (const ConfigFileException& excp)
{
if ("config-show" == cfgmode)
{
std::cout << excp.what()
<< std::endl;
return 2;
}
}
// Report any issues with the configuration file, regardless
// of operation
try
{
config.CheckExclusiveOptions();
}
catch (const ExclusiveOptionError& err)
{
std::cerr << std::endl
<< "==================================="
<< "==================================="
<< std::endl;
std::cerr << "An error was found in the configuration file:"
<< std::endl;
std::cerr << " *** " << err.what() << std::endl;
std::cerr << "==================================="
<< "==================================="
<< std::endl << std::endl;
}
if ("config-show" == cfgmode)
{
if (!config.empty())
{
std::cout << config;
}
else
{
std::cout << "Configuration file is empty" << std::endl;
}
}
else if ("config-set" == cfgmode
|| "config-unset" == cfgmode)
{
std::string optname = args->GetLastValue(cfgmode);
std::vector<std::string> values = args->GetAllExtraArgs();
std::string new_value{""};
// Simple sanity to retrieve the new config value
if ("config-set" == cfgmode && values.size() == 0)
{
throw CommandException("netcfg-service",
"A value must be given to --"
+ cfgmode + " " + optname);
}
else if ("config-unset" == cfgmode && values.size() > 0)
{
throw CommandException("netcfg-service",
"No value can be given to --"
+ cfgmode + " " + optname);
}
else if (values.size() > 1)
{
throw CommandException("netcfg-service",
"Only a single value can be given to --"
+ cfgmode + " " + optname);
}
else if (values.size() == 1)
{
new_value = values.at(0);
}
// Update the configuration and save the file.
config.SetValue(optname, new_value);
try
{
config.CheckExclusiveOptions();
config.Save(config_file);
std::cout << "Configuration file updated. "
<< "Changes will be activated next time "
<< "openvpn3-service-netcfg restarts"
<< std::endl;
}
catch (const ExclusiveOptionError& err)
{
std::cerr << "Configuration NOT changed due to the "
<< "following error:" << std::endl << std::endl;
std::cerr << " *** " << err.what() << std::endl
<< std::endl;
}
}
}
catch (const OptionNotFound&)
{
// Nothing to do; options not present
}
return 0;
}
catch (const ExclusiveOptionError& excp)
{
throw CommandException("netcfg-service", excp.what());
}
catch (const DBusException& excp)
{
throw CommandException("netcfg-service", excp.what());
}
catch (const DBusProxyAccessDeniedException& excp)
{
throw CommandException("netcfg-service", excp.what());
}
}
std::string arghelper_netcfg_subscribers()
{
DBusProxy prx(G_BUS_TYPE_SYSTEM,
OpenVPN3DBus_name_netcfg,
OpenVPN3DBus_interf_netcfg,
OpenVPN3DBus_rootp_netcfg);
GVariant *l = prx.Call("NotificationSubscriberList");
GVariantIter *list = nullptr;
g_variant_get(l, "(a(su))", &list);
GVariant *sub = nullptr;
std::string res;
while ((sub = g_variant_iter_next_value(list)))
{
gchar *subscriber = nullptr;
unsigned int mask;
g_variant_get(sub, "(su)", &subscriber, &mask);
res += std::string(subscriber) + " ";
g_free(subscriber);
g_variant_unref(sub);
}
g_variant_iter_free(list);
g_variant_unref(l);
return res;
}
std::string arghelper_netcfg_config_keys()
{
NetCfgConfigFile cfg;
std::stringstream r;
for (const auto& o : cfg.GetOptions(true))
{
r << o << " ";
}
return r.str();
}
SingleCommand::Ptr prepare_command_netcfg_service()
{
SingleCommand::Ptr cmd;
cmd.reset(new SingleCommand("netcfg-service",
"Management of net.openvpn.v3.netcfg "
"(requires root)",
cmd_netcfg_service));
cmd->AddOption("config-show",
"Show the current configuration file used by netcfg-service");
cmd->AddOption("config-set", 0, "CONFIG-KEY", true,
"Sets a configuration option and saves it in the config file",
arghelper_netcfg_config_keys);
cmd->AddOption("config-unset", 0, "CONFIG-KEY", true,
"Removes a configuration option and updates the config file",
arghelper_netcfg_config_keys);
cmd->AddOption("config-file-override", 0, "CONFIG-FILE", true,
"Overrides the default configuration file (default file "
"provivded by openvpn3-service-netcfg)");
cmd->AddOption("list-subscribers",
"List all D-Bus services subscribed to "
"NetworkChange signals");
cmd->AddOption("unsubscribe", 0, "DBUS-UNIQUE-NAME", true,
"Unsubscribe a specific subscriber",
arghelper_netcfg_subscribers);
return cmd;
}
| {
"pile_set_name": "Github"
} |
//
// QSDeliciousPlugIn.m
// QSDeliciousPlugIn
//
// Created by Nicholas Jitkoff on 9/18/04.
// Copyright __MyCompanyName__ 2004. All rights reserved.
//
#import "QSDeliciousPlugIn.h"
@implementation QSDeliciousPlugIn
@end
| {
"pile_set_name": "Github"
} |
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.firebase.database.core.view;
import com.google.firebase.database.core.EventRegistration;
import java.util.List;
public class ViewAccess {
// Provides test access to event registrations on a view.
public static List<EventRegistration> getEventRegistrations(View view) {
return view.getEventRegistrations();
}
}
| {
"pile_set_name": "Github"
} |
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// 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.
syntax = "proto2";
package fuzztests;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.gostring_all) = true;
message Nil {
}
message NinRepPackedNative {
repeated double Field1 = 1 [packed = true];
repeated float Field2 = 2 [packed = true];
repeated int32 Field3 = 3 [packed = true];
repeated int64 Field4 = 4 [packed = true];
repeated uint32 Field5 = 5 [packed = true];
repeated uint64 Field6 = 6 [packed = true];
repeated sint32 Field7 = 7 [packed = true];
repeated sint64 Field8 = 8 [packed = true];
repeated fixed32 Field9 = 9 [packed = true];
repeated sfixed32 Field10 = 10 [packed = true];
repeated fixed64 Field11 = 11 [packed = true];
repeated sfixed64 Field12 = 12 [packed = true];
repeated bool Field13 = 13 [packed = true];
}
message NinOptNative {
optional double Field1 = 1;
optional float Field2 = 2;
optional int32 Field3 = 3;
optional int64 Field4 = 4;
optional uint32 Field5 = 5;
optional uint64 Field6 = 6;
optional sint32 Field7 = 7;
optional sint64 Field8 = 8;
optional fixed32 Field9 = 9;
optional sfixed32 Field10 = 10;
optional fixed64 Field11 = 11;
optional sfixed64 Field12 = 12;
optional bool Field13 = 13;
optional string Field14 = 14;
optional bytes Field15 = 15;
}
message NinOptStruct {
optional double Field1 = 1;
optional float Field2 = 2;
optional NinOptNative Field3 = 3;
optional NinOptNative Field4 = 4;
optional uint64 Field6 = 6;
optional sint32 Field7 = 7;
optional NinOptNative Field8 = 8;
optional bool Field13 = 13;
optional string Field14 = 14;
optional bytes Field15 = 15;
}
| {
"pile_set_name": "Github"
} |
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.Hosting.Contracts;
namespace Microsoft.SqlTools.DataProtocol.Contracts.Connection
{
/// <summary>
/// ConnectionChanged notification mapping entry
/// </summary>
public class ConnectionChangedNotification
{
public static readonly
EventType<ConnectionChangedParams> Type =
EventType<ConnectionChangedParams>.Create("connection/connectionchanged");
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.tensor.functions;
import com.google.common.collect.ImmutableList;
import com.yahoo.tensor.DimensionSizes;
import com.yahoo.tensor.IndexedTensor;
import com.yahoo.tensor.Tensor;
import com.yahoo.tensor.TensorType;
import com.yahoo.tensor.evaluation.EvaluationContext;
import com.yahoo.tensor.evaluation.Name;
import java.util.Arrays;
import java.util.List;
import java.util.function.DoubleBinaryOperator;
import java.util.stream.Collectors;
/**
* An optimization for tensor expressions where a join immediately follows a
* reduce. Evaluating this as one operation is significantly more efficient
* than evaluating each separately.
*
* This implementation optimizes the case where the reduce is done on the same
* dimensions as the join. A particularly efficient evaluation is done if there
* is one common dimension that is joined and reduced on, which is a common
* case as it covers vector and matrix like multiplications.
*
* @author lesters
*/
public class ReduceJoin<NAMETYPE extends Name> extends CompositeTensorFunction<NAMETYPE> {
private final TensorFunction<NAMETYPE> argumentA, argumentB;
private final DoubleBinaryOperator combinator;
private final Reduce.Aggregator aggregator;
private final List<String> dimensions;
public ReduceJoin(Reduce<NAMETYPE> reduce, Join<NAMETYPE> join) {
this(join.arguments().get(0), join.arguments().get(1), join.combinator(), reduce.aggregator(), reduce.dimensions());
}
public ReduceJoin(TensorFunction<NAMETYPE> argumentA,
TensorFunction<NAMETYPE> argumentB,
DoubleBinaryOperator combinator,
Reduce.Aggregator aggregator,
List<String> dimensions) {
this.argumentA = argumentA;
this.argumentB = argumentB;
this.combinator = combinator;
this.aggregator = aggregator;
this.dimensions = ImmutableList.copyOf(dimensions);
}
@Override
public List<TensorFunction<NAMETYPE>> arguments() {
return ImmutableList.of(argumentA, argumentB);
}
@Override
public TensorFunction<NAMETYPE> withArguments(List<TensorFunction<NAMETYPE>> arguments) {
if ( arguments.size() != 2)
throw new IllegalArgumentException("ReduceJoin must have 2 arguments, got " + arguments.size());
return new ReduceJoin<>(arguments.get(0), arguments.get(1), combinator, aggregator, dimensions);
}
@Override
public PrimitiveTensorFunction<NAMETYPE> toPrimitive() {
Join<NAMETYPE> join = new Join<>(argumentA.toPrimitive(), argumentB.toPrimitive(), combinator);
return new Reduce<>(join, aggregator, dimensions);
}
@Override
public final Tensor evaluate(EvaluationContext<NAMETYPE> context) {
Tensor a = argumentA.evaluate(context);
Tensor b = argumentB.evaluate(context);
TensorType joinedType = new TensorType.Builder(a.type(), b.type()).build();
if (canOptimize(a, b)) {
return evaluate((IndexedTensor)a, (IndexedTensor)b, joinedType);
}
return Reduce.evaluate(Join.evaluate(a, b, joinedType, combinator), dimensions, aggregator);
}
/**
* Tests whether or not the reduce is over the join dimensions. The
* remaining logic in this class assumes this to be true.
*
* If no dimensions are given, the join must be on all tensor dimensions.
*
* @return {@code true} if the implementation can optimize evaluation
* given the two tensors.
*/
public boolean canOptimize(Tensor a, Tensor b) {
if (a.type().dimensions().isEmpty() || b.type().dimensions().isEmpty()) // TODO: support scalars
return false;
if ( ! (a instanceof IndexedTensor))
return false;
if ( ! (a.type().dimensions().stream().allMatch(d -> d.type() == TensorType.Dimension.Type.indexedBound)))
return false;
if ( ! (b instanceof IndexedTensor))
return false;
if ( ! (b.type().dimensions().stream().allMatch(d -> d.type() == TensorType.Dimension.Type.indexedBound)))
return false;
TensorType commonDimensions = dimensionsInCommon((IndexedTensor)a, (IndexedTensor)b);
if (dimensions.isEmpty()) {
if (a.type().dimensions().size() != commonDimensions.dimensions().size())
return false;
if (b.type().dimensions().size() != commonDimensions.dimensions().size())
return false;
} else {
for (TensorType.Dimension dimension : commonDimensions.dimensions()) {
if (!dimensions.contains(dimension.name()))
return false;
}
}
return true;
}
/**
* Evaluates the reduce-join. Special handling for common cases where the
* reduce dimension is the innermost dimension in both tensors.
*/
private Tensor evaluate(IndexedTensor a, IndexedTensor b, TensorType joinedType) {
TensorType reducedType = Reduce.outputType(joinedType, dimensions);
if (reduceDimensionIsInnermost(a, b)) {
if (a.type().dimensions().size() == 1 && b.type().dimensions().size() == 1) {
return vectorVectorProduct(a, b, reducedType);
}
if (a.type().dimensions().size() == 1 && b.type().dimensions().size() == 2) {
return vectorMatrixProduct(a, b, reducedType, false);
}
if (a.type().dimensions().size() == 2 && b.type().dimensions().size() == 1) {
return vectorMatrixProduct(b, a, reducedType, true);
}
if (a.type().dimensions().size() == 2 && b.type().dimensions().size() == 2) {
return matrixMatrixProduct(a, b, reducedType);
}
}
return evaluateGeneral(a, b, reducedType);
}
private Tensor vectorVectorProduct(IndexedTensor a, IndexedTensor b, TensorType reducedType) {
if ( a.type().dimensions().size() != 1 || b.type().dimensions().size() != 1) {
throw new IllegalArgumentException("Wrong dimension sizes for tensors for vector-vector product");
}
IndexedTensor.BoundBuilder builder = (IndexedTensor.BoundBuilder)IndexedTensor.Builder.of(reducedType);
long commonSize = Math.min(a.dimensionSizes().size(0), b.dimensionSizes().size(0));
Reduce.ValueAggregator agg = Reduce.ValueAggregator.ofType(aggregator);
for (int ic = 0; ic < commonSize; ++ic) {
double va = a.get(ic);
double vb = b.get(ic);
agg.aggregate(combinator.applyAsDouble(va, vb));
}
builder.cellByDirectIndex(0, agg.aggregatedValue());
return builder.build();
}
private Tensor vectorMatrixProduct(IndexedTensor a, IndexedTensor b, TensorType reducedType, boolean swapped) {
if ( a.type().dimensions().size() != 1 || b.type().dimensions().size() != 2) {
throw new IllegalArgumentException("Wrong dimension sizes for tensors for vector-matrix product");
}
IndexedTensor.BoundBuilder builder = (IndexedTensor.BoundBuilder)IndexedTensor.Builder.of(reducedType);
DimensionSizes sizesA = a.dimensionSizes();
DimensionSizes sizesB = b.dimensionSizes();
Reduce.ValueAggregator agg = Reduce.ValueAggregator.ofType(aggregator);
for (int ib = 0; ib < sizesB.size(0); ++ib) {
agg.reset();
for (int ic = 0; ic < Math.min(sizesA.size(0), sizesB.size(1)); ++ic) {
double va = a.get(ic);
double vb = b.get(ib * sizesB.size(1) + ic);
double result = swapped ? combinator.applyAsDouble(vb, va) : combinator.applyAsDouble(va, vb);
agg.aggregate(result);
}
builder.cellByDirectIndex(ib, agg.aggregatedValue());
}
return builder.build();
}
private Tensor matrixMatrixProduct(IndexedTensor a, IndexedTensor b, TensorType reducedType) {
if ( a.type().dimensions().size() != 2 || b.type().dimensions().size() != 2) {
throw new IllegalArgumentException("Wrong dimension sizes for tensors for matrix-matrix product");
}
IndexedTensor.BoundBuilder builder = (IndexedTensor.BoundBuilder)IndexedTensor.Builder.of(reducedType);
DimensionSizes sizesA = a.dimensionSizes();
DimensionSizes sizesB = b.dimensionSizes();
int iaToReduced = reducedType.indexOfDimension(a.type().dimensions().get(0).name()).get();
int ibToReduced = reducedType.indexOfDimension(b.type().dimensions().get(0).name()).get();
long strideA = iaToReduced < ibToReduced ? sizesB.size(0) : 1;
long strideB = ibToReduced < iaToReduced ? sizesA.size(0) : 1;
Reduce.ValueAggregator agg = Reduce.ValueAggregator.ofType(aggregator);
for (int ia = 0; ia < sizesA.size(0); ++ia) {
for (int ib = 0; ib < sizesB.size(0); ++ib) {
agg.reset();
for (int ic = 0; ic < Math.min(sizesA.size(1), sizesB.size(1)); ++ic) {
double va = a.get(ia * sizesA.size(1) + ic);
double vb = b.get(ib * sizesB.size(1) + ic);
agg.aggregate(combinator.applyAsDouble(va, vb));
}
builder.cellByDirectIndex(ia * strideA + ib * strideB, agg.aggregatedValue());
}
}
return builder.build();
}
private Tensor evaluateGeneral(IndexedTensor a, IndexedTensor b, TensorType reducedType) {
IndexedTensor.BoundBuilder builder = (IndexedTensor.BoundBuilder)IndexedTensor.Builder.of(reducedType);
TensorType onlyInA = Reduce.outputType(a.type(), dimensions);
TensorType onlyInB = Reduce.outputType(b.type(), dimensions);
TensorType common = dimensionsInCommon(a, b);
// pre-calculate strides for each index position
long[] stridesA = strides(a.type());
long[] stridesB = strides(b.type());
long[] stridesResult = strides(reducedType);
// mapping of dimension indexes
int[] mapOnlyAToA = Join.mapIndexes(onlyInA, a.type());
int[] mapCommonToA = Join.mapIndexes(common, a.type());
int[] mapOnlyBToB = Join.mapIndexes(onlyInB, b.type());
int[] mapCommonToB = Join.mapIndexes(common, b.type());
int[] mapOnlyAToResult = Join.mapIndexes(onlyInA, reducedType);
int[] mapOnlyBToResult = Join.mapIndexes(onlyInB, reducedType);
// TODO: refactor with code in IndexedTensor and Join
MultiDimensionIterator ic = new MultiDimensionIterator(common);
Reduce.ValueAggregator agg = Reduce.ValueAggregator.ofType(aggregator);
for (MultiDimensionIterator ia = new MultiDimensionIterator(onlyInA); ia.hasNext(); ia.next()) {
for (MultiDimensionIterator ib = new MultiDimensionIterator(onlyInB); ib.hasNext(); ib.next()) {
agg.reset();
for (ic.reset(); ic.hasNext(); ic.next()) {
double va = a.get(toDirectIndex(ia, ic, stridesA, mapOnlyAToA, mapCommonToA));
double vb = b.get(toDirectIndex(ib, ic, stridesB, mapOnlyBToB, mapCommonToB));
agg.aggregate(combinator.applyAsDouble(va, vb));
}
builder.cellByDirectIndex(toDirectIndex(ia, ib, stridesResult, mapOnlyAToResult, mapOnlyBToResult),
agg.aggregatedValue());
}
}
return builder.build();
}
private long toDirectIndex(MultiDimensionIterator iter, MultiDimensionIterator common, long[] strides, int[] map, int[] commonmap) {
long directIndex = 0;
for (int i = 0; i < iter.length(); ++i) {
directIndex += strides[map[i]] * iter.iterator[i];
}
for (int i = 0; i < common.length(); ++i) {
directIndex += strides[commonmap[i]] * common.iterator[i];
}
return directIndex;
}
private long[] strides(TensorType type) {
long[] strides = new long[type.dimensions().size()];
if (strides.length > 0) {
long previous = 1;
strides[strides.length - 1] = previous;
for (int i = strides.length - 2; i >= 0; --i) {
strides[i] = previous * type.dimensions().get(i + 1).size().get();
previous = strides[i];
}
}
return strides;
}
private TensorType dimensionsInCommon(IndexedTensor a, IndexedTensor b) {
TensorType.Builder builder = new TensorType.Builder(TensorType.combinedValueType(a.type(), b.type()));
for (TensorType.Dimension aDim : a.type().dimensions()) {
for (TensorType.Dimension bDim : b.type().dimensions()) {
if (aDim.name().equals(bDim.name())) {
if ( ! aDim.size().isPresent()) {
builder.set(aDim);
} else if ( ! bDim.size().isPresent()) {
builder.set(bDim);
} else {
builder.set(aDim.size().get() < bDim.size().get() ? aDim : bDim); // minimum size of dimension
}
}
}
}
return builder.build();
}
/**
* Tests if there is exactly one reduce dimension and it is the innermost
* dimension in both tensors.
*/
private boolean reduceDimensionIsInnermost(Tensor a, Tensor b) {
List<String> reducingDimensions = dimensions;
if (reducingDimensions.isEmpty()) {
reducingDimensions = dimensionsInCommon((IndexedTensor)a, (IndexedTensor)b).dimensions().stream()
.map(TensorType.Dimension::name)
.collect(Collectors.toList());
}
if (reducingDimensions.size() != 1) {
return false;
}
String dimension = reducingDimensions.get(0);
int indexInA = a.type().indexOfDimension(dimension).orElseThrow(() ->
new IllegalArgumentException("Reduce-Join dimension '" + dimension + "' missing in tensor A."));
if (indexInA != (a.type().dimensions().size() - 1)) {
return false;
}
int indexInB = b.type().indexOfDimension(dimension).orElseThrow(() ->
new IllegalArgumentException("Reduce-Join dimension '" + dimension + "' missing in tensor B."));
if (indexInB < (b.type().dimensions().size() - 1)) {
return false;
}
return true;
}
@Override
public String toString(ToStringContext context) {
return "reduce_join(" + argumentA.toString(context) + ", " +
argumentB.toString(context) + ", " +
combinator + ", " +
aggregator +
Reduce.commaSeparated(dimensions) + ")";
}
private static class MultiDimensionIterator {
private long[] bounds;
private long[] iterator;
private int remaining;
MultiDimensionIterator(TensorType type) {
bounds = new long[type.dimensions().size()];
iterator = new long[type.dimensions().size()];
for (int i = 0; i < bounds.length; ++i) {
bounds[i] = type.dimensions().get(i).size().get();
}
reset();
}
public int length() {
return iterator.length;
}
public boolean hasNext() {
return remaining > 0;
}
public void reset() {
remaining = 1;
for (int i = iterator.length - 1; i >= 0; --i) {
iterator[i] = 0;
remaining *= bounds[i];
}
}
public void next() {
for (int i = iterator.length - 1; i >= 0; --i) {
iterator[i] += 1;
if (iterator[i] < bounds[i]) {
break;
}
iterator[i] = 0;
}
remaining -= 1;
}
public String toString() {
return Arrays.toString(iterator);
}
}
}
| {
"pile_set_name": "Github"
} |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{E7317702-64D3-4A65-8734-030F3AE3DBBC}</ProjectGuid>
<ProjectVersion>18.8</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>JWTClient.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1040</VerInfo_Locale>
<DCC_UnitSearchPath>..\..\..\sources;..\..\..\lib\delphistompclient;..\..\..\lib\loggerpro;..\..\..\lib\dmustache;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<SanitizedProjectName>JWTClient</SanitizedProjectName>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>DBXSqliteDriver;DBXDb2Driver;dxCoreRS23;vclactnband;frxe23;vclFireDAC;dxPSLnksRS23;dxPSdxLCLnkRS23;tethering;cxDataRS23;dxPSdxOCLnkRS23;dxTabbedMDIRS23;FireDACADSDriver;dxSkinBlackRS23;dxSkinLondonLiquidSkyRS23;JvPluginSystem;dxDBXServerModeRS23;dxHttpIndyRequestRS23;dxPScxGridLnkRS23;cxSchedulerRS23;FireDACMSSQLDriver;dclRBDBE1723;vcltouch;JvBands;vcldb;rbDB1723;svn;dxWizardControlRS23;dxSkinMcSkinRS23;dxPScxCommonRS23;JvJans;Intraweb;dxSkinOffice2007BlueRS23;rbIBE1723;dxBarRS23;cxSchedulerRibbonStyleEventEditorRS23;dxSkinOffice2013WhiteRS23;JvDotNetCtrls;dxPSTeeChartRS23;cxLibraryRS23;dxSkinVisualStudio2013LightRS23;vclib;cxPivotGridChartRS23;rbDBE1723;dxSkinSummer2008RS23;dxPSdxDBOCLnkRS23;dxGDIPlusRS23;dxSkinDarkSideRS23;FireDACDBXDriver;dxSkinFoggyRS23;dxSkinSevenRS23;vclx;rbCIDE1723;dxSkinOffice2010SilverRS23;dxdborRS23;RESTBackendComponents;dxLayoutControlRS23;dxPSPrVwRibbonRS23;VCLRESTComponents;dxSkinDevExpressStyleRS23;dxSkinWhiteprintRS23;vclie;bindengine;CloudService;rbRAP1723;JvHMI;FireDACMySQLDriver;dxSkinOffice2013DarkGrayRS23;DataSnapClient;dxPScxPCProdRS23;bindcompdbx;DBXSybaseASEDriver;IndyIPServer;dxSkinPumpkinRS23;IndySystem;dsnapcon;cxTreeListdxBarPopupMenuRS23;dclRBIBE1723;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;dxSkinLilianRS23;Jcl;rbADO1723;dxBarDBNavRS23;dxFlowChartRS23;dxSkinOffice2016ColorfulRS23;rbUSER1723;DBXOdbcDriver;FireDACTDataDriver;FMXTee;ipstudiowinclient;soaprtl;DbxCommonDriver;dxSpreadSheetRS23;AsyncProDR;JvManagedThreads;dxSkinOffice2007PinkRS23;dxPSdxSpreadSheetLnkRS23;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;DTKANPRPackage;dxSkinHighContrastRS23;rtl;dxSkinSevenClassicRS23;DbxClientDriver;dxSkinDevExpressDarkStyleRS23;DBXSybaseASADriver;dxNavBarRS23;dxSkinMetropolisDarkRS23;CodeSiteExpressPkg;dxSkinTheAsphaltWorldRS23;JvSystem;SampleListViewMultiDetailAppearancePackage;dxRichEditControlRS23;JvStdCtrls;JvTimeFramework;ipstudiowin;appanalytics;cxPivotGridRS23;rbUSERDesign1723;dxSkinsdxDLPainterRS23;IndyIPClient;dxRibbonRS23;dxPScxVGridLnkRS23;bindcompvcl;frxDB23;vcldbx;dxSkinOffice2007SilverRS23;dxPScxTLLnkRS23;dxMapControlRS23;TeeUI;rbDIDE1723;JvPascalInterpreter;JvDocking;VclSmp;dxPScxSchedulerLnkRS23;cxTreeListRS23;FireDACODBCDriver;JclVcl;DataSnapIndy10ServerTransport;dxRibbonCustomizationFormRS23;dxPSRichEditControlLnkRS23;dxBarExtDBItemsRS23;DataSnapProviderClient;FireDACMongoDBDriver;dxSkiniMaginaryRS23;frx23;dxSpellCheckerRS23;JvControls;dxSkinsdxBarPainterRS23;JvPrintPreview;dxSkinCoffeeRS23;DataSnapServerMidas;RESTComponents;DBXInterBaseDriver;rbRTL1723;dxADOServerModeRS23;emsclientfiredac;DataSnapFireDAC;svnui;dxmdsRS23;dxSkinLiquidSkyRS23;dxdbtrRS23;dxSkinSpringTimeRS23;dxPSDBTeeChartRS23;JvGlobus;dxSkinscxPCPainterRS23;dxPSCoreRS23;DBXMSSQLDriver;JvMM;dxSkinXmas2008BlueRS23;rbDAD1723;DatasnapConnectorsFreePascal;bindcompfmx;JvNet;DBXOracleDriver;dxSkinSilverRS23;dxSkinValentineRS23;inetdb;JvAppFrm;ipstudiowinwordxp;rbTC1723;FmxTeeUI;dxBarExtItemsRS23;FireDACIBDriver;fmx;fmxdae;DelphiCookbookListViewAppearance;dxServerModeRS23;dxPsPrVwAdvRS23;dxSkinOffice2010BlackRS23;JvWizards;cxPageControlRS23;dxSkinStardustRS23;cxSchedulerGridRS23;dbexpress;IndyCore;dxSkinSharpPlusRS23;UIBD21Win32R;JvPageComps;dsnap;DataSnapCommon;emsclient;FireDACCommon;dxSkinOffice2010BlueRS23;bdertl;JvDB;dxSkinVS2010RS23;dxSkinMetropolisRS23;DataSnapConnectors;cxVerticalGridRS23;soapserver;dxSkinCaramelRS23;frxTee23;dxTileControlRS23;JclDeveloperTools;cxGridRS23;CPortLibDXE;FireDACOracleDriver;DBXMySQLDriver;JvCmp;rbFireDAC1723;DBXFirebirdDriver;FireDACCommonDriver;rbTCUI1723;LockBoxDR;inet;IndyIPCommon;JvCustom;dxSkinDarkRoomRS23;dxDockingRS23;vcl;dxSkinOffice2007GreenRS23;dxPScxExtCommonRS23;JvXPCtrls;dxSkinsCoreRS23;FireDACDb2Driver;dxThemeRS23;dxSkinsdxRibbonPainterRS23;dxSkinVisualStudio2013BlueRS23;rbRest1723;TSG5201;dxSkinMoneyTwinsRS23;dxPSdxFCLnkRS23;dxtrmdRS23;TeeDB;FireDAC;cxSchedulerTreeBrowserRS23;JvCore;dxFireDACServerModeRS23;dxSkinBlueRS23;OverbyteIcsD10SRun;JvCrypt;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;cxEditorsRS23;dxSkinGlassOceansRS23;JvDlgs;JvRuntimeDesign;dxSkinsdxNavBarPainterRS23;dxGaugeControlRS23;ibxpress;Tee;dxSkinSharpRS23;DataSnapServer;ibxbindings;cxPivotGridOLAPRS23;rbIDE1723;vclwinx;FireDACDSDriver;dxSkinBlueprintRS23;dxSkinOffice2007BlackRS23;CustomIPTransport;vcldsnap;rbBDE1723;dxSkinOffice2013LightGrayRS23;bindcomp;DBXInformixDriver;officeXPrt;dxPSdxGaugeControlLnkRS23;dxPScxPivotGridLnkRS23;dxorgcRS23;dxPSdxDBTVLnkRS23;dclRBADO1723;vclribbon;dbxcds;KernowSoftwareFMX;adortl;dclRBFireDAC1723;dclRBE1723;dxComnRS23;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;cxExportRS23;dxSkinOffice2016DarkRS23;JclContainers;dxSkinVisualStudio2013DarkRS23;rbRCL1723;dxSkinscxSchedulerPainterRS23;rbRIDE1723;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<DCC_UsePackage>DBXSqliteDriver;DBXDb2Driver;dxCoreRS23;vclactnband;vclFireDAC;dxPSLnksRS23;dxPSdxLCLnkRS23;tethering;cxDataRS23;dxPSdxOCLnkRS23;dxTabbedMDIRS23;FireDACADSDriver;dxSkinBlackRS23;dxSkinLondonLiquidSkyRS23;dxDBXServerModeRS23;dxHttpIndyRequestRS23;dxPScxGridLnkRS23;cxSchedulerRS23;FireDACMSSQLDriver;vcltouch;vcldb;dxWizardControlRS23;dxSkinMcSkinRS23;dxPScxCommonRS23;Intraweb;dxSkinOffice2007BlueRS23;dxBarRS23;cxSchedulerRibbonStyleEventEditorRS23;dxSkinOffice2013WhiteRS23;dxPSTeeChartRS23;cxLibraryRS23;dxSkinVisualStudio2013LightRS23;vclib;cxPivotGridChartRS23;dxSkinSummer2008RS23;dxPSdxDBOCLnkRS23;dxGDIPlusRS23;dxSkinDarkSideRS23;FireDACDBXDriver;dxSkinFoggyRS23;dxSkinSevenRS23;vclx;dxSkinOffice2010SilverRS23;dxdborRS23;RESTBackendComponents;dxLayoutControlRS23;dxPSPrVwRibbonRS23;VCLRESTComponents;dxSkinDevExpressStyleRS23;dxSkinWhiteprintRS23;vclie;bindengine;CloudService;FireDACMySQLDriver;dxSkinOffice2013DarkGrayRS23;DataSnapClient;dxPScxPCProdRS23;bindcompdbx;DBXSybaseASEDriver;IndyIPServer;dxSkinPumpkinRS23;IndySystem;dsnapcon;cxTreeListdxBarPopupMenuRS23;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;dxSkinLilianRS23;dxBarDBNavRS23;dxFlowChartRS23;dxSkinOffice2016ColorfulRS23;DBXOdbcDriver;FireDACTDataDriver;FMXTee;ipstudiowinclient;soaprtl;DbxCommonDriver;dxSpreadSheetRS23;AsyncProDR;dxSkinOffice2007PinkRS23;dxPSdxSpreadSheetLnkRS23;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;dxSkinHighContrastRS23;rtl;dxSkinSevenClassicRS23;DbxClientDriver;dxSkinDevExpressDarkStyleRS23;DBXSybaseASADriver;dxNavBarRS23;dxSkinMetropolisDarkRS23;dxSkinTheAsphaltWorldRS23;dxRichEditControlRS23;ipstudiowin;appanalytics;cxPivotGridRS23;dxSkinsdxDLPainterRS23;IndyIPClient;dxRibbonRS23;dxPScxVGridLnkRS23;bindcompvcl;dxSkinOffice2007SilverRS23;dxPScxTLLnkRS23;dxMapControlRS23;TeeUI;VclSmp;dxPScxSchedulerLnkRS23;cxTreeListRS23;FireDACODBCDriver;DataSnapIndy10ServerTransport;dxRibbonCustomizationFormRS23;dxPSRichEditControlLnkRS23;dxBarExtDBItemsRS23;DataSnapProviderClient;FireDACMongoDBDriver;dxSkiniMaginaryRS23;dxSpellCheckerRS23;dxSkinsdxBarPainterRS23;dxSkinCoffeeRS23;DataSnapServerMidas;RESTComponents;DBXInterBaseDriver;dxADOServerModeRS23;emsclientfiredac;DataSnapFireDAC;dxmdsRS23;dxSkinLiquidSkyRS23;dxdbtrRS23;dxSkinSpringTimeRS23;dxPSDBTeeChartRS23;dxSkinscxPCPainterRS23;dxPSCoreRS23;DBXMSSQLDriver;dxSkinXmas2008BlueRS23;DatasnapConnectorsFreePascal;bindcompfmx;DBXOracleDriver;dxSkinSilverRS23;dxSkinValentineRS23;inetdb;FmxTeeUI;dxBarExtItemsRS23;FireDACIBDriver;fmx;fmxdae;dxServerModeRS23;dxPsPrVwAdvRS23;dxSkinOffice2010BlackRS23;cxPageControlRS23;dxSkinStardustRS23;cxSchedulerGridRS23;dbexpress;IndyCore;dxSkinSharpPlusRS23;dsnap;DataSnapCommon;emsclient;FireDACCommon;dxSkinOffice2010BlueRS23;dxSkinVS2010RS23;dxSkinMetropolisRS23;DataSnapConnectors;cxVerticalGridRS23;soapserver;dxSkinCaramelRS23;dxTileControlRS23;cxGridRS23;FireDACOracleDriver;DBXMySQLDriver;DBXFirebirdDriver;FireDACCommonDriver;LockBoxDR;inet;IndyIPCommon;dxSkinDarkRoomRS23;dxDockingRS23;vcl;dxSkinOffice2007GreenRS23;dxPScxExtCommonRS23;dxSkinsCoreRS23;FireDACDb2Driver;dxThemeRS23;dxSkinsdxRibbonPainterRS23;dxSkinVisualStudio2013BlueRS23;dxSkinMoneyTwinsRS23;dxPSdxFCLnkRS23;dxtrmdRS23;TeeDB;FireDAC;cxSchedulerTreeBrowserRS23;dxFireDACServerModeRS23;dxSkinBlueRS23;OverbyteIcsD10SRun;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;cxEditorsRS23;dxSkinGlassOceansRS23;dxSkinsdxNavBarPainterRS23;dxGaugeControlRS23;ibxpress;Tee;dxSkinSharpRS23;DataSnapServer;ibxbindings;cxPivotGridOLAPRS23;vclwinx;FireDACDSDriver;dxSkinBlueprintRS23;dxSkinOffice2007BlackRS23;CustomIPTransport;vcldsnap;dxSkinOffice2013LightGrayRS23;bindcomp;DBXInformixDriver;officeXPrt;dxPSdxGaugeControlLnkRS23;dxPScxPivotGridLnkRS23;dxorgcRS23;dxPSdxDBTVLnkRS23;vclribbon;dbxcds;adortl;dxComnRS23;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;cxExportRS23;dxSkinOffice2016DarkRS23;dxSkinVisualStudio2013DarkRS23;dxSkinscxSchedulerPainterRS23;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<BT_BuildType>Debug</BT_BuildType>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="MainClientFormU.pas">
<Form>Form5</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType>Application</Borland.ProjectType>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">JWTClient.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k240.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp240.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k240.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp240.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="Win32\Debug\JWTClient.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>JWTClient.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeX86File"/>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1024">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1024x768">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1536">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1536x2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1668">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1668x2388">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048x1536">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048x2732">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2224">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2388x1668">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2732x2048">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch768">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch768x1024">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1125">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1136x640">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1242">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1242x2688">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1334">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch1792">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2208">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2436">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2688x1242">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch320">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch640">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch640x1136">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch750">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch828">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceResourceRules">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements">
<Platform Name="iOSDevice32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSInfoPList">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug">
<Platform Name="OSX64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>
| {
"pile_set_name": "Github"
} |
// Copyright 2009 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.
Contents:
+ SoyToJsSrcCompiler.jar
Executable jar that compiles template files into JavaScript files.
+ soyutils.js
Helper utilities required by all JavaScript code that SoyToJsSrcCompiler
generates. Equivalent functionality to soyutils_usegoog.js, but this
version does not need Closure Library.
+ soyutils_usegoog.js
Helper utilities required by all JavaScript code that SoyToJsSrcCompiler
generates. Equivalent functionality to soyutils.js, but this version
assumes Closure Library is present.
Instructions:
+ A simple Hello World for JavaScript:
http://code.google.com/closure/templates/docs/helloworld_js.html
+ Complete documentation:
http://code.google.com/closure/templates/
+ Closure Templates project on Google Code:
http://code.google.com/p/closure-templates/
Notes:
+ Closure Templates requires Java 6 or higher:
http://www.java.com/
| {
"pile_set_name": "Github"
} |
package net.minecraft.server;
public interface NPC extends IAnimal {}
| {
"pile_set_name": "Github"
} |
---
type: sharded
default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet
default_version: 2.0
mongoc:
- name: config1
mongos:
- name: router1
shards:
- name: sh1
type: single
mongod:
- name: db1
# vim: ts=4 sts=4 sw=4 et:
| {
"pile_set_name": "Github"
} |
// Copyright 2008 the V8 project authors. 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 Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var threw = false;
try {
var obj = new (Function.__proto__)();
} catch (e) {
assertInstanceof(e, TypeError);
threw = true;
}
assertTrue(threw);
| {
"pile_set_name": "Github"
} |
/* $Id: sha512str.cpp $ */
/** @file
* IPRT - SHA-512 string functions.
*/
/*
* Copyright (C) 2009 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
#include <iprt/assert.h>
#include <iprt/err.h>
#include <iprt/string.h>
RTDECL(int) RTSha512ToString(uint8_t const pabDigest[RTSHA512_HASH_SIZE], char *pszDigest, size_t cchDigest)
{
return RTStrPrintHexBytes(pszDigest, cchDigest, &pabDigest[0], RTSHA512_HASH_SIZE, 0 /*fFlags*/);
}
RTDECL(int) RTSha512FromString(char const *pszDigest, uint8_t pabDigest[RTSHA512_HASH_SIZE])
{
return RTStrConvertHexBytes(RTStrStripL(pszDigest), &pabDigest[0], RTSHA512_HASH_SIZE, 0 /*fFlags*/);
}
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2001-2004
// Copyright Peter Dimov 2001-2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/placeholders.hpp" header
// -- DO NOT modify by hand!
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg< -1 > _;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_)
namespace placeholders {
using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_;
}
}}
/// agurt, 17/mar/02: one more placeholder for the last 'apply#'
/// specialization
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<1> _1;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_1)
namespace placeholders {
using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_1;
}
}}
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<2> _2;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_2)
namespace placeholders {
using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_2;
}
}}
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<3> _3;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_3)
namespace placeholders {
using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_3;
}
}}
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<4> _4;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_4)
namespace placeholders {
using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_4;
}
}}
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<5> _5;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_5)
namespace placeholders {
using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_5;
}
}}
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<6> _6;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_6)
namespace placeholders {
using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_6;
}
}}
| {
"pile_set_name": "Github"
} |
"""Tests for distutils.command.bdist_wininst."""
import unittest
from test.test_support import run_unittest
from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support
class BuildWinInstTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
def test_get_exe_bytes(self):
# issue5731: command was broken on non-windows platforms
# this test makes sure it works now for every platform
# let's create a command
pkg_pth, dist = self.create_dist()
cmd = bdist_wininst(dist)
cmd.ensure_finalized()
# let's run the code that finds the right wininst*.exe file
# and make sure it finds it and returns its content
# no matter what platform we have
exe_file = cmd.get_exe_bytes()
self.assertGreater(len(exe_file), 10)
def test_suite():
return unittest.makeSuite(BuildWinInstTestCase)
if __name__ == '__main__':
run_unittest(test_suite())
| {
"pile_set_name": "Github"
} |
/*
* Copyright © 2014 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 _INTEL_LRC_H_
#define _INTEL_LRC_H_
#include <linux/types.h>
struct drm_printer;
struct drm_i915_private;
struct i915_gem_context;
struct i915_request;
struct intel_context;
struct intel_engine_cs;
/* Execlists regs */
#define RING_ELSP(base) _MMIO((base) + 0x230)
#define RING_EXECLIST_STATUS_LO(base) _MMIO((base) + 0x234)
#define RING_EXECLIST_STATUS_HI(base) _MMIO((base) + 0x234 + 4)
#define RING_CONTEXT_CONTROL(base) _MMIO((base) + 0x244)
#define CTX_CTRL_INHIBIT_SYN_CTX_SWITCH (1 << 3)
#define CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT (1 << 0)
#define CTX_CTRL_RS_CTX_ENABLE (1 << 1)
#define CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT (1 << 2)
#define GEN12_CTX_CTRL_OAR_CONTEXT_ENABLE (1 << 8)
#define RING_CONTEXT_STATUS_PTR(base) _MMIO((base) + 0x3a0)
#define RING_EXECLIST_SQ_CONTENTS(base) _MMIO((base) + 0x510)
#define RING_EXECLIST_CONTROL(base) _MMIO((base) + 0x550)
#define EL_CTRL_LOAD (1 << 0)
/* The docs specify that the write pointer wraps around after 5h, "After status
* is written out to the last available status QW at offset 5h, this pointer
* wraps to 0."
*
* Therefore, one must infer than even though there are 3 bits available, 6 and
* 7 appear to be * reserved.
*/
#define GEN8_CSB_ENTRIES 6
#define GEN8_CSB_PTR_MASK 0x7
#define GEN8_CSB_READ_PTR_MASK (GEN8_CSB_PTR_MASK << 8)
#define GEN8_CSB_WRITE_PTR_MASK (GEN8_CSB_PTR_MASK << 0)
#define GEN11_CSB_ENTRIES 12
#define GEN11_CSB_PTR_MASK 0xf
#define GEN11_CSB_READ_PTR_MASK (GEN11_CSB_PTR_MASK << 8)
#define GEN11_CSB_WRITE_PTR_MASK (GEN11_CSB_PTR_MASK << 0)
#define MAX_CONTEXT_HW_ID (1<<21) /* exclusive */
#define MAX_GUC_CONTEXT_HW_ID (1 << 20) /* exclusive */
#define GEN11_MAX_CONTEXT_HW_ID (1<<11) /* exclusive */
/* in Gen12 ID 0x7FF is reserved to indicate idle */
#define GEN12_MAX_CONTEXT_HW_ID (GEN11_MAX_CONTEXT_HW_ID - 1)
enum {
INTEL_CONTEXT_SCHEDULE_IN = 0,
INTEL_CONTEXT_SCHEDULE_OUT,
INTEL_CONTEXT_SCHEDULE_PREEMPTED,
};
/* Logical Rings */
void intel_logical_ring_cleanup(struct intel_engine_cs *engine);
int intel_execlists_submission_setup(struct intel_engine_cs *engine);
/* Logical Ring Contexts */
/* At the start of the context image is its per-process HWS page */
#define LRC_PPHWSP_PN (0)
#define LRC_PPHWSP_SZ (1)
/* After the PPHWSP we have the logical state for the context */
#define LRC_STATE_PN (LRC_PPHWSP_PN + LRC_PPHWSP_SZ)
#define LRC_STATE_OFFSET (LRC_STATE_PN * PAGE_SIZE)
/* Space within PPHWSP reserved to be used as scratch */
#define LRC_PPHWSP_SCRATCH 0x34
#define LRC_PPHWSP_SCRATCH_ADDR (LRC_PPHWSP_SCRATCH * sizeof(u32))
void intel_execlists_set_default_submission(struct intel_engine_cs *engine);
void intel_lr_context_reset(struct intel_engine_cs *engine,
struct intel_context *ce,
u32 head,
bool scrub);
void intel_execlists_show_requests(struct intel_engine_cs *engine,
struct drm_printer *m,
void (*show_request)(struct drm_printer *m,
struct i915_request *rq,
const char *prefix),
unsigned int max);
struct intel_context *
intel_execlists_create_virtual(struct intel_engine_cs **siblings,
unsigned int count);
struct intel_context *
intel_execlists_clone_virtual(struct intel_engine_cs *src);
int intel_virtual_engine_attach_bond(struct intel_engine_cs *engine,
const struct intel_engine_cs *master,
const struct intel_engine_cs *sibling);
struct intel_engine_cs *
intel_virtual_engine_get_sibling(struct intel_engine_cs *engine,
unsigned int sibling);
bool
intel_engine_in_execlists_submission_mode(const struct intel_engine_cs *engine);
#endif /* _INTEL_LRC_H_ */
| {
"pile_set_name": "Github"
} |
product tool
use v68k
use tap-out
| {
"pile_set_name": "Github"
} |
from threading import Thread
from webhooks.webhooks import (
call_environment_webhooks,
WebhookEventType,
call_organisation_webhooks,
)
date_format = "%Y-%m-%dT%H:%M:%S.%fZ"
def trigger_feature_state_change_webhooks(instance):
history_instance = instance.history.first()
timestamp = (
history_instance.history_date.strftime(date_format)
if history_instance and history_instance.history_date
else ""
)
changed_by = (
str(history_instance.history_user)
if history_instance and history_instance.history_user
else ""
)
data = {
"new_state": _get_feature_state_webhook_data(instance),
"changed_by": changed_by,
"timestamp": timestamp,
}
if history_instance.prev_record:
data["previous_state"] = _get_feature_state_webhook_data(
history_instance.prev_record.instance, previous=True
)
Thread(
target=call_environment_webhooks,
args=(instance.environment, data, WebhookEventType.FLAG_UPDATED),
).start()
Thread(
target=call_organisation_webhooks,
args=(
instance.environment.project.organisation,
data,
WebhookEventType.FLAG_UPDATED,
),
).start()
def _get_feature_state_webhook_data(feature_state, previous=False):
# TODO: fix circular imports and use serializers instead.
feature = feature_state.feature
feature_state_value = (
feature_state.get_feature_state_value()
if not previous
else feature_state.previous_feature_state_value
)
identity_identifier = (
feature_state.identity.identifier if feature_state.identity else None
)
data = {
"feature": {
"id": feature.id,
"created_date": feature.created_date.strftime(date_format),
"default_enabled": feature.default_enabled,
"description": feature.description,
"initial_value": feature.initial_value,
"name": feature.name,
"project": {
"id": feature.project_id,
"name": feature.project.name,
},
"type": feature.type,
},
"environment": {
"id": feature_state.environment_id,
"name": feature_state.environment.name,
},
"identity": feature_state.identity_id,
"identity_identifier": identity_identifier,
"feature_segment": None, # default to none, will be updated below if it exists
"enabled": feature_state.enabled,
"feature_state_value": feature_state_value,
}
if feature_state.feature_segment:
feature_segment = feature_state.feature_segment
data["feature_segment"] = {
"segment": {
"id": feature_segment.segment.id,
"name": feature_segment.segment.name,
"description": feature_segment.segment.description,
},
"priority": feature_segment.priority,
"enabled": feature_segment.enabled,
"value": feature_segment.get_value(),
}
return data
| {
"pile_set_name": "Github"
} |
/* run widgets in their own function scope so they don't interfere with
currently-running apps */
(() => {
function draw() {
g.reset(); // reset the graphics context to defaults (color/font/etc)
// add your code
g.drawString("X", this.x, this.y);
}
// add your widget
WIDGETS["mywidget"]={
area:"tl", // tl (top left), tr (top right), bl (bottom left), br (bottom right)
width: 28, // how wide is the widget? You can change this and call Bangle.drawWidgets() to re-layout
draw:draw // called to draw the widget
};
})()
| {
"pile_set_name": "Github"
} |
{
"pages": [
"pages/index/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"sitemapLocation": "sitemap.json"
} | {
"pile_set_name": "Github"
} |
from .application_config import ApplicationConfig
| {
"pile_set_name": "Github"
} |
#include "Geometry/HGCalCommonData/interface/HGCalGeomParameters.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "DataFormats/Math/interface/GeantUnits.h"
#include "DataFormats/Math/interface/Point3D.h"
#include "DetectorDescription/Core/interface/DDConstant.h"
#include "DetectorDescription/Core/interface/DDFilter.h"
#include "DetectorDescription/Core/interface/DDFilteredView.h"
#include "DetectorDescription/Core/interface/DDSolid.h"
#include "DetectorDescription/Core/interface/DDValue.h"
#include "DetectorDescription/Core/interface/DDutils.h"
#include "DetectorDescription/DDCMS/interface/DDShapes.h"
#include "DetectorDescription/RegressionTest/interface/DDErrorDetection.h"
#include "Geometry/HGCalCommonData/interface/HGCalTypes.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferMask.h"
#include "Geometry/HGCalCommonData/interface/HGCalWaferType.h"
#include <algorithm>
#include <unordered_set>
//#define EDM_ML_DEBUG
using namespace geant_units::operators;
const double tolerance = 0.001;
const double tolmin = 1.e-20;
HGCalGeomParameters::HGCalGeomParameters() : sqrt3_(std::sqrt(3.0)) {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters::HGCalGeomParameters "
<< "constructor";
#endif
}
HGCalGeomParameters::~HGCalGeomParameters() {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters::destructed!!!";
#endif
}
void HGCalGeomParameters::loadGeometryHexagon(const DDFilteredView& _fv,
HGCalParameters& php,
const std::string& sdTag1,
const DDCompactView* cpv,
const std::string& sdTag2,
const std::string& sdTag3,
HGCalGeometryMode::WaferMode mode) {
DDFilteredView fv = _fv;
bool dodet(true);
std::map<int, HGCalGeomParameters::layerParameters> layers;
std::vector<HGCalParameters::hgtrform> trforms;
std::vector<bool> trformUse;
while (dodet) {
const DDSolid& sol = fv.logicalPart().solid();
// Layers first
std::vector<int> copy = fv.copyNumbers();
int nsiz = (int)(copy.size());
int lay = (nsiz > 0) ? copy[nsiz - 1] : 0;
int zp = (nsiz > 2) ? copy[nsiz - 3] : -1;
if (zp != 1)
zp = -1;
if (lay == 0) {
throw cms::Exception("DDException") << "Funny layer # " << lay << " zp " << zp << " in " << nsiz << " components";
} else {
if (std::find(php.layer_.begin(), php.layer_.end(), lay) == php.layer_.end())
php.layer_.emplace_back(lay);
auto itr = layers.find(lay);
if (itr == layers.end()) {
double rin(0), rout(0);
double zz = HGCalParameters::k_ScaleFromDDD * fv.translation().Z();
if ((sol.shape() == DDSolidShape::ddpolyhedra_rz) || (sol.shape() == DDSolidShape::ddpolyhedra_rrz)) {
const DDPolyhedra& polyhedra = static_cast<DDPolyhedra>(sol);
const std::vector<double>& rmin = polyhedra.rMinVec();
const std::vector<double>& rmax = polyhedra.rMaxVec();
rin = 0.5 * HGCalParameters::k_ScaleFromDDD * (rmin[0] + rmin[1]);
rout = 0.5 * HGCalParameters::k_ScaleFromDDD * (rmax[0] + rmax[1]);
} else if (sol.shape() == DDSolidShape::ddtubs) {
const DDTubs& tube = static_cast<DDTubs>(sol);
rin = HGCalParameters::k_ScaleFromDDD * tube.rIn();
rout = HGCalParameters::k_ScaleFromDDD * tube.rOut();
}
HGCalGeomParameters::layerParameters laypar(rin, rout, zz);
layers[lay] = laypar;
}
DD3Vector x, y, z;
fv.rotation().GetComponents(x, y, z);
const CLHEP::HepRep3x3 rotation(x.X(), y.X(), z.X(), x.Y(), y.Y(), z.Y(), x.Z(), y.Z(), z.Z());
const CLHEP::HepRotation hr(rotation);
double xx = HGCalParameters::k_ScaleFromDDD * fv.translation().X();
if (std::abs(xx) < tolerance)
xx = 0;
double yy = HGCalParameters::k_ScaleFromDDD * fv.translation().Y();
if (std::abs(yy) < tolerance)
yy = 0;
double zz = HGCalParameters::k_ScaleFromDDD * fv.translation().Z();
const CLHEP::Hep3Vector h3v(xx, yy, zz);
HGCalParameters::hgtrform mytrf;
mytrf.zp = zp;
mytrf.lay = lay;
mytrf.sec = 0;
mytrf.subsec = 0;
mytrf.h3v = h3v;
mytrf.hr = hr;
trforms.emplace_back(mytrf);
trformUse.emplace_back(false);
}
dodet = fv.next();
}
// Then wafers
// This assumes layers are build starting from 1 (which on 25 Jan 2016, they
// were) to ensure that new copy numbers are always added to the end of the
// list.
std::unordered_map<int32_t, int32_t> copies;
HGCalParameters::layer_map copiesInLayers(layers.size() + 1);
std::vector<int32_t> wafer2copy;
std::vector<HGCalGeomParameters::cellParameters> wafers;
std::string attribute = "Volume";
DDValue val1(attribute, sdTag2, 0.0);
DDSpecificsMatchesValueFilter filter1{val1};
DDFilteredView fv1(*cpv, filter1);
bool ok = fv1.firstChild();
if (!ok) {
throw cms::Exception("DDException") << "Attribute " << val1 << " not found but needed.";
} else {
dodet = true;
std::unordered_set<std::string> names;
while (dodet) {
const DDSolid& sol = fv1.logicalPart().solid();
const std::string& name = fv1.logicalPart().name().name();
std::vector<int> copy = fv1.copyNumbers();
int nsiz = (int)(copy.size());
int wafer = (nsiz > 0) ? copy[nsiz - 1] : 0;
int layer = (nsiz > 1) ? copy[nsiz - 2] : 0;
if (nsiz < 2) {
throw cms::Exception("DDException") << "Funny wafer # " << wafer << " in " << nsiz << " components";
} else if (layer > (int)(layers.size())) {
edm::LogWarning("HGCalGeom") << "Funny wafer # " << wafer << " Layer " << layer << ":" << layers.size()
<< " among " << nsiz << " components";
} else {
auto itr = copies.find(wafer);
auto cpy = copiesInLayers[layer].find(wafer);
if (itr != copies.end() && cpy == copiesInLayers[layer].end()) {
copiesInLayers[layer][wafer] = itr->second;
}
if (itr == copies.end()) {
copies[wafer] = wafer2copy.size();
copiesInLayers[layer][wafer] = wafer2copy.size();
double xx = HGCalParameters::k_ScaleFromDDD * fv1.translation().X();
if (std::abs(xx) < tolerance)
xx = 0;
double yy = HGCalParameters::k_ScaleFromDDD * fv1.translation().Y();
if (std::abs(yy) < tolerance)
yy = 0;
wafer2copy.emplace_back(wafer);
GlobalPoint p(xx, yy, HGCalParameters::k_ScaleFromDDD * fv1.translation().Z());
HGCalGeomParameters::cellParameters cell(false, wafer, p);
wafers.emplace_back(cell);
if (names.count(name) == 0) {
std::vector<double> zv, rv;
if (mode == HGCalGeometryMode::Polyhedra) {
const DDPolyhedra& polyhedra = static_cast<DDPolyhedra>(sol);
zv = polyhedra.zVec();
rv = polyhedra.rMaxVec();
} else {
const DDExtrudedPolygon& polygon = static_cast<DDExtrudedPolygon>(sol);
zv = polygon.zVec();
rv = polygon.xVec();
}
php.waferR_ = 2.0 * HGCalParameters::k_ScaleFromDDDToG4 * rv[0] * tan30deg_;
php.waferSize_ = HGCalParameters::k_ScaleFromDDD * rv[0];
double dz = 0.5 * HGCalParameters::k_ScaleFromDDDToG4 * (zv[1] - zv[0]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom")
<< "Mode " << mode << " R " << php.waferSize_ << ":" << php.waferR_ << " z " << dz;
#endif
HGCalParameters::hgtrap mytr;
mytr.lay = 1;
mytr.bl = php.waferR_;
mytr.tl = php.waferR_;
mytr.h = php.waferR_;
mytr.dz = dz;
mytr.alpha = 0.0;
mytr.cellSize = waferSize_;
php.fillModule(mytr, false);
names.insert(name);
}
}
}
dodet = fv1.next();
}
}
// Finally the cells
std::map<int, int> wafertype;
std::map<int, HGCalGeomParameters::cellParameters> cellsf, cellsc;
DDValue val2(attribute, sdTag3, 0.0);
DDSpecificsMatchesValueFilter filter2{val2};
DDFilteredView fv2(*cpv, filter2);
ok = fv2.firstChild();
if (!ok) {
throw cms::Exception("DDException") << "Attribute " << val2 << " not found but needed.";
} else {
dodet = true;
while (dodet) {
const DDSolid& sol = fv2.logicalPart().solid();
const std::string& name = sol.name().name();
std::vector<int> copy = fv2.copyNumbers();
int nsiz = (int)(copy.size());
int cellx = (nsiz > 0) ? copy[nsiz - 1] : 0;
int wafer = (nsiz > 1) ? copy[nsiz - 2] : 0;
int cell = HGCalTypes::getUnpackedCell6(cellx);
int type = HGCalTypes::getUnpackedCellType6(cellx);
if (type != 1 && type != 2) {
throw cms::Exception("DDException")
<< "Funny cell # " << cell << " type " << type << " in " << nsiz << " components";
} else {
auto ktr = wafertype.find(wafer);
if (ktr == wafertype.end())
wafertype[wafer] = type;
bool newc(false);
std::map<int, HGCalGeomParameters::cellParameters>::iterator itr;
double cellsize = php.cellSize_[0];
if (type == 1) {
itr = cellsf.find(cell);
newc = (itr == cellsf.end());
} else {
itr = cellsc.find(cell);
newc = (itr == cellsc.end());
cellsize = php.cellSize_[1];
}
if (newc) {
bool half = (name.find("Half") != std::string::npos);
double xx = HGCalParameters::k_ScaleFromDDD * fv2.translation().X();
double yy = HGCalParameters::k_ScaleFromDDD * fv2.translation().Y();
if (half) {
math::XYZPointD p1(-2.0 * cellsize / 9.0, 0, 0);
math::XYZPointD p2 = fv2.rotation()(p1);
xx += (HGCalParameters::k_ScaleFromDDD * (p2.X()));
yy += (HGCalParameters::k_ScaleFromDDD * (p2.Y()));
#ifdef EDM_ML_DEBUG
if (std::abs(p2.X()) < HGCalParameters::tol)
p2.SetX(0.0);
if (std::abs(p2.Z()) < HGCalParameters::tol)
p2.SetZ(0.0);
edm::LogVerbatim("HGCalGeom") << "Wafer " << wafer << " Type " << type << " Cell " << cellx << " local "
<< xx << ":" << yy << " new " << p1 << ":" << p2;
#endif
}
HGCalGeomParameters::cellParameters cp(half, wafer, GlobalPoint(xx, yy, 0));
if (type == 1) {
cellsf[cell] = cp;
} else {
cellsc[cell] = cp;
}
}
}
dodet = fv2.next();
}
}
loadGeometryHexagon(
layers, trforms, trformUse, copies, copiesInLayers, wafer2copy, wafers, wafertype, cellsf, cellsc, php);
}
void HGCalGeomParameters::loadGeometryHexagon(const cms::DDCompactView* cpv,
HGCalParameters& php,
const std::string& sdTag1,
const std::string& sdTag2,
const std::string& sdTag3,
HGCalGeometryMode::WaferMode mode) {
const cms::DDFilter filter("Volume", sdTag1);
cms::DDFilteredView fv((*cpv), filter);
std::map<int, HGCalGeomParameters::layerParameters> layers;
std::vector<HGCalParameters::hgtrform> trforms;
std::vector<bool> trformUse;
std::vector<std::pair<int, int> > trused;
while (fv.firstChild()) {
const std::vector<double>& pars = fv.parameters();
// Layers first
std::vector<int> copy = fv.copyNos();
int nsiz = (int)(copy.size());
int lay = (nsiz > 0) ? copy[0] : 0;
int zp = (nsiz > 2) ? copy[2] : -1;
if (zp != 1)
zp = -1;
if (lay == 0) {
throw cms::Exception("DDException") << "Funny layer # " << lay << " zp " << zp << " in " << nsiz << " components";
} else {
if (std::find(php.layer_.begin(), php.layer_.end(), lay) == php.layer_.end())
php.layer_.emplace_back(lay);
auto itr = layers.find(lay);
double zz = HGCalParameters::k_ScaleFromDD4Hep * fv.translation().Z();
if (itr == layers.end()) {
double rin(0), rout(0);
if (fv.isA<dd4hep::Polyhedra>()) {
rin = 0.5 * HGCalParameters::k_ScaleFromDD4Hep * (pars[5] + pars[8]);
rout = 0.5 * HGCalParameters::k_ScaleFromDD4Hep * (pars[6] + pars[9]);
} else if (fv.isATubeSeg()) {
cms::dd::DDTubs tubeSeg(fv);
rin = HGCalParameters::k_ScaleFromDD4Hep * tubeSeg.rIn();
rout = HGCalParameters::k_ScaleFromDD4Hep * tubeSeg.rOut();
}
HGCalGeomParameters::layerParameters laypar(rin, rout, zz);
layers[lay] = laypar;
}
std::pair<int, int> layz(lay, zp);
if (std::find(trused.begin(), trused.end(), layz) == trused.end()) {
trused.emplace_back(layz);
DD3Vector x, y, z;
fv.rotation().GetComponents(x, y, z);
const CLHEP::HepRep3x3 rotation(x.X(), y.X(), z.X(), x.Y(), y.Y(), z.Y(), x.Z(), y.Z(), z.Z());
const CLHEP::HepRotation hr(rotation);
double xx = HGCalParameters::k_ScaleFromDD4Hep * fv.translation().X();
if (std::abs(xx) < tolerance)
xx = 0;
double yy = HGCalParameters::k_ScaleFromDD4Hep * fv.translation().Y();
if (std::abs(yy) < tolerance)
yy = 0;
double zz = HGCalParameters::k_ScaleFromDD4Hep * fv.translation().Z();
const CLHEP::Hep3Vector h3v(xx, yy, zz);
HGCalParameters::hgtrform mytrf;
mytrf.zp = zp;
mytrf.lay = lay;
mytrf.sec = 0;
mytrf.subsec = 0;
mytrf.h3v = h3v;
mytrf.hr = hr;
trforms.emplace_back(mytrf);
trformUse.emplace_back(false);
}
}
}
// Then wafers
// This assumes layers are build starting from 1 (which on 25 Jan 2016, they
// were) to ensure that new copy numbers are always added to the end of the
// list.
std::unordered_map<int32_t, int32_t> copies;
HGCalParameters::layer_map copiesInLayers(layers.size() + 1);
std::vector<int32_t> wafer2copy;
std::vector<HGCalGeomParameters::cellParameters> wafers;
const cms::DDFilter filter1("Volume", sdTag2);
cms::DDFilteredView fv1((*cpv), filter1);
bool ok = fv1.firstChild();
if (!ok) {
throw cms::Exception("DDException") << "Attribute " << sdTag2 << " not found but needed.";
} else {
bool dodet = true;
std::unordered_set<std::string> names;
while (dodet) {
const std::string name = static_cast<std::string>(fv1.name());
std::vector<int> copy = fv1.copyNos();
int nsiz = (int)(copy.size());
int wafer = (nsiz > 0) ? copy[0] : 0;
int layer = (nsiz > 1) ? copy[1] : 0;
if (nsiz < 2) {
throw cms::Exception("DDException") << "Funny wafer # " << wafer << " in " << nsiz << " components";
} else if (layer > (int)(layers.size())) {
edm::LogWarning("HGCalGeom") << "Funny wafer # " << wafer << " Layer " << layer << ":" << layers.size()
<< " among " << nsiz << " components";
} else {
auto itr = copies.find(wafer);
auto cpy = copiesInLayers[layer].find(wafer);
if (itr != copies.end() && cpy == copiesInLayers[layer].end()) {
copiesInLayers[layer][wafer] = itr->second;
}
if (itr == copies.end()) {
copies[wafer] = wafer2copy.size();
copiesInLayers[layer][wafer] = wafer2copy.size();
double xx = HGCalParameters::k_ScaleFromDD4Hep * fv1.translation().X();
if (std::abs(xx) < tolerance)
xx = 0;
double yy = HGCalParameters::k_ScaleFromDD4Hep * fv1.translation().Y();
if (std::abs(yy) < tolerance)
yy = 0;
wafer2copy.emplace_back(wafer);
GlobalPoint p(xx, yy, HGCalParameters::k_ScaleFromDD4Hep * fv1.translation().Z());
HGCalGeomParameters::cellParameters cell(false, wafer, p);
wafers.emplace_back(cell);
if (names.count(name) == 0) {
double zv[2], rv;
const std::vector<double>& pars = fv1.parameters();
if (mode == HGCalGeometryMode::Polyhedra) {
zv[0] = pars[4];
zv[1] = pars[7];
rv = pars[6];
} else {
zv[0] = pars[3];
zv[1] = pars[9];
rv = pars[4];
}
php.waferR_ = 2.0 * HGCalParameters::k_ScaleFromDD4HepToG4 * rv * tan30deg_;
php.waferSize_ = HGCalParameters::k_ScaleFromDD4Hep * rv;
double dz = 0.5 * HGCalParameters::k_ScaleFromDD4HepToG4 * (zv[1] - zv[0]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom")
<< "Mode " << mode << " R " << php.waferSize_ << ":" << php.waferR_ << " z " << dz;
#endif
HGCalParameters::hgtrap mytr;
mytr.lay = 1;
mytr.bl = php.waferR_;
mytr.tl = php.waferR_;
mytr.h = php.waferR_;
mytr.dz = dz;
mytr.alpha = 0.0;
mytr.cellSize = waferSize_;
php.fillModule(mytr, false);
names.insert(name);
}
}
}
dodet = fv1.firstChild();
}
}
// Finally the cells
std::map<int, int> wafertype;
std::map<int, HGCalGeomParameters::cellParameters> cellsf, cellsc;
const cms::DDFilter filter2("Volume", sdTag3);
cms::DDFilteredView fv2((*cpv), filter2);
ok = fv2.firstChild();
if (!ok) {
throw cms::Exception("DDException") << "Attribute " << sdTag3 << " not found but needed.";
} else {
bool dodet = true;
while (dodet) {
const std::string name = static_cast<std::string>(fv2.name());
std::vector<int> copy = fv2.copyNos();
int nsiz = (int)(copy.size());
int cellx = (nsiz > 0) ? copy[0] : 0;
int wafer = (nsiz > 1) ? copy[1] : 0;
int cell = HGCalTypes::getUnpackedCell6(cellx);
int type = HGCalTypes::getUnpackedCellType6(cellx);
if (type != 1 && type != 2) {
throw cms::Exception("DDException")
<< "Funny cell # " << cell << " type " << type << " in " << nsiz << " components";
} else {
auto ktr = wafertype.find(wafer);
if (ktr == wafertype.end())
wafertype[wafer] = type;
bool newc(false);
std::map<int, HGCalGeomParameters::cellParameters>::iterator itr;
double cellsize = php.cellSize_[0];
if (type == 1) {
itr = cellsf.find(cell);
newc = (itr == cellsf.end());
} else {
itr = cellsc.find(cell);
newc = (itr == cellsc.end());
cellsize = php.cellSize_[1];
}
if (newc) {
bool half = (name.find("Half") != std::string::npos);
double xx = HGCalParameters::k_ScaleFromDD4Hep * fv2.translation().X();
double yy = HGCalParameters::k_ScaleFromDD4Hep * fv2.translation().Y();
if (half) {
math::XYZPointD p1(-2.0 * cellsize / 9.0, 0, 0);
math::XYZPointD p2 = fv2.rotation()(p1);
xx += (HGCalParameters::k_ScaleFromDDD * (p2.X()));
yy += (HGCalParameters::k_ScaleFromDDD * (p2.Y()));
#ifdef EDM_ML_DEBUG
if (std::abs(p2.X()) < HGCalParameters::tol)
p2.SetX(0.0);
if (std::abs(p2.Z()) < HGCalParameters::tol)
p2.SetZ(0.0);
edm::LogVerbatim("HGCalGeom") << "Wafer " << wafer << " Type " << type << " Cell " << cellx << " local "
<< xx << ":" << yy << " new " << p1 << ":" << p2;
#endif
}
HGCalGeomParameters::cellParameters cp(half, wafer, GlobalPoint(xx, yy, 0));
if (type == 1) {
cellsf[cell] = cp;
} else {
cellsc[cell] = cp;
}
}
}
dodet = fv2.firstChild();
}
}
loadGeometryHexagon(
layers, trforms, trformUse, copies, copiesInLayers, wafer2copy, wafers, wafertype, cellsf, cellsc, php);
}
void HGCalGeomParameters::loadGeometryHexagon(const std::map<int, HGCalGeomParameters::layerParameters>& layers,
std::vector<HGCalParameters::hgtrform>& trforms,
std::vector<bool>& trformUse,
const std::unordered_map<int32_t, int32_t>& copies,
const HGCalParameters::layer_map& copiesInLayers,
const std::vector<int32_t>& wafer2copy,
const std::vector<HGCalGeomParameters::cellParameters>& wafers,
const std::map<int, int>& wafertype,
const std::map<int, HGCalGeomParameters::cellParameters>& cellsf,
const std::map<int, HGCalGeomParameters::cellParameters>& cellsc,
HGCalParameters& php) {
if (((cellsf.size() + cellsc.size()) == 0) || (wafers.empty()) || (layers.empty())) {
throw cms::Exception("DDException") << "HGCalGeomParameters: mismatch between geometry and specpar: cells "
<< cellsf.size() << ":" << cellsc.size() << " wafers " << wafers.size()
<< " layers " << layers.size();
}
for (unsigned int i = 0; i < layers.size(); ++i) {
for (auto& layer : layers) {
if (layer.first == (int)(i + php.firstLayer_)) {
php.layerIndex_.emplace_back(i);
php.rMinLayHex_.emplace_back(layer.second.rmin);
php.rMaxLayHex_.emplace_back(layer.second.rmax);
php.zLayerHex_.emplace_back(layer.second.zpos);
break;
}
}
}
for (unsigned int i = 0; i < php.layer_.size(); ++i) {
for (unsigned int i1 = 0; i1 < trforms.size(); ++i1) {
if (!trformUse[i1] && php.layerGroup_[trforms[i1].lay - 1] == (int)(i + 1)) {
trforms[i1].h3v *= static_cast<double>(HGCalParameters::k_ScaleFromDDD);
trforms[i1].lay = (i + 1);
trformUse[i1] = true;
php.fillTrForm(trforms[i1]);
int nz(1);
for (unsigned int i2 = i1 + 1; i2 < trforms.size(); ++i2) {
if (!trformUse[i2] && trforms[i2].zp == trforms[i1].zp &&
php.layerGroup_[trforms[i2].lay - 1] == (int)(i + 1)) {
php.addTrForm(trforms[i2].h3v);
nz++;
trformUse[i2] = true;
}
}
if (nz > 0) {
php.scaleTrForm(double(1.0 / nz));
}
}
}
}
double rmin = HGCalParameters::k_ScaleFromDDD * php.waferR_;
for (unsigned i = 0; i < wafer2copy.size(); ++i) {
php.waferCopy_.emplace_back(wafer2copy[i]);
php.waferPosX_.emplace_back(wafers[i].xyz.x());
php.waferPosY_.emplace_back(wafers[i].xyz.y());
auto ktr = wafertype.find(wafer2copy[i]);
int typet = (ktr == wafertype.end()) ? 0 : (ktr->second);
php.waferTypeT_.emplace_back(typet);
double r = wafers[i].xyz.perp();
int type(3);
for (int k = 1; k < 4; ++k) {
if ((r + rmin) <= php.boundR_[k]) {
type = k;
break;
}
}
php.waferTypeL_.emplace_back(type);
}
php.copiesInLayers_ = copiesInLayers;
php.nSectors_ = (int)(php.waferCopy_.size());
std::vector<HGCalGeomParameters::cellParameters>::const_iterator itrf = wafers.end();
for (unsigned int i = 0; i < cellsf.size(); ++i) {
auto itr = cellsf.find(i);
if (itr == cellsf.end()) {
throw cms::Exception("DDException") << "HGCalGeomParameters: missing info for fine cell number " << i;
} else {
double xx = (itr->second).xyz.x();
double yy = (itr->second).xyz.y();
int waf = (itr->second).wafer;
std::pair<double, double> xy = cellPosition(wafers, itrf, waf, xx, yy);
php.cellFineX_.emplace_back(xy.first);
php.cellFineY_.emplace_back(xy.second);
php.cellFineHalf_.emplace_back((itr->second).half);
}
}
itrf = wafers.end();
for (unsigned int i = 0; i < cellsc.size(); ++i) {
auto itr = cellsc.find(i);
if (itr == cellsc.end()) {
throw cms::Exception("DDException") << "HGCalGeomParameters: missing info for coarse cell number " << i;
} else {
double xx = (itr->second).xyz.x();
double yy = (itr->second).xyz.y();
int waf = (itr->second).wafer;
std::pair<double, double> xy = cellPosition(wafers, itrf, waf, xx, yy);
php.cellCoarseX_.emplace_back(xy.first);
php.cellCoarseY_.emplace_back(xy.second);
php.cellCoarseHalf_.emplace_back((itr->second).half);
}
}
int depth(0);
for (unsigned int i = 0; i < php.layerGroup_.size(); ++i) {
bool first(true);
for (unsigned int k = 0; k < php.layerGroup_.size(); ++k) {
if (php.layerGroup_[k] == (int)(i + 1)) {
if (first) {
php.depth_.emplace_back(i + 1);
php.depthIndex_.emplace_back(depth);
php.depthLayerF_.emplace_back(k);
++depth;
first = false;
}
}
}
}
HGCalParameters::hgtrap mytr = php.getModule(0, false);
mytr.bl *= HGCalParameters::k_ScaleFromDDD;
mytr.tl *= HGCalParameters::k_ScaleFromDDD;
mytr.h *= HGCalParameters::k_ScaleFromDDD;
mytr.dz *= HGCalParameters::k_ScaleFromDDD;
mytr.cellSize *= HGCalParameters::k_ScaleFromDDD;
double dz = mytr.dz;
php.fillModule(mytr, true);
mytr.dz = 2 * dz;
php.fillModule(mytr, true);
mytr.dz = 3 * dz;
php.fillModule(mytr, true);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters finds " << php.zLayerHex_.size() << " layers";
for (unsigned int i = 0; i < php.zLayerHex_.size(); ++i) {
int k = php.layerIndex_[i];
edm::LogVerbatim("HGCalGeom") << "Layer[" << i << ":" << k << ":" << php.layer_[k]
<< "] with r = " << php.rMinLayHex_[i] << ":" << php.rMaxLayHex_[i]
<< " at z = " << php.zLayerHex_[i];
}
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters has " << php.depthIndex_.size() << " depths";
for (unsigned int i = 0; i < php.depthIndex_.size(); ++i) {
int k = php.depthIndex_[i];
edm::LogVerbatim("HGCalGeom") << "Reco Layer[" << i << ":" << k << "] First Layer " << php.depthLayerF_[i]
<< " Depth " << php.depth_[k];
}
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters finds " << php.nSectors_ << " wafers";
for (unsigned int i = 0; i < php.waferCopy_.size(); ++i)
edm::LogVerbatim("HGCalGeom") << "Wafer[" << i << ": " << php.waferCopy_[i] << "] type " << php.waferTypeL_[i]
<< ":" << php.waferTypeT_[i] << " at (" << php.waferPosX_[i] << ","
<< php.waferPosY_[i] << ",0)";
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: wafer radius " << php.waferR_ << " and dimensions of the "
<< "wafers:";
edm::LogVerbatim("HGCalGeom") << "Sim[0] " << php.moduleLayS_[0] << " dx " << php.moduleBlS_[0] << ":"
<< php.moduleTlS_[0] << " dy " << php.moduleHS_[0] << " dz " << php.moduleDzS_[0]
<< " alpha " << php.moduleAlphaS_[0];
for (unsigned int k = 0; k < php.moduleLayR_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "Rec[" << k << "] " << php.moduleLayR_[k] << " dx " << php.moduleBlR_[k] << ":"
<< php.moduleTlR_[k] << " dy " << php.moduleHR_[k] << " dz " << php.moduleDzR_[k]
<< " alpha " << php.moduleAlphaR_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters finds " << php.cellFineX_.size() << " fine cells in a wafer";
for (unsigned int i = 0; i < php.cellFineX_.size(); ++i)
edm::LogVerbatim("HGCalGeom") << "Fine Cell[" << i << "] at (" << php.cellFineX_[i] << "," << php.cellFineY_[i]
<< ",0)";
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters finds " << php.cellCoarseX_.size()
<< " coarse cells in a wafer";
for (unsigned int i = 0; i < php.cellCoarseX_.size(); ++i)
edm::LogVerbatim("HGCalGeom") << "Coarse Cell[" << i << "] at (" << php.cellCoarseX_[i] << ","
<< php.cellCoarseY_[i] << ",0)";
edm::LogVerbatim("HGCalGeom") << "Obtained " << php.trformIndex_.size() << " transformation matrices";
for (unsigned int k = 0; k < php.trformIndex_.size(); ++k) {
edm::LogVerbatim("HGCalGeom") << "Matrix[" << k << "] (" << std::hex << php.trformIndex_[k] << std::dec
<< ") Translation (" << php.trformTranX_[k] << ", " << php.trformTranY_[k] << ", "
<< php.trformTranZ_[k] << " Rotation (" << php.trformRotXX_[k] << ", "
<< php.trformRotYX_[k] << ", " << php.trformRotZX_[k] << ", " << php.trformRotXY_[k]
<< ", " << php.trformRotYY_[k] << ", " << php.trformRotZY_[k] << ", "
<< php.trformRotXZ_[k] << ", " << php.trformRotYZ_[k] << ", " << php.trformRotZZ_[k]
<< ")";
}
edm::LogVerbatim("HGCalGeom") << "Dump copiesInLayers for " << php.copiesInLayers_.size() << " layers";
for (unsigned int k = 0; k < php.copiesInLayers_.size(); ++k) {
const auto& theModules = php.copiesInLayers_[k];
edm::LogVerbatim("HGCalGeom") << "Layer " << k << ":" << theModules.size();
int k2(0);
for (std::unordered_map<int, int>::const_iterator itr = theModules.begin(); itr != theModules.end(); ++itr, ++k2) {
edm::LogVerbatim("HGCalGeom") << "[" << k2 << "] " << itr->first << ":" << itr->second;
}
}
#endif
}
void HGCalGeomParameters::loadGeometryHexagon8(const DDFilteredView& _fv, HGCalParameters& php, int firstLayer) {
DDFilteredView fv = _fv;
bool dodet(true);
std::map<int, HGCalGeomParameters::layerParameters> layers;
std::map<std::pair<int, int>, HGCalParameters::hgtrform> trforms;
int levelTop = 3 + std::max(php.levelT_[0], php.levelT_[1]);
#ifdef EDM_ML_DEBUG
int ntot(0);
#endif
while (dodet) {
#ifdef EDM_ML_DEBUG
++ntot;
#endif
std::vector<int> copy = fv.copyNumbers();
int nsiz = (int)(copy.size());
if (nsiz < levelTop) {
int lay = copy[nsiz - 1];
int zside = (nsiz > php.levelZSide_) ? copy[php.levelZSide_] : -1;
if (zside != 1)
zside = -1;
const DDSolid& sol = fv.logicalPart().solid();
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << sol.name() << " shape " << sol.shape() << " size " << nsiz << ":" << levelTop
<< " lay " << lay << " z " << zside;
#endif
if (lay == 0) {
throw cms::Exception("DDException")
<< "Funny layer # " << lay << " zp " << zside << " in " << nsiz << " components";
} else {
if (std::find(php.layer_.begin(), php.layer_.end(), lay) == php.layer_.end())
php.layer_.emplace_back(lay);
auto itr = layers.find(lay);
if (itr == layers.end()) {
const DDTubs& tube = static_cast<DDTubs>(sol);
double rin = HGCalParameters::k_ScaleFromDDD * tube.rIn();
double rout = HGCalParameters::k_ScaleFromDDD * tube.rOut();
double zp = HGCalParameters::k_ScaleFromDDD * fv.translation().Z();
HGCalGeomParameters::layerParameters laypar(rin, rout, zp);
layers[lay] = laypar;
}
if (trforms.find(std::make_pair(lay, zside)) == trforms.end()) {
DD3Vector x, y, z;
fv.rotation().GetComponents(x, y, z);
const CLHEP::HepRep3x3 rotation(x.X(), y.X(), z.X(), x.Y(), y.Y(), z.Y(), x.Z(), y.Z(), z.Z());
const CLHEP::HepRotation hr(rotation);
double xx =
((std::abs(fv.translation().X()) < tolerance) ? 0
: HGCalParameters::k_ScaleFromDDD * fv.translation().X());
double yy =
((std::abs(fv.translation().Y()) < tolerance) ? 0
: HGCalParameters::k_ScaleFromDDD * fv.translation().Y());
const CLHEP::Hep3Vector h3v(xx, yy, HGCalParameters::k_ScaleFromDDD * fv.translation().Z());
HGCalParameters::hgtrform mytrf;
mytrf.zp = zside;
mytrf.lay = lay;
mytrf.sec = 0;
mytrf.subsec = 0;
mytrf.h3v = h3v;
mytrf.hr = hr;
trforms[std::make_pair(lay, zside)] = mytrf;
}
}
}
dodet = fv.next();
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Total # of views " << ntot;
#endif
loadGeometryHexagon8(layers, trforms, firstLayer, php);
}
void HGCalGeomParameters::loadGeometryHexagon8(const cms::DDCompactView* cpv,
HGCalParameters& php,
const std::string& sdTag1,
int firstLayer) {
const cms::DDFilter filter("Volume", sdTag1);
cms::DDFilteredView fv((*cpv), filter);
std::map<int, HGCalGeomParameters::layerParameters> layers;
std::map<std::pair<int, int>, HGCalParameters::hgtrform> trforms;
int levelTop = 3 + std::max(php.levelT_[0], php.levelT_[1]);
#ifdef EDM_ML_DEBUG
int ntot(0);
#endif
while (fv.firstChild()) {
#ifdef EDM_ML_DEBUG
++ntot;
#endif
// Layers first
int nsiz = static_cast<int>(fv.level());
if (nsiz < levelTop) {
std::vector<int> copy = fv.copyNos();
int lay = copy[0];
int zside = (nsiz > php.levelZSide_) ? copy[nsiz - php.levelZSide_ - 1] : -1;
if (zside != 1)
zside = -1;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << fv.name() << " shape " << cms::dd::name(cms::DDSolidShapeMap, fv.shape())
<< " size " << nsiz << ":" << levelTop << " lay " << lay << " z " << zside << ":"
<< php.levelZSide_;
#endif
if (lay == 0) {
throw cms::Exception("DDException")
<< "Funny layer # " << lay << " zp " << zside << " in " << nsiz << " components";
} else {
if (std::find(php.layer_.begin(), php.layer_.end(), lay) == php.layer_.end())
php.layer_.emplace_back(lay);
auto itr = layers.find(lay);
if (itr == layers.end()) {
const std::vector<double>& pars = fv.parameters();
double rin = HGCalParameters::k_ScaleFromDD4Hep * pars[0];
double rout = HGCalParameters::k_ScaleFromDD4Hep * pars[1];
double zp = HGCalParameters::k_ScaleFromDD4Hep * fv.translation().Z();
HGCalGeomParameters::layerParameters laypar(rin, rout, zp);
layers[lay] = laypar;
}
if (trforms.find(std::make_pair(lay, zside)) == trforms.end()) {
DD3Vector x, y, z;
fv.rotation().GetComponents(x, y, z);
const CLHEP::HepRep3x3 rotation(x.X(), y.X(), z.X(), x.Y(), y.Y(), z.Y(), x.Z(), y.Z(), z.Z());
const CLHEP::HepRotation hr(rotation);
double xx = ((std::abs(fv.translation().X()) < tolerance)
? 0
: HGCalParameters::k_ScaleFromDD4Hep * fv.translation().X());
double yy = ((std::abs(fv.translation().Y()) < tolerance)
? 0
: HGCalParameters::k_ScaleFromDD4Hep * fv.translation().Y());
const CLHEP::Hep3Vector h3v(xx, yy, HGCalParameters::k_ScaleFromDD4Hep * fv.translation().Z());
HGCalParameters::hgtrform mytrf;
mytrf.zp = zside;
mytrf.lay = lay;
mytrf.sec = 0;
mytrf.subsec = 0;
mytrf.h3v = h3v;
mytrf.hr = hr;
trforms[std::make_pair(lay, zside)] = mytrf;
}
}
}
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Total # of views " << ntot;
#endif
loadGeometryHexagon8(layers, trforms, firstLayer, php);
}
void HGCalGeomParameters::loadGeometryHexagon8(const std::map<int, HGCalGeomParameters::layerParameters>& layers,
std::map<std::pair<int, int>, HGCalParameters::hgtrform>& trforms,
const int& firstLayer,
HGCalParameters& php) {
double rmin(0), rmax(0);
for (unsigned int i = 0; i < layers.size(); ++i) {
for (auto& layer : layers) {
if (layer.first == (int)(i + firstLayer)) {
php.layerIndex_.emplace_back(i);
php.rMinLayHex_.emplace_back(layer.second.rmin);
php.rMaxLayHex_.emplace_back(layer.second.rmax);
php.zLayerHex_.emplace_back(layer.second.zpos);
if (i == 0) {
rmin = layer.second.rmin;
rmax = layer.second.rmax;
} else {
if (rmin > layer.second.rmin)
rmin = layer.second.rmin;
if (rmax < layer.second.rmax)
rmax = layer.second.rmax;
}
break;
}
}
}
php.rLimit_.emplace_back(rmin);
php.rLimit_.emplace_back(rmax);
php.depth_ = php.layer_;
php.depthIndex_ = php.layerIndex_;
php.depthLayerF_ = php.layerIndex_;
for (unsigned int i = 0; i < php.layer_.size(); ++i) {
for (auto& trform : trforms) {
if (trform.first.first == (int)(i + firstLayer)) {
php.fillTrForm(trform.second);
}
}
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Minimum/maximum R " << php.rLimit_[0] << ":" << php.rLimit_[1];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters finds " << php.zLayerHex_.size() << " layers";
for (unsigned int i = 0; i < php.zLayerHex_.size(); ++i) {
int k = php.layerIndex_[i];
edm::LogVerbatim("HGCalGeom") << "Layer[" << i << ":" << k << ":" << php.layer_[k]
<< "] with r = " << php.rMinLayHex_[i] << ":" << php.rMaxLayHex_[i]
<< " at z = " << php.zLayerHex_[i];
}
edm::LogVerbatim("HGCalGeom") << "Obtained " << php.trformIndex_.size() << " transformation matrices";
for (unsigned int k = 0; k < php.trformIndex_.size(); ++k) {
edm::LogVerbatim("HGCalGeom") << "Matrix[" << k << "] (" << std::hex << php.trformIndex_[k] << std::dec
<< ") Translation (" << php.trformTranX_[k] << ", " << php.trformTranY_[k] << ", "
<< php.trformTranZ_[k] << " Rotation (" << php.trformRotXX_[k] << ", "
<< php.trformRotYX_[k] << ", " << php.trformRotZX_[k] << ", " << php.trformRotXY_[k]
<< ", " << php.trformRotYY_[k] << ", " << php.trformRotZY_[k] << ", "
<< php.trformRotXZ_[k] << ", " << php.trformRotYZ_[k] << ", " << php.trformRotZZ_[k]
<< ")";
}
#endif
}
void HGCalGeomParameters::loadSpecParsHexagon(const DDFilteredView& fv,
HGCalParameters& php,
const DDCompactView* cpv,
const std::string& sdTag1,
const std::string& sdTag2) {
DDsvalues_type sv(fv.mergedSpecifics());
php.boundR_ = getDDDArray("RadiusBound", sv, 4);
rescale(php.boundR_, HGCalParameters::k_ScaleFromDDD);
php.rLimit_ = getDDDArray("RadiusLimits", sv, 2);
rescale(php.rLimit_, HGCalParameters::k_ScaleFromDDD);
php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv, 0));
// Grouping of layers
php.layerGroup_ = dbl_to_int(getDDDArray("GroupingZFine", sv, 0));
php.layerGroupM_ = dbl_to_int(getDDDArray("GroupingZMid", sv, 0));
php.layerGroupO_ = dbl_to_int(getDDDArray("GroupingZOut", sv, 0));
php.slopeMin_ = getDDDArray("Slope", sv, 1);
// Wafer size
std::string attribute = "Volume";
DDSpecificsMatchesValueFilter filter1{DDValue(attribute, sdTag1, 0.0)};
DDFilteredView fv1(*cpv, filter1);
if (fv1.firstChild()) {
DDsvalues_type sv(fv1.mergedSpecifics());
const auto& dummy = getDDDArray("WaferSize", sv, 0);
waferSize_ = dummy[0];
}
// Cell size
DDSpecificsMatchesValueFilter filter2{DDValue(attribute, sdTag2, 0.0)};
DDFilteredView fv2(*cpv, filter2);
if (fv2.firstChild()) {
DDsvalues_type sv(fv2.mergedSpecifics());
php.cellSize_ = getDDDArray("CellSize", sv, 0);
}
loadSpecParsHexagon(php);
}
void HGCalGeomParameters::loadSpecParsHexagon(const cms::DDFilteredView& fv,
HGCalParameters& php,
const std::string& sdTag1,
const std::string& sdTag2,
const std::string& sdTag3,
const std::string& sdTag4) {
php.boundR_ = fv.get<std::vector<double> >(sdTag4, "RadiusBound");
rescale(php.boundR_, HGCalParameters::k_ScaleFromDD4Hep);
php.rLimit_ = fv.get<std::vector<double> >(sdTag4, "RadiusLimits");
rescale(php.rLimit_, HGCalParameters::k_ScaleFromDD4Hep);
php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(sdTag4, "LevelTop"));
// Grouping of layers
php.layerGroup_ = dbl_to_int(fv.get<std::vector<double> >(sdTag1, "GroupingZFine"));
php.layerGroupM_ = dbl_to_int(fv.get<std::vector<double> >(sdTag1, "GroupingZMid"));
php.layerGroupO_ = dbl_to_int(fv.get<std::vector<double> >(sdTag1, "GroupingZOut"));
php.slopeMin_ = fv.get<std::vector<double> >(sdTag4, "Slope");
if (php.slopeMin_.empty())
php.slopeMin_.emplace_back(0);
// Wafer size
const auto& dummy = fv.get<std::vector<double> >(sdTag2, "WaferSize");
waferSize_ = dummy[0] * HGCalParameters::k_ScaleFromDD4HepToG4;
// Cell size
php.cellSize_ = fv.get<std::vector<double> >(sdTag3, "CellSize");
rescale(php.cellSize_, HGCalParameters::k_ScaleFromDD4HepToG4);
loadSpecParsHexagon(php);
}
void HGCalGeomParameters::loadSpecParsHexagon(const HGCalParameters& php) {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: wafer radius ranges"
<< " for cell grouping " << php.boundR_[0] << ":" << php.boundR_[1] << ":"
<< php.boundR_[2] << ":" << php.boundR_[3];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Minimum/maximum R " << php.rLimit_[0] << ":" << php.rLimit_[1];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: LevelTop " << php.levelT_[0];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: minimum slope " << php.slopeMin_[0] << " and layer groupings "
<< "for the 3 ranges:";
for (unsigned int k = 0; k < php.layerGroup_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << php.layerGroup_[k] << ":" << php.layerGroupM_[k] << ":"
<< php.layerGroupO_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Wafer Size: " << waferSize_;
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: " << php.cellSize_.size() << " cells of sizes:";
for (unsigned int k = 0; k < php.cellSize_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << " [" << k << "] " << php.cellSize_[k];
#endif
}
void HGCalGeomParameters::loadSpecParsHexagon8(const DDFilteredView& fv, HGCalParameters& php) {
DDsvalues_type sv(fv.mergedSpecifics());
php.cellThickness_ = getDDDArray("CellThickness", sv, 3);
rescale(php.cellThickness_, HGCalParameters::k_ScaleFromDDD);
php.radius100to200_ = getDDDArray("Radius100to200", sv, 5);
php.radius200to300_ = getDDDArray("Radius200to300", sv, 5);
const auto& dummy = getDDDArray("RadiusCuts", sv, 4);
php.choiceType_ = (int)(dummy[0]);
php.nCornerCut_ = (int)(dummy[1]);
php.fracAreaMin_ = dummy[2];
php.zMinForRad_ = HGCalParameters::k_ScaleFromDDD * dummy[3];
php.radiusMixBoundary_ = fv.vector("RadiusMixBoundary");
rescale(php.radiusMixBoundary_, HGCalParameters::k_ScaleFromDDD);
php.slopeMin_ = getDDDArray("SlopeBottom", sv, 0);
php.zFrontMin_ = getDDDArray("ZFrontBottom", sv, 0);
rescale(php.zFrontMin_, HGCalParameters::k_ScaleFromDDD);
php.rMinFront_ = getDDDArray("RMinFront", sv, 0);
rescale(php.rMinFront_, HGCalParameters::k_ScaleFromDDD);
php.slopeTop_ = getDDDArray("SlopeTop", sv, 0);
php.zFrontTop_ = getDDDArray("ZFrontTop", sv, 0);
rescale(php.zFrontTop_, HGCalParameters::k_ScaleFromDDD);
php.rMaxFront_ = getDDDArray("RMaxFront", sv, 0);
rescale(php.rMaxFront_, HGCalParameters::k_ScaleFromDDD);
php.zRanges_ = fv.vector("ZRanges");
rescale(php.zRanges_, HGCalParameters::k_ScaleFromDDD);
const auto& dummy2 = getDDDArray("LayerOffset", sv, 1);
php.layerOffset_ = dummy2[0];
php.layerCenter_ = dbl_to_int(fv.vector("LayerCenter"));
loadSpecParsHexagon8(php);
// Read in parameters from Philip's file
if (php.waferMaskMode_ > 1) {
std::vector<int> waferIndex, waferTypes, waferParts, waferOrien;
if (php.waferMaskMode_ == siliconFileEE) {
waferIndex = dbl_to_int(fv.vector("WaferIndexEE"));
waferTypes = dbl_to_int(fv.vector("WaferTypesEE"));
waferParts = dbl_to_int(fv.vector("WaferPartialEE"));
waferOrien = dbl_to_int(fv.vector("WaferOrientEE"));
} else if (php.waferMaskMode_ == siliconFileHE) {
waferIndex = dbl_to_int(fv.vector("WaferIndexHE"));
waferTypes = dbl_to_int(fv.vector("WaferTypesHE"));
waferParts = dbl_to_int(fv.vector("WaferPartialHE"));
waferOrien = dbl_to_int(fv.vector("WaferOrientHE"));
}
loadSpecParsHexagon8(php, waferIndex, waferTypes, waferParts, waferOrien);
}
}
void HGCalGeomParameters::loadSpecParsHexagon8(const cms::DDFilteredView& fv,
const cms::DDVectorsMap& vmap,
HGCalParameters& php,
const std::string& sdTag1) {
php.cellThickness_ = fv.get<std::vector<double> >(sdTag1, "CellThickness");
rescale(php.cellThickness_, HGCalParameters::k_ScaleFromDD4Hep);
php.radius100to200_ = fv.get<std::vector<double> >(sdTag1, "Radius100to200");
php.radius200to300_ = fv.get<std::vector<double> >(sdTag1, "Radius200to300");
const auto& dummy = fv.get<std::vector<double> >(sdTag1, "RadiusCuts");
if (dummy.size() > 3) {
php.choiceType_ = static_cast<int>(dummy[0]);
php.nCornerCut_ = static_cast<int>(dummy[1]);
php.fracAreaMin_ = dummy[2];
php.zMinForRad_ = HGCalParameters::k_ScaleFromDD4Hep * dummy[3];
} else {
php.choiceType_ = php.nCornerCut_ = php.fracAreaMin_ = php.zMinForRad_ = 0;
}
php.slopeMin_ = fv.get<std::vector<double> >(sdTag1, "SlopeBottom");
php.zFrontMin_ = fv.get<std::vector<double> >(sdTag1, "ZFrontBottom");
rescale(php.zFrontMin_, HGCalParameters::k_ScaleFromDD4Hep);
php.rMinFront_ = fv.get<std::vector<double> >(sdTag1, "RMinFront");
rescale(php.rMinFront_, HGCalParameters::k_ScaleFromDD4Hep);
php.slopeTop_ = fv.get<std::vector<double> >(sdTag1, "SlopeTop");
php.zFrontTop_ = fv.get<std::vector<double> >(sdTag1, "ZFrontTop");
rescale(php.zFrontTop_, HGCalParameters::k_ScaleFromDD4Hep);
php.rMaxFront_ = fv.get<std::vector<double> >(sdTag1, "RMaxFront");
rescale(php.rMaxFront_, HGCalParameters::k_ScaleFromDD4Hep);
unsigned int kmax = (php.zFrontTop_.size() - php.slopeTop_.size());
for (unsigned int k = 0; k < kmax; ++k)
php.slopeTop_.emplace_back(0);
const auto& dummy2 = fv.get<std::vector<double> >(sdTag1, "LayerOffset");
if (!dummy2.empty()) {
php.layerOffset_ = dummy2[0];
} else {
php.layerOffset_ = 0;
}
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "RadiusMixBoundary")) {
for (const auto& i : it.second)
php.radiusMixBoundary_.emplace_back(HGCalParameters::k_ScaleFromDD4Hep * i);
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "ZRanges")) {
for (const auto& i : it.second)
php.zRanges_.emplace_back(HGCalParameters::k_ScaleFromDD4Hep * i);
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "LayerCenter")) {
for (const auto& i : it.second)
php.layerCenter_.emplace_back(std::round(i));
}
}
loadSpecParsHexagon8(php);
// Read in parameters from Philip's file
if (php.waferMaskMode_ > 1) {
std::vector<int> waferIndex, waferTypes, waferParts, waferOrien;
if (php.waferMaskMode_ == siliconFileEE) {
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferIndexEE")) {
for (const auto& i : it.second)
waferIndex.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferTypesEE")) {
for (const auto& i : it.second)
waferTypes.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferPartialEE")) {
for (const auto& i : it.second)
waferParts.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferOrientEE")) {
for (const auto& i : it.second)
waferOrien.emplace_back(std::round(i));
}
}
} else if (php.waferMaskMode_ == siliconFileHE) {
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferIndexHE")) {
for (const auto& i : it.second)
waferIndex.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferTypesHE")) {
for (const auto& i : it.second)
waferTypes.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferPartialHE")) {
for (const auto& i : it.second)
waferParts.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "WaferOrientHE")) {
for (const auto& i : it.second)
waferOrien.emplace_back(std::round(i));
}
}
}
loadSpecParsHexagon8(php, waferIndex, waferTypes, waferParts, waferOrien);
}
}
void HGCalGeomParameters::loadSpecParsHexagon8(HGCalParameters& php) {
#ifdef EDM_ML_DEBUG
for (unsigned int k = 0; k < php.cellThickness_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: cell[" << k << "] Thickness " << php.cellThickness_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Polynomial "
<< "parameters for 120 to 200 micron "
<< "transition with" << php.radius100to200_.size() << " elements";
for (unsigned int k = 0; k < php.radius100to200_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "Element [" << k << "] " << php.radius100to200_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Polynomial "
<< "parameters for 200 to 300 micron "
<< "transition with " << php.radius200to300_.size() << " elements";
for (unsigned int k = 0; k < php.radius200to300_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "Element [" << k << "] " << php.radius200to300_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Parameters for the"
<< " transition " << php.choiceType_ << ":" << php.nCornerCut_ << ":"
<< php.fracAreaMin_ << ":" << php.zMinForRad_;
for (unsigned int k = 0; k < php.radiusMixBoundary_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Mix[" << k << "] R = " << php.radiusMixBoundary_[k];
for (unsigned int k = 0; k < php.zFrontMin_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Boundary[" << k << "] Bottom Z = " << php.zFrontMin_[k]
<< " Slope = " << php.slopeMin_[k] << " rMax = " << php.rMinFront_[k];
for (unsigned int k = 0; k < php.zFrontTop_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Boundary[" << k << "] Top Z = " << php.zFrontTop_[k]
<< " Slope = " << php.slopeTop_[k] << " rMax = " << php.rMaxFront_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Z-Boundary " << php.zRanges_[0] << ":" << php.zRanges_[1] << ":"
<< php.zRanges_[2] << ":" << php.zRanges_[3];
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: LayerOffset " << php.layerOffset_ << " in array of size "
<< php.layerCenter_.size();
for (unsigned int k = 0; k < php.layerCenter_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << php.layerCenter_[k];
#endif
}
void HGCalGeomParameters::loadSpecParsHexagon8(HGCalParameters& php,
const std::vector<int>& waferIndex,
const std::vector<int>& waferTypes,
const std::vector<int>& waferParts,
const std::vector<int>& waferOrien) {
// Store parameters from Philip's file
for (unsigned int k = 0; k < waferIndex.size(); ++k) {
php.waferInfoMap_[waferIndex[k]] = HGCalParameters::waferInfo(waferTypes[k], waferParts[k], waferOrien[k]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "[" << k << ":" << waferIndex[k] << "] "
<< " Type " << waferTypes[k] << " Partial type " << waferParts[k] << " Orientation "
<< waferOrien[k];
#endif
}
}
void HGCalGeomParameters::loadSpecParsTrapezoid(const DDFilteredView& fv, HGCalParameters& php) {
DDsvalues_type sv(fv.mergedSpecifics());
php.radiusMixBoundary_ = fv.vector("RadiusMixBoundary");
rescale(php.radiusMixBoundary_, HGCalParameters::k_ScaleFromDDD);
php.nPhiBinBH_ = dbl_to_int(getDDDArray("NPhiBinBH", sv, 0));
php.layerFrontBH_ = dbl_to_int(getDDDArray("LayerFrontBH", sv, 0));
php.rMinLayerBH_ = getDDDArray("RMinLayerBH", sv, 0);
rescale(php.rMinLayerBH_, HGCalParameters::k_ScaleFromDDD);
php.nCellsFine_ = php.nPhiBinBH_[0];
php.nCellsCoarse_ = php.nPhiBinBH_[1];
php.cellSize_.emplace_back(2.0 * M_PI / php.nCellsFine_);
php.cellSize_.emplace_back(2.0 * M_PI / php.nCellsCoarse_);
php.slopeMin_ = getDDDArray("SlopeBottom", sv, 0);
php.zFrontMin_ = getDDDArray("ZFrontBottom", sv, 0);
rescale(php.zFrontMin_, HGCalParameters::k_ScaleFromDDD);
php.rMinFront_ = getDDDArray("RMinFront", sv, 0);
rescale(php.rMinFront_, HGCalParameters::k_ScaleFromDDD);
php.slopeTop_ = getDDDArray("SlopeTop", sv, 0);
php.zFrontTop_ = getDDDArray("ZFrontTop", sv, 0);
rescale(php.zFrontTop_, HGCalParameters::k_ScaleFromDDD);
php.rMaxFront_ = getDDDArray("RMaxFront", sv, 0);
rescale(php.rMaxFront_, HGCalParameters::k_ScaleFromDDD);
php.zRanges_ = fv.vector("ZRanges");
rescale(php.zRanges_, HGCalParameters::k_ScaleFromDDD);
// Offsets
const auto& dummy2 = getDDDArray("LayerOffset", sv, 1);
php.layerOffset_ = dummy2[0];
php.layerCenter_ = dbl_to_int(fv.vector("LayerCenter"));
loadSpecParsTrapezoid(php);
// tile parameters from Katja's file
if (php.waferMaskMode_ == scintillatorFile) {
std::vector<int> tileIndx, tileType, tileSiPM;
std::vector<int> tileHEX1, tileHEX2, tileHEX3, tileHEX4;
std::vector<double> tileRMin, tileRMax;
std::vector<int> tileRingMin, tileRingMax;
tileIndx = dbl_to_int(fv.vector("TileIndex"));
tileType = dbl_to_int(fv.vector("TileType"));
tileSiPM = dbl_to_int(fv.vector("TileSiPM"));
tileHEX1 = dbl_to_int(fv.vector("TileHEX1"));
tileHEX2 = dbl_to_int(fv.vector("TileHEX2"));
tileHEX3 = dbl_to_int(fv.vector("TileHEX3"));
tileHEX4 = dbl_to_int(fv.vector("TileHEX4"));
tileRMin = fv.vector("TileRMin");
tileRMax = fv.vector("TileRMax");
rescale(tileRMin, HGCalParameters::k_ScaleFromDDD);
rescale(tileRMax, HGCalParameters::k_ScaleFromDDD);
tileRingMin = dbl_to_int(fv.vector("TileRingMin"));
tileRingMax = dbl_to_int(fv.vector("TileRingMax"));
loadSpecParsTrapezoid(php,
tileIndx,
tileType,
tileSiPM,
tileHEX1,
tileHEX2,
tileHEX3,
tileHEX4,
tileRMin,
tileRMax,
tileRingMin,
tileRingMax);
}
}
void HGCalGeomParameters::loadSpecParsTrapezoid(const cms::DDFilteredView& fv,
const cms::DDVectorsMap& vmap,
HGCalParameters& php,
const std::string& sdTag1) {
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "RadiusMixBoundary")) {
for (const auto& i : it.second)
php.radiusMixBoundary_.emplace_back(HGCalParameters::k_ScaleFromDD4Hep * i);
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "ZRanges")) {
for (const auto& i : it.second)
php.zRanges_.emplace_back(HGCalParameters::k_ScaleFromDD4Hep * i);
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "LayerCenter")) {
for (const auto& i : it.second)
php.layerCenter_.emplace_back(std::round(i));
}
}
php.nPhiBinBH_ = dbl_to_int(fv.get<std::vector<double> >(sdTag1, "NPhiBinBH"));
php.layerFrontBH_ = dbl_to_int(fv.get<std::vector<double> >(sdTag1, "LayerFrontBH"));
php.rMinLayerBH_ = fv.get<std::vector<double> >(sdTag1, "RMinLayerBH");
rescale(php.rMinLayerBH_, HGCalParameters::k_ScaleFromDD4Hep);
php.nCellsFine_ = php.nPhiBinBH_[0];
php.nCellsCoarse_ = php.nPhiBinBH_[1];
php.cellSize_.emplace_back(2.0 * M_PI / php.nCellsFine_);
php.cellSize_.emplace_back(2.0 * M_PI / php.nCellsCoarse_);
php.slopeMin_ = fv.get<std::vector<double> >(sdTag1, "SlopeBottom");
php.zFrontMin_ = fv.get<std::vector<double> >(sdTag1, "ZFrontBottom");
rescale(php.zFrontMin_, HGCalParameters::k_ScaleFromDD4Hep);
php.rMinFront_ = fv.get<std::vector<double> >(sdTag1, "RMinFront");
rescale(php.rMinFront_, HGCalParameters::k_ScaleFromDD4Hep);
php.slopeTop_ = fv.get<std::vector<double> >(sdTag1, "SlopeTop");
php.zFrontTop_ = fv.get<std::vector<double> >(sdTag1, "ZFrontTop");
rescale(php.zFrontTop_, HGCalParameters::k_ScaleFromDD4Hep);
php.rMaxFront_ = fv.get<std::vector<double> >(sdTag1, "RMaxFront");
rescale(php.rMaxFront_, HGCalParameters::k_ScaleFromDD4Hep);
unsigned int kmax = (php.zFrontTop_.size() - php.slopeTop_.size());
for (unsigned int k = 0; k < kmax; ++k)
php.slopeTop_.emplace_back(0);
const auto& dummy2 = fv.get<std::vector<double> >(sdTag1, "LayerOffset");
php.layerOffset_ = dummy2[0];
loadSpecParsTrapezoid(php);
// tile parameters from Katja's file
if (php.waferMaskMode_ == scintillatorFile) {
std::vector<int> tileIndx, tileType, tileSiPM;
std::vector<int> tileHEX1, tileHEX2, tileHEX3, tileHEX4;
std::vector<double> tileRMin, tileRMax;
std::vector<int> tileRingMin, tileRingMax;
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileIndex")) {
for (const auto& i : it.second)
tileIndx.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileType")) {
for (const auto& i : it.second)
tileType.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileSiPM")) {
for (const auto& i : it.second)
tileSiPM.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileHEX1")) {
for (const auto& i : it.second)
tileHEX1.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileHEX2")) {
for (const auto& i : it.second)
tileHEX2.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileHEX3")) {
for (const auto& i : it.second)
tileHEX3.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileHEX4")) {
for (const auto& i : it.second)
tileHEX4.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileRMin")) {
for (const auto& i : it.second)
tileRMin.emplace_back(HGCalParameters::k_ScaleFromDD4Hep * i);
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileRMax")) {
for (const auto& i : it.second)
tileRMax.emplace_back(HGCalParameters::k_ScaleFromDD4Hep * i);
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileRingMin")) {
for (const auto& i : it.second)
tileRingMin.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "TileRingMax")) {
for (const auto& i : it.second)
tileRingMax.emplace_back(std::round(i));
}
}
loadSpecParsTrapezoid(php,
tileIndx,
tileType,
tileSiPM,
tileHEX1,
tileHEX2,
tileHEX3,
tileHEX4,
tileRMin,
tileRMax,
tileRingMin,
tileRingMax);
}
}
void HGCalGeomParameters::loadSpecParsTrapezoid(HGCalParameters& php) {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters:nCells " << php.nCellsFine_ << ":" << php.nCellsCoarse_
<< " cellSize: " << php.cellSize_[0] << ":" << php.cellSize_[1];
for (unsigned int k = 0; k < php.layerFrontBH_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Type[" << k << "] Front Layer = " << php.layerFrontBH_[k]
<< " rMin = " << php.rMinLayerBH_[k];
for (unsigned int k = 0; k < php.radiusMixBoundary_.size(); ++k) {
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Mix[" << k << "] R = " << php.radiusMixBoundary_[k]
<< " Nphi = " << php.scintCells(k + php.firstLayer_)
<< " dPhi = " << php.scintCellSize(k + php.firstLayer_);
}
for (unsigned int k = 0; k < php.zFrontMin_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Boundary[" << k << "] Bottom Z = " << php.zFrontMin_[k]
<< " Slope = " << php.slopeMin_[k] << " rMax = " << php.rMinFront_[k];
for (unsigned int k = 0; k < php.zFrontTop_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Boundary[" << k << "] Top Z = " << php.zFrontTop_[k]
<< " Slope = " << php.slopeTop_[k] << " rMax = " << php.rMaxFront_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Z-Boundary " << php.zRanges_[0] << ":" << php.zRanges_[1] << ":"
<< php.zRanges_[2] << ":" << php.zRanges_[3];
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: LayerOffset " << php.layerOffset_ << " in array of size "
<< php.layerCenter_.size();
for (unsigned int k = 0; k < php.layerCenter_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << php.layerCenter_[k];
#endif
}
void HGCalGeomParameters::loadSpecParsTrapezoid(HGCalParameters& php,
const std::vector<int>& tileIndx,
const std::vector<int>& tileType,
const std::vector<int>& tileSiPM,
const std::vector<int>& tileHEX1,
const std::vector<int>& tileHEX2,
const std::vector<int>& tileHEX3,
const std::vector<int>& tileHEX4,
const std::vector<double>& tileRMin,
const std::vector<double>& tileRMax,
const std::vector<int>& tileRingMin,
const std::vector<int>& tileRingMax) {
// tile parameters from Katja's file
for (unsigned int k = 0; k < tileIndx.size(); ++k) {
php.tileInfoMap_[tileIndx[k]] =
HGCalParameters::tileInfo(tileType[k], tileSiPM[k], tileHEX1[k], tileHEX2[k], tileHEX3[k], tileHEX4[k]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Tile[" << k << ":" << tileIndx[k] << "] "
<< " Type " << tileType[k] << " SiPM " << tileSiPM[k] << " HEX " << std::hex
<< tileHEX1[k] << ":" << tileHEX2[k] << ":" << tileHEX3[k] << ":" << tileHEX4[k]
<< std::dec;
#endif
}
for (unsigned int k = 0; k < tileRMin.size(); ++k) {
php.tileRingR_.emplace_back(tileRMin[k], tileRMax[k]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "TileRingR[" << k << "] " << tileRMin[k] << ":" << tileRMax[k];
#endif
}
for (unsigned k = 0; k < tileRingMin.size(); ++k) {
php.tileRingRange_.emplace_back(tileRingMin[k], tileRingMax[k]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "TileRingRange[" << k << "] " << tileRingMin[k] << ":" << tileRingMax[k];
#endif
}
}
void HGCalGeomParameters::loadWaferHexagon(HGCalParameters& php) {
double waferW(HGCalParameters::k_ScaleFromDDD * waferSize_), rmin(HGCalParameters::k_ScaleFromDDD * php.waferR_);
double rin(php.rLimit_[0]), rout(php.rLimit_[1]), rMaxFine(php.boundR_[1]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Input waferWidth " << waferW << ":" << rmin << " R Limits: " << rin << ":" << rout
<< " Fine " << rMaxFine;
#endif
// Clear the vectors
php.waferCopy_.clear();
php.waferTypeL_.clear();
php.waferTypeT_.clear();
php.waferPosX_.clear();
php.waferPosY_.clear();
double dx = 0.5 * waferW;
double dy = 3.0 * dx * tan(30._deg);
double rr = 2.0 * dx * tan(30._deg);
int ncol = (int)(2.0 * rout / waferW) + 1;
int nrow = (int)(rout / (waferW * tan(30._deg))) + 1;
int ns2 = (2 * ncol + 1) * (2 * nrow + 1) * php.layer_.size();
int incm(0), inrm(0), kount(0), ntot(0);
HGCalParameters::layer_map copiesInLayers(php.layer_.size() + 1);
HGCalParameters::waferT_map waferTypes(ns2 + 1);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Row " << nrow << " Column " << ncol;
#endif
for (int nr = -nrow; nr <= nrow; ++nr) {
int inr = (nr >= 0) ? nr : -nr;
for (int nc = -ncol; nc <= ncol; ++nc) {
int inc = (nc >= 0) ? nc : -nc;
if (inr % 2 == inc % 2) {
double xpos = nc * dx;
double ypos = nr * dy;
std::pair<int, int> corner = HGCalGeomTools::waferCorner(xpos, ypos, dx, rr, rin, rout, true);
double rpos = std::sqrt(xpos * xpos + ypos * ypos);
int typet = (rpos < rMaxFine) ? 1 : 2;
int typel(3);
for (int k = 1; k < 4; ++k) {
if ((rpos + rmin) <= php.boundR_[k]) {
typel = k;
break;
}
}
++ntot;
if (corner.first > 0) {
int copy = HGCalTypes::packTypeUV(typel, nc, nr);
if (inc > incm)
incm = inc;
if (inr > inrm)
inrm = inr;
kount++;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << kount << ":" << ntot << " Copy " << copy << " Type " << typel << ":" << typet
<< " Location " << corner.first << " Position " << xpos << ":" << ypos
<< " Layers " << php.layer_.size();
#endif
php.waferCopy_.emplace_back(copy);
php.waferTypeL_.emplace_back(typel);
php.waferTypeT_.emplace_back(typet);
php.waferPosX_.emplace_back(xpos);
php.waferPosY_.emplace_back(ypos);
for (unsigned int il = 0; il < php.layer_.size(); ++il) {
std::pair<int, int> corner =
HGCalGeomTools::waferCorner(xpos, ypos, dx, rr, php.rMinLayHex_[il], php.rMaxLayHex_[il], true);
if (corner.first > 0) {
auto cpy = copiesInLayers[php.layer_[il]].find(copy);
if (cpy == copiesInLayers[php.layer_[il]].end())
copiesInLayers[php.layer_[il]][copy] =
((corner.first == (int)(HGCalParameters::k_CornerSize)) ? php.waferCopy_.size() : -1);
}
if ((corner.first > 0) && (corner.first < (int)(HGCalParameters::k_CornerSize))) {
int wl = HGCalWaferIndex::waferIndex(php.layer_[il], copy, 0, true);
waferTypes[wl] = corner;
}
}
}
}
}
}
php.copiesInLayers_ = copiesInLayers;
php.waferTypes_ = waferTypes;
php.nSectors_ = (int)(php.waferCopy_.size());
php.waferUVMax_ = 0;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalWaferHexagon: # of columns " << incm << " # of rows " << inrm << " and "
<< kount << ":" << ntot << " wafers; R " << rin << ":" << rout;
edm::LogVerbatim("HGCalGeom") << "Dump copiesInLayers for " << php.copiesInLayers_.size() << " layers";
for (unsigned int k = 0; k < copiesInLayers.size(); ++k) {
const auto& theModules = copiesInLayers[k];
edm::LogVerbatim("HGCalGeom") << "Layer " << k << ":" << theModules.size();
int k2(0);
for (std::unordered_map<int, int>::const_iterator itr = theModules.begin(); itr != theModules.end(); ++itr, ++k2) {
edm::LogVerbatim("HGCalGeom") << "[" << k2 << "] " << itr->first << ":" << itr->second;
}
}
#endif
}
void HGCalGeomParameters::loadWaferHexagon8(HGCalParameters& php) {
double waferW(php.waferSize_);
double waferS(php.sensorSeparation_);
auto wType = std::make_unique<HGCalWaferType>(php.radius100to200_,
php.radius200to300_,
HGCalParameters::k_ScaleToDDD * (waferW + waferS),
HGCalParameters::k_ScaleToDDD * php.zMinForRad_,
php.choiceType_,
php.nCornerCut_,
php.fracAreaMin_);
double rout(php.rLimit_[1]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Input waferWidth " << waferW << ":" << waferS << " R Max: " << rout;
#endif
// Clear the vectors
php.waferCopy_.clear();
php.waferTypeL_.clear();
php.waferTypeT_.clear();
php.waferPosX_.clear();
php.waferPosY_.clear();
double r = 0.5 * (waferW + waferS);
double R = 2.0 * r / sqrt3_;
double dy = 0.75 * R;
double r1 = 0.5 * waferW;
double R1 = 2.0 * r1 / sqrt3_;
int N = (r == 0) ? 3 : ((int)(0.5 * rout / r) + 3);
int ns1 = (2 * N + 1) * (2 * N + 1);
int ns2 = ns1 * php.zLayerHex_.size();
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "wafer " << waferW << ":" << waferS << " r " << r << " dy " << dy << " N " << N
<< " sizes " << ns1 << ":" << ns2;
std::vector<int> indtypes(ns1 + 1);
indtypes.clear();
#endif
HGCalParameters::wafer_map wafersInLayers(ns1 + 1);
HGCalParameters::wafer_map typesInLayers(ns2 + 1);
HGCalParameters::waferT_map waferTypes(ns2 + 1);
int ipos(0), lpos(0), uvmax(0);
std::vector<int> uvmx(php.zLayerHex_.size(), 0);
for (int v = -N; v <= N; ++v) {
for (int u = -N; u <= N; ++u) {
int nr = 2 * v;
int nc = -2 * u + v;
double xpos = nc * r;
double ypos = nr * dy;
int indx = HGCalWaferIndex::waferIndex(0, u, v);
php.waferCopy_.emplace_back(indx);
php.waferPosX_.emplace_back(xpos);
php.waferPosY_.emplace_back(ypos);
wafersInLayers[indx] = ipos;
++ipos;
std::pair<int, int> corner = HGCalGeomTools::waferCorner(xpos, ypos, r1, R1, 0, rout, false);
if ((corner.first == (int)(HGCalParameters::k_CornerSize)) || ((corner.first > 0) && php.defineFull_)) {
uvmax = std::max(uvmax, std::max(std::abs(u), std::abs(v)));
}
for (unsigned int i = 0; i < php.zLayerHex_.size(); ++i) {
int copy = i + php.layerOffset_;
std::pair<double, double> xyoff = geomTools_.shiftXY(php.layerCenter_[copy], (waferW + waferS));
int lay = php.layer_[php.layerIndex_[i]];
double xpos0 = xpos + xyoff.first;
double ypos0 = ypos + xyoff.second;
double zpos = php.zLayerHex_[i];
int kndx = HGCalWaferIndex::waferIndex(lay, u, v);
int type(-1);
if (php.mode_ == HGCalGeometryMode::Hexagon8File)
type = wType->getType(kndx, php.waferInfoMap_);
if (type < 0)
type = wType->getType(HGCalParameters::k_ScaleToDDD * xpos0,
HGCalParameters::k_ScaleToDDD * ypos0,
HGCalParameters::k_ScaleToDDD * zpos);
php.waferTypeL_.emplace_back(type);
typesInLayers[kndx] = lpos;
++lpos;
#ifdef EDM_ML_DEBUG
indtypes.emplace_back(kndx);
#endif
std::pair<int, int> corner =
HGCalGeomTools::waferCorner(xpos0, ypos0, r1, R1, php.rMinLayHex_[i], php.rMaxLayHex_[i], false);
#ifdef EDM_ML_DEBUG
if (((corner.first == 0) && std::abs(u) < 5 && std::abs(v) < 5) || (std::abs(u) < 2 && std::abs(v) < 2)) {
edm::LogVerbatim("HGCalGeom") << "Layer " << lay << " R " << php.rMinLayHex_[i] << ":" << php.rMaxLayHex_[i]
<< " u " << u << " v " << v << " with " << corner.first << " corners";
}
#endif
if ((corner.first == (int)(HGCalParameters::k_CornerSize)) || ((corner.first > 0) && php.defineFull_)) {
uvmx[i] = std::max(uvmx[i], std::max(std::abs(u), std::abs(v)));
}
if ((corner.first < (int)(HGCalParameters::k_CornerSize)) && (corner.first > 0)) {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Layer " << lay << " u|v " << u << ":" << v << " with corner "
<< corner.first << ":" << corner.second;
#endif
int wl = HGCalWaferIndex::waferIndex(lay, u, v);
if (php.waferMaskMode_ > 0) {
std::pair<int, int> corner0 = HGCalWaferMask::getTypeMode(
xpos0, ypos0, r1, R1, php.rMinLayHex_[i], php.rMaxLayHex_[i], type, php.waferMaskMode_);
waferTypes[wl] = corner0;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom")
<< "Layer " << lay << " u|v " << u << ":" << v << " Index " << std::hex << wl << std::dec << " pos "
<< xpos0 << ":" << ypos0 << " R " << r1 << ":" << R1 << " Range " << php.rMinLayHex_[i] << ":"
<< php.rMaxLayHex_[i] << type << ":" << php.waferMaskMode_ << " corner " << corner.first << ":"
<< corner.second << " croner0 " << corner0.first << ":" << corner0.second;
#endif
} else {
waferTypes[wl] = corner;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Layer " << lay << " u|v " << u << ":" << v << " with corner "
<< corner.first << ":" << corner.second;
#endif
}
}
}
}
}
php.waferUVMax_ = uvmax;
php.waferUVMaxLayer_ = uvmx;
php.wafersInLayers_ = wafersInLayers;
php.typesInLayers_ = typesInLayers;
php.waferTypes_ = waferTypes;
php.nSectors_ = (int)(php.waferCopy_.size());
HGCalParameters::hgtrap mytr;
mytr.lay = 1;
mytr.bl = php.waferR_;
mytr.tl = php.waferR_;
mytr.h = php.waferR_;
mytr.alpha = 0.0;
mytr.cellSize = HGCalParameters::k_ScaleToDDD * php.waferSize_;
for (auto const& dz : php.cellThickness_) {
mytr.dz = 0.5 * HGCalParameters::k_ScaleToDDD * dz;
php.fillModule(mytr, false);
}
for (unsigned k = 0; k < php.cellThickness_.size(); ++k) {
HGCalParameters::hgtrap mytr = php.getModule(k, false);
mytr.bl *= HGCalParameters::k_ScaleFromDDD;
mytr.tl *= HGCalParameters::k_ScaleFromDDD;
mytr.h *= HGCalParameters::k_ScaleFromDDD;
mytr.dz *= HGCalParameters::k_ScaleFromDDD;
mytr.cellSize *= HGCalParameters::k_ScaleFromDDD;
php.fillModule(mytr, true);
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Total of " << php.waferCopy_.size() << " wafers";
for (unsigned int k = 0; k < php.waferCopy_.size(); ++k) {
int id = php.waferCopy_[k];
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << std::hex << id << std::dec << ":"
<< HGCalWaferIndex::waferLayer(id) << ":" << HGCalWaferIndex::waferU(id) << ":"
<< HGCalWaferIndex::waferV(id) << " x " << php.waferPosX_[k] << " y "
<< php.waferPosY_[k] << " index " << php.wafersInLayers_[id];
}
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: Total of " << php.waferTypeL_.size() << " wafer types";
for (unsigned int k = 0; k < php.waferTypeL_.size(); ++k) {
int id = indtypes[k];
edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << php.typesInLayers_[id] << ":" << php.waferTypeL_[k] << " ID "
<< std::hex << id << std::dec << ":" << HGCalWaferIndex::waferLayer(id) << ":"
<< HGCalWaferIndex::waferU(id) << ":" << HGCalWaferIndex::waferV(id);
}
#endif
//Wafer offset
php.xLayerHex_.clear();
php.yLayerHex_.clear();
double waferSize = php.waferSize_ + php.sensorSeparation_;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "WaferSize " << waferSize;
#endif
for (unsigned int k = 0; k < php.zLayerHex_.size(); ++k) {
int copy = k + php.layerOffset_;
std::pair<double, double> xyoff = geomTools_.shiftXY(php.layerCenter_[copy], waferSize);
php.xLayerHex_.emplace_back(xyoff.first);
php.yLayerHex_.emplace_back(xyoff.second);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Layer[" << k << "] Off " << copy << ":" << php.layerCenter_[copy] << " Shift "
<< xyoff.first << ":" << xyoff.second;
#endif
}
}
void HGCalGeomParameters::loadCellParsHexagon(const DDCompactView* cpv, HGCalParameters& php) {
// Special parameters for cell parameters
std::string attribute = "OnlyForHGCalNumbering";
DDSpecificsHasNamedValueFilter filter1{attribute};
DDFilteredView fv1(*cpv, filter1);
bool ok = fv1.firstChild();
if (ok) {
php.cellFine_ = dbl_to_int(cpv->vector("waferFine"));
php.cellCoarse_ = dbl_to_int(cpv->vector("waferCoarse"));
}
loadCellParsHexagon(php);
}
void HGCalGeomParameters::loadCellParsHexagon(const cms::DDVectorsMap& vmap, HGCalParameters& php) {
for (auto const& it : vmap) {
if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "waferFine")) {
for (const auto& i : it.second)
php.cellFine_.emplace_back(std::round(i));
} else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "waferCoarse")) {
for (const auto& i : it.second)
php.cellCoarse_.emplace_back(std::round(i));
}
}
loadCellParsHexagon(php);
}
void HGCalGeomParameters::loadCellParsHexagon(const HGCalParameters& php) {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalLoadCellPars: " << php.cellFine_.size() << " rows for fine cells";
for (unsigned int k = 0; k < php.cellFine_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "]: " << php.cellFine_[k];
edm::LogVerbatim("HGCalGeom") << "HGCalLoadCellPars: " << php.cellCoarse_.size() << " rows for coarse cells";
for (unsigned int k = 0; k < php.cellCoarse_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "[" << k << "]: " << php.cellCoarse_[k];
#endif
}
void HGCalGeomParameters::loadCellTrapezoid(HGCalParameters& php) {
php.xLayerHex_.resize(php.zLayerHex_.size(), 0);
php.yLayerHex_.resize(php.zLayerHex_.size(), 0);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalParameters: x|y|zLayerHex in array of size " << php.zLayerHex_.size();
for (unsigned int k = 0; k < php.zLayerHex_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "Layer[" << k << "] Shift " << php.xLayerHex_[k] << ":" << php.yLayerHex_[k] << ":"
<< php.zLayerHex_[k];
#endif
// Find the radius of each eta-partitions
if (php.mode_ == HGCalGeometryMode::TrapezoidFile) {
//Ring radii for each partition
for (unsigned k = 0; k < 2; ++k) {
for (unsigned int kk = 0; kk < php.tileRingR_.size(); ++kk) {
php.radiusLayer_[k].emplace_back(php.tileRingR_[kk].first);
#ifdef EDM_ML_DEBUG
double zv = ((k == 0) ? (php.zLayerHex_[php.layerFrontBH_[1] - php.firstLayer_])
: (php.zLayerHex_[php.zLayerHex_.size() - 1]));
double rv = php.radiusLayer_[k].back();
double eta = -(std::log(std::tan(0.5 * std::atan(rv / zv))));
edm::LogVerbatim("HGCalGeom") << "New [" << kk << "] new R = " << rv << " Eta = " << eta;
#endif
}
}
// Minimum and maximum radius index for each layer
for (unsigned k = 0; k < php.zLayerHex_.size(); ++k) {
php.iradMinBH_.emplace_back(1 + php.tileRingRange_[k].first);
php.iradMaxBH_.emplace_back(php.tileRingRange_[k].second);
#ifdef EDM_ML_DEBUG
int kk = php.scintType(php.firstLayer_ + (int)(k));
edm::LogVerbatim("HGcalGeom") << "New Layer " << k << " Type " << kk << " Low edge " << php.iradMinBH_.back()
<< " Top edge " << php.iradMaxBH_.back();
#endif
}
} else {
//Ring radii for each partition
for (unsigned k = 0; k < 2; ++k) {
double rmax = ((k == 0) ? (php.rMaxLayHex_[php.layerFrontBH_[1] - php.firstLayer_] - 1)
: (php.rMaxLayHex_[php.rMaxLayHex_.size() - 1]));
double rv = php.rMinLayerBH_[k];
double zv = ((k == 0) ? (php.zLayerHex_[php.layerFrontBH_[1] - php.firstLayer_])
: (php.zLayerHex_[php.zLayerHex_.size() - 1]));
php.radiusLayer_[k].emplace_back(rv);
#ifdef EDM_ML_DEBUG
double eta = -(std::log(std::tan(0.5 * std::atan(rv / zv))));
edm::LogVerbatim("HGCalGeom") << "Old [" << k << "] rmax " << rmax << " Z = " << zv
<< " dEta = " << php.cellSize_[k] << "\nOld[0] new R = " << rv << " Eta = " << eta;
int kount(1);
#endif
while (rv < rmax) {
double eta = -(php.cellSize_[k] + std::log(std::tan(0.5 * std::atan(rv / zv))));
rv = zv * std::tan(2.0 * std::atan(std::exp(-eta)));
php.radiusLayer_[k].emplace_back(rv);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Old [" << kount << "] new R = " << rv << " Eta = " << eta;
++kount;
#endif
}
}
// Find minimum and maximum radius index for each layer
for (unsigned k = 0; k < php.zLayerHex_.size(); ++k) {
int kk = php.scintType(php.firstLayer_ + (int)(k));
std::vector<double>::iterator low, high;
low = std::lower_bound(php.radiusLayer_[kk].begin(), php.radiusLayer_[kk].end(), php.rMinLayHex_[k]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Old [" << k << "] RLow = " << php.rMinLayHex_[k] << " pos "
<< (int)(low - php.radiusLayer_[kk].begin());
#endif
if (low == php.radiusLayer_[kk].begin())
++low;
int irlow = (int)(low - php.radiusLayer_[kk].begin());
double drlow = php.radiusLayer_[kk][irlow] - php.rMinLayHex_[k];
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "irlow " << irlow << " dr " << drlow << " min " << php.minTileSize_;
#endif
if (drlow < php.minTileSize_) {
++irlow;
#ifdef EDM_ML_DEBUG
drlow = php.radiusLayer_[kk][irlow] - php.rMinLayHex_[k];
edm::LogVerbatim("HGCalGeom") << "Modified irlow " << irlow << " dr " << drlow;
#endif
}
high = std::lower_bound(php.radiusLayer_[kk].begin(), php.radiusLayer_[kk].end(), php.rMaxLayHex_[k]);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Old [" << k << "] RHigh = " << php.rMaxLayHex_[k] << " pos "
<< (int)(high - php.radiusLayer_[kk].begin());
#endif
if (high == php.radiusLayer_[kk].end())
--high;
int irhigh = (int)(high - php.radiusLayer_[kk].begin());
double drhigh = php.rMaxLayHex_[k] - php.radiusLayer_[kk][irhigh - 1];
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "irhigh " << irhigh << " dr " << drhigh << " min " << php.minTileSize_;
#endif
if (drhigh < php.minTileSize_) {
--irhigh;
#ifdef EDM_ML_DEBUG
drhigh = php.rMaxLayHex_[k] - php.radiusLayer_[kk][irhigh - 1];
edm::LogVerbatim("HGCalGeom") << "Modified irhigh " << irhigh << " dr " << drhigh;
#endif
}
php.iradMinBH_.emplace_back(irlow);
php.iradMaxBH_.emplace_back(irhigh);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGcalGeom") << "Old Layer " << k << " Type " << kk << " Low edge " << irlow << ":" << drlow
<< " Top edge " << irhigh << ":" << drhigh;
#endif
}
}
// Now define the volumes
int im(0);
php.waferUVMax_ = 0;
HGCalParameters::hgtrap mytr;
mytr.alpha = 0.0;
for (unsigned int k = 0; k < php.zLayerHex_.size(); ++k) {
if (php.iradMaxBH_[k] > php.waferUVMax_)
php.waferUVMax_ = php.iradMaxBH_[k];
int kk = ((php.firstLayer_ + (int)(k)) < php.layerFrontBH_[1]) ? 0 : 1;
int irm = php.radiusLayer_[kk].size() - 1;
#ifdef EDM_ML_DEBUG
double rmin = php.radiusLayer_[kk][std::max((php.iradMinBH_[k] - 1), 0)];
double rmax = php.radiusLayer_[kk][std::min(php.iradMaxBH_[k], irm)];
edm::LogVerbatim("HGCalGeom") << "Layer " << php.firstLayer_ + k << ":" << kk << " Radius range "
<< php.iradMinBH_[k] << ":" << php.iradMaxBH_[k] << ":" << rmin << ":" << rmax;
#endif
mytr.lay = php.firstLayer_ + k;
for (int irad = php.iradMinBH_[k]; irad <= php.iradMaxBH_[k]; ++irad) {
double rmin = php.radiusLayer_[kk][std::max((irad - 1), 0)];
double rmax = php.radiusLayer_[kk][std::min(irad, irm)];
mytr.bl = 0.5 * rmin * php.scintCellSize(mytr.lay);
mytr.tl = 0.5 * rmax * php.scintCellSize(mytr.lay);
mytr.h = 0.5 * (rmax - rmin);
mytr.dz = 0.5 * php.waferThick_;
mytr.cellSize = 0.5 * (rmax + rmin) * php.scintCellSize(mytr.lay);
php.fillModule(mytr, true);
mytr.bl *= HGCalParameters::k_ScaleToDDD;
mytr.tl *= HGCalParameters::k_ScaleToDDD;
mytr.h *= HGCalParameters::k_ScaleToDDD;
mytr.dz *= HGCalParameters::k_ScaleToDDD;
mytr.cellSize *= HGCalParameters::k_ScaleFromDDD;
php.fillModule(mytr, false);
if (irad == php.iradMinBH_[k])
php.firstModule_.emplace_back(im);
++im;
if (irad == php.iradMaxBH_[k] - 1)
php.lastModule_.emplace_back(im);
}
}
php.nSectors_ = php.waferUVMax_;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "Maximum radius index " << php.waferUVMax_;
for (unsigned int k = 0; k < php.firstModule_.size(); ++k)
edm::LogVerbatim("HGCalGeom") << "Layer " << k + php.firstLayer_ << " Modules " << php.firstModule_[k] << ":"
<< php.lastModule_[k];
#endif
}
std::vector<double> HGCalGeomParameters::getDDDArray(const std::string& str, const DDsvalues_type& sv, const int nmin) {
DDValue value(str);
if (DDfetch(&sv, value)) {
const std::vector<double>& fvec = value.doubles();
int nval = fvec.size();
if (nmin > 0) {
if (nval < nmin) {
throw cms::Exception("DDException")
<< "HGCalGeomParameters: # of " << str << " bins " << nval << " < " << nmin << " ==> illegal";
}
} else {
if (nval < 1 && nmin == 0) {
throw cms::Exception("DDException")
<< "HGCalGeomParameters: # of " << str << " bins " << nval << " < 1 ==> illegal"
<< " (nmin=" << nmin << ")";
}
}
return fvec;
} else {
if (nmin >= 0) {
throw cms::Exception("DDException") << "HGCalGeomParameters: cannot get array " << str;
}
std::vector<double> fvec;
return fvec;
}
}
std::pair<double, double> HGCalGeomParameters::cellPosition(
const std::vector<HGCalGeomParameters::cellParameters>& wafers,
std::vector<HGCalGeomParameters::cellParameters>::const_iterator& itrf,
int wafer,
double xx,
double yy) {
if (itrf == wafers.end()) {
for (std::vector<HGCalGeomParameters::cellParameters>::const_iterator itr = wafers.begin(); itr != wafers.end();
++itr) {
if (itr->wafer == wafer) {
itrf = itr;
break;
}
}
}
double dx(0), dy(0);
if (itrf != wafers.end()) {
dx = (xx - itrf->xyz.x());
if (std::abs(dx) < tolerance)
dx = 0;
dy = (yy - itrf->xyz.y());
if (std::abs(dy) < tolerance)
dy = 0;
}
return std::make_pair(dx, dy);
}
void HGCalGeomParameters::rescale(std::vector<double>& v, const double s) {
std::for_each(v.begin(), v.end(), [s](double& n) { n *= s; });
}
void HGCalGeomParameters::resetZero(std::vector<double>& v) {
for (auto n : v)
if (std::abs(n) < tolmin)
n = 0;
}
| {
"pile_set_name": "Github"
} |
import win32ras
stateStrings = {
win32ras.RASCS_OpenPort : "OpenPort",
win32ras.RASCS_PortOpened : "PortOpened",
win32ras.RASCS_ConnectDevice : "ConnectDevice",
win32ras.RASCS_DeviceConnected : "DeviceConnected",
win32ras.RASCS_AllDevicesConnected : "AllDevicesConnected",
win32ras.RASCS_Authenticate : "Authenticate",
win32ras.RASCS_AuthNotify : "AuthNotify",
win32ras.RASCS_AuthRetry : "AuthRetry",
win32ras.RASCS_AuthCallback : "AuthCallback",
win32ras.RASCS_AuthChangePassword : "AuthChangePassword",
win32ras.RASCS_AuthProject : "AuthProject",
win32ras.RASCS_AuthLinkSpeed : "AuthLinkSpeed",
win32ras.RASCS_AuthAck : "AuthAck",
win32ras.RASCS_ReAuthenticate : "ReAuthenticate",
win32ras.RASCS_Authenticated : "Authenticated",
win32ras.RASCS_PrepareForCallback : "PrepareForCallback",
win32ras.RASCS_WaitForModemReset : "WaitForModemReset",
win32ras.RASCS_WaitForCallback : "WaitForCallback",
win32ras.RASCS_Projected : "Projected",
win32ras.RASCS_StartAuthentication : "StartAuthentication",
win32ras.RASCS_CallbackComplete : "CallbackComplete",
win32ras.RASCS_LogonNetwork : "LogonNetwork",
win32ras.RASCS_Interactive : "Interactive",
win32ras.RASCS_RetryAuthentication : "RetryAuthentication",
win32ras.RASCS_CallbackSetByCaller : "CallbackSetByCaller",
win32ras.RASCS_PasswordExpired : "PasswordExpired",
win32ras.RASCS_Connected : "Connected",
win32ras.RASCS_Disconnected : "Disconnected"
}
def TestCallback( hras, msg, state, error, exterror):
print("Callback called with ", hras, msg, stateStrings[state], error, exterror)
def test(rasName = "_ Divert Off"):
return win32ras.Dial(None, None, (rasName,),TestCallback) | {
"pile_set_name": "Github"
} |
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z" />
, 'FormatTextdirectionRToLOutlined');
| {
"pile_set_name": "Github"
} |
!=====================================================================
!
! UTM (Universal Transverse Mercator) projection from the USGS
!
!=====================================================================
subroutine utm_geo(rlon,rlat,rx,ry,UTM_PROJECTION_ZONE,iway,SUPPRESS_UTM_PROJECTION)
! convert geodetic longitude and latitude to UTM, and back
! use iway = ILONGLAT2UTM for long/lat to UTM, IUTM2LONGLAT for UTM to lat/long
! a list of UTM zones of the world is available at www.dmap.co.uk/utmworld.htm
implicit none
include "constants.h"
!
!-----CAMx v2.03
!
! UTM_GEO performs UTM to geodetic (long/lat) translation, and back.
!
! This is a Fortran version of the BASIC program "Transverse Mercator
! Conversion", Copyright 1986, Norman J. Berls (Stefan Musarra, 2/94)
! Based on algorithm taken from "Map Projections Used by the USGS"
! by John P. Snyder, Geological Survey Bulletin 1532, USDI.
!
! Input/Output arguments:
!
! rlon Longitude (deg, negative for West)
! rlat Latitude (deg)
! rx UTM easting (m)
! ry UTM northing (m)
! UTM_PROJECTION_ZONE UTM zone
! iway Conversion type
! ILONGLAT2UTM = geodetic to UTM
! IUTM2LONGLAT = UTM to geodetic
!
integer UTM_PROJECTION_ZONE,iway
double precision rx,ry,rlon,rlat
logical SUPPRESS_UTM_PROJECTION
double precision, parameter :: degrad=PI/180., raddeg=180./PI
double precision, parameter :: semimaj=6378206.4d0, semimin=6356583.8d0
double precision, parameter :: scfa=.9996d0
double precision, parameter :: north=0.d0, east=500000.d0
double precision e2,e4,e6,ep2,xx,yy,dlat,dlon,zone,cm,cmr,delam
double precision f1,f2,f3,f4,rm,rn,t,c,a,e1,u,rlat1,dlat1,c1,t1,rn1,r1,d
double precision rx_save,ry_save,rlon_save,rlat_save
if (SUPPRESS_UTM_PROJECTION) then
if (iway == ILONGLAT2UTM) then
rx = rlon
ry = rlat
else
rlon = rx
rlat = ry
endif
return
endif
! save original parameters
rlon_save = rlon
rlat_save = rlat
rx_save = rx
ry_save = ry
! define parameters of reference ellipsoid
e2=1.0-(semimin/semimaj)**2.0
e4=e2*e2
e6=e2*e4
ep2=e2/(1.-e2)
if (iway == IUTM2LONGLAT) then
xx = rx
yy = ry
else
dlon = rlon
dlat = rlat
endif
!
!----- Set Zone parameters
!
zone = dble(UTM_PROJECTION_ZONE)
cm = zone*6.0 - 183.0
cmr = cm*degrad
!
!---- Lat/Lon to UTM conversion
!
if (iway == ILONGLAT2UTM) then
rlon = degrad*dlon
rlat = degrad*dlat
delam = dlon - cm
if (delam < -180.) delam = delam + 360.
if (delam > 180.) delam = delam - 360.
delam = delam*degrad
f1 = (1. - e2/4. - 3.*e4/64. - 5.*e6/256)*rlat
f2 = 3.*e2/8. + 3.*e4/32. + 45.*e6/1024.
f2 = f2*sin(2.*rlat)
f3 = 15.*e4/256.*45.*e6/1024.
f3 = f3*sin(4.*rlat)
f4 = 35.*e6/3072.
f4 = f4*sin(6.*rlat)
rm = semimaj*(f1 - f2 + f3 - f4)
if (dlat == 90. .or. dlat == -90.) then
xx = 0.
yy = scfa*rm
else
rn = semimaj/sqrt(1. - e2*sin(rlat)**2)
t = tan(rlat)**2
c = ep2*cos(rlat)**2
a = cos(rlat)*delam
f1 = (1. - t + c)*a**3/6.
f2 = 5. - 18.*t + t**2 + 72.*c - 58.*ep2
f2 = f2*a**5/120.
xx = scfa*rn*(a + f1 + f2)
f1 = a**2/2.
f2 = 5. - t + 9.*c + 4.*c**2
f2 = f2*a**4/24.
f3 = 61. - 58.*t + t**2 + 600.*c - 330.*ep2
f3 = f3*a**6/720.
yy = scfa*(rm + rn*tan(rlat)*(f1 + f2 + f3))
endif
xx = xx + east
yy = yy + north
!
!---- UTM to Lat/Lon conversion
!
else
xx = xx - east
yy = yy - north
e1 = sqrt(1. - e2)
e1 = (1. - e1)/(1. + e1)
rm = yy/scfa
u = 1. - e2/4. - 3.*e4/64. - 5.*e6/256.
u = rm/(semimaj*u)
f1 = 3.*e1/2. - 27.*e1**3./32.
f1 = f1*sin(2.*u)
f2 = 21.*e1**2/16. - 55.*e1**4/32.
f2 = f2*sin(4.*u)
f3 = 151.*e1**3./96.
f3 = f3*sin(6.*u)
rlat1 = u + f1 + f2 + f3
dlat1 = rlat1*raddeg
if (dlat1 >= 90. .or. dlat1 <= -90.) then
dlat1 = dmin1(dlat1,dble(90.) )
dlat1 = dmax1(dlat1,dble(-90.) )
dlon = cm
else
c1 = ep2*cos(rlat1)**2.
t1 = tan(rlat1)**2.
f1 = 1. - e2*sin(rlat1)**2.
rn1 = semimaj/sqrt(f1)
r1 = semimaj*(1. - e2)/sqrt(f1**3)
d = xx/(rn1*scfa)
f1 = rn1*tan(rlat1)/r1
f2 = d**2/2.
f3 = 5.*3.*t1 + 10.*c1 - 4.*c1**2 - 9.*ep2
f3 = f3*d**2*d**2/24.
f4 = 61. + 90.*t1 + 298.*c1 + 45.*t1**2. - 252.*ep2 - 3.*c1**2
f4 = f4*(d**2)**3./720.
rlat = rlat1 - f1*(f2 - f3 + f4)
dlat = rlat*raddeg
f1 = 1. + 2.*t1 + c1
f1 = f1*d**2*d/6.
f2 = 5. - 2.*c1 + 28.*t1 - 3.*c1**2 + 8.*ep2 + 24.*t1**2.
f2 = f2*(d**2)**2*d/120.
rlon = cmr + (d - f1 + f2)/cos(rlat1)
dlon = rlon*raddeg
if (dlon < -180.) dlon = dlon + 360.
if (dlon > 180.) dlon = dlon - 360.
endif
endif
if (iway == IUTM2LONGLAT) then
rlon = dlon
rlat = dlat
rx = rx_save
ry = ry_save
else
rx = xx
ry = yy
rlon = rlon_save
rlat = rlat_save
endif
end subroutine utm_geo
| {
"pile_set_name": "Github"
} |
{ mkDerivation, extra-cmake-modules, qtbase, ki18n }:
mkDerivation {
name = "kdecoration";
meta = {
broken = builtins.compareVersions qtbase.version "5.12.0" < 0;
};
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ qtbase ki18n ];
outputs = [ "out" "dev" ];
broken = true;
}
| {
"pile_set_name": "Github"
} |
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef BASEPLAYER_SHARED_H
#define BASEPLAYER_SHARED_H
#ifdef _WIN32
#pragma once
#endif
// PlayerUse defines
#define PLAYER_USE_RADIUS 80.f
#define CONE_45_DEGREES 0.707f
#define CONE_15_DEGREES 0.9659258f
#define CONE_90_DEGREES 0
#define TRAIN_ACTIVE 0x80
#define TRAIN_NEW 0xc0
#define TRAIN_OFF 0x00
#define TRAIN_NEUTRAL 0x01
#define TRAIN_SLOW 0x02
#define TRAIN_MEDIUM 0x03
#define TRAIN_FAST 0x04
#define TRAIN_BACK 0x05
// entity messages
#define PLAY_PLAYER_JINGLE 1
#define UPDATE_PLAYER_RADAR 2
#define DEATH_ANIMATION_TIME 3.0f
typedef struct
{
Vector m_vecAutoAimDir; // The direction autoaim wishes to point.
Vector m_vecAutoAimPoint; // The point (world space) that autoaim is aiming at.
EHANDLE m_hAutoAimEntity; // The entity that autoaim is aiming at.
bool m_bAutoAimAssisting; // If this is true, autoaim is aiming at the target. If false, the player is naturally aiming.
bool m_bOnTargetNatural;
float m_fScale;
float m_fMaxDist;
} autoaim_params_t;
enum stepsoundtimes_t
{
STEPSOUNDTIME_NORMAL = 0,
STEPSOUNDTIME_ON_LADDER,
STEPSOUNDTIME_WATER_KNEE,
STEPSOUNDTIME_WATER_FOOT,
};
void CopySoundNameWithModifierToken( char *pchDest, const char *pchSource, int nMaxLenInChars, const char *pchToken );
// Shared header file for players
#if defined( CLIENT_DLL )
#define CBasePlayer C_BasePlayer
#include "c_baseplayer.h"
#else
#include "player.h"
#endif
#endif // BASEPLAYER_SHARED_H
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: zccrs <zccrs@live.com>
*
* Maintainer: zccrs <zhangjide@deepin.com>
*
* 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
* 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/>.
*/
#ifndef DFMSETTINGS_H
#define DFMSETTINGS_H
#include <QObject>
#include <QVariantHash>
#include "dfmglobal.h"
DFM_BEGIN_NAMESPACE
class DFMSettingsPrivate;
class DFMSettings : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(DFMSettings)
Q_PROPERTY(bool autoSync READ autoSync WRITE setAutoSync)
#ifndef DFM_NO_FILE_WATCHER
Q_PROPERTY(bool watchChanges READ watchChanges WRITE setWatchChanges)
#endif
public:
enum ConfigType {
AppConfig,
GenericConfig
};
explicit DFMSettings(const QString &defaultFile, const QString &fallbackFile, const QString &settingFile, QObject *parent = nullptr);
explicit DFMSettings(const QString &name, ConfigType type = AppConfig, QObject *parent = nullptr);
~DFMSettings();
bool contains(const QString &group, const QString &key) const;
QSet<QString> groups() const;
QSet<QString> keys(const QString &group) const;
QStringList keyList(const QString &group) const;
static DUrl toUrlValue(const QVariant &url);
QVariant value(const QString &group, const QString &key, const QVariant &defaultValue = QVariant()) const;
QVariant value(const QString &group, const DUrl &key, const QVariant &defaultValue = QVariant()) const;
DUrl urlValue(const QString &group, const QString &key, const DUrl &defaultValue = DUrl()) const;
DUrl urlValue(const QString &group, const DUrl &key, const DUrl &defaultValue = DUrl()) const;
void setValue(const QString &group, const QString &key, const QVariant &value);
void setValue(const QString &group, const DUrl &key, const QVariant &value);
// if changed return true
bool setValueNoNotify(const QString &group, const QString &key, const QVariant &value);
bool setValueNoNotify(const QString &group, const DUrl &key, const QVariant &value);
void removeGroup(const QString &group);
bool isRemovable(const QString &group, const QString &key) const;
bool isRemovable(const QString &group, const DUrl &key) const;
void remove(const QString &group, const QString &key);
void remove(const QString &group, const DUrl &key);
void clear();
void reload();
bool sync();
bool autoSync() const;
#ifndef DFM_NO_FILE_WATCHER
bool watchChanges() const;
#endif
public Q_SLOTS:
void setAutoSync(bool autoSync);
#ifndef DFM_NO_FILE_WATCHER
void setWatchChanges(bool watchChanges);
#endif
Q_SIGNALS:
void valueChanged(const QString &group, const QString &key, const QVariant &value);
void valueEdited(const QString &group, const QString &key, const QVariant &value);
private:
QScopedPointer<DFMSettingsPrivate> d_ptr;
#ifndef DFM_NO_FILE_WATCHER
void onFileChanged(const DUrl &);
#endif
};
DFM_END_NAMESPACE
#endif // DFMSETTINGS_H
| {
"pile_set_name": "Github"
} |
<?php
/*
* OAuth2 Client Bundle
* Copyright (c) KnpUniversity <http://knpuniversity.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KnpU\OAuth2ClientBundle\Security\Exception;
use Exception;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
/**
* Used to help direct a user to "finish registration" during Guard authentication.
*/
class FinishRegistrationException extends AuthenticationException
{
private $userInformation;
/**
* @param mixed $userInfo Any info to be used to help registration
* @param string $message
* @param int $code
* @param \Exception $previous
*/
public function __construct($userInfo, $message = '', $code = 0, Exception $previous = null)
{
$this->userInformation = $userInfo;
parent::__construct($message, $code, $previous);
}
public function getUserInformation()
{
return $this->userInformation;
}
/**
* This method should *not* be called normally. The purpose
* of this exception is to be a "flag" for code that will
* redirect the user to some "finish registration" page. If
* this message is shown to your user, then you're missing
* this piece of your code.
*/
public function getMessageKey(): string
{
return 'You need to finish registration to login.';
}
}
| {
"pile_set_name": "Github"
} |
package com.zhuanghongji.mpchartexample.notimportant;
/**
* Created by Philipp Jahoda on 07/12/15.
*/
public class ContentItem {
String name;
String desc;
boolean isNew = false;
public ContentItem(String n, String d) {
name = n;
desc = d;
}
}
| {
"pile_set_name": "Github"
} |
// @filename: file.tsx
// @jsx: preserve
// @module: amd
// @noLib: true
// @skipLibCheck: true
// @libFiles: react.d.ts,lib.d.ts
import React = require('react')
declare function OneThing(): JSX.Element;
declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
let obj = {
yy: 10,
yy1: "hello"
}
let obj1 = {
yy: true
}
let obj2 = {
yy: 500,
"ignore-prop": "hello"
}
let defaultObj: any;
// OK
const c1 = <OneThing />
const c2 = <OneThing {...obj}/>
const c3 = <OneThing {...{}} />
const c4 = <OneThing {...obj1} {...obj} />
const c5 = <OneThing {...obj1} yy={42} {...{yy1: "hi"}}/>
const c6 = <OneThing {...obj1} {...{yy: 10000, yy1: "true"}} />
const c7 = <OneThing {...defaultObj} yy {...obj} />; // No error. should pick second overload
const c8 = <OneThing ignore-prop={100} />
const c9 = <OneThing {...{ "ignore-prop":200 }} />;
const c10 = <OneThing {...obj2} yy1="boo" />;
| {
"pile_set_name": "Github"
} |
uniform vec4 _Detail_ST;
uniform mat4 _LightMatrix0;
uniform vec4 _MainTex_ST;
uniform mat4 _Object2World;
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 unity_Scale;
varying vec4 xlv_FOG;
void main ()
{
vec4 tmpvar_1;
vec4 pos_2;
pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
tmpvar_1.zw = ((gl_MultiTexCoord1.xy * _Detail_ST.xy) + _Detail_ST.zw);
mat3 tmpvar_3;
tmpvar_3[0] = _Object2World[0].xyz;
tmpvar_3[1] = _Object2World[1].xyz;
tmpvar_3[2] = _Object2World[2].xyz;
gl_Position = pos_2;
vec4 tmpvar_4;
tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
tmpvar_4.x = pos_2.z;
xlv_FOG = tmpvar_4;
gl_TexCoord[0] = tmpvar_1;
vec4 tmpvar_5;
tmpvar_5.w = 0.0;
tmpvar_5.xyz = (tmpvar_3 * (gl_Normal * unity_Scale.w));
gl_TexCoord[1] = tmpvar_5;
vec4 tmpvar_6;
tmpvar_6.w = 0.0;
vec4 tmpvar_7;
tmpvar_7 = (_Object2World * gl_Vertex);
tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
gl_TexCoord[2] = tmpvar_6;
gl_TexCoord[3] = (_LightMatrix0 * tmpvar_7);
}
// stats: 13 alu 0 tex 0 flow
// inputs: 4
// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
// #2: gl_Normal (high float) 3x1 [-1] loc 2
// #3: gl_Vertex (high float) 4x1 [-1] loc 0
// uniforms: 7 (total size: 0)
// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
// #1: _Detail_ST (high float) 4x1 [-1]
// #2: _LightMatrix0 (high float) 4x4 [-1]
// #3: _MainTex_ST (high float) 4x1 [-1]
// #4: _Object2World (high float) 4x4 [-1]
// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1]
// #6: unity_Scale (high float) 4x1 [-1]
| {
"pile_set_name": "Github"
} |
<?php
$lang = array(
'rss_invalid_channel' => 'The channel specified in your RSS feed does not exist.',
'rss_module_description' => 'RSS page generating module',
'rss_module_name' => 'RSS',
);
// EOF
| {
"pile_set_name": "Github"
} |
/* Copyright 2012 10gen 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.
*/
#include "mongo/base/status.h"
#include <ostream>
#include <sstream>
namespace mongo {
Status::ErrorInfo* Status::getOKInfo() {
static ErrorInfo* okInfo = new ErrorInfo(ErrorCodes::OK, "", 0);
return okInfo;
}
Status::ErrorInfo::ErrorInfo(ErrorCodes::Error aCode, const std::string& aReason, int aLocation)
: code(aCode), reason(aReason), location(aLocation) {}
Status::Status(ErrorCodes::Error code, const char* reason, int location) {
_error = new ErrorInfo(code, std::string(reason), location);
ref(_error);
}
Status::Status(ErrorCodes::Error code, const std::string& reason, int location) {
_error = new ErrorInfo(code, reason, location);
ref(_error);
}
Status::Status(ErrorInfo* info) {
_error = info;
ref(info);
}
Status::Status(const Status& other) {
ref(other._error);
_error = other._error;
}
Status& Status::operator=(const Status& other) {
ref(other._error);
unref(_error);
_error = other._error;
return *this;
}
Status::~Status() {
unref(_error);
}
bool Status::compare(const Status& other) const {
return _error->code == other._error->code &&
_error->location == other._error->location;
}
bool Status::operator==(const Status& other) const {
return compare(other);
}
bool Status::operator!=(const Status& other) const {
return ! compare(other);
}
bool Status::compareCode(const ErrorCodes::Error other) const {
return _error->code == other;
}
bool Status::operator==(const ErrorCodes::Error other) const {
return compareCode(other);
}
bool Status::operator!=(const ErrorCodes::Error other) const {
return ! compareCode(other);
}
void Status::ref(ErrorInfo* error) {
// okInfo is never deallocated, so no need to bump ref here.
if (error == getOKInfo()) {
return;
}
error->refs.fetchAndAdd(1);
}
void Status::unref(ErrorInfo* error) {
// okInfo is never deallocated.
if (error == getOKInfo()) {
return;
}
if (error->refs.subtractAndFetch(1) == 0) {
delete error;
}
}
std::ostream& operator<<(std::ostream& os, const Status& status) {
return os << status.codeString() << " " << status.reason();
}
std::ostream& operator<<(std::ostream& os, ErrorCodes::Error code) {
return os << ErrorCodes::errorString(code);
}
std::string Status::toString() const {
std::ostringstream ss;
ss << codeString();
if ( !isOK() )
ss << " " << reason();
if ( location() != 0 )
ss << " @ " << location();
return ss.str();
}
namespace {
/// Ensure that Status::OK() is called at least once in single threaded context,
/// by creating a global variable whose static initializer calls it.
Status okStatusInstance = Status::OK();
} // namespace
} // namespace mongo
| {
"pile_set_name": "Github"
} |
Title: Peach Class 1
Country and volume: Italy, ca 175g
Description: Peach is a stone fruit with yellow or orange pulp and velvety shell. Suitable for eating naturally but can also be used for pastry, marmalade and jam.
URL: https://www.hemkop.se/produkt/Persika-Klass-1-100257703_KG
| {
"pile_set_name": "Github"
} |
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
| {
"pile_set_name": "Github"
} |
<?php
/*
* $Id$
*
* 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.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
/**
* Doctrine_Query_Filter_Chain
*
* @package Doctrine
* @subpackage Query
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Query_Filter_Chain
{
/**
* @var array $_filters an array of Doctrine_Query_Filter objects
*/
protected $_filters = array();
/**
* add
*
* @param Doctrine_Query_Filter $filter
* @return void
*/
public function add(Doctrine_Query_Filter $filter)
{
$this->_filters[] = $filter;
}
/**
* returns a Doctrine_Query_Filter on success
* and null on failure
*
* @param mixed $key
* @return mixed
*/
public function get($key)
{
if ( ! isset($this->_filters[$key])) {
throw new Doctrine_Query_Exception('Unknown filter ' . $key);
}
return $this->_filters[$key];
}
/**
* set
*
* @param mixed $key
* @param Doctrine_Query_Filter $listener
* @return void
*/
public function set($key, Doctrine_Query_Filter $listener)
{
$this->_filters[$key] = $listener;
}
/**
* preQuery
*
* Method for listening the preQuery method of Doctrine_Query and
* hooking into the query building procedure, doing any custom / specialized
* query building procedures that are neccessary.
*
* @return void
*/
public function preQuery(Doctrine_Query $query)
{
foreach ($this->_filters as $filter) {
$filter->preQuery($query);
}
}
/**
* postQuery
*
* Method for listening the postQuery method of Doctrine_Query and
* to hook into the query building procedure, doing any custom / specialized
* post query procedures (for example logging) that are neccessary.
*
* @return void
*/
public function postQuery(Doctrine_Query $query)
{
foreach ($this->_filters as $filter) {
$filter->postQuery($query);
}
}
} | {
"pile_set_name": "Github"
} |
<h2>Grain Mill</h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc">Here your grain is milled in order to produce flour. Based on its level your grain mill can increase your crop production by up to 25 percent.</td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(8,4);">
<img class="building g8" src="img/x.gif" alt="Grain Mill" title="Grain Mill" /></a>
</td>
</tr>
<tr>
<td class="requ">Prerequisites</td>
</tr>
<tr>
<td>
<a href="#" onClick="return Popup(4,4);">Cropland</a> <span title="+4">Level 5</span>
</td>
</tr></tbody>
</table> | {
"pile_set_name": "Github"
} |
export const DEFAULT_CONFIG = {
package: {
include: [],
exclude: []
},
environment: {}
}
| {
"pile_set_name": "Github"
} |
{
"name": "maxreams",
"version": "0.1.2",
"description": "Gejrs MaxReams",
"main": "main.js",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com:TheGejr/MaxReams.git"
},
"author": "Malte Gejr <maxreams@gejr.dk>",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/TheGejr/MaxReams/issues"
},
"homepage": "https://github.com/TheGejr/MaxReams#README",
"dependencies": {
"csvtojson": "^2.0.8",
"electron-log": "^2.2.17",
"electron-updater": "^4.0.6",
"material-design-lite": "^1.3.0",
"os-locale": "^3.1.0",
"print-js": "^1.0.54"
}
} | {
"pile_set_name": "Github"
} |
# Lab 1: Reward Function Constructors Championship!
#### Time breakdown
- Presenter provides competition and covers competition : 2 minutes
- Teams read lab content : 13 minutes
- Teams discuss and implement your reward function and start training : 15 minutes
- Total : 30 minutes
## Overview
The goal of lab 1 is to get you familiar with the reward functions used to create RL models for AWS DeepRacer. To this end we have created an informal competition called the Reward Function Constructors Championship, where your team will compete to win bragging rights. The competition will also give you an overview of the AWS DeepRacer simulator found in the AWS Console.
## Reward Function Championship Instructions
Form a team with the other attendees at your table. Your team needs to engineer a reward function that will power you car, and the first team to reach the middle of the hairpin (the next turn on the track) with screenshot proof wins. The following image shows you where the finish line is. Note the finish line won't be on the track, so if you get halfway through the hairpin that is it, take a screenshot and shout out! Since it takes 6 minutes to spin up the containers, please train your model for at least 15 minutes.

Please read through the following sections and when you are finished feel free to start discussing in your team which reward function you need to create to reach the objective. You will have 13 minutes to read the content, and once done 15 minutes to debate and implement your reward function and kickoff training. Feel free to start discussing when you are done reading. Before you start training, nominate just one person to start training. We will continue with the workshop after the 30 minutes and this person will have to monitor the progress of training during the workshop. Everyone will get to implement their own reward function during lab 2.
Tip: As you read through the next sections carefully consider what behavior do you want to incentivize to ensure your car stays on track and makes the turn. You will have to write your reward function using Python3, but we provide three good examples to look at.
Let's get going!
## Step 1: AWS Console
Logon to the AWS Console using the account details provided to you.
Navigate to AWS DeepRacer, https://console.aws.amazon.com/deepracer/home?region=us-east-1
From the AWS DeepRacer landing page, expand the pane on the left and select **Reinforcement learning.**
## Step 2: Model List Page
This page gives a list of all the models you have created and each model's respective status.

If you don't have any models this list will be empty, and you can create a model by choosing **Create model**.
Once you have created models you can use this page to view the status of the model, for example is it training, or ready to download or evaluate. You can click on the model's name to proceed to the Model details page. Alternatively selecting the radio button next to a model name will allow you to delete the model, clone the model, or download the model, if training has completed.
Choose **Create model**
## Step 3: Create model
This page gives you the ability to create an RL model for AWS DeepRacer and start training. There are a few sections on the page, so let's look at each in detail.
#### Model details
Here you have the ability to name your model, provide a model description, and create the resources needed to start AWS DeepRacer training jobs. Note that the resources should be ready in the account given to you. If you do not see three green radio boxes beneath the Permission and storage section please let us know.

<font color=cyan>**Info**</font> **Buttons**
Throughout the console you will see <font color=cyan>**Info**</font> buttons. When selected they will slide out an information pane from the right of the window, without navigating away from the page.

Please enter a name for your model and scroll to the next section
#### Environment simulation
Here you will select the track on which your RL model will train. This track will be simulated by AWS RoboMaker throughout the training process, and you will be able to monitor training progress. We will cover that in a few steps.
At present we have only loaded one track into AWS DeepRacer. The track has the same shape that you will encounter at our AWS DeepRacer activities throughout re:Invent. We will have a detailed slide at the end of the workshop outlining the activities.
Choose the re:Invent 2018 track and scroll to the next section.
#### Reward function
In RL, the reward function plays a **critical** role in training an RL model. The reward function directly impacts the behaviors that your model will learn, by determining which actions (from each specific state) lead to good outcomes and which actions lead to outcomes that should best be avoided. The reward function contains the “logic” to determine if an action was good or bad, and quantify it. For example, if your goal is for the car to finish a lap around a racetrack, rewarding the car for staying on the track, as opposed to going off the track, is a good starting point. An example of the logic used in a basic reward function that incentivizes the car for staying closer to the middle of the track can be seen in the Basic Reward function section.
On the left-hand-side of the page, please expand the **Basic function** and choose **Insert code**. This action will copy the basic reward function code (Python3 syntax) to the code editor on the right. **Note** that the code in the code editor on the right will be the reward function that is used to train your model.

The reward function in the code editor contains the following logic.
```
marker_1 = 0.1 * track_width
marker_2 = 0.25 * track_width
marker_3 = 0.5 * track_width
reward = 1e-3
if distance_from_center >= 0.0 and distance_from_center <= marker_1:
reward = 1
elif distance_from_center <= marker_2:
reward = 0.5
elif distance_from_center <= marker_3:
reward = 0.1
else:
reward = 1e-3 # likely crashed/ close to off track
```
Here we first create three bands around the track, using the three markers, and then proceed to reward the car more for driving in the narrow band as opposed to the medium or the wide band. Also note the differences in the size of the reward. We provide a reward of 1 for staying in the narrow band, 0.5 for staying in the medium band, and 0.1 for staying in the wide band. If we decrease the reward for the narrow band, or increase the reward for the medium band, we are essentially incentivizing the car to be use a larger portion of the track surface. This could come in handy, especially when there are sharp corners.
The following reward heatmaps show the intensity of rewards received and how this is spread about the center line for a narrow band vs. a wide band.


Here is a list of variables that you can use to build the logic for your reward function. Note that the reward function has to be written using Python syntax, and we've added a **Validate** button to help you check that your code is good before training begins.

#### Algorithm settings
This section controls the hyperparameters for your RL optimization algorithm. In the interest of
time, for the first lab we can skip this section, our default values should suffice for the lab.
#### Stop conditions
This is the last section before you start training. Here you can specify the maximum time your model will train for. Ideally you should put a number in this condition. You can always stop training early. Furthermore, if your mode stopped as a result of the condition, you can go to the model list screen, and clone your model to restart training using new parameters.

## Step 5: Reward Function Constructors' Championship
Once you reach this section please discuss in your team the reward function you need to implement to reach the goal. You will have 15 minutes to create it, implement it, and launch. Before you start training, nominate just one person to start training. We will continue with the workshop after the 30 minutes expired and this person will have to monitor the progress of training during the workshop. Everyone will get to implement their own reward function during lab 2. The sooner you start training your model the sooner your car will reach the middle of the hairpin.

[Go back to Workshop](https://github.com/aws-samples/aws-deepracer-workshops/blob/master/README.md)
---
## Additional Reading Not Required For Lab Purposes
#### Reward Function Comparison
Here's an example of a good reward function, observe how it has consistent high rewards over a long
period of time

Here's an example of a bad reward function, observe how its spikey and has low rewards

#### Algorithm settings
This section controls the hyperparameters for your RL optimization algorithm. Please expand it. These hyperparameters have been optimized by our scientists, through lots of testing. That said you are more than welcome to change them.
Training happens through an iterative process of simulation to gather experience, followed by training on the experience to update your model, followed by simulation using the new model to get new experience, followed by training on the new experience to update your model and so forth. Initially your model does not have any knowledge of which actions will lead to good outcomes. It will choose actions at random as it explores the environment. Over time it will learn which actions are better and start to exploit these. How quickly it exploits or how long it explores is a trade-off that you have to make.

| {
"pile_set_name": "Github"
} |
// go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm,freebsd
package unix
const (
// SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int
SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void
SYS_FORK = 2 // { int fork(void); }
SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); }
SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); }
SYS_OPEN = 5 // { int open(char *path, int flags, int mode); }
SYS_CLOSE = 6 // { int close(int fd); }
SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); }
SYS_LINK = 9 // { int link(char *path, char *link); }
SYS_UNLINK = 10 // { int unlink(char *path); }
SYS_CHDIR = 12 // { int chdir(char *path); }
SYS_FCHDIR = 13 // { int fchdir(int fd); }
SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); }
SYS_CHMOD = 15 // { int chmod(char *path, int mode); }
SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); }
SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int
SYS_GETPID = 20 // { pid_t getpid(void); }
SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); }
SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); }
SYS_SETUID = 23 // { int setuid(uid_t uid); }
SYS_GETUID = 24 // { uid_t getuid(void); }
SYS_GETEUID = 25 // { uid_t geteuid(void); }
SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); }
SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); }
SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); }
SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); }
SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); }
SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); }
SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); }
SYS_ACCESS = 33 // { int access(char *path, int amode); }
SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); }
SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); }
SYS_SYNC = 36 // { int sync(void); }
SYS_KILL = 37 // { int kill(int pid, int signum); }
SYS_GETPPID = 39 // { pid_t getppid(void); }
SYS_DUP = 41 // { int dup(u_int fd); }
SYS_PIPE = 42 // { int pipe(void); }
SYS_GETEGID = 43 // { gid_t getegid(void); }
SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); }
SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); }
SYS_GETGID = 47 // { gid_t getgid(void); }
SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); }
SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); }
SYS_ACCT = 51 // { int acct(char *path); }
SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); }
SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); }
SYS_REBOOT = 55 // { int reboot(int opt); }
SYS_REVOKE = 56 // { int revoke(char *path); }
SYS_SYMLINK = 57 // { int symlink(char *path, char *link); }
SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); }
SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); }
SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int
SYS_CHROOT = 61 // { int chroot(char *path); }
SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); }
SYS_VFORK = 66 // { int vfork(void); }
SYS_SBRK = 69 // { int sbrk(int incr); }
SYS_SSTK = 70 // { int sstk(int incr); }
SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise ovadvise_args int
SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); }
SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, int prot); }
SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); }
SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); }
SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); }
SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); }
SYS_GETPGRP = 81 // { int getpgrp(void); }
SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); }
SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); }
SYS_SWAPON = 85 // { int swapon(char *name); }
SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); }
SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); }
SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); }
SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); }
SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }
SYS_FSYNC = 95 // { int fsync(int fd); }
SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); }
SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); }
SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); }
SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); }
SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); }
SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); }
SYS_LISTEN = 106 // { int listen(int s, int backlog); }
SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); }
SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); }
SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); }
SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }
SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); }
SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); }
SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); }
SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); }
SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); }
SYS_SETREGID = 127 // { int setregid(int rgid, int egid); }
SYS_RENAME = 128 // { int rename(char *from, char *to); }
SYS_FLOCK = 131 // { int flock(int fd, int how); }
SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); }
SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); }
SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); }
SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); }
SYS_MKDIR = 136 // { int mkdir(char *path, int mode); }
SYS_RMDIR = 137 // { int rmdir(char *path); }
SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); }
SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); }
SYS_SETSID = 147 // { int setsid(void); }
SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); }
SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); }
SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); }
SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); }
SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); }
SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); }
SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); }
SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); }
SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); }
SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); }
SYS_SETFIB = 175 // { int setfib(int fibnum); }
SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); }
SYS_SETGID = 181 // { int setgid(gid_t gid); }
SYS_SETEGID = 182 // { int setegid(gid_t egid); }
SYS_SETEUID = 183 // { int seteuid(uid_t euid); }
SYS_STAT = 188 // { int stat(char *path, struct stat *ub); }
SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); }
SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); }
SYS_PATHCONF = 191 // { int pathconf(char *path, int name); }
SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); }
SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int
SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int
SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); }
SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int
SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); }
SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); }
SYS_UNDELETE = 205 // { int undelete(char *path); }
SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); }
SYS_GETPGID = 207 // { int getpgid(pid_t pid); }
SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); }
SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); }
SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); }
SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); }
SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }
SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }
SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); }
SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); }
SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); }
SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); }
SYS_CLOCK_SETTIME = 233 // { int clock_settime( clockid_t clock_id, const struct timespec *tp); }
SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); }
SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); }
SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); }
SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }
SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); }
SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); }
SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }
SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); }
SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); }
SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); }
SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); }
SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); }
SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }
SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); }
SYS_RFORK = 251 // { int rfork(int flags); }
SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); }
SYS_ISSETUGID = 253 // { int issetugid(void); }
SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); }
SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); }
SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); }
SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }
SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, size_t count); }
SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); }
SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); }
SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); }
SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); }
SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); }
SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); }
SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); }
SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }
SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }
SYS_MODNEXT = 300 // { int modnext(int modid); }
SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat *stat); }
SYS_MODFNEXT = 302 // { int modfnext(int modid); }
SYS_MODFIND = 303 // { int modfind(const char *name); }
SYS_KLDLOAD = 304 // { int kldload(const char *file); }
SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); }
SYS_KLDFIND = 306 // { int kldfind(const char *file); }
SYS_KLDNEXT = 307 // { int kldnext(int fileid); }
SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); }
SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); }
SYS_GETSID = 310 // { int getsid(pid_t pid); }
SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }
SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }
SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); }
SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }
SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }
SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); }
SYS_YIELD = 321 // { int yield(void); }
SYS_MLOCKALL = 324 // { int mlockall(int how); }
SYS_MUNLOCKALL = 325 // { int munlockall(void); }
SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); }
SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }
SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }
SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }
SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); }
SYS_SCHED_YIELD = 331 // { int sched_yield (void); }
SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }
SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }
SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); }
SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); }
SYS_JAIL = 338 // { int jail(struct jail *jail); }
SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); }
SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); }
SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); }
SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); }
SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); }
SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); }
SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); }
SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); }
SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }
SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); }
SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }
SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }
SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); }
SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }
SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
SYS_KQUEUE = 362 // { int kqueue(void); }
SYS_KEVENT = 363 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); }
SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }
SYS___SETUGID = 374 // { int __setugid(int flag); }
SYS_EACCESS = 376 // { int eaccess(char *path, int amode); }
SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); }
SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); }
SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); }
SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); }
SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); }
SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); }
SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); }
SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); }
SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); }
SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); }
SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); }
SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int mode); }
SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); }
SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); }
SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }
SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); }
SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); }
SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); }
SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); }
SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); }
SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); }
SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); }
SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); }
SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); }
SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); }
SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); }
SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); }
SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( const char *path, int attrnamespace, const char *attrname); }
SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); }
SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); }
SYS_SIGRETURN = 417 // { int sigreturn( const struct __ucontext *sigcntxp); }
SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); }
SYS_SETCONTEXT = 422 // { int setcontext( const struct __ucontext *ucp); }
SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); }
SYS_SWAPOFF = 424 // { int swapoff(const char *name); }
SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); }
SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); }
SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); }
SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); }
SYS_THR_EXIT = 431 // { void thr_exit(long *state); }
SYS_THR_SELF = 432 // { int thr_self(long *id); }
SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); }
SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); }
SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }
SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); }
SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( const char *path, int attrnamespace, void *data, size_t nbytes); }
SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); }
SYS_THR_SUSPEND = 442 // { int thr_suspend( const struct timespec *timeout); }
SYS_THR_WAKE = 443 // { int thr_wake(long id); }
SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); }
SYS_AUDIT = 445 // { int audit(const void *record, u_int length); }
SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); }
SYS_GETAUID = 447 // { int getauid(uid_t *auid); }
SYS_SETAUID = 448 // { int setauid(uid_t *auid); }
SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); }
SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); }
SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); }
SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); }
SYS_AUDITCTL = 453 // { int auditctl(char *path); }
SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); }
SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); }
SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); }
SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); }
SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); }
SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); }
SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len,unsigned msg_prio, const struct timespec *abs_timeout);}
SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); }
SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); }
SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); }
SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); }
SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); }
SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); }
SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); }
SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); }
SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); }
SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr * from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); }
SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); }
SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); }
SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); }
SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); }
SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); }
SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); }
SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); }
SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); }
SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); }
SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); }
SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); }
SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); }
SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); }
SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); }
SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); }
SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); }
SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); }
SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); }
SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, struct stat *buf, int flag); }
SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); }
SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); }
SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); }
SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }
SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); }
SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); }
SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); }
SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); }
SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); }
SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); }
SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); }
SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); }
SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); }
SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); }
SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); }
SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); }
SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); }
SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); }
SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); }
SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); }
SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); }
SYS_CAP_ENTER = 516 // { int cap_enter(void); }
SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }
SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); }
SYS_PDKILL = 519 // { int pdkill(int fd, int signum); }
SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); }
SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); }
SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); }
SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); }
SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); }
SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); }
SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); }
SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); }
SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); }
SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); }
SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); }
SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); }
SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); }
SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); }
SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); }
SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); }
SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); }
SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); }
SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); }
SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); }
SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); }
SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); }
SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, id_t id, struct vm_domain_policy_entry *policy); }
SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, id_t id, const struct vm_domain_policy_entry *policy); }
SYS_FDATASYNC = 550 // { int fdatasync(int fd); }
)
| {
"pile_set_name": "Github"
} |
/*
ShadX's Natural Vision Shader
Ported and tweaked by Hyllian - 2016
parameterized by Sp00kyFox
*/
/* COMPATIBILITY
- HLSL compilers
- Cg compilers
- FX11 compilers
*/
#include "../compat_includes.inc"
uniform COMPAT_Texture2D(decal) : TEXUNIT0;
uniform float4x4 modelViewProj;
struct out_vertex
{
float4 position : COMPAT_POS;
float2 texCoord : TEXCOORD0;
#ifndef HLSL_4
float4 Color : COLOR;
#endif
};
out_vertex main_vertex(COMPAT_IN_VERTEX)
{
out_vertex OUT;
#ifdef HLSL_4
float4 position = VIN.position;
float2 texCoord = VIN.texCoord;
#else
OUT.Color = color;
#endif
OUT.position = mul(modelViewProj, position);
OUT.texCoord = texCoord;
return OUT;
}
#pragma parameter GIN "NaturalVision Gamma In" 2.2 0.0 10.0 0.05
#pragma parameter GOUT "NaturalVision Gamma Out" 2.2 0.0 10.0 0.05
#pragma parameter Y "NaturalVision Luminance" 1.1 0.0 10.0 0.01
#pragma parameter I "NaturalVision Orange-Cyan" 1.1 0.0 10.0 0.01
#pragma parameter Q "NaturalVision Magenta-Green" 1.1 0.0 10.0 0.01
#ifdef PARAMETER_UNIFORM
uniform float GIN, GOUT, Y, I, Q;
#else
#define GIN 2.2
#define GOUT 2.2
#define Y 1.1
#define I 1.1
#define Q 1.1
#endif
const static float3x3 RGBtoYIQ = float3x3(0.299, 0.587, 0.114,
0.595716, -0.274453, -0.321263,
0.211456, -0.522591, 0.311135);
const static float3x3 YIQtoRGB = float3x3(1, 0.95629572, 0.62102442,
1, -0.27212210, -0.64738060,
1, -1.10698902, 1.70461500);
const static float3 YIQ_lo = float3(0, -0.595716, -0.522591);
const static float3 YIQ_hi = float3(1, 0.595716, 0.522591);
float3 natural_vision(float2 texCoord, COMPAT_Texture2D(decal))
{
float3 c = COMPAT_Sample(decal, texCoord).xyz;
c = pow(c, GIN);
c = mul(RGBtoYIQ, c);
c = float3(pow(c.x,Y), c.y*I, c.z*Q);
c = clamp(c, YIQ_lo, YIQ_hi);
c = mul(YIQtoRGB, c);
c = pow(c, 1.0/GOUT);
return c;
}
float4 main_fragment(COMPAT_IN_FRAGMENT) : COMPAT_Output
{
return float4(natural_vision(VOUT.texCoord, decal), 1.0);
}
COMPAT_END | {
"pile_set_name": "Github"
} |
We welcome your code contributions.
For us to accept them, please sign the Google Contributor License Agreement first and let us know. Otherwise, we are unable to accept them.
You can find the individual and organization level CLAs here:
Individual: https://cla.developers.google.com/about/google-individual
Organization: https://cla.developers.google.com/about/google-corporate
Thanks again for contributing code!
| {
"pile_set_name": "Github"
} |
[Max Money]
0832C180 05F5E0FF
[All Medal Max Stats]
C0000000 00000036
0832D922 63636363
1832D926 00006363
DC000000 00000084
D1000000 00000000
[255 Medagacha Coins]
2832C2EC 00000000
2832C2F0 000000FF
[All medaria construction items x999]
2832C284 00000002
2832C288 00000003
2832C28C 00000004
2832C290 00000005
2832C294 00000006
2832C298 00000007
2832C29C 00000008
2832C2A0 00000009
2832C2A4 0000000A
2832C2A8 0000000B
2832C2AC 0000000C
2832C2B0 0000000D
2832C2B4 0000000E
2832C2B8 0000000F
2832C2BC 00000010
2832C2C0 00000011
2832C2C4 00000012
2832C2C8 00000013
2832C2CC 00000014
2832C2D0 00000015
2832C2D4 00000016
2832C2D8 00000017
2832C2DC 00000018
2832C2E0 00000019
2832C2E4 0000001A
2832C2E8 0000001B
C0000000 00000019
1832C286 000003E7
DC000000 00000004
D1000000 00000000
[All consumables x999]
2832C2EC 0000001C
2832C2F0 0000001D
2832C2F4 0000001E
2832C2F8 0000001F
2832C2FC 00000020
2832C300 00000021
2832C304 00000022
2832C308 00000023
2832C30C 00000024
2832C310 00000025
2832C314 00000026
2832C318 00000027
2832C31C 00000028
2832C320 00000029
2832C324 0000002A
2832C328 0000002B
2832C32C 0000002C
2832C330 0000002D
2832C334 0000002E
2832C338 0000002F
2832C33C 00000030
C0000000 00000014
1832C2EE 000003E7
DC000000 00000004
D1000000 00000000
[All Parts x99]
C0000000 000010E4
2832C6F0 00000063
2832C6F1 00000038
DC000000 00000004
D1000000 00000000
[All Medals]
2832D910 00000003
2832D994 00000008
2832DA18 0000000B
2832DA9C 0000000D
2832DB20 0000000E
2832DBA4 00000010
2832DC28 00000011
2832DCAC 00000013
2832DD30 00000015
2832DDB4 00000016
2832DE38 00000018
2832DEBC 0000001A
2832DF40 0000001B
2832DFC4 0000001C
2832E048 0000001F
2832E0CC 00000020
2832E150 00000022
2832E1D4 00000024
2832E258 00000026
2832E2DC 00000029
2832E360 0000002B
2832E3E4 0000002E
2832E468 00000031
2832E4EC 00000032
2832E570 00000033
2832E5F4 00000034
2832E678 00000035
2832E6FC 00000036
2832E780 00000038
2832E804 0000003B
2832E888 0000003C
2832E90C 0000003E
2832E990 00000040
2832EA14 00000042
2832EA98 00000043
2832EB1C 00000045
2832EBA0 00000046
2832EC24 0000004F
2832ECA8 00000050
2832ED2C 00000051
2832EDB0 00000052
2832EE34 00000053
2832EEB8 00000054
2832EF3C 00000056
2832EFC0 00000058
2832F044 0000005A
2832F0C8 0000005B
2832F14C 0000005D
2832F1D0 0000005E
2832F254 0000005F
| {
"pile_set_name": "Github"
} |
#!/bin/bash
#
# requires:
# bash
#
## include files
. ${BASH_SOURCE[0]%/*}/helper_shunit2.sh
. ${BASH_SOURCE[0]%/*}/helper_load_balancer.sh
## variables
### optional
## functions
function oneTimeSetUp() {
:
}
function oneTimeTearDown() {
:
}
function setUp() {
:
}
function tearDown() {
destroy_load_balancer
}
###
function test_create_load_balancer_httpchk() {
local httpchk_path="/index.html"
create_output="$(run_cmd load_balancer create)"
assertEquals 0 $?
assertEquals ${httpchk_path} $(echo "${create_output}" | hash_value httpchk_path)
load_balancer_uuid=$(echo "${create_output}" | hash_value id)
retry_until "document_pair? load_balancer ${load_balancer_uuid} state running"
assertEquals 0 $?
}
## shunit2
. ${shunit2_file}
| {
"pile_set_name": "Github"
} |
@include describe("The _modifier function") {
$_bem-current-context: () !global;
@include it("should generate a modifier selector for the current block") {
@include block('block', 'object') {
@include should( expect( #{_modifier('modifier')} ), to( be( '.o-block--modifier' )));
}
}
$_bem-current-context: () !global;
@include it("should generate a modifier selector for the current element") {
@include block('block', 'object') {
@include element('element') {
@include should( expect( #{_modifier('modifier')} ), to( be( '.o-block__element--modifier' )));
}
}
}
$_bem-current-context: () !global;
@include it("should generate multiple modifier selectors for the current block") {
@include block('block', 'object') {
@include should( expect( #{_modifier('modifier1', 'modifier2')} ), to( be( '.o-block--modifier1, .o-block--modifier2' )));
}
}
$_bem-current-context: () !global;
@include it("should generate multiple modifier selectors for the current element") {
@include block('block', 'object') {
@include element('element') {
@include should( expect( #{_modifier('modifier1', 'modifier2')} ), to( be( '.o-block__element--modifier1, .o-block__element--modifier2' )));
}
}
}
$_bem-current-context: () !global;
@include it("should generate multiple modifier selectors for multiple elements") {
@include block('block', 'object') {
@include element('element1', 'element2') {
@include should( expect( #{_modifier('modifier1', 'modifier2')} ), to( be( '.o-block__element1--modifier1, .o-block__element2--modifier1, .o-block__element1--modifier2, .o-block__element2--modifier2' )));
}
}
}
$_bem-current-context: () !global;
@include it("should return false or throw error if modifier is created within another modifier") {
@include block('block', 'object') {
@include modifier('modifier1') {
@include should( expect( _modifier('modifier2') ), to( be( false )));
}
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
package identity
import (
"github.com/oracle/oci-go-sdk/v25/common"
"net/http"
)
// GetTenancyRequest wrapper for the GetTenancy operation
type GetTenancyRequest struct {
// The OCID of the tenancy.
TenancyId *string `mandatory:"true" contributesTo:"path" name:"tenancyId"`
// Unique Oracle-assigned identifier for the request.
// If you need to contact Oracle about a particular request, please provide the request ID.
OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
// Metadata about the request. This information will not be transmitted to the service, but
// represents information that the SDK will consume to drive retry behavior.
RequestMetadata common.RequestMetadata
}
func (request GetTenancyRequest) String() string {
return common.PointerString(request)
}
// HTTPRequest implements the OCIRequest interface
func (request GetTenancyRequest) HTTPRequest(method, path string) (http.Request, error) {
return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}
// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request GetTenancyRequest) RetryPolicy() *common.RetryPolicy {
return request.RequestMetadata.RetryPolicy
}
// GetTenancyResponse wrapper for the GetTenancy operation
type GetTenancyResponse struct {
// The underlying http response
RawResponse *http.Response
// The Tenancy instance
Tenancy `presentIn:"body"`
// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
// particular request, please provide the request ID.
OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
}
func (response GetTenancyResponse) String() string {
return common.PointerString(response)
}
// HTTPResponse implements the OCIResponse interface
func (response GetTenancyResponse) HTTPResponse() *http.Response {
return response.RawResponse
}
| {
"pile_set_name": "Github"
} |
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/android/infobars/data_reduction_promo_infobar.h"
#include <utility>
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/android/resource_mapper.h"
#include "chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h"
#include "content/public/browser/web_contents.h"
// DataReductionPromoInfoBar --------------------------------------------------
DataReductionPromoInfoBar::DataReductionPromoInfoBar(
std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate)
: ConfirmInfoBar(std::move(delegate)) {}
DataReductionPromoInfoBar::~DataReductionPromoInfoBar() {
}
base::android::ScopedJavaLocalRef<jobject>
DataReductionPromoInfoBar::CreateRenderInfoBar(JNIEnv* env) {
return GetDelegate()->CreateRenderInfoBar(env);
}
DataReductionPromoInfoBarDelegateAndroid*
DataReductionPromoInfoBar::GetDelegate() {
return static_cast<DataReductionPromoInfoBarDelegateAndroid*>(delegate());
}
// DataReductionPromoInfoBarDelegate ------------------------------------------
// static
std::unique_ptr<infobars::InfoBar>
DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar(
infobars::InfoBarManager* infobar_manager,
std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate) {
return base::MakeUnique<DataReductionPromoInfoBar>(std::move(delegate));
}
| {
"pile_set_name": "Github"
} |
let loc = Loc.ghost
in
Ast.StExp (loc,
(Ast.ExLet (loc, Ast.ReNil,
(Ast.BiEq (loc, (Ast.PaId (loc, (Ast.IdLid (loc, "loc")))),
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Loc")),
(Ast.IdLid (loc, "ghost")))))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "StTyp")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "TyDcl")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExStr (loc, "t")))),
(Ast.ExId (loc, (Ast.IdUid (loc, "[]")))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "TySum")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "TyOr")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "TyId")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc,
(Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "IdUid")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExStr (loc, "A")))))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "TyId")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExApp (loc,
(Ast.ExApp (loc,
(Ast.ExId (loc,
(Ast.IdAcc (loc, (Ast.IdUid (loc, "Ast")),
(Ast.IdUid (loc, "IdUid")))))),
(Ast.ExId (loc, (Ast.IdLid (loc, "loc")))))),
(Ast.ExStr (loc, "B")))))))))))),
(Ast.ExId (loc, (Ast.IdUid (loc, "[]")))))))))))
| {
"pile_set_name": "Github"
} |
<html class="reftest-wait">
<head>
<script>
document.addEventListener("MozReftestInvalidate", doTest, false);
function doTest() {
window.location.href = "#two";
document.documentElement.className = "";
}
</script>
</head>
<body>
<div style="height: 200px;">spacer</div>
<div id="one" style="background: blue; width: 200px; height: 200px; display: none;">div one</div>
<div id="two" style="background: red; width: 200px; height: 200px;">div two</div>
<div style="height: 10000px;">spacer</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
import React from 'react';
import ReactDOM from 'react-dom';
import { AUlabel, AUhintText, AUerrorText, AUformGroup, AUfieldset, AUForm, AUlegend } from './form.js';
import AUtextInput from '../../../text-inputs/src/js/react';
import AUheading from '../../../headings/src/js/react';
import AUselect from '../../../select/src/js/react';
import { AUcheckbox } from '../../../control-input/src/js/react';
class App extends React.Component {
render() {
const states = [
{ value: '', text: 'Please select'},
{ value: '1', text: 'ACT' },
{ value: '2', text: 'VIC' },
{ value: '3', text: 'NSW' },
];
return (
<React.Fragment>
<div className="split-wrapper">
<div className="split">
<h2>Normal background</h2>
<h3>Label</h3>
<p>
<AUlabel htmlFor="label" text="Email"></AUlabel>
<AUtextInput type="email" id="label" />
</p>
<hr/>
<h3>Label <code>--inline</code> </h3>
<p>
<AUlabel text="Email" htmlFor="label-inline" inline />
<AUtextInput type="email" id="label-inline" />
</p>
<hr/>
<h3>Hint Text</h3>
<p>
<AUlabel text="Email" htmlFor="email-with-hint" />
<AUhintText text="We will only use this to respond to your request" id="hint-text"/>
<AUtextInput type="email" id="email-with-hint" aria-describedby="hint-text"/>
</p>
<hr/>
<h3>Error text</h3>
<p>
<AUlabel text="Email" htmlFor="email-with-error" />
<AUhintText text="We will only use this to respond to your request" id="hint-text-with-error"/>
<AUerrorText type="email" text="Enter an email address in the correct format, like name@example.com" id="error-text" />
<AUtextInput id="email-with-error" aria-describedby="error-text hint-text-with-error" status="invalid" />
</p>
<hr/>
<h3>Error text bottom</h3>
<p>
<AUlabel text="Email" htmlFor="email-with-error-bottom" />
<AUhintText text="We will only use this to respond to your request" id="hint-text-with-error-bottom"/>
<AUtextInput type="email" id="email-with-error-bottom" aria-describedby="error-text-bottom hint-text-with-error-bottom" status="invalid" />
<AUerrorText text="Enter an email address in the correct format, like name@example.com" id="error-text-bottom" />
</p>
<hr/>
<h3>Error text <code>--inline</code></h3>
<p>
<AUlabel text="Email" htmlFor="email-with-error-inline" />
<AUhintText text="We will only use this to respond to your request" id="hint-text-with-error-inline"/>
<AUtextInput type="email" id="email-with-error-inline" aria-describedby="error-text-inline hint-text-with-error-inline" status="invalid" />
<AUerrorText text="Enter an email address in the correct format, like name@example.com" inline id="error-text-inline" />
</p>
<hr/>
<h3>Form group</h3>
<AUformGroup>
<AUlabel text="Username" htmlFor="fg-username" />
<AUtextInput type="email" id="fg-username"/>
</AUformGroup>
<AUformGroup>
<AUlabel text="Email" htmlFor="fg-password" />
<AUhintText text="We will only use this to respond to your request" id="fg-hint-text"/>
<AUtextInput type="email" id="fg-password" aria-describedby="fg-hint-text" />
</AUformGroup>
<hr/>
<h3>Form group with <code>--invalid</code></h3>
<AUformGroup>
<AUlabel text="Username" htmlFor="fg-username" />
<AUtextInput type="email" id="fg-username"/>
</AUformGroup>
<AUformGroup status="invalid">
<AUlabel text="Email" htmlFor="fg-password" />
<AUhintText text="We will only use this to respond to your request" id="fg-hint-text"/>
<AUerrorText text="Password was not 6 characters" id="fg-error-text" />
<AUtextInput type="email" id="fg-password" aria-describedby="fg-hint-text fg-error-text" status="invalid" />
</AUformGroup>
<hr/>
<h3>Form group with <code>--invalid</code> bottom</h3>
<AUformGroup>
<AUlabel text="Username" htmlFor="fg-username-err-bottom" />
<AUtextInput type="email" id="fg-username-err-bottom"/>
</AUformGroup>
<AUformGroup status="invalid">
<AUlabel text="Email" htmlFor="fg-password-err-bottom" />
<AUhintText text="We will only use this to respond to your request" id="fg-hint-text-err-bottom"/>
<AUtextInput type="email" id="fg-password-err-bottom" aria-describedby="fg-hint-text-err-bottom fg-error-text-err-bottom" status="invalid" />
<AUerrorText text="Password was not 6 characters" id="fg-error-text-err-bottom" />
</AUformGroup>
<hr/>
<h3>Fieldsets</h3>
<br/>
<AUfieldset>
<AUlegend>
<AUheading level="2" size="lg">
What is your address?
</AUheading>
</AUlegend>
<AUformGroup>
<AUlabel htmlFor="address-1" text="Street and number" />
<AUtextInput type="text" id="address-1" width="lg" />
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-2" text="Suburb" />
<AUtextInput type="text" id="address-2" width="lg" />
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="select1" text="State" />
<AUselect id="select1" options={states} />
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-4" text="Postcode" />
<AUtextInput type="number" id="address-4" width="sm" />
</AUformGroup>
</AUfieldset>
<hr/>
<h3>Fieldsets with <code>--invalid</code></h3>
<br/>
<AUfieldset>
<AUlegend>
<AUheading level="2" size="lg">
What is your address?
</AUheading>
</AUlegend>
<AUformGroup>
<AUlabel htmlFor="address-1-err" text="Street and number" />
<AUtextInput type="text" id="address-1-err" width="lg" />
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-2-err" text="Suburb" />
<AUtextInput type="text" id="address-2-err" width="lg" />
</AUformGroup>
<AUformGroup status="invalid">
<AUlabel htmlFor="select1-err" text="State" />
<AUerrorText text="A state was not selected" id="fg-error-text-err-bottom" />
<AUselect status="invalid" id="select1-err" options={states} />
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-4-err" text="Postcode" />
<AUtextInput type="number" id="address-4-err" width="sm" />
</AUformGroup>
</AUfieldset>
<hr/>
<h3>Fieldsets with control inputs <code>--invalid</code></h3>
<p></p>
<AUformGroup status="invalid">
<AUfieldset >
<AUlegend>
<AUheading level="2" size="lg">
Please select your favorite device
</AUheading>
<AUhintText text="We will only use this to respond to your request" id="device-hint-text-err" />
<AUerrorText text="A device was not selected" id="device-cb-err" />
</AUlegend>
<AUcheckbox label="Phone" name="checkbox-ex-err" id="cb-phone-err" block/>
<AUcheckbox label="Tablet" name="checkbox-ex-err" id="cb-tablet-err" block/>
<AUcheckbox label="Laptop" name="checkbox-ex-err" id="cb-laptop-err" block/>
</AUfieldset>
</AUformGroup>
<br/>
</div>
<div className="split split--alt">
<h2><code>--alt</code> background</h2>
<h3>Label</h3>
<p>
<AUlabel text="Email" htmlFor="label-alt"/>
<AUtextInput id="label-alt"/>
</p>
<hr/>
<h3>Label <code>--inline</code> </h3>
<p>
<AUlabel text="Email" htmlFor="label-inline-alt" inline/>
<AUtextInput id="label-inline-alt"/>
</p>
<hr/>
<h3>Hint Text</h3>
<p>
<AUlabel text="Email" htmlFor="email-with-hint-alt"/>
<AUhintText text="We will only use this to respond to your request" id="hint-text-alt"/>
<AUtextInput id="email-with-hint-alt" aria-describedby="hint-text-alt"/>
</p>
<hr/>
<h3>Error text</h3>
<p>
<AUlabel text="Email" htmlFor="email-with-error-alt"/>
<AUhintText text="We will only use this to respond to your request" id="hint-text-with-error-alt"/>
<AUerrorText text="Enter an email address in the correct format, like name@example.com" id="error-text-alt"/>
<AUtextInput id="email-with-error" aria-describedby="error-text-alt hint-text-with-error-alt" status="invalid" dark/>
</p>
<hr/>
<h3>Error text bottom</h3>
<p>
<AUlabel text="Email" htmlFor="email-with-error-bottom-alt"/>
<AUhintText text="We will only use this to respond to your request" id="hint-text-with-error-bottom-alt"/>
<AUtextInput id="email-with-error-bottom-alt" aria-describedby="error-text-bottom-alt hint-text-with-error-bottom-alt" status="invalid"/>
<AUerrorText text="Enter an email address in the correct format, like name@example.com" id="error-text-bottom-alt" />
</p>
<hr/>
<h3>Error text <code>--inline</code></h3>
<p>
<AUlabel text="Email" htmlFor="email-with-error-inline-alt" />
<AUhintText text="We will only use this to respond to your request" id="hint-text-with-error-inline-alt"/>
<AUtextInput type="email" id="email-with-error-inline-alt" aria-describedby="error-text-inline-alt hint-text-with-error-inline-alt" status="invalid" />
<AUerrorText text="Enter an email address in the correct format, like name@example.com" inline id="error-text-inline-alt" />
</p>
<hr/>
<h3>Form group</h3>
<AUformGroup>
<AUlabel text="Username" htmlFor="fg-username-alt"/>
<AUtextInput type="email" id="fg-username-alt"/>
</AUformGroup>
<AUformGroup>
<AUlabel text="Email" htmlFor="fg-password-alt"/>
<AUhintText text="We will only use this to respond to your request" id="fg-hint-text-alt"/>
<AUtextInput type="email" id="fg-password-alt" aria-describedby="fg-hint-text-alt"/>
</AUformGroup>
<hr/>
<h3>Form group with <code>--invalid</code></h3>
<AUformGroup>
<AUlabel text="Username" htmlFor="fg-username-invalid-alt"/>
<AUtextInput type="email" id="fg-username-invalid-alt"/>
</AUformGroup>
<AUformGroup status="invalid">
<AUlabel text="Email" htmlFor="fg-password-alt"/>
<AUhintText text="We will only use this to respond to your request" id="fg-hint-text-alt"/>
<AUerrorText text="Password was not 6 characters" id="fg-error-text-alt"/>
<AUtextInput type="email" id="fg-password-alt" aria-describedby="fg-hint-text-alt fg-error-text-alt" status="invalid"/>
</AUformGroup>
<hr/>
<h3>Form group with <code>--invalid</code> bottom</h3>
<AUformGroup>
<AUlabel text="Username" htmlFor="fg-username-err-bottom-alt"/>
<AUtextInput id="fg-username-err-bottom-alt"/>
</AUformGroup>
<AUformGroup status="invalid">
<AUlabel text="Email" htmlFor="fg-password-err-bottom-alt"/>
<AUhintText text="We will only use this to respond to your request" id="fg-hint-text-err-bottom-alt"/>
<AUtextInput type="email" id="fg-password-err-bottom-alt" aria-describedby="fg-hint-text-err-bottom-alt fg-error-text-err-bottom-alt" status="invalid" dark/>
<AUerrorText text="Password was not 6 characters" id="fg-error-text-err-bottom-alt" />
</AUformGroup>
<hr/>
<h3>Fieldsets</h3>
<br/>
<AUfieldset>
<AUlegend>
<AUheading level="2" size="lg">
What is your address?
</AUheading>
</AUlegend>
<AUformGroup>
<AUlabel htmlFor="address-1-alt" text="Street and number"/>
<AUtextInput id="address-1-alt" width="lg"/>
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-2-alt" text="Suburb"/>
<AUtextInput id="address-2-alt" width="lg"/>
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="select1-alt" text="State"/>
<AUselect id="select1-alt" options={states}/>
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-4-alt" text="Postcode"/>
<AUtextInput type="number" id="address-4-alt" width="sm"/>
</AUformGroup>
</AUfieldset>
<hr/>
<h3>Fieldsets with <code>--invalid</code></h3>
<br/>
<AUfieldset>
<AUlegend>
<AUheading level="2" size="lg">
What is your address?
</AUheading>
</AUlegend>
<AUformGroup>
<AUlabel htmlFor="address-1-err-alt" text="Street and number"/>
<AUtextInput id="address-1-err-alt" width="lg"/>
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-2-err-alt" text="Suburb"/>
<AUtextInput id="address-2-err-alt" width="lg"/>
</AUformGroup>
<AUformGroup status="invalid">
<AUlabel htmlFor="select1-err-alt" text="State"/>
<AUerrorText text="A state was not selected" id="fg-error-text-err-bottom"/>
<AUselect status="invalid" id="select1-err-alt" options={states}/>
</AUformGroup>
<AUformGroup>
<AUlabel htmlFor="address-4-err-alt" text="Postcode"/>
<AUtextInput id="address-4-err-alt" type="number" width="sm"/>
</AUformGroup>
</AUfieldset>
<hr/>
<h3>Fieldsets with control inputs <code>--invalid</code></h3>
<p></p>
<AUformGroup status="invalid">
<AUfieldset>
<AUlegend>
<AUheading level="2" size="lg">
Please select your favorite device
</AUheading>
<AUhintText text="We will only use this to respond to your request" id="device-hint-text-err-alt"/>
<AUerrorText text="A device was not selected" id="device-cb-err-alt"/>
</AUlegend>
<AUcheckbox label="Phone" name="checkbox-ex-err-alt" id="cb-phone-err-alt" block/>
<AUcheckbox label="Tablet" name="checkbox-ex-err-alt" id="cb-tablet-err-alt" block/>
<AUcheckbox label="Laptop" name="checkbox-ex-err-alt" id="cb-laptop-err-alt" block/>
</AUfieldset>
</AUformGroup>
</div>
</div>
</React.Fragment>
);
}
}
export default App;
ReactDOM.render(<App />,
document.getElementById('root'),
);
| {
"pile_set_name": "Github"
} |
// +build linux
// +build !appengine
package isatty
import (
"syscall"
"unsafe"
)
const ioctlReadTermios = syscall.TCGETS
// IsTerminal return true if the file descriptor is terminal.
func IsTerminal(fd uintptr) bool {
var termios syscall.Termios
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
return err == 0
}
| {
"pile_set_name": "Github"
} |
.. _api:
API Documentation
=================
.. py:class:: UnQLite([filename=':mem:'[, flags=UNQLITE_OPEN_CREATE[, open_database=True]])
The :py:class:`UnQLite` object provides a pythonic interface for interacting
with `UnQLite databases <http://unqlite.symisc.net/>`_. UnQLite is a lightweight,
embedded NoSQL database and JSON document store.
:param str filename: The path to the database file.
:param int flags: How the database file should be opened.
:param bool open_database: When set to ``True``, the database will be opened automatically when the class is instantiated. If set to ``False`` you will need to manually call :py:meth:`~UnQLite.open`.
.. note::
UnQLite supports in-memory databases, which can be created by passing in ``':mem:'`` as the database file. This is the default behavior if no database file is specified.
Example usage:
.. code-block:: pycon
>>> db = UnQLite() # Create an in-memory database.
>>> db['foo'] = 'bar' # Use as a key/value store.
>>> print db['foo']
bar
>>> for i in range(4):
... db['k%s' % i] = str(i)
...
>>> 'k3' in db
True
>>> 'k4' in db
False
>>> del db['k3']
>>> db.append('k2', 'XXXX')
>>> db['k2']
'2XXXX'
>>> with db.cursor() as cursor:
... for key, value in cursor:
... print key, '=>', value
...
foo => bar
k0 => 0
k1 => 1
k2 => 2XXXX
>>> script = """
... db_create('users');
... db_store('users', $list_of_users);
... $users_from_db = db_fetch_all('users');
... """
>>> list_of_users = [
... {'username': 'Huey', 'age': 3},
... {'username': 'Mickey', 'age': 5}
... ]
>>> with db.vm(script) as vm:
... vm['list_of_users'] = list_of_users
... vm.execute()
... users_from_db = vm['users_from_db']
...
True
>>> users_from_db # UnQLite assigns items in a collection an ID.
[{'username': 'Huey', 'age': 3, '__id': 0},
{'username': 'Mickey', 'age': 5, '__id': 1}]
.. py:method:: open()
Open the database. This method should only be called if the database was manually closed, or if the database was instantiated with ``open_database=False``.
Valid flags:
* ``UNQLITE_OPEN_CREATE``
* ``UNQLITE_OPEN_READONLY``
* ``UNQLITE_OPEN_READWRITE``
* ``UNQLITE_OPEN_CREATE``
* ``UNQLITE_OPEN_EXCLUSIVE``
* ``UNQLITE_OPEN_TEMP_DB``
* ``UNQLITE_OPEN_NOMUTEX``
* ``UNQLITE_OPEN_OMIT_JOURNALING``
* ``UNQLITE_OPEN_IN_MEMORY``
* ``UNQLITE_OPEN_MMAP``
Detailed descriptions of these flags can be found in the `unqlite_open docs <http://unqlite.org/c_api/unqlite_open.html>`_.
.. py:method:: close()
Close the database.
.. warning::
If you are using a file-based database, by default any uncommitted changes will be committed when the database is closed. If you wish to discard uncommitted changes, you can use :py:meth:`~UnQLite.disable_autocommit`.
.. py:method:: __enter__()
Use the database as a context manager, opening the connection and closing it at the end of the wrapped block:
.. code-block:: python
with UnQLite('my_db.udb') as db:
db['foo'] = 'bar'
# When the context manager exits, the database is closed.
.. py:method:: disable_autocommit()
When the database is closed, prevent any uncommitted writes from being saved.
.. note:: This method only affects file-based databases.
.. py:method:: store(key, value)
Store a value in the given key.
:param str key: Identifier used for storing data.
:param str value: A value to store in UnQLite.
Example:
.. code-block:: python
db = UnQLite()
db.store('some key', 'some value')
db.store('another key', 'another value')
You can also use the dictionary-style ``db[key] = value`` to store a value:
.. code-block:: python
db['some key'] = 'some value'
.. py:method:: fetch(key)
Retrieve the value stored at the given ``key``. If no value exists in the given key, a ``KeyError`` will be raised.
:param str key: Identifier to retrieve
:returns: The data stored at the given key
:raises: ``KeyError`` if the given key does not exist.
Example:
.. code-block:: python
db = UnQLite()
db.store('some key', 'some value')
value = db.fetch('some key')
You can also use the dictionary-style ``value = db[key]`` lookup to retrieve a value:
.. code-block:: python
value = db['some key']
.. py:method:: delete(key)
Remove the key and its associated value from the database.
:param str key: The key to remove from the database.
:raises: ``KeyError`` if the given key does not exist.
Example:
.. code-block:: python
def clear_cache():
db.delete('cached-data')
You can also use the python ``del`` keyword combined with a dictionary lookup:
.. code-block:: python
def clear_cache():
del db['cached-data']
.. py:method:: append(key, value)
Append the given ``value`` to the data stored in the ``key``. If no data exists, the operation is equivalent to :py:meth:`~UnQLite.store`.
:param str key: The identifier of the value to append to.
:param value: The value to append.
.. py:method:: exists(key)
Return whether the given ``key`` exists in the database.
:param str key:
:returns: A boolean value indicating whether the given ``key`` exists in the database.
Example:
.. code-block:: python
def get_expensive_data():
if not db.exists('cached-data'):
db.set('cached-data', calculate_expensive_data())
return db.get('cached-data')
You can also use the python ``in`` keyword to determine whether a key exists:
.. code-block:: python
def get_expensive_data():
if 'cached-data' not in db:
db['cached-data'] = calculate_expensive_data()
return db['cached-data']
.. py:method:: begin()
Begin a transaction.
.. py:method:: rollback()
Roll back the current transaction.
.. py:method:: commit()
Commit the current transaction.
.. py:method:: transaction()
Create a context manager for performing multiple operations in a transaction.
.. warning::
Transactions occur at the disk-level and have no effect on in-memory databases.
Example:
.. code-block:: python
# Transfer $100 in a transaction.
with db.transaction():
db['from_acct'] = db['from_account'] - 100
db['to_acct'] = db['to_acct'] + 100
# Make changes and then roll them back.
with db.transaction():
db['foo'] = 'bar'
db.rollback() # Whoops, do not commit these changes.
.. py:method:: commit_on_success(fn)
Function decorator that will cause the wrapped function to have all statements wrapped in a transaction. If the function returns without an exception, the transaction is committed. If an exception occurs in the function, the transaction is rolled back.
Example:
.. code-block:: pycon
>>> @db.commit_on_success
... def save_value(key, value, exc=False):
... db[key] = value
... if exc:
... raise Exception('uh-oh')
...
>>> save_value('k3', 'v3')
>>> save_value('k3', 'vx', True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "unqlite/core.py", line 312, in wrapper
return fn()
File "<stdin>", line 5, in save_value
Exception: uh-oh
>>> db['k3']
'v3'
.. py:method:: cursor()
:returns: a :py:class:`Cursor` instance.
Create a cursor for traversing database records.
.. py:method:: vm(code)
:param str code: a Jx9 script.
:returns: a :py:class:`VM` instance with the compiled script.
Compile the given Jx9 script and return an initialized :py:class:`VM` instance.
Usage:
.. code-block:: python
script = "$users = db_fetch_all('users');"
with db.vm(script) as vm:
vm.execute()
users = vm['users']
.. py:method:: collection(name)
:param str name: The name of the collection.
Factory method for instantiating a :py:class:`Collection` for working with a collection of JSON objects.
Usage:
.. code-block:: python
Users = db.collection('users')
# Fetch all records in the collection.
all_users = Users.all()
# Create a new record.
Users.store({'name': 'Charlie', 'activities': ['reading', 'programming']})
See the :py:class:`Collection` docs for more examples.
.. py:method:: keys()
:returns: A generator that successively yields the keys in the database.
.. py:method:: values()
:returns: A generator that successively yields the values in the database.
.. py:method:: items()
:returns: A generator that successively yields tuples containing the keys and values in the database.
.. py:method:: update(data)
:param dict data: Dictionary of data to store in the database. If any keys in ``data`` already exist, the values will be overwritten.
.. py:method:: __iter__()
UnQLite databases can be iterated over. The iterator is a :py:class:`Cursor`, and will yield 2-tuples of keys and values:
.. code-block:: python
db = UnQLite('my_db.udb')
for (key, value) in db:
print key, '=>', value
.. py:method:: range(start_key, end_key[, include_end_key=True])
Iterate over a range of key/value pairs in the database.
.. code-block:: python
for key, value in db.range('d.20140101', 'd.20140201', False):
calculate_daily_aggregate(key, value)
.. py:method:: __len__()
Return the number of records in the database.
.. warning:: This method calculates the lengthy by iterating and counting every record. At the time of writing, there is no C API for calculating the size of the database.
.. py:method:: flush()
Delete all records in the database.
.. warning:: This method works by iterating through all the records and deleting them one-by-one. At the time of writing there is no API for bulk deletes. If you are worried about speed, simply delete the database file and re-open it.
.. py:method:: random_string(nbytes)
:param int nbytes: number of bytes to generate
:returns: a string consisting of random lower-case letters (a-z).
.. py:method:: random_number()
:returns: a random positive integer
.. py:method:: lib_version()
:returns: The UnQLite library version.
.. py:class:: Transaction(unqlite)
:param UnQLite unqlite: An :py:class:`UnQLite` instance.
Context-manager for executing wrapped blocks in a transaction. Rather than instantiating this object directly, it is recommended that you use :py:meth:`UnQLite.transaction`.
Example:
.. code-block:: python
with db.transaction():
db['from_acct'] = db['from_acct'] + 100
db['to_acct'] = db['to_acct'] - 100
To roll back changes inside a transaction, call :py:meth:`UnQLite.rollback`:
.. code-block:: python
with db.transaction():
db['from_acct'] = db['from_acct'] + 100
db['to_acct'] = db['to_acct'] - 100
if int(db['to_acct']) < 0:
db.rollback() # Not enough funds!
.. py:class:: Cursor(unqlite)
:param UnQLite unqlite: An :py:class:`UnQLite` instance.
Create a cursor. Cursors should generally be used as context managers.
Rather than instantiating this class directly, it is preferable to call the factory method :py:meth:`UnQLite.cursor`.
.. code-block:: python
for i in range(4):
db['k%d' % i] = str(i)
# Cursor support iteration, which returns key/value pairs.
with db.cursor() as cursor:
all_items = [(key, value) for key, value in cursor]
# You can seek to a record, then iterate to retrieve a portion
# of results.
cursor.seek('k2')
k2, k3 = [key for key, _ in cursor]
# Previous cursor was closed automatically, open a new one.
with db.cursor() as cursor:
cursor.seek('k1') # Jump to the 2nd record, k1
assert cursor.key() == 'k1' # Use the key()/value() methods.
assert cursor.value() == '1'
cursor.delete() # Delete k1/v1
cursor.first() # Cursor now points to k0/0
cursor.next() # Cursor jumps to k2/2 since k1/1 is deleted.
assert cursor.key() == 'k2'
keys = [key for key, value in cursor] # Cursor iterates from k2->k3
assert keys == ['k2', 'k3']
.. py:method:: reset()
Reset the cursor, which also resets the pointer to the first record.
.. py:method:: seek(key[, flags=UNQLITE_CURSOR_MATCH_EXACT])
Advance the cursor to the given key using the comparison method
described in the flags.
A detailed description of alternate flags and their usage can be found in the `unqlite_kv_cursor docs <http://unqlite.org/c_api/unqlite_kv_cursor.html>`_.
Usage:
.. code-block:: python
with db.cursor() as cursor:
cursor.seek('item.20140101')
while cursor.is_valid():
data_for_day = cursor.value()
# do something with data for day
handle_data(data_for_day)
if cursor.key() == 'item.20140201':
break
else:
cursor.next()
.. py:method:: first()
Place cursor at the first record.
.. py:method:: last()
Place cursor at the last record.
.. py:method:: next_entry()
Move the cursor to the next record.
:raises: ``StopIteration`` if you have gone past the last record.
.. py:method:: previous_entry()
Move the cursor to the previous record.
:raises: ``StopIteration`` if you have gone past the first record.
.. py:method:: is_valid()
:rtype: bool
Indicate whether this cursor is pointing to a valid record.
.. py:method:: __iter__()
Iterate over the keys in the database, returning 2-tuples of key/value.
.. note:: Iteration will begin wherever the cursor is currently pointing, rather than starting at the first record.
.. py:method:: key()
Return the key of the current record.
.. py:method:: value()
Return the value of the current record.
.. py:method:: delete()
Delete the record currently pointed to by the cursor.
.. warning::
The :py:meth:`~Cursor.delete` method is a little weird in that
it only seems to work if you explicitly call :py:meth:`~Cursor.seek`
beforehand.
.. py:method:: fetch_until(stop_key[, include_stop_key=True])
:param str stop_key: The key at which the cursor should stop iterating.
:param bool include_stop_key: Whether the stop key/value pair should be returned.
Yield successive key/value pairs until the ``stop_key`` is reached.
By default the ``stop_key`` and associated value will be returned, but
this behavior can be controlled using the ``include_stop_key`` flag.
.. py:class:: VM(unqlite, code)
:param UnQLite unqlite: An :py:class:`UnQLite` instance.
:param str code: A Jx9 script.
Python wrapper around an UnQLite virtual machine. The VM is the primary means of executing Jx9 scripts and interacting with the JSON document store.
VM instances should not be instantiated directly, but created by calling :py:meth:`UnQLite.vm`.
.. note:: For information on Jx9 scripting, see the `Jx9 docs <http://unqlite.org/jx9.html>`_.
Example of passing values into a Jx9 script prior to execution, then extracting values afterwards:
.. code-block:: python
script = """
$collection = 'users';
db_create($collection);
db_store($collection, $values);
$users = db_fetch_all($collection);
"""
# We can pass all sorts of interesting data in to our script.
values = [
{'username': 'huey', 'color': 'white'},
{'username': 'mickey', 'color': 'black'},
]
with db.vm(script) as vm:
# Set the value of the `values` variable in the Jx9 script:
vm['values'] = values
# Execute the script, which creates the collection and stores
# the two records.
vm.execute()
# After execution, we can extract the value of the `users` variable.
users = vm['users']
# Jx9 document store assigns a unique 0-based id to each record
# in a collection. The extracted variable `users` will now equal:
print users == [
{'username': 'huey', 'color': 'white', '__id': 0},
{'username': 'mickey', 'color': 'black', '__id': 1},
] # prints `True`
.. py:method:: execute()
Execute the compiled Jx9 script.
.. py:method:: close()
Release the VM, deallocating associated memory.
.. note:: When using the VM as a context manager, this is handled automatically.
.. py:method:: __enter__()
Typically the VM should be used as a context manager. The context manager API handles compiling the Jx9 code and releasing the data-structures afterwards.
.. code-block:: python
with db.vm(jx9_script) as vm:
vm.execute()
.. py:method:: set_value(name, value)
:param str name: A variable name
:param value: Value to pass in to the scope of the Jx9 script, which should be either a string, int, float, bool, list, dict, or None (basically a valid JSON type).
Set the value of a Jx9 variable. You can also use dictionary-style assignment to set the value.
.. py:method:: get_value(name)
:param str name: A variable name
Retrieve the value of a variable after the execution of a Jx9 script. You can also use dictionary-style lookup to retrieve the value.
.. py:method:: compile(code)
:param str code: A Jx9 script.
Compile the Jx9 script and initialize the VM.
.. warning::
It is not necessary to call this method yourself, as it is called automatically when the VM is used as a context manager.
.. note::
This does not execute the code. To execute the code, you must also call :py:meth:`VM.execute`.
.. py:class:: Collection(unqlite, name)
:param unqlite: a :py:class:`UnQLite` instance
:param str name: the name of the collection
Perform common operations on a JSON document collection.
.. note::
Rather than instantiating this class directly, use the factory method :py:meth:`UnQLite.collection`.
Basic operations:
.. code-block:: pycon
>>> users = db.collection('users')
>>> users.create() # Create the collection if it does not exist.
>>> users.exists()
True
>>> users.store([
... {'name': 'Charlie', 'color': 'green'},
... {'name': 'Huey', 'color': 'white'},
... {'name': 'Mickey', 'color': 'black'}])
True
>>> users.store({'name': 'Leslie', 'color': 'also green'})
True
>>> users.fetch(0) # Fetch the first record (user "__id" = 0).
{'__id': 0, 'color': 'green', 'name': 'Charlie'}
>>> users.delete(0) # Delete the first record (user "__id" = 0).
True
>>> users.delete(users.last_record_id()) # Delete the last record.
True
>>> users.update(1, {'color': 'white', 'name': 'Baby Huey'})
True
>>> users.all()
[{'__id': 1, 'color': 'white', 'name': 'Baby Huey'},
{'__id': 2, 'color': 'black', 'name': 'Mickey'}]
>>> users.filter(lambda obj: obj['name'].startswith('B'))
[{'__id': 1, 'color': 'white', 'name': 'Baby Huey'}]
.. py:method:: all()
Return a list containing all records in the collection.
.. py:method:: filter(filter_fn)
Filter the list of records using the provided function (or lambda).
Your filter function should accept a single parameter, which will be
the record, and return a boolean value indicating whether the record
should be returned.
Example:
.. code-block:: pycon
>>> users.filter(lambda user: user['is_admin'] == True)
[{'__id': 0, 'username': 'Huey', 'is_admin': True},
{'__id': 3, 'username': 'Zaizee', 'is_admin': True},
{'__id': 4, 'username': 'Charlie', 'is_admin': True}]
.. py:method:: create()
Create the collection if it does not exist.
.. py:method:: drop()
Drop the collection, deleting all records.
.. py:method:: exists()
:returns: boolean value indicating whether the collection exists.
.. py:method:: last_record_id()
:returns: The integer ID of the last record stored in the collection.
.. py:method:: current_record_id()
:returns: The integer ID of the record pointed to by the active cursor.
.. py:method:: reset_cursor()
Reset the collection cursor to point to the first record in the collection.
.. py:method:: __len__()
Return the number of records in the collection.
.. py:method:: fetch(record_id)
Return the record with the given id.
.. code-block:: pycon
>>> users = db.collection('users')
>>> users.fetch(0) # Fetch the first record in collection (id=0).
{'name': 'Charlie', 'color': 'green', '__id': 0}
>>> users[1] # You can also use dictionary-style lookup.
{'name': 'Huey', 'color': 'white', '__id': 1}
You can also use the dictionary API:
.. code-block:: python
>>> users[0]
{'name': 'Charlie', 'color': 'green', '__id': 0}
.. py:method:: store(record[, return_id=True])
:param record: Either a dictionary (single-record), or a list of dictionaries.
:param bool return_id: Return the ID of the newly-created object.
:returns: New object's ID, or a boolean indicating if the record was stored successfully.
Store the record(s) in the collection.
.. code-block:: pycon
>>> users = db.collection('users')
>>> users.store({'name': 'Charlie', 'color': 'green'})
True
>>> users.store([
... {'name': 'Huey', 'color': 'white'},
... {'name': 'Mickey', 'color': 'black'}])
True
.. py:method:: update(record_id, record)
:param record_id: The ID of the record to update.
:param record: A dictionary of data to update the given record ID.
:returns: Boolean value indicating if the update was successful.
Update the data stored for the given ``record_id``. The data is completely replaced, rather than being appended to.
.. code-block:: pycon
>>> users = db.collection('users')
>>> users.store({'name': 'Charlie'})
True
>>> users.update(users.last_record_id(), {'name': 'Chuck'})
True
>>> users.fetch(users.last_record_id())
{'__id': 0, 'name': 'Chuck'}
.. py:method:: delete(record_id)
:param record_id: The database-provided ID of the record to delete.
:returns: Boolean indicating if the record was deleted successfully.
Delete the record with the given id.
.. code-block:: pycon
>>> data = db.collection('data')
>>> data.create()
>>> data.store({'foo': 'bar'})
True
>>> data.delete(data.last_record_id())
True
>>> data.all()
[]
You can also use the dictionary API:
.. code-block:: pycon
>>> del users[1] # Delete user object with `__id=1`.
.. py:method:: fetch_current()
Fetch the record pointed to by the collection cursor.
| {
"pile_set_name": "Github"
} |
module OAuth
class Unauthorized < OAuth::Error
attr_reader :request
def initialize(request = nil)
@request = request
end
def to_s
[request.code, request.message] * " "
end
end
end
| {
"pile_set_name": "Github"
} |
# What the Hack: OSS DevOps
## Intentionally Blank
Please see the full list of OSS DevOps Challenges [Here](../readme.md) | {
"pile_set_name": "Github"
} |
signature MLTON_MONO_ARRAY = sig
type t
type elem
val fromPoly: elem array -> t
val toPoly: t -> elem array
end
| {
"pile_set_name": "Github"
} |
"\'_#0r"
"\'_#1r"
"\'_#2r"
"\'_#3r"
"\'_#4r"
| {
"pile_set_name": "Github"
} |
<acrn-config board="nuc6cayh" scenario="industry">
<hv>
<DEBUG_OPTIONS desc="Debug options for ACRN hypervisor, only valid on debug version">
<RELEASE desc="Release build. 'y' for Release, 'n' for Debug.">n</RELEASE>
<SERIAL_CONSOLE desc="The serial device which is used for hypervisor debug, only valid on Debug version.">/dev/ttyS0</SERIAL_CONSOLE>
<MEM_LOGLEVEL desc="Default loglevel in memory">5</MEM_LOGLEVEL>
<NPK_LOGLEVEL desc="Default loglevel for the hypervisor NPK log">5</NPK_LOGLEVEL>
<CONSOLE_LOGLEVEL desc="Default loglevel on the serial console">3</CONSOLE_LOGLEVEL>
<LOG_DESTINATION desc="Bitmap of consoles where logs are printed.">7</LOG_DESTINATION>
<LOG_BUF_SIZE desc="Capacity of logbuf for each physical cpu.">0x40000</LOG_BUF_SIZE>
</DEBUG_OPTIONS>
<FEATURES>
<RELOC desc="Enable hypervisor relocation">y</RELOC>
<SCHEDULER desc="The CPU scheduler to be used by the hypervisor.">SCHED_BVT</SCHEDULER>
<MULTIBOOT2 desc="Support boot ACRN from multiboot2 protocol.">y</MULTIBOOT2>
<RDT desc="Intel RDT (Resource Director Technology).">
<RDT_ENABLED desc="Enable RDT">y</RDT_ENABLED>
<CDP_ENABLED desc="CDP (Code and Data Prioritization). CDP is an extension of CAT.">n</CDP_ENABLED>
<CLOS_MASK desc="Cache Capacity Bitmask">0xff</CLOS_MASK>
<CLOS_MASK desc="Cache Capacity Bitmask">0xff</CLOS_MASK>
<CLOS_MASK desc="Cache Capacity Bitmask">0xff</CLOS_MASK>
<CLOS_MASK desc="Cache Capacity Bitmask">0xff</CLOS_MASK>
</RDT>
<HYPERV_ENABLED desc="Enable Hyper-V enlightenment">y</HYPERV_ENABLED>
<IOMMU_ENFORCE_SNP desc="IOMMU enforce snoop behavior of DMA operation.">n</IOMMU_ENFORCE_SNP>
<ACPI_PARSE_ENABLED desc="Enable ACPI runtime parsing.">y</ACPI_PARSE_ENABLED>
<L1D_VMENTRY_ENABLED desc="Enable L1 cache flush before VM entry.">n</L1D_VMENTRY_ENABLED>
<MCE_ON_PSC_DISABLED desc="Force to disable software workaround for Machine Check Error on Page Size Change.">n</MCE_ON_PSC_DISABLED>
<IVSHMEM desc="IVSHMEM configuration">
<IVSHMEM_ENABLED desc="Enable Share Memory between VMs by IVSHMEM.">n</IVSHMEM_ENABLED>
<IVSHMEM_REGION desc="the shared memory region name (starting with hv:/, size (in MB), and IDs of all VMs (separated by a colon) sharing this region, for example hv:/sharename,2,0:2"></IVSHMEM_REGION>
</IVSHMEM>
</FEATURES>
<MEMORY>
<STACK_SIZE desc="Capacity of one stack, in bytes.">0x2000</STACK_SIZE>
<HV_RAM_SIZE desc="Size of the RAM region used by the hypervisor"></HV_RAM_SIZE>
<HV_RAM_START desc="2M-aligned Start physical address of the RAM region used by the hypervisor."></HV_RAM_START>
<LOW_RAM_SIZE desc="Size of the low RAM region">0x00010000</LOW_RAM_SIZE>
<UOS_RAM_SIZE desc="Size of the User OS (UOS) RAM.">0x200000000</UOS_RAM_SIZE>
<SOS_RAM_SIZE desc="Size of the Service OS (SOS) RAM.">0x400000000</SOS_RAM_SIZE>
<PLATFORM_RAM_SIZE desc="Size of the physical platform RAM">0x400000000</PLATFORM_RAM_SIZE>
</MEMORY>
<CAPACITIES desc="Capacity limits for static assigned data struct or maximum supported resouce">
<IOMMU_BUS_NUM desc="Highest PCI bus ID used during IOMMU initialization.">0x100</IOMMU_BUS_NUM>
<MAX_IR_ENTRIES desc="Maximum number of Interrupt Remapping Entries.">256</MAX_IR_ENTRIES>
<MAX_IOAPIC_NUM desc="Maximum number of IO-APICs.">1</MAX_IOAPIC_NUM>
<MAX_PCI_DEV_NUM desc="Maximum number of PCI devices.">96</MAX_PCI_DEV_NUM>
<MAX_IOAPIC_LINES desc="Maximum number of interrupt lines per IOAPIC.">120</MAX_IOAPIC_LINES>
<MAX_PT_IRQ_ENTRIES desc="Maximum number of interrupt source for PT devices.">64</MAX_PT_IRQ_ENTRIES>
<MAX_MSIX_TABLE_NUM desc="Maximum number of MSI-X tables per device. Please leave it blank if not sure.">16</MAX_MSIX_TABLE_NUM>
<MAX_EMULATED_MMIO desc="Maximum number of emulated MMIO regions.">16</MAX_EMULATED_MMIO>
</CAPACITIES>
<MISC_CFG>
<GPU_SBDF desc="Segment, Bus, Device, and function of the GPU.">0x00000010</GPU_SBDF>
<UEFI_OS_LOADER_NAME desc="UEFI OS loader name.">\\EFI\\BOOT\\bootx64.efi</UEFI_OS_LOADER_NAME>
</MISC_CFG>
</hv>
<vm id="0">
<vm_type desc="Specify the VM type" readonly="true">SOS_VM</vm_type>
<name desc="Specify the VM name which will be shown in hypervisor console command: vm_list.">ACRN SOS VM</name>
<guest_flags desc="Select all applicable flags for the VM" multiselect="true">
<guest_flag>0</guest_flag>
</guest_flags>
<clos configurable="0" desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
</clos>
<memory>
<start_hpa configurable="0" desc="The start physical address in host for the VM">0</start_hpa>
<size configurable="0" desc="The memory size in Bytes for the VM">0x20000000</size>
</memory>
<os_config>
<name desc="Specify the OS name of VM, currently it is not referenced by hypervisor code.">ACRN Service OS</name>
<kern_type desc="Specify the VM name which will be shown in hypervisor console command: vm_list.">KERNEL_BZIMAGE</kern_type>
<kern_mod desc="The tag for kernel image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline.">Linux_bzImage</kern_mod>
<ramdisk_mod desc="The tag for ramdisk image which act as multiboot module, it must exactly match the module tag in GRUB multiboot cmdline."></ramdisk_mod>
<bootargs configurable="0" desc="Specify kernel boot arguments">SOS_VM_BOOTARGS</bootargs>
</os_config>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address." readonly="true">SOS_COM1_BASE</base>
<irq configurable="0" desc="vCOM1 irq">SOS_COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">SOS_COM2_BASE</base>
<irq configurable="0" desc="vCOM2 irq">SOS_COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">2</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">1</target_uart_id>
</vuart>
<pci_devs configurable="0" desc="pci devices list">
<pci_dev desc="pci device"></pci_dev>
<pci_dev desc="pci device"></pci_dev>
</pci_devs>
<board_private>
<rootfs desc="rootfs for Linux kernel">/dev/sda3</rootfs>
<bootargs desc="Specify kernel boot arguments">
rw rootwait console=tty0 consoleblank=0 no_timer_check quiet loglevel=3
i915.nuclear_pageflip=1 hvlog=2M@0xe00000 memmap=0x200000$0xe00000
</bootargs>
</board_private>
</vm>
<vm id="1">
<vm_type desc="Specify the VM type" readonly="true">POST_STD_VM</vm_type>
<guest_flags desc="Select all applicable flags for the VM" multiselect="true">
<guest_flag>0</guest_flag>
</guest_flags>
<cpu_affinity desc="List of pCPU: the guest VM is allowed to create vCPU from all or a subset of this list.">
<pcpu_id>1</pcpu_id>
</cpu_affinity>
<clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
</clos>
<epc_section configurable="0" desc="epc section">
<base desc="SGX EPC section base, must be page aligned">0</base>
<size desc="SGX EPC section size in Bytes, must be page aligned">0</size>
</epc_section>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">COM1_BASE</base>
<irq configurable="0" desc="vCOM1 irq">COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">INVALID_COM_BASE</base>
<irq configurable="0" desc="vCOM2 irq">COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">0</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">1</target_uart_id>
</vuart>
</vm>
<vm id="2">
<vm_type desc="Specify the VM type" readonly="true">POST_RT_VM</vm_type>
<guest_flags desc="Select all applicable flags for the VM" multiselect="true">
<guest_flag>0</guest_flag>
</guest_flags>
<cpu_affinity desc="List of pCPU: the guest VM is allowed to create vCPU from all or a subset of this list.">
<pcpu_id>2</pcpu_id>
<pcpu_id>3</pcpu_id>
</cpu_affinity>
<clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
<vcpu_clos>0</vcpu_clos>
</clos>
<epc_section configurable="0" desc="epc section">
<base desc="SGX EPC section base, must be page aligned">0</base>
<size desc="SGX EPC section size in Bytes, must be page aligned">0</size>
</epc_section>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">COM1_BASE</base>
<irq configurable="0" desc="vCOM1 irq">COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">COM2_BASE</base>
<irq configurable="0" desc="vCOM2 irq">COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">0</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">1</target_uart_id>
</vuart>
</vm>
<vm id="3">
<vm_type desc="Specify the VM type" readonly="true">POST_STD_VM</vm_type>
<guest_flags desc="Select all applicable flags for the VM" multiselect="true">
<guest_flag>0</guest_flag>
</guest_flags>
<cpu_affinity desc="List of pCPU: the guest VM is allowed to create vCPU from all or a subset of this list.">
<pcpu_id>0</pcpu_id>
<pcpu_id>1</pcpu_id>
</cpu_affinity>
<clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
<vcpu_clos>0</vcpu_clos>
</clos>
<epc_section configurable="0" desc="epc section">
<base desc="SGX EPC section base, must be page aligned">0</base>
<size desc="SGX EPC section size in Bytes, must be page aligned">0</size>
</epc_section>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">COM1_BASE</base>
<irq configurable="0" desc="vCOM1 irq">COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">INVALID_COM_BASE</base>
<irq configurable="0" desc="vCOM2 irq">COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">0</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">1</target_uart_id>
</vuart>
</vm>
<vm id="4">
<vm_type desc="Specify the VM type" readonly="true">POST_STD_VM</vm_type>
<guest_flags desc="Select all applicable flags for the VM" multiselect="true">
<guest_flag>0</guest_flag>
</guest_flags>
<cpu_affinity desc="List of pCPU: the guest VM is allowed to create vCPU from all or a subset of this list.">
<pcpu_id>0</pcpu_id>
<pcpu_id>1</pcpu_id>
</cpu_affinity>
<clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
<vcpu_clos>0</vcpu_clos>
</clos>
<epc_section configurable="0" desc="epc section">
<base desc="SGX EPC section base, must be page aligned">0</base>
<size desc="SGX EPC section size in Bytes, must be page aligned">0</size>
</epc_section>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">COM1_BASE</base>
<irq configurable="0" desc="vCOM1 irq">COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">INVALID_COM_BASE</base>
<irq configurable="0" desc="vCOM2 irq">COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">0</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">1</target_uart_id>
</vuart>
</vm>
<vm id="5">
<vm_type desc="Specify the VM type" readonly="true">POST_STD_VM</vm_type>
<guest_flags desc="Select all applicable flags for the VM" multiselect="true">
<guest_flag>0</guest_flag>
</guest_flags>
<cpu_affinity desc="List of pCPU: the guest VM is allowed to create vCPU from all or a subset of this list.">
<pcpu_id>0</pcpu_id>
<pcpu_id>1</pcpu_id>
</cpu_affinity>
<clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
<vcpu_clos>0</vcpu_clos>
</clos>
<epc_section configurable="0" desc="epc section">
<base desc="SGX EPC section base, must be page aligned">0</base>
<size desc="SGX EPC section size in Bytes, must be page aligned">0</size>
</epc_section>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">COM1_BASE</base>
<irq configurable="0" desc="vCOM1 irq">COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">INVALID_COM_BASE</base>
<irq configurable="0" desc="vCOM2 irq">COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">0</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">1</target_uart_id>
</vuart>
</vm>
<vm id="6">
<vm_type desc="Specify the VM type" readonly="true">POST_STD_VM</vm_type>
<guest_flags desc="Select all applicable flags for the VM" multiselect="true">
<guest_flag>0</guest_flag>
</guest_flags>
<cpu_affinity desc="List of pCPU: the guest VM is allowed to create vCPU from all or a subset of this list.">
<pcpu_id>0</pcpu_id>
<pcpu_id>1</pcpu_id>
</cpu_affinity>
<clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
<vcpu_clos>0</vcpu_clos>
</clos>
<epc_section configurable="0" desc="epc section">
<base desc="SGX EPC section base, must be page aligned">0</base>
<size desc="SGX EPC section size in Bytes, must be page aligned">0</size>
</epc_section>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">COM1_BASE</base>
<irq configurable="0" desc="vCOM1 irq">COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">INVALID_COM_BASE</base>
<irq configurable="0" desc="vCOM2 irq">COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">0</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">1</target_uart_id>
</vuart>
</vm>
<vm id="7" configurable="1" desc="specific for Kata">
<vm_type readonly="true" desc="Specify the VM type">KATA_VM</vm_type>
<cpu_affinity desc="List of pCPU: the guest VM is allowed to create vCPU from all or a subset of this list.">
<pcpu_id>0</pcpu_id>
<pcpu_id>1</pcpu_id>
</cpu_affinity>
<clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
<vcpu_clos>0</vcpu_clos>
<vcpu_clos>0</vcpu_clos>
</clos>
<epc_section configurable="0" desc="epc section">
<base desc="SGX EPC section base, must be page aligned">0</base>
<size desc="SGX EPC section size in Bytes, must be page aligned">0</size>
</epc_section>
<vuart id="0">
<type configurable="0" desc="vCOM1 type">VUART_LEGACY_PIO</type>
<base configurable="0" desc="vUART0 (A.K.A COM1) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">INVALID_COM_BASE</base>
<irq configurable="0" desc="vCOM1 irq">COM1_IRQ</irq>
</vuart>
<vuart id="1">
<type configurable="0" desc="vCOM2 type">VUART_LEGACY_PIO</type>
<base configurable="0" desc="vUART1 (A.K.A COM2) enabling switch. Enable by exposing its base address, disable by returning invalid base address.">INVALID_COM_BASE</base>
<irq configurable="0" desc="vCOM2 irq">COM2_IRQ</irq>
<target_vm_id desc="COM2 is used for VM communications. When it is enabled, please specify which target VM that current VM connect to.">0</target_vm_id>
<target_uart_id configurable="0" desc="target vUART ID that vCOM2 connect to">0</target_uart_id>
</vuart>
</vm>
</acrn-config>
| {
"pile_set_name": "Github"
} |
/*!
* Bootstrap Grunt task for generating raw-files.min.js for the Customizer
* http://getbootstrap.com
* Copyright 2014-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict';
var fs = require('fs');
var btoa = require('btoa');
var glob = require('glob');
function getFiles(type) {
var files = {};
var recursive = type === 'less';
var globExpr = recursive ? '/**/*' : '/*';
glob.sync(type + globExpr)
.filter(function (path) {
return type === 'fonts' ? true : new RegExp('\\.' + type + '$').test(path);
})
.forEach(function (fullPath) {
var relativePath = fullPath.replace(/^[^/]+\//, '');
files[relativePath] = type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8');
});
return 'var __' + type + ' = ' + JSON.stringify(files) + '\n';
}
module.exports = function generateRawFilesJs(grunt, banner) {
if (!banner) {
banner = '';
}
var dirs = ['js', 'less', 'fonts'];
var files = banner + dirs.map(getFiles).reduce(function (combined, file) {
return combined + file;
}, '');
var rawFilesJs = 'docs/assets/js/raw-files.min.js';
try {
fs.writeFileSync(rawFilesJs, files);
} catch (err) {
grunt.fail.warn(err);
}
grunt.log.writeln('File ' + rawFilesJs.cyan + ' created.');
};
| {
"pile_set_name": "Github"
} |
namespace VkNet.Enums
{
/// <summary>
/// Статус подписки
/// </summary>
public enum SubscriptionStatus
{
/// <summary>
/// Платная
/// </summary>
Chargeable,
/// <summary>
/// Активная
/// </summary>
Active,
/// <summary>
/// Отмененная
/// </summary>
Cancelled
}
} | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2000, 2001, 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 java.awt;
/**
* Capabilities and properties of images.
* @author Michael Martak
* @since 1.4
*/
public class ImageCapabilities implements Cloneable {
private boolean accelerated = false;
/**
* Creates a new object for specifying image capabilities.
* @param accelerated whether or not an accelerated image is desired
*/
public ImageCapabilities(boolean accelerated) {
this.accelerated = accelerated;
}
/**
* Returns <code>true</code> if the object whose capabilities are
* encapsulated in this <code>ImageCapabilities</code> can be or is
* accelerated.
* @return whether or not an image can be, or is, accelerated. There are
* various platform-specific ways to accelerate an image, including
* pixmaps, VRAM, AGP. This is the general acceleration method (as
* opposed to residing in system memory).
*/
public boolean isAccelerated() {
return accelerated;
}
/**
* Returns <code>true</code> if the <code>VolatileImage</code>
* described by this <code>ImageCapabilities</code> can lose
* its surfaces.
* @return whether or not a volatile image is subject to losing its surfaces
* at the whim of the operating system.
*/
public boolean isTrueVolatile() {
return false;
}
/**
* @return a copy of this ImageCapabilities object.
*/
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
// Since we implement Cloneable, this should never happen
throw new InternalError();
}
}
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.