text
stringlengths
2
99k
meta
dict
<?xml version="1.0"?> <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> </pickle> <pickle> <dictionary> <item> <key> <string>delegated_list</string> </key> <value> <list> <string>proxy_listbox_ids</string> <string>description</string> <string>title</string> <string>portal_type</string> <string>columns</string> </list> </value> </item> <item> <key> <string>id</string> </key> <value> <string>my_destination_title</string> </value> </item> <item> <key> <string>message_values</string> </key> <value> <dictionary> <item> <key> <string>external_validator_failed</string> </key> <value> <string>The input failed the external validator.</string> </value> </item> </dictionary> </value> </item> <item> <key> <string>overrides</string> </key> <value> <dictionary> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>target</string> </key> <value> <string></string> </value> </item> </dictionary> </value> </item> <item> <key> <string>tales</string> </key> <value> <dictionary> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>target</string> </key> <value> <string></string> </value> </item> </dictionary> </value> </item> <item> <key> <string>values</string> </key> <value> <dictionary> <item> <key> <string>columns</string> </key> <value> <list> <tuple> <string>title</string> <string>Usual Name</string> </tuple> <tuple> <string>description</string> <string>Description</string> </tuple> <tuple> <string>getDefaultTelephoneText</string> <string>Telephone</string> </tuple> <tuple> <string>getDefaultAddressText</string> <string>Address</string> </tuple> <tuple> <string>translated_portal_type</string> <string>Type</string> </tuple> <tuple> <string>translated_validation_state_title</string> <string>State</string> </tuple> </list> </value> </item> <item> <key> <string>description</string> </key> <value> <string>The organisation or person who is delivered goods or services in this operation</string> </value> </item> <item> <key> <string>field_id</string> </key> <value> <string>my_relation_field</string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string>Base_viewFieldLibrary</string> </value> </item> <item> <key> <string>portal_type</string> </key> <value> <list> <tuple> <string>Organisation</string> <string>Organisation</string> </tuple> <tuple> <string>Person</string> <string>Person</string> </tuple> </list> </value> </item> <item> <key> <string>proxy_listbox_ids</string> </key> <value> <list> <tuple> <string>Base_viewRelatedObjectListBase/listbox</string> <string>All</string> </tuple> <tuple> <string>ERP5Site_viewClientNodeList/listbox</string> <string>Clients</string> </tuple> <tuple> <string>ERP5Site_viewSupplierNodeList/listbox</string> <string>Suppliers</string> </tuple> <tuple> <string>OrganisationModule_viewOrganisationList/listbox</string> <string>Organisations</string> </tuple> <tuple> <string>PersonModule_viewPersonList/listbox</string> <string>Persons</string> </tuple> </list> </value> </item> <item> <key> <string>target</string> </key> <value> <string>Click to edit the target</string> </value> </item> <item> <key> <string>title</string> </key> <value> <string>Recipient or Beneficiary</string> </value> </item> </dictionary> </value> </item> </dictionary> </pickle> </record> </ZopeData>
{ "pile_set_name": "Github" }
--TEST-- Bug #37046 (foreach breaks static scope) --FILE-- <?php function s() { static $storage = array(array('x', 'y')); return $storage[0]; } foreach (s() as $k => $function) { echo "op1 $k\n"; if ($k == 0) { foreach (s() as $k => $function) { echo "op2 $k\n"; } } } ?> --EXPECT-- op1 0 op2 0 op2 1 op1 1
{ "pile_set_name": "Github" }
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://oss.oracle.com/licenses/CDDL+GPL-1.1 * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package com.sun.tools.xjc.generator.annotation.spec; import javax.xml.bind.annotation.XmlElementDecl; import com.sun.codemodel.JAnnotationWriter; import com.sun.codemodel.JType; /** * <p><b> * Auto-generated, do not edit. * </b></p> */ public interface XmlElementDeclWriter extends JAnnotationWriter<XmlElementDecl> { XmlElementDeclWriter name(String value); XmlElementDeclWriter scope(Class value); XmlElementDeclWriter scope(JType value); XmlElementDeclWriter namespace(String value); XmlElementDeclWriter defaultValue(String value); XmlElementDeclWriter substitutionHeadNamespace(String value); XmlElementDeclWriter substitutionHeadName(String value); }
{ "pile_set_name": "Github" }
# # Automatically generated file; DO NOT EDIT. # Espressif IoT Development Framework Configuration # CONFIG_GATTC_ENABLE= CONFIG_ESP32_PHY_MAX_TX_POWER=20 CONFIG_FATFS_CODEPAGE_852= CONFIG_FREERTOS_LEGACY_TICK_HOOK= CONFIG_TRACEMEM_RESERVE_DRAM=0x0 CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 CONFIG_MBEDTLS_XTEA_C= CONFIG_SECURE_BOOT_SIGNING_KEY="" CONFIG_BLE_SMP_ENABLE= CONFIG_FATFS_LFN_NONE=y CONFIG_LWIP_STATS= CONFIG_STACK_CHECK= CONFIG_TCP_RECVMBOX_SIZE=6 CONFIG_FATFS_CODEPAGE_437=y CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE= CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y CONFIG_STACK_CHECK_NORM= CONFIG_TCP_WND_DEFAULT=5744 CONFIG_ESPTOOLPY_BEFORE_NORESET= CONFIG_MBEDTLS_BLOWFISH_C= CONFIG_SECURE_BOOT_ALLOW_JTAG= CONFIG_BT_HCI_UART_NO= CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_DECRYPT= CONFIG_SW_COEXIST_ENABLE= CONFIG_OPTIMIZATION_ASSERTIONS_SILENT= CONFIG_SPIFFS_USE_MAGIC_LENGTH=y CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_FATFS_PER_FILE_CACHE=y CONFIG_ESPTOOLPY_FLASHFREQ="40m" CONFIG_SPIRAM_USE_MEMMAP= CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y CONFIG_UDP_RECVMBOX_SIZE=6 CONFIG_FATFS_CODEPAGE_775= CONFIG_ESP32_APPTRACE_ENABLE= CONFIG_OPENSSL_ASSERT_DEBUG= CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT= CONFIG_MBEDTLS_AES_C=y CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y CONFIG_A2DP_SINK_TASK_STACK_SIZE= CONFIG_OPENSSL_ASSERT_DEBUG_BLOCK= CONFIG_MBEDTLS_GCM_C=y CONFIG_ESPTOOLPY_FLASHSIZE="4MB" CONFIG_LOG_DEFAULT_LEVEL_VERBOSE= CONFIG_HEAP_POISONING_DISABLED=y CONFIG_SPIFFS_CACHE_WR=y CONFIG_SPIRAM_CACHE_WORKAROUND= CONFIG_BROWNOUT_DET_LVL_SEL_0=y CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_BLUEDROID_PINNED_TO_CORE_1= CONFIG_LWIP_AUTOIP_TRIES= CONFIG_FATFS_CODEPAGE_857= CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL= CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE= CONFIG_SPIFFS_CACHE=y CONFIG_INT_WDT=y CONFIG_SECURE_BOOT_ENABLED= CONFIG_MBEDTLS_SSL_PROTO_TLS1=y CONFIG_FREERTOS_LEGACY_IDLE_HOOK= CONFIG_BT_STACK_NO_LOG= CONFIG_MONITOR_BAUD_9600B= CONFIG_MBEDTLS_ECDSA_C=y CONFIG_ESPTOOLPY_FLASHFREQ_40M=y CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y CONFIG_ESPTOOLPY_FLASHSIZE_2MB= CONFIG_LWIP_MULTICAST_PING= CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 CONFIG_FATFS_CODEPAGE_860= CONFIG_AWS_IOT_MQTT_PORT= CONFIG_ESP32_APPTRACE_ONPANIC_HOST_FLUSH_TMO= CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 CONFIG_MBEDTLS_ECDH_C=y CONFIG_SPIRAM_USE_CAPS_ALLOC= CONFIG_ESP32_ENABLE_COREDUMP_TO_UART= CONFIG_FREERTOS_RUN_TIME_STATS_USING_CPU_CLK= CONFIG_SPIFFS_CHECK_DBG= CONFIG_ESPTOOLPY_BAUD_230400B= CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 CONFIG_AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL= CONFIG_MBEDTLS_SSL_ALPN=y CONFIG_MBEDTLS_PEM_WRITE_C=y CONFIG_SPIFFS_CACHE_STATS= CONFIG_LOG_DEFAULT_LEVEL_INFO=y CONFIG_FLASHMODE_QOUT= CONFIG_BT_RESERVE_DRAM=0 CONFIG_SPIFFS_TEST_VISUALISATION= CONFIG_LOG_BOOTLOADER_LEVEL_ERROR= CONFIG_CXX_EXCEPTIONS= CONFIG_FATFS_FS_LOCK=0 CONFIG_IP_LOST_TIMER_INTERVAL=120 CONFIG_SPIFFS_META_LENGTH=4 CONFIG_ESP32_PANIC_PRINT_REBOOT=y CONFIG_SYSVIEW_EVT_TASK_TERMINATE_ENABLE= CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y CONFIG_BROWNOUT_DET_LVL_SEL_5= CONFIG_AWS_IOT_MQTT_RX_BUF_LEN= CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION= CONFIG_CONSOLE_UART_BAUDRATE=115200 CONFIG_SPIRAM_SUPPORT= CONFIG_MBEDTLS_DES_C= CONFIG_LWIP_MAX_SOCKETS=10 CONFIG_LWIP_NETIF_LOOPBACK=y CONFIG_MBEDTLS_HAVE_TIME_DATE= CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL= CONFIG_SPIRAM_TYPE_ESPPSRAM32= CONFIG_EMAC_TASK_PRIORITY=20 CONFIG_FREERTOS_USE_TRACE_FACILITY= CONFIG_SYSVIEW_TS_SOURCE_TIMER_11= CONFIG_TIMER_TASK_STACK_DEPTH=2048 CONFIG_TCP_MSS=1436 CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y CONFIG_FATFS_CODEPAGE_737= CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_ENCRYPT= CONFIG_ESP32_TIME_SYSCALL_USE_FRC1= CONFIG_SPIFFS_CACHE_DBG= CONFIG_MBEDTLS_SSL_PROTO_SSL3= CONFIG_FATFS_CODEPAGE=437 CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y CONFIG_ULP_COPROC_RESERVE_MEM=0 CONFIG_SYSVIEW_TS_SOURCE_TIMER_01= CONFIG_MEMMAP_TRACEMEM_TWOBANKS= CONFIG_LWIP_MAX_UDP_PCBS=16 CONFIG_ESPTOOLPY_BAUD=115200 CONFIG_INT_WDT_CHECK_CPU1=y CONFIG_ADC_CAL_LUT_ENABLE=y CONFIG_LOG_DEFAULT_LEVEL_WARN= CONFIG_AWS_IOT_MQTT_TX_BUF_LEN= CONFIG_BROWNOUT_DET_LVL_SEL_6= CONFIG_FLASHMODE_DIO=y CONFIG_FREERTOS_PORTMUX_DEBUG= CONFIG_FATFS_CODEPAGE_936= CONFIG_ESPTOOLPY_AFTER_RESET=y CONFIG_LWIP_AUTOIP_MAX_CONFLICTS= CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 CONFIG_TOOLPREFIX="xtensa-esp32-elf-" CONFIG_MBEDTLS_ECP_C=y CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024 CONFIG_MBEDTLS_RC4_DISABLED=y CONFIG_BLUEDROID_MEM_DEBUG= CONFIG_FATFS_LFN_STACK= CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS= CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED= CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY= CONFIG_CONSOLE_UART_NUM=0 CONFIG_MBEDTLS_CAMELLIA_C= CONFIG_SYSVIEW_ENABLE= CONFIG_ESP32_APPTRACE_PENDING_DATA_SIZE_MAX= CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y CONFIG_ESPTOOLPY_BAUD_115200B=y CONFIG_SECURE_BOOT_INSECURE= CONFIG_TCP_OVERSIZE_MSS=y CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y CONFIG_CONSOLE_UART_DEFAULT=y CONFIG_OPENSSL_ASSERT_DEBUG_EXIT= CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384 CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF= CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK= CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_SPI_FLASH_LOG_FAILED_WRITE= CONFIG_PARTITION_TABLE_CUSTOM= CONFIG_PPP_CHAP_SUPPORT= CONFIG_LOG_DEFAULT_LEVEL_ERROR= CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_CACHE= CONFIG_TIMER_TASK_STACK_SIZE=3584 CONFIG_MBEDTLS_MPI_USE_INTERRUPT= CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y CONFIG_SYSVIEW_EVT_ISR_ENTER_ENABLE= CONFIG_MBEDTLS_RIPEMD160_C= CONFIG_ESPTOOLPY_FLASHSIZE_1MB= CONFIG_SYSVIEW_EVT_IDLE_ENABLE= CONFIG_MBEDTLS_X509_CRL_PARSE_C=y CONFIG_SYSVIEW_EVT_TASK_STOP_EXEC_ENABLE= CONFIG_FATFS_CODEPAGE_869= CONFIG_LOG_BOOTLOADER_LEVEL_WARN= CONFIG_MBEDTLS_PSK_MODES= CONFIG_LWIP_DHCPS_LEASE_UNIT=60 CONFIG_OPENSSL_DEBUG= CONFIG_SPIFFS_USE_MAGIC=y CONFIG_BROWNOUT_DET_LVL_SEL_1= CONFIG_ESP32_TRAX_TWOBANKS= CONFIG_TCPIP_TASK_STACK_SIZE=2048 CONFIG_ESP_TIMER_PROFILING= CONFIG_BLUEDROID_PINNED_TO_CORE_0= CONFIG_FATFS_CODEPAGE_850= CONFIG_TASK_WDT=y CONFIG_MAIN_TASK_STACK_SIZE=3584 CONFIG_SPIFFS_PAGE_CHECK=y CONFIG_LWIP_MAX_ACTIVE_TCP=16 CONFIG_HEAP_TRACING_STACK_DEPTH= CONFIG_SECURE_BOOTLOADER_ONE_TIME_FLASH= CONFIG_TASK_WDT_TIMEOUT_S=5 CONFIG_INT_WDT_TIMEOUT_MS=300 CONFIG_NEWLIB_STDIN_LINE_ENDING_LF= CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1= CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES= CONFIG_FATFS_CODEPAGE_863= CONFIG_ESPTOOLPY_FLASHMODE="dio" CONFIG_CONSOLE_UART_CUSTOM= CONFIG_MEMMAP_TRACEMEM= CONFIG_BTC_TASK_STACK_SIZE= CONFIG_BLUEDROID_ENABLED= CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y CONFIG_ESPTOOLPY_BEFORE="default_reset" CONFIG_FATFS_LFN_HEAP= CONFIG_SYSVIEW_EVT_ISR_TO_SCHEDULER_ENABLE= CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y CONFIG_MONITOR_BAUD_57600B= CONFIG_TIMER_QUEUE_LENGTH=10 CONFIG_MBEDTLS_TLS_DISABLED= CONFIG_MAKE_WARN_UNDEFINED_VARIABLES=y CONFIG_SYSVIEW_EVT_TIMER_ENTER_ENABLE= CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS= CONFIG_FATFS_TIMEOUT_MS=10000 CONFIG_OPENSSL_DEBUG_LEVEL= CONFIG_FLASHMODE_DOUT= CONFIG_BOOTLOADER_SPI_WP_PIN= CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 CONFIG_MBEDTLS_CCM_C=y CONFIG_PM_USE_RTC_TIMER_REF= CONFIG_SPI_FLASH_ENABLE_COUNTERS= CONFIG_HEAP_POISONING_COMPREHENSIVE= CONFIG_BROWNOUT_DET_LVL_SEL_2= CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 CONFIG_FATFS_CODEPAGE_855= CONFIG_ESP32_TIME_SYSCALL_USE_RTC= CONFIG_FATFS_CODEPAGE_932= CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ULP_COPROC_ENABLED= CONFIG_LOG_DEFAULT_LEVEL_DEBUG= CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH= CONFIG_HEAP_TRACING= CONFIG_SYSVIEW_EVT_TASK_STOP_READY_ENABLE= CONFIG_PM_TRACE= CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK= CONFIG_ESP32_TRAX= CONFIG_FATFS_CODEPAGE_866= CONFIG_AWS_IOT_SDK= CONFIG_DMA_RX_BUF_NUM=10 CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y CONFIG_ESP32_ENABLE_COREDUMP= CONFIG_MONITOR_BAUD_OTHER= CONFIG_SYSVIEW_TS_SOURCE_TIMER_10= CONFIG_MBEDTLS_KEY_EXCHANGE_PSK= CONFIG_FREERTOS_CORETIMER_1= CONFIG_FREERTOS_LEGACY_HOOKS= CONFIG_TCP_SYNMAXRTX=6 CONFIG_ESP32_PANIC_SILENT_REBOOT= CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y CONFIG_ESPTOOLPY_FLASHSIZE_8MB= CONFIG_ESP32_XTAL_FREQ_26= CONFIG_HEAP_POISONING_LIGHT= CONFIG_PYTHON="python" CONFIG_WL_SECTOR_MODE_SAFE= CONFIG_MBEDTLS_SSL_PROTO_DTLS= CONFIG_MBEDTLS_ECP_NIST_OPTIM=y CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y CONFIG_ESPTOOLPY_COMPRESSED=y CONFIG_CONSOLE_UART_CUSTOM_NUM_1= CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" CONFIG_SECURE_BOOT_ALLOW_ROM_BASIC= CONFIG_OPENSSL_LOWLEVEL_DEBUG= CONFIG_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1 CONFIG_TCP_MSL=60000 CONFIG_FATFS_CODEPAGE_720= CONFIG_PARTITION_TABLE_CUSTOM_PHY_DATA_OFFSET= CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y CONFIG_LWIP_SO_REUSE_RXTOALL=y CONFIG_NO_BLOBS= CONFIG_PARTITION_TABLE_SINGLE_APP=y CONFIG_BROWNOUT_DET_LVL_SEL_7= CONFIG_SPIRAM_USE_MALLOC= CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_MBEDTLS_X509_CSR_PARSE_C=y CONFIG_SPIFFS_USE_MTIME=y CONFIG_PM_DFS_INIT_AUTO= CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE= CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR= CONFIG_STACK_CHECK_STRONG= CONFIG_FLASHMODE_QIO= CONFIG_SPIRAM_SPEED_80M= CONFIG_SYSVIEW_EVT_TASK_CREATE_ENABLE= CONFIG_SYSVIEW_TS_SOURCE_ESP_TIMER= CONFIG_FREERTOS_ASSERT_DISABLE= CONFIG_FATFS_CODEPAGE_865= CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL= CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y CONFIG_MBEDTLS_DEBUG= CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE= CONFIG_ESPTOOLPY_FLASHFREQ_80M= CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK= CONFIG_PPP_SUPPORT= CONFIG_SPIRAM_SPEED_40M= CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2048 CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 CONFIG_SPIFFS_GC_DBG= CONFIG_AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS= CONFIG_BROWNOUT_DET_LVL=0 CONFIG_MBEDTLS_PEM_PARSE_C=y CONFIG_PHY_DATA_OFFSET= CONFIG_SPIFFS_GC_MAX_RUNS=10 CONFIG_LWIP_AUTOIP_RATE_LIMIT_INTERVAL= CONFIG_ESPTOOLPY_FLASHSIZE_16MB= CONFIG_SPI_FLASH_WARN_SETTING_ZERO_TO_ONE= CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_STACK_CHECK_ALL= CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET=0x10000 CONFIG_SYSVIEW_TS_SOURCE_CCOUNT= CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4= CONFIG_MONITOR_BAUD_2MB= CONFIG_ESP32_PANIC_GDBSTUB= CONFIG_ESPTOOLPY_FLASHFREQ_20M= CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y CONFIG_SYSVIEW_EVT_TIMER_EXIT_ENABLE= CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y CONFIG_SPI_FLASH_VERIFY_WRITE= CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 CONFIG_MBEDTLS_HARDWARE_AES=y CONFIG_FREERTOS_HZ=100 CONFIG_LOG_COLORS=y CONFIG_PPP_DEBUG_ON= CONFIG_FREERTOS_PORTMUX_DEBUG_RECURSIVE= CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_STACK_CHECK_NONE=y CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y CONFIG_BROWNOUT_DET=y CONFIG_TCP_OVERSIZE_DISABLE= CONFIG_WL_SECTOR_SIZE_512= CONFIG_ESP32_XTAL_FREQ=40 CONFIG_MONITOR_BAUD_115200B=y CONFIG_LOG_BOOTLOADER_LEVEL=3 CONFIG_FATFS_CODEPAGE_949= CONFIG_SPIFFS_DBG= CONFIG_MBEDTLS_TLS_ENABLED=y CONFIG_LWIP_MAX_RAW_PCBS=16 CONFIG_SMP_ENABLE= CONFIG_SPIRAM_SIZE= CONFIG_PARTITION_TABLE_TWO_OTA= CONFIG_PM_ENABLE= CONFIG_FLASH_ENCRYPTION_INSECURE= CONFIG_MBEDTLS_SSL_SESSION_TICKETS=y CONFIG_NEWLIB_NANO_FORMAT= CONFIG_SPIFFS_MAX_PARTITIONS=3 CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS= CONFIG_TWO_UNIVERSAL_MAC_ADDRESS= CONFIG_CONSOLE_UART_TX_GPIO= CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0= CONFIG_MBEDTLS_SSL_RENEGOTIATION=y CONFIG_ESPTOOLPY_BEFORE_RESET=y CONFIG_FATFS_CODEPAGE_862= CONFIG_ESP32_CORE_DUMP_UART_DELAY= CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 CONFIG_PPP_MPPE_SUPPORT= CONFIG_SECURE_BOOTLOADER_REFLASHABLE= CONFIG_L2_TO_L3_COPY= CONFIG_SPIFFS_OBJ_NAME_LEN=32 CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_LOG_BOOTLOADER_LEVEL_NONE= CONFIG_SECURE_BOOT_TEST_MODE= CONFIG_TCP_OVERSIZE_QUARTER_MSS= CONFIG_ESPTOOLPY_BAUD_2MB= CONFIG_TCPIP_RECVMBOX_SIZE=32 CONFIG_ESP32_DEFAULT_CPU_FREQ_240= CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG= CONFIG_ESP32_XTAL_FREQ_AUTO= CONFIG_SPIFFS_GC_STATS= CONFIG_TCP_MAXRTX=12 CONFIG_ESPTOOLPY_AFTER="hard_reset" CONFIG_LWIP_SO_REUSE=y CONFIG_ESP32_XTAL_FREQ_40=y CONFIG_MBEDTLS_TLS_SERVER_ONLY= CONFIG_DMA_TX_BUF_NUM=10 CONFIG_ESP32_TIME_SYSCALL_USE_NONE= CONFIG_LWIP_MAX_LISTENING_TCP=16 CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y CONFIG_WL_SECTOR_SIZE=4096 CONFIG_ESP32_DEBUG_OCDAWARE=y CONFIG_LOG_DEFAULT_LEVEL_NONE= CONFIG_BROWNOUT_DET_LVL_SEL_3= CONFIG_TIMER_TASK_PRIORITY=1 CONFIG_PPP_PAP_SUPPORT= CONFIG_MBEDTLS_TLS_CLIENT=y CONFIG_CONSOLE_UART_RX_GPIO= CONFIG_AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL= CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF= CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI= CONFIG_BT_ENABLED= CONFIG_SYSVIEW_EVT_OVERFLOW_ENABLE= CONFIG_ESP32_WIFI_STATIC_TX_BUFFER= CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y CONFIG_MONITOR_BAUD=115200 CONFIG_MBEDTLS_HARDWARE_SHA= CONFIG_FATFS_CODEPAGE_861= CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST= CONFIG_FREERTOS_CORETIMER_0=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_MBEDTLS_HAVE_TIME=y CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y CONFIG_TCP_QUEUE_OOSEQ=y CONFIG_OPENSSL_ASSERT_EXIT= CONFIG_ESP32_CORE_DUMP_LOG_LEVEL= CONFIG_FREERTOS_DEBUG_INTERNALS= CONFIG_MBEDTLS_RC4_ENABLED= CONFIG_GATTS_ENABLE= CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE= CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y CONFIG_LWIP_AUTOIP= CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER= CONFIG_MBEDTLS_TLS_SERVER=y CONFIG_LWIP_IP_REASSEMBLY= CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y CONFIG_FATFS_CODEPAGE_771= CONFIG_SPIRAM_BOOT_INIT= CONFIG_ESPTOOLPY_AFTER_NORESET= CONFIG_CONSOLE_UART_CUSTOM_NUM_0= CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL= CONFIG_FREERTOS_ISR_STACKSIZE=1536 CONFIG_SPIFFS_API_DBG= CONFIG_DISABLE_BASIC_ROM_CONSOLE= CONFIG_SECURE_BOOT_VERIFICATION_KEY="" CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS= CONFIG_CLASSIC_BT_ENABLED= CONFIG_PM_PROFILING= CONFIG_LWIP_IP_FRAG= CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK= CONFIG_BROWNOUT_DET_LVL_SEL_4= CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK= CONFIG_MONITOR_BAUD_921600B= CONFIG_OPENSSL_ASSERT_DO_NOTHING=y CONFIG_SPIRAM_MEMTEST= CONFIG_ESPTOOLPY_BAUD_OTHER= CONFIG_WL_SECTOR_SIZE_4096=y CONFIG_ESP32_APPTRACE_DEST_TRAX= CONFIG_OPTIMIZATION_LEVEL_DEBUG=y CONFIG_SYSVIEW_EVT_TASK_START_EXEC_ENABLE= CONFIG_WL_SECTOR_MODE_PERF= CONFIG_AWS_IOT_MQTT_HOST="" CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_BT_HCI_UART_BAUDRATE= CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED= CONFIG_FATFS_CODEPAGE_864= CONFIG_FREERTOS_UNICORE= CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y CONFIG_MBEDTLS_TLS_CLIENT_ONLY= CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM= CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_BT_ACL_CONNECTIONS= CONFIG_FATFS_MAX_LFN= CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH= CONFIG_SUPPORT_STATIC_ALLOCATION= CONFIG_SYSVIEW_EVT_ISR_EXIT_ENABLE= CONFIG_SYSVIEW_TS_SOURCE_TIMER_00= CONFIG_ESPTOOLPY_BAUD_921600B= CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_SYSVIEW_EVT_TASK_START_READY_ENABLE= CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 CONFIG_ESP32_DEFAULT_CPU_FREQ_80= CONFIG_FATFS_CODEPAGE_950= CONFIG_APP_OFFSET=0x10000 CONFIG_MEMMAP_SMP=y CONFIG_MONITOR_BAUD_230400B= CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y CONFIG_LWIP_BROADCAST_PING= CONFIG_FATFS_CODEPAGE_DYNAMIC= CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y CONFIG_FLASH_ENCRYPTION_ENABLED= CONFIG_PPP_MSCHAP_SUPPORT= CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_LWIP_SO_RCVBUF= CONFIG_ESPTOOLPY_FLASHFREQ_26M= CONFIG_MBEDTLS_HARDWARE_MPI= CONFIG_MONITOR_BAUD_OTHER_VAL=115200 CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y CONFIG_ESPTOOLPY_PORT="COM2" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y CONFIG_OPTIMIZATION_LEVEL_RELEASE= CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V= CONFIG_TASK_WDT_PANIC= CONFIG_CONSOLE_UART_NONE= CONFIG_ESP32_PANIC_PRINT_HALT= CONFIG_BLUEDROID_PINNED_TO_CORE=
{ "pile_set_name": "Github" }
static char help[] = "Tests MatIncreaseOverlap() and MatCreateSubmatrices() for the parallel case.\n\ This example is similar to ex40.c; here the index sets used are random.\n\ Input arguments are:\n\ -f <input_file> : file to load. For example see $PETSC_DIR/share/petsc/datafiles/matrices\n\ -nd <size> : > 0 no of domains per processor \n\ -ov <overlap> : >=0 amount of overlap between domains\n\n"; #include <petscmat.h> int main(int argc,char **args) { PetscErrorCode ierr; PetscInt nd = 2,ov=1,i,j,lsize,m,n,*idx,bs; PetscMPIInt rank, size; PetscBool flg; Mat A,B,*submatA,*submatB; char file[PETSC_MAX_PATH_LEN]; PetscViewer fd; IS *is1,*is2; PetscRandom r; PetscBool test_unsorted = PETSC_FALSE; PetscScalar rand; ierr = PetscInitialize(&argc,&args,(char*)0,help);if (ierr) return ierr; ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr); ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&rank);CHKERRQ(ierr); ierr = PetscOptionsGetString(NULL,NULL,"-f",file,sizeof(file),NULL);CHKERRQ(ierr); ierr = PetscOptionsGetInt(NULL,NULL,"-nd",&nd,NULL);CHKERRQ(ierr); ierr = PetscOptionsGetInt(NULL,NULL,"-ov",&ov,NULL);CHKERRQ(ierr); ierr = PetscOptionsGetBool(NULL,NULL,"-test_unsorted",&test_unsorted,NULL);CHKERRQ(ierr); /* Read matrix A and RHS */ ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,file,FILE_MODE_READ,&fd);CHKERRQ(ierr); ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr); ierr = MatSetType(A,MATAIJ);CHKERRQ(ierr); ierr = MatSetFromOptions(A);CHKERRQ(ierr); ierr = MatLoad(A,fd);CHKERRQ(ierr); ierr = PetscViewerDestroy(&fd);CHKERRQ(ierr); /* Read the same matrix as a seq matrix B */ ierr = PetscViewerBinaryOpen(PETSC_COMM_SELF,file,FILE_MODE_READ,&fd);CHKERRQ(ierr); ierr = MatCreate(PETSC_COMM_SELF,&B);CHKERRQ(ierr); ierr = MatSetType(B,MATSEQAIJ);CHKERRQ(ierr); ierr = MatSetFromOptions(B);CHKERRQ(ierr); ierr = MatLoad(B,fd);CHKERRQ(ierr); ierr = PetscViewerDestroy(&fd);CHKERRQ(ierr); ierr = MatGetBlockSize(A,&bs);CHKERRQ(ierr); /* Create the Random no generator */ ierr = MatGetSize(A,&m,&n);CHKERRQ(ierr); ierr = PetscRandomCreate(PETSC_COMM_SELF,&r);CHKERRQ(ierr); ierr = PetscRandomSetFromOptions(r);CHKERRQ(ierr); /* Create the IS corresponding to subdomains */ ierr = PetscMalloc1(nd,&is1);CHKERRQ(ierr); ierr = PetscMalloc1(nd,&is2);CHKERRQ(ierr); ierr = PetscMalloc1(m ,&idx);CHKERRQ(ierr); for (i = 0; i < m; i++) {idx[i] = i;CHKERRQ(ierr);} /* Create the random Index Sets */ for (i=0; i<nd; i++) { /* Skip a few,so that the IS on different procs are diffeent*/ for (j=0; j<rank; j++) { ierr = PetscRandomGetValue(r,&rand);CHKERRQ(ierr); } ierr = PetscRandomGetValue(r,&rand);CHKERRQ(ierr); lsize = (PetscInt)(rand*(m/bs)); /* shuffle */ for (j=0; j<lsize; j++) { PetscInt k, swap, l; ierr = PetscRandomGetValue(r,&rand);CHKERRQ(ierr); k = j + (PetscInt)(rand*((m/bs)-j)); for (l = 0; l < bs; l++) { swap = idx[bs*j+l]; idx[bs*j+l] = idx[bs*k+l]; idx[bs*k+l] = swap; } } if (!test_unsorted) {ierr = PetscSortInt(lsize*bs,idx);CHKERRQ(ierr);} ierr = ISCreateGeneral(PETSC_COMM_SELF,lsize*bs,idx,PETSC_COPY_VALUES,is1+i);CHKERRQ(ierr); ierr = ISCreateGeneral(PETSC_COMM_SELF,lsize*bs,idx,PETSC_COPY_VALUES,is2+i);CHKERRQ(ierr); ierr = ISSetBlockSize(is1[i],bs);CHKERRQ(ierr); ierr = ISSetBlockSize(is2[i],bs);CHKERRQ(ierr); } if (!test_unsorted) { ierr = MatIncreaseOverlap(A,nd,is1,ov);CHKERRQ(ierr); ierr = MatIncreaseOverlap(B,nd,is2,ov);CHKERRQ(ierr); for (i=0; i<nd; ++i) { ierr = ISSort(is1[i]);CHKERRQ(ierr); ierr = ISSort(is2[i]);CHKERRQ(ierr); } } ierr = MatCreateSubMatrices(A,nd,is1,is1,MAT_INITIAL_MATRIX,&submatA);CHKERRQ(ierr); ierr = MatCreateSubMatrices(B,nd,is2,is2,MAT_INITIAL_MATRIX,&submatB);CHKERRQ(ierr); /* Now see if the serial and parallel case have the same answers */ for (i=0; i<nd; ++i) { ierr = MatEqual(submatA[i],submatB[i],&flg);CHKERRQ(ierr); if (!flg) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"%D-th paralle submatA != seq submatB",i); } /* Free Allocated Memory */ for (i=0; i<nd; ++i) { ierr = ISDestroy(&is1[i]);CHKERRQ(ierr); ierr = ISDestroy(&is2[i]);CHKERRQ(ierr); } ierr = MatDestroySubMatrices(nd,&submatA);CHKERRQ(ierr); ierr = MatDestroySubMatrices(nd,&submatB);CHKERRQ(ierr); ierr = PetscRandomDestroy(&r);CHKERRQ(ierr); ierr = PetscFree(is1);CHKERRQ(ierr); ierr = PetscFree(is2);CHKERRQ(ierr); ierr = MatDestroy(&A);CHKERRQ(ierr); ierr = MatDestroy(&B);CHKERRQ(ierr); ierr = PetscFree(idx);CHKERRQ(ierr); ierr = PetscFinalize(); return ierr; } /*TEST build: requires: !complex test: nsize: 3 requires: datafilespath double !define(PETSC_USE_64BIT_INDICES) !complex args: -f ${DATAFILESPATH}/matrices/arco1 -nd 5 -ov 2 test: suffix: 2 args: -f ${DATAFILESPATH}/matrices/arco1 -nd 8 -ov 2 requires: datafilespath double !define(PETSC_USE_64BIT_INDICES) !complex test: suffix: unsorted_baij_mpi nsize: 3 requires: datafilespath double !define(PETSC_USE_64BIT_INDICES) !complex args: -f ${DATAFILESPATH}/matrices/cfd.1.10 -nd 8 -mat_type baij -test_unsorted test: suffix: unsorted_baij_seq requires: datafilespath double !define(PETSC_USE_64BIT_INDICES) !complex args: -f ${DATAFILESPATH}/matrices/cfd.1.10 -nd 8 -mat_type baij -test_unsorted test: suffix: unsorted_mpi nsize: 3 requires: datafilespath double !define(PETSC_USE_64BIT_INDICES) !complex args: -f ${DATAFILESPATH}/matrices/arco1 -nd 8 -test_unsorted test: suffix: unsorted_seq requires: datafilespath double !define(PETSC_USE_64BIT_INDICES) !complex args: -f ${DATAFILESPATH}/matrices/arco1 -nd 8 -test_unsorted TEST*/
{ "pile_set_name": "Github" }
@echo off CD /D "%~dp0" set nscexe="%CD%\nsudoc.exe" if NOT exist %nscexe% echo Error! nsudoc.exe not found. & echo. & echo Press any key to exit . . . & pause >nul & exit goto checkadmin :checkadmin echo Elevating to Administrator permissions . . . echo. NET FILE>nul 2>&1||goto elevate goto elevated :elevate echo.CreateObject^("Shell.Application"^).ShellExecute%0,,,"RunAs",1 >"%CD%\runas.vbs" cscript //Nologo "%CD%\runas.vbs" >nul del /q "%CD%\runas.vbs" exit :elevated NET FILE>nul 2>&1||exit echo Elevating to TrustedInstaller permissions . . . echo. whoami /groups | find /C "TrustedInstaller" >nul if %ERRORLEVEL% EQU 0 goto start %nscexe% -U:T -P:E %0 exit :start REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter" /v "ActivationType" /t REG_DWORD /d 1 /f echo. echo Press any key to exit . . . pause >nul exit 0
{ "pile_set_name": "Github" }
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.api.ads.adwords.jaxws.v201809.rm; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for AccessReason. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="AccessReason"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="OWNED"/> * &lt;enumeration value="SHARED"/> * &lt;enumeration value="LICENSED"/> * &lt;enumeration value="SUBSCRIBED"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "AccessReason") @XmlEnum public enum AccessReason { /** * * The entity is owned by the user. * * */ OWNED, /** * * The entity is shared to the user. * * */ SHARED, /** * * The entity is licensed to the user. * * */ LICENSED, /** * * The user subscribed to the entity. * * */ SUBSCRIBED; public String value() { return name(); } public static AccessReason fromValue(String v) { return valueOf(v); } }
{ "pile_set_name": "Github" }
<?php /* * This file is part of the phpunit-mock-objects package. * * (c) Sebastian Bergmann <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Framework\MockObject; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount; use PHPUnit\Framework\MockObject\Matcher\AnyParameters; use PHPUnit\Framework\MockObject\Matcher\Invocation as MatcherInvocation; use PHPUnit\Framework\MockObject\Matcher\InvokedCount; use PHPUnit\Framework\MockObject\Matcher\MethodName; use PHPUnit\Framework\MockObject\Matcher\Parameters; use PHPUnit\Framework\TestFailure; /** * Main matcher which defines a full expectation using method, parameter and * invocation matchers. * This matcher encapsulates all the other matchers and allows the builder to * set the specific matchers when the appropriate methods are called (once(), * where() etc.). * * All properties are public so that they can easily be accessed by the builder. */ class Matcher implements MatcherInvocation { /** * @var MatcherInvocation */ private $invocationMatcher; /** * @var mixed */ private $afterMatchBuilderId = null; /** * @var bool */ private $afterMatchBuilderIsInvoked = false; /** * @var MethodName */ private $methodNameMatcher = null; /** * @var Parameters */ private $parametersMatcher = null; /** * @var Stub */ private $stub = null; /** * @param MatcherInvocation $invocationMatcher */ public function __construct(MatcherInvocation $invocationMatcher) { $this->invocationMatcher = $invocationMatcher; } public function hasMatchers(): bool { return $this->invocationMatcher !== null && !$this->invocationMatcher instanceof AnyInvokedCount; } public function hasMethodNameMatcher(): bool { return $this->methodNameMatcher !== null; } public function getMethodNameMatcher(): MethodName { return $this->methodNameMatcher; } public function setMethodNameMatcher(MethodName $matcher) { $this->methodNameMatcher = $matcher; } public function hasParametersMatcher(): bool { return $this->parametersMatcher !== null; } public function getParametersMatcher(): Parameters { return $this->parametersMatcher; } public function setParametersMatcher($matcher) { $this->parametersMatcher = $matcher; } public function setStub($stub) { $this->stub = $stub; } public function setAfterMatchBuilderId($id) { $this->afterMatchBuilderId = $id; } /** * @param Invocation $invocation * * @return mixed * * @throws \Exception * @throws RuntimeException * @throws ExpectationFailedException */ public function invoked(Invocation $invocation) { if ($this->invocationMatcher === null) { throw new RuntimeException( 'No invocation matcher is set' ); } if ($this->methodNameMatcher === null) { throw new RuntimeException('No method matcher is set'); } if ($this->afterMatchBuilderId !== null) { $builder = $invocation->getObject() ->__phpunit_getInvocationMocker() ->lookupId($this->afterMatchBuilderId); if (!$builder) { throw new RuntimeException( \sprintf( 'No builder found for match builder identification <%s>', $this->afterMatchBuilderId ) ); } $matcher = $builder->getMatcher(); if ($matcher && $matcher->invocationMatcher->hasBeenInvoked()) { $this->afterMatchBuilderIsInvoked = true; } } $this->invocationMatcher->invoked($invocation); try { if ($this->parametersMatcher !== null && !$this->parametersMatcher->matches($invocation)) { $this->parametersMatcher->verify(); } } catch (ExpectationFailedException $e) { throw new ExpectationFailedException( \sprintf( "Expectation failed for %s when %s\n%s", $this->methodNameMatcher->toString(), $this->invocationMatcher->toString(), $e->getMessage() ), $e->getComparisonFailure() ); } if ($this->stub) { return $this->stub->invoke($invocation); } return $invocation->generateReturnValue(); } /** * @param Invocation $invocation * * @return bool * * @throws RuntimeException * @throws ExpectationFailedException */ public function matches(Invocation $invocation) { if ($this->afterMatchBuilderId !== null) { $builder = $invocation->getObject() ->__phpunit_getInvocationMocker() ->lookupId($this->afterMatchBuilderId); if (!$builder) { throw new RuntimeException( \sprintf( 'No builder found for match builder identification <%s>', $this->afterMatchBuilderId ) ); } $matcher = $builder->getMatcher(); if (!$matcher) { return false; } if (!$matcher->invocationMatcher->hasBeenInvoked()) { return false; } } if ($this->invocationMatcher === null) { throw new RuntimeException( 'No invocation matcher is set' ); } if ($this->methodNameMatcher === null) { throw new RuntimeException('No method matcher is set'); } if (!$this->invocationMatcher->matches($invocation)) { return false; } try { if (!$this->methodNameMatcher->matches($invocation)) { return false; } } catch (ExpectationFailedException $e) { throw new ExpectationFailedException( \sprintf( "Expectation failed for %s when %s\n%s", $this->methodNameMatcher->toString(), $this->invocationMatcher->toString(), $e->getMessage() ), $e->getComparisonFailure() ); } return true; } /** * @throws RuntimeException * @throws ExpectationFailedException */ public function verify() { if ($this->invocationMatcher === null) { throw new RuntimeException( 'No invocation matcher is set' ); } if ($this->methodNameMatcher === null) { throw new RuntimeException('No method matcher is set'); } try { $this->invocationMatcher->verify(); if ($this->parametersMatcher === null) { $this->parametersMatcher = new AnyParameters; } $invocationIsAny = $this->invocationMatcher instanceof AnyInvokedCount; $invocationIsNever = $this->invocationMatcher instanceof InvokedCount && $this->invocationMatcher->isNever(); if (!$invocationIsAny && !$invocationIsNever) { $this->parametersMatcher->verify(); } } catch (ExpectationFailedException $e) { throw new ExpectationFailedException( \sprintf( "Expectation failed for %s when %s.\n%s", $this->methodNameMatcher->toString(), $this->invocationMatcher->toString(), TestFailure::exceptionToString($e) ) ); } } /** * @return string */ public function toString() { $list = []; if ($this->invocationMatcher !== null) { $list[] = $this->invocationMatcher->toString(); } if ($this->methodNameMatcher !== null) { $list[] = 'where ' . $this->methodNameMatcher->toString(); } if ($this->parametersMatcher !== null) { $list[] = 'and ' . $this->parametersMatcher->toString(); } if ($this->afterMatchBuilderId !== null) { $list[] = 'after ' . $this->afterMatchBuilderId; } if ($this->stub !== null) { $list[] = 'will ' . $this->stub->toString(); } return \implode(' ', $list); } }
{ "pile_set_name": "Github" }
^D:\TRIAGE\TITLES\PDOANE-API-TEST\GIT\APITEST\THIRDPARTY\SDL2-2.0.1\TEST\TESTJOYSTICK.C D:\TRIAGE\TITLES\PDOANE-API-TEST\GIT\APITEST\THIRDPARTY\SDL2-2.0.1\VISUALC\TESTS\TESTJOYSTICK\WIN32\DEBUG\TESTJOYSTICK.OBJ D:\TRIAGE\TITLES\PDOANE-API-TEST\GIT\APITEST\THIRDPARTY\SDL2-2.0.1\VISUALC\TESTS\TESTJOYSTICK\WIN32\DEBUG\VC110.PDB
{ "pile_set_name": "Github" }
 Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{49A62C40-8E8C-43D3-9D15-61383E21EED3}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pcx857x.Tests", "tests\Pcx857x.Tests.csproj", "{9FE93847-7EA5-406D-BB15-41F12952BC94}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pcx857x", "Pcx857x.csproj", "{9F268672-407B-4349-82E5-2115CC838240}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9FE93847-7EA5-406D-BB15-41F12952BC94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Debug|Any CPU.Build.0 = Debug|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Debug|x64.ActiveCfg = Debug|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Debug|x64.Build.0 = Debug|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Debug|x86.ActiveCfg = Debug|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Debug|x86.Build.0 = Debug|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Release|Any CPU.ActiveCfg = Release|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Release|Any CPU.Build.0 = Release|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Release|x64.ActiveCfg = Release|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Release|x64.Build.0 = Release|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Release|x86.ActiveCfg = Release|Any CPU {9FE93847-7EA5-406D-BB15-41F12952BC94}.Release|x86.Build.0 = Release|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Debug|Any CPU.Build.0 = Debug|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Debug|x64.ActiveCfg = Debug|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Debug|x64.Build.0 = Debug|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Debug|x86.ActiveCfg = Debug|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Debug|x86.Build.0 = Debug|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Release|Any CPU.ActiveCfg = Release|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Release|Any CPU.Build.0 = Release|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Release|x64.ActiveCfg = Release|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Release|x64.Build.0 = Release|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Release|x86.ActiveCfg = Release|Any CPU {9F268672-407B-4349-82E5-2115CC838240}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {9FE93847-7EA5-406D-BB15-41F12952BC94} = {49A62C40-8E8C-43D3-9D15-61383E21EED3} EndGlobalSection EndGlobal
{ "pile_set_name": "Github" }
package org.geogebra.desktop.gui.view.spreadsheet; import java.awt.Component; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.DefaultCellEditor; import javax.swing.JTable; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import org.geogebra.common.gui.view.spreadsheet.RelativeCopy; import org.geogebra.common.gui.view.spreadsheet.SpreadsheetController; import org.geogebra.common.kernel.Kernel; import org.geogebra.common.kernel.geos.GeoElement; import org.geogebra.common.kernel.geos.GeoElementSpreadsheet; import org.geogebra.common.kernel.kernelND.GeoElementND; import org.geogebra.common.plugin.EventType; import org.geogebra.common.util.debug.Log; import org.geogebra.desktop.gui.inputfield.AutoCompleteTextFieldD; import org.geogebra.desktop.gui.inputfield.KeyNavigation; import org.geogebra.desktop.gui.virtualkeyboard.VirtualKeyboardD; import org.geogebra.desktop.main.AppD; /** * Default cell editor for the spreadsheet, extends * DefaultCellEditor(JTextField) * */ public class MyCellEditorSpreadsheet extends DefaultCellEditor implements FocusListener { private static final long serialVersionUID = 1L; protected Kernel kernel; protected AppD app; protected GeoElementND value; protected MyTableD table; AutoCompleteTextFieldD textField; protected int column; protected int row; boolean editing = false; private boolean errorOnStopEditing = false; private boolean allowProcessGeo = false; public boolean allowProcessGeo() { return allowProcessGeo; } public void setAllowProcessGeo(boolean allowProcessGeo) { this.allowProcessGeo = allowProcessGeo; } private boolean enableAutoComplete = false; private SpreadsheetController controller; public boolean isEnableAutoComplete() { return enableAutoComplete; } public void setEnableAutoComplete(boolean enableAutoComplete) { this.enableAutoComplete = enableAutoComplete; textField.setAutoComplete(enableAutoComplete); } public MyCellEditorSpreadsheet(Kernel kernel, SpreadsheetController controller) { super(new AutoCompleteTextFieldD(0, (AppD) kernel.getApplication(), KeyNavigation.IGNORE)); this.kernel = kernel; this.controller = controller; app = (AppD) kernel.getApplication(); textField = (AutoCompleteTextFieldD) editorComponent; textField.setAutoComplete(enableAutoComplete); editorComponent .addKeyListener(new SpreadsheetCellEditorKeyListener(false)); editorComponent.addFocusListener(this); DocumentListener documentListener = new DocumentListener() { @Override public void changedUpdate(DocumentEvent documentEvent) { // do nothing } @Override public void insertUpdate(DocumentEvent documentEvent) { updateFormulaBar(documentEvent); } @Override public void removeUpdate(DocumentEvent documentEvent) { updateFormulaBar(documentEvent); } private void updateFormulaBar(DocumentEvent documentEvent) { if (table.view.getShowFormulaBar() && (textField.hasFocus() || table.isDragging2)) { table.view.getFormulaBar() .setEditorText(textField.getText()); } } }; textField.getDocument().addDocumentListener(documentListener); } public void setText(String text) { if (!textField.hasFocus() && !table.isDragging2) { textField.setText(text); } } @Override public Component getTableCellEditorComponent(JTable table0, Object value0, boolean isSelected, int row0, int column0) { if (table0 instanceof MyTableD) { table = (MyTableD) table0; } else { return null; } if (value0 instanceof String) { // clicked to type value = null; } else { value = (GeoElement) value0; } column = column0; row = row0; String text = ""; if (value != null) { text = controller.getEditorInitString(value); int index = text.indexOf("="); if ((!value.isGeoText())) { if (index == -1) { text = "=" + text; } } } delegate.setValue(text); Component component = getComponent(); component.setFont(app.getFontCanDisplayAwt(text)); editing = true; return component; } /** * set flag to require text start with "=" to activate autocomplete */ public void setEqualsRequired(boolean equalsRequired) { textField.setEqualsRequired(equalsRequired); } /** * returns flag that requires text start with "=" to activate autocomplete */ public boolean isEqualsRequired() { return textField.isEqualsRequired(); } public void setLabels() { textField.setDictionary(true); } /** * * @return true if the completion popup is open */ public boolean completionsPopupOpen() { return textField.getCompletions() != null; } // ======================================================= // In-cell Editing Methods // ======================================================= public boolean isEditing() { return editing; } public int getCaretPosition() { return textField.getCaretPosition(); } /** Insert a geo label into current editor string. */ public void addLabel(String label) { if (!editing) { return; } // String text = (String) delegate.getCellEditorValue(); // delegate.setValue(text + label); textField.replaceSelection(" " + label + " "); } public void setLabel(String text) { if (!editing) { return; } delegate.setValue(text); } public String getEditingValue() { return (String) delegate.getCellEditorValue(); } @Override public Object getCellEditorValue() { return value; } // ======================================================= // Stop/Cancel Editing // ======================================================= @Override public void cancelCellEditing() { editing = false; errorOnStopEditing = false; super.cancelCellEditing(); // give the table the focus in case the formula bar is the editor if (table.getView().getFormulaBar().editorHasFocus()) { // Application.debug("give focus to table"); table.requestFocus(); } } @Override public boolean stopCellEditing() { errorOnStopEditing = true; // flag to handle column resizing during // editing (see focusLost method) // try to redefine or create the cell geo with the current editing // string if (!processGeo()) { return false; } errorOnStopEditing = false; editing = false; boolean success = super.stopCellEditing(); // give the table the focus in case the formula bar is the editor if (table.getView().getFormulaBar().editorHasFocus()) { // Application.debug("give focus to table"); table.requestFocus(); } return success; } boolean stopCellEditing(int colOff, int rowOff) { allowProcessGeo = true; boolean success = stopCellEditing(); moveSelectedCell(colOff, rowOff); allowProcessGeo = false; return success; } private void moveSelectedCell(int colOff, int rowOff) { int nextRow = Math.min(row + rowOff, table.getRowCount() - 1); int nextColumn = Math.min(column + colOff, table.getColumnCount() - 1); table.setSelection(nextColumn, nextRow); } /** * Attempts to create or redefine the cell geo using the current editing * string * * @return */ private boolean processGeo() { try { if (allowProcessGeo) { String text = (String) delegate.getCellEditorValue(); // get GeoElement of current cell value = kernel.lookupLabel(GeoElementSpreadsheet .getSpreadsheetCellName(column, row)); if ("".equals(text)) { if (value != null) { value.removeOrSetUndefinedIfHasFixedDescendent(); value = null; } } else { GeoElementND newVal = RelativeCopy .prepareAddingValueToTableNoStoringUndoInfo(kernel, app, text, value, column, row, false); if (newVal == null) { return false; } value = newVal; } if (value != null) { app.storeUndoInfo(); } } } catch (Exception ex) { // show GeoGebra error dialog // kernel.getApplication().showError(ex.getMessage()); ex.printStackTrace(); super.stopCellEditing(); editing = false; return false; } return true; } // ======================================================= // Key and Focus Listeners // ======================================================= /** * keep track of when <tab> was first pressed so we can return to that * column when <enter> pressed */ public int tabReturnCol = -1; public class SpreadsheetCellEditorKeyListener implements KeyListener { // boolean escape = false; boolean isFormulaBarListener; public SpreadsheetCellEditorKeyListener(boolean isFormulaBarListener) { this.isFormulaBarListener = isFormulaBarListener; } @Override public void keyTyped(KeyEvent e) { // } @Override public void keyPressed(KeyEvent e) { checkCursorKeys(e); int keyCode = e.getKeyCode(); if (keyCode == KeyEvent.VK_ESCAPE) { GeoElement oldGeo = kernel.getGeoAt(column, row); cancelCellEditing(); // restore old text in spreadsheet table.getModel().setValueAt(oldGeo, row, column); // stopCellEditing(0,0); // force nice redraw table.setSelection(column, row); // update the formula bar after escape table.getView().updateFormulaBar(); } } @Override public void keyReleased(KeyEvent e) { // } public void checkCursorKeys(KeyEvent e) { String text = (String) delegate.getCellEditorValue(); int keyCode = e.getKeyCode(); // Application.debug(e+""); switch (keyCode) { default: // do nothing break; case KeyEvent.VK_UP: if (isFormulaBarListener) { return; } // Application.debug("UP"); stopCellEditing(0, -1); editing = false; e.consume(); tabReturnCol = -1; break; case KeyEvent.VK_TAB: if (isFormulaBarListener) { return; } Log.debug(" tab"); // Application.debug("RIGHT"); // shift-tab moves left // tab moves right if (tabReturnCol == -1) { tabReturnCol = column; } stopCellEditing(e.isShiftDown() ? -1 : 1, 0); editing = false; break; case KeyEvent.VK_ENTER: // if incomplete command entered, want to move the cursor to // between [] int bracketsIndex = text.indexOf("[]"); if (bracketsIndex == -1) { if (tabReturnCol != -1) { int colOffset = tabReturnCol - column; stopCellEditing(colOffset, 1); editing = false; } else { String cellBelowStr = GeoElementSpreadsheet .getSpreadsheetCellName(column, row + 1); GeoElement cellBelow = kernel.getConstruction() .lookupLabel(cellBelowStr); boolean moveDown = cellBelow == null || !cellBelow.isProtected(EventType.UPDATE); // don't move down to cell below after <Enter> if it's // fixed stopCellEditing(0, moveDown ? 1 : 0); } } else { textField.setCaretPosition(bracketsIndex + 1); e.consume(); } tabReturnCol = -1; break; case KeyEvent.VK_DOWN: if (isFormulaBarListener) { e.consume(); return; } // Application.debug("DOWN"); stopCellEditing(0, 1); editing = false; tabReturnCol = -1; break; case KeyEvent.VK_LEFT: if (isFormulaBarListener) { return; } // Application.debug("LEFT"); // Allow left/right keys to exit cell for easier data entry if (getCaretPosition() == 0) { stopCellEditing(-1, 0); editing = false; } editing = false; tabReturnCol = -1; break; case KeyEvent.VK_RIGHT: if (isFormulaBarListener) { return; } // Application.debug("RIGHT"); // Allow left/right keys to exit cell for easier data entry if (getCaretPosition() == text.length()) { stopCellEditing(1, 0); editing = false; } editing = false; tabReturnCol = -1; break; case KeyEvent.VK_PAGE_DOWN: case KeyEvent.VK_PAGE_UP: e.consume(); tabReturnCol = -1; break; // An F1 keypress causes the focus to be lost, so we // need to set 'editing' to false to prevent the focusLost() // method from calling stopCellEditing() case KeyEvent.VK_F1: editing = false; break; } } } @Override public void focusGained(FocusEvent arg0) { editing = true; } @Override public void focusLost(FocusEvent arg0) { // VirtualKeyboard gets the focus very briefly when opened // so ignore this! if (arg0.getOppositeComponent() instanceof VirtualKeyboardD) { return; } // only needed if eg columns resized if (editing) { if (!errorOnStopEditing) { // Process the current edit, exit the editor and update the // formula bar setAllowProcessGeo(true); stopCellEditing(); setAllowProcessGeo(false); table.getView().getFormulaBar().update(); } else if (!app.isErrorDialogShowing()) { cancelCellEditing(); } } } }
{ "pile_set_name": "Github" }
# RUN: llvm-mc -show-encoding -triple mips-unknown-unknown %s \ # RUN: | FileCheck %s -check-prefix=CHECK-ENC # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s \ # RUN: | llvm-objdump -disassemble - | FileCheck %s -check-prefix=CHECK-INSTR # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s \ # RUN: | llvm-readobj -r | FileCheck %s -check-prefix=CHECK-REL # Check that 1 is added to the high 16 bits if bit 15 of the low part is 1. .equ addr, 0xdeadbeef lui $4, %hi(addr) lb $2, %lo(addr)($4) # CHECK-ENC: # encoding: [0x3c,0x04,0xde,0xae] # CHECK-ENC: # encoding: [0x80,0x82,0xbe,0xef] # Check that assembler can handle %hi(label1 - label2) and %lo(label1 - label2) # expressions. $L1: # Emit zeros so that difference between $L3 and $L1 is 0x30124 bytes. .fill 0x30124-8 $L2: lui $4, %hi($L3-$L1) addiu $4, $4, %lo($L3-$L1) # CHECK-INSTR: lui $4, 3 # CHECK-INSTR: addiu $4, $4, 292 $L3: lui $5, %hi($L2-$L3) lw $5, %lo($L2-$L3)($5) # CHECK-INSTR: lui $5, 0 # CHECK-INSTR: lw $5, -8($5) # Check that relocation isn't emitted for %hi(label1 - label2) and # %lo(label1 - label2) expressions. # CHECK-REL-NOT: R_MIPS
{ "pile_set_name": "Github" }
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Snap.Test.Common ( coverEqInstance , coverOrdInstance , coverReadInstance , coverShowInstance , coverTypeableInstance , forceSameType , expectException , expectExceptionH , liftQ , eatException , waitabit , seconds ) where ------------------------------------------------------------------------------ import Control.Concurrent (threadDelay) import Control.DeepSeq (deepseq) import Control.Exception.Lifted (SomeException (..), catch, evaluate, try) import Control.Monad (Monad ((>>), return), liftM, replicateM) import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Trans.Control (MonadBaseControl) import qualified Data.ByteString as S import Data.ByteString.Internal (c2w) import qualified Data.ByteString.Lazy as L import Data.Typeable (Typeable, typeOf) import Prelude (Either (..), Eq (..), IO, Int, Num (..), Ord (..), Ordering (..), Read (..), Show (..), fail, map, seq, ($), (.), (^)) import Test.QuickCheck (Arbitrary (arbitrary), choose) import Test.QuickCheck.Monadic (PropertyM) import qualified Test.QuickCheck.Monadic as QC ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ instance Arbitrary S.ByteString where arbitrary = liftM (S.pack . map c2w) arbitrary instance Arbitrary L.ByteString where arbitrary = do n <- choose(0,5) chunks <- replicateM n arbitrary return $ L.fromChunks chunks ------------------------------------------------------------------------------ eatException :: (MonadBaseControl IO m) => m a -> m () eatException a = (a >> return ()) `catch` handler where handler :: (MonadBaseControl IO m) => SomeException -> m () handler _ = return () ------------------------------------------------------------------------------ forceSameType :: a -> a -> a forceSameType _ a = a ------------------------------------------------------------------------------ -- | Kill the false negative on derived show instances. coverShowInstance :: (Monad m, Show a) => a -> m () coverShowInstance x = a `deepseq` b `deepseq` c `deepseq` return () where a = showsPrec 0 x "" b = show x c = showList [x] "" ------------------------------------------------------------------------------ coverReadInstance :: (MonadIO m, Read a) => a -> m () coverReadInstance x = do liftIO $ eatException $ evaluate $ forceSameType [(x,"")] $ readsPrec 0 "" liftIO $ eatException $ evaluate $ forceSameType [([x],"")] $ readList "" ------------------------------------------------------------------------------ coverEqInstance :: (Monad m, Eq a) => a -> m () coverEqInstance x = a `seq` b `seq` return () where a = x == x b = x /= x ------------------------------------------------------------------------------ coverOrdInstance :: (Monad m, Ord a) => a -> m () coverOrdInstance x = a `deepseq` b `deepseq` return () where a = [ x < x , x >= x , x > x , x <= x , compare x x == EQ ] b = min a $ max a a ------------------------------------------------------------------------------ coverTypeableInstance :: (Monad m, Typeable a) => a -> m () coverTypeableInstance a = typeOf a `seq` return () ------------------------------------------------------------------------------ expectException :: IO a -> PropertyM IO () expectException m = do e <- liftQ $ try m case e of Left (z::SomeException) -> (forceList $ show z) `seq` return () Right _ -> fail "expected exception, didn't get one" ------------------------------------------------------------------------------ expectExceptionH :: IO a -> IO () expectExceptionH act = do e <- try act case e of Left (z::SomeException) -> (forceList $ show z) `seq` return () Right _ -> fail "expected exception, didn't get one" ------------------------------------------------------------------------------ forceList :: [a] -> () forceList [] = () forceList (x:xs) = x `seq` forceList xs ------------------------------------------------------------------------------ liftQ :: forall a m . (Monad m) => m a -> PropertyM m a liftQ = QC.run ------------------------------------------------------------------------------ waitabit :: IO () waitabit = threadDelay $ 2*seconds ------------------------------------------------------------------------------ seconds :: Int seconds = (10::Int) ^ (6::Int)
{ "pile_set_name": "Github" }
import tensorflow as tf from zh.model.mnist.mlp import MLP from zh.model.utils import MNISTLoader num_epochs = 5 batch_size = 50 learning_rate_1 = 0.001 learning_rate_2 = 0.01 model = MLP() data_loader = MNISTLoader() # 宣告兩個優化器,設定不同的學習率,分別用於更新MLP模型的第一層和第二層 optimizer_1 = tf.keras.optimizers.Adam(learning_rate=learning_rate_1) optimizer_2 = tf.keras.optimizers.Adam(learning_rate=learning_rate_2) num_batches = int(data_loader.num_train_data // batch_size * num_epochs) for batch_index in range(num_batches): X, y = data_loader.get_batch(batch_size) with tf.GradientTape(persistent=True) as tape: # 宣告一個永久的GradientTape,允許我們多次呼叫tape.gradient方法 y_pred = model(X) loss = tf.keras.losses.sparse_categorical_crossentropy(y_true=y, y_pred=y_pred) loss = tf.reduce_mean(loss) print("batch %d: loss %f" % (batch_index, loss.numpy())) grads = tape.gradient(loss, model.dense1.variables) # 單獨求第一層參數的梯度 optimizer_1.apply_gradients(grads_and_vars=zip(grads, model.dense1.variables)) # 單獨對第一層參數更新,學習率0.001 grads = tape.gradient(loss, model.dense2.variables) # 單獨求第二層參數的梯度 optimizer_2.apply_gradients(grads_and_vars=zip(grads, model.dense2.variables)) # 單獨對第二層參數更新,學習率0.01
{ "pile_set_name": "Github" }
"""Search using HMMER's online REST interface. http://hmmer.janelia.org/search From Nick Loman's EntrezAjax: https://github.com/nickloman/entrezajax """ from __future__ import print_function from six.moves import urllib import logging class SmartRedirectHandler(urllib.request.HTTPRedirectHandler): def http_error_302(self, req, fp, code, msg, headers): logging.debug(headers) return headers def _hmmer(endpoint, args1, args2): opener = urllib.request.build_opener(SmartRedirectHandler()) urllib.request.install_opener(opener); params = urllib.parse.urlencode(args1) try: req = urllib.request.Request(endpoint, data = params, headers={"Accept" : "application/json"}) v = urllib.request.urlopen(req) except urllib.error.HTTPError as e: raise Exception("HTTP Error 400: %s" % e.read()) results_url = v['location'] enc_res_params = urllib.parse.urlencode(args2) modified_res_url = results_url + '?' + enc_res_params results_request = urllib.request.Request(modified_res_url) f = urllib.request.urlopen(results_request) return f def phmmer(**kwargs): """Search a protein sequence against a HMMER sequence database. Arguments: seq - The sequence to search -- a Fasta string. seqdb -- Sequence database to search against. range -- A string range of results to return (ie. 1,10 for the first ten) output -- The output format (defaults to JSON). """ logging.debug(kwargs) args = {'seq' : kwargs.get('seq'), 'seqdb' : kwargs.get('seqdb')} args2 = {'output' : kwargs.get('output', 'json'), 'range' : kwargs.get('range')} return _hmmer("http://hmmer.janelia.org/search/phmmer", args, args2) def hmmscan(**kwargs): logging.debug(kwargs) args = {'seq' : kwargs.get('seq'), 'hmmdb' : kwargs.get('hmmdb')} args2 = {'output' : 'json'} range = kwargs.get('range', None) if range: args2['range'] = range return _hmmer("http://hmmer.janelia.org/search/hmmscan", args, args2) def test(): seq = """>lcl||YPD4_1219|ftsK|128205128 putative cell division protein MSQEYTEDKEVTLKKLSNGRRLLEAVLIVVTILAAYLMVALVSFNPSDPSWSQTAWHEPI HNLGGSIGAWMADTLFSTFGVLAYAIPPIMVIFCWTAFRQRDASEYLDYFALSLRLIGTL ALILTSCGLAALNIDDLYYFASGGVIGSLFSNAMLPWFNGVGATLTLLCIWVVGLTLFTG WSWLVIAEKIGAAVLGSLTFITNRSRREERYDDEDSYHDDDHADGRDITGQEKGVVSNKG VVSNNAVVGAGVAASSALAHGDDDVLFSAPSVTDSIVEHGSVVATGTETTDTKATDTNDE YDPLLSPLRATDYSVQDATSSPIADVAVEPVLNHDAAAIYGTTPVMTNTATPPLYSFELP EESLPIQTHAAPTERPEPKLGAWDMSPTPVSHSPFDFSAIQRPVGQLESRQPGSNQSGSH QIHSAQSSHISVGNTPYMNPGLDAQIDGLSTTSLTNKPVLASGTVAAATAAAAFMPAFTA TSDSSSQIKQGIGPELPRPNPVRIPTRRELASFGIKLPSQRMAEQELRERDGDETQNPQM AASSYGTEITSDEDAALQQAILRKAFADQQSERYALSTLAEQSSITERSPAAEMPTTPSQ VSDLEDEQALQEAELRQAFAAQQQHRYGATGDTDNAVDNIRSVDTSTAFTFSPIADLVDD SPREPLFTLSPYVDETDVDEPVQLEGKEESLLQDYPEQVPTYQPPVQQAHLGQSAPTQPS HTQSTYGQSTYGQSTYGQSTPAPVSQPVVTSASAISTSVTPTSIASLNTAPVSAAPVAPS PQPPAFSQPTAAMDSLIHPFLMRNDQPLQKPTTPLPTLDLLSSPPAEEEPVDMFALEQTA RLVEARLGDYRVKAEVVGISPGPVITRFELDLAPGVKASRISNLSRDLARSLSAIAVRVV EVIPGKPYVGLELPNKHRQTVYLREVLDCAKFRENPSPLAIVLGKDIAGQPVVADLAKMP HLLVAGTTGSGKSVGVNAMILSILYKATPDDVRFIMIDPKMLELSVYEGIPHLLTGVVTD MKDAANALRWCVGEMERRYKLMSALGVRNLAGYNERVAQAEAMGRPIPDPFWKPSDSMDI SPPMLVKLPYIVVMVDEFADLMMTVGKKVEELIARLAQKARAAGIHLVLATQRPSVDVIT GLIKANIPTRIAFTVSSKIDSRTILDQGGAESLLGMGDMLYMAPNSSIPVRVHGAFVRDQ EVHAVVNDWKARGRPQYIDSILSGGEEGEGGGLGLDSDEELDPLFDQAVNFVLEKRRASI SGVQRQFRIGYNRAARIIEQMEAQQIVSTPGHNGNREVLAPPPHE""" handle = hmmscan(hmmdb = 'pfam', seq = seq) import json j = json.loads(handle.read()) print(json.dumps(j, sort_keys=True, indent=4)) # test()
{ "pile_set_name": "Github" }
#ifndef XT_HMARK_H_ #define XT_HMARK_H_ #include <linux/types.h> enum { XT_HMARK_SADDR_MASK, XT_HMARK_DADDR_MASK, XT_HMARK_SPI, XT_HMARK_SPI_MASK, XT_HMARK_SPORT, XT_HMARK_DPORT, XT_HMARK_SPORT_MASK, XT_HMARK_DPORT_MASK, XT_HMARK_PROTO_MASK, XT_HMARK_RND, XT_HMARK_MODULUS, XT_HMARK_OFFSET, XT_HMARK_CT, XT_HMARK_METHOD_L3, XT_HMARK_METHOD_L3_4, }; #define XT_HMARK_FLAG(flag) (1 << flag) union hmark_ports { struct { __u16 src; __u16 dst; } p16; struct { __be16 src; __be16 dst; } b16; __u32 v32; __be32 b32; }; struct xt_hmark_info { union nf_inet_addr src_mask; union nf_inet_addr dst_mask; union hmark_ports port_mask; union hmark_ports port_set; __u32 flags; __u16 proto_mask; __u32 hashrnd; __u32 hmodulus; __u32 hoffset; /* Mark offset to start from */ }; #endif /* XT_HMARK_H_ */
{ "pile_set_name": "Github" }
/* Atom One Light by Daniel Gamage Original One Light Syntax theme from https://github.com/atom/one-light-syntax base: #fafafa mono-1: #383a42 mono-2: #686b77 mono-3: #a0a1a7 hue-1: #0184bb hue-2: #4078f2 hue-3: #a626a4 hue-4: #50a14f hue-5: #e45649 hue-5-2: #c91243 hue-6: #986801 hue-6-2: #c18401 */ .hljs { display: block; overflow-x: auto; padding: 0.5em; color: #383a42; background: #fafafa; } .hljs-comment, .hljs-quote { color: #a0a1a7; font-style: italic; } .hljs-doctag, .hljs-keyword, .hljs-formula { color: #a626a4; } .hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { color: #e45649; } .hljs-literal { color: #0184bb; } .hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { color: #50a14f; } .hljs-built_in, .hljs-class .hljs-title { color: #c18401; } .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { color: #986801; } .hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { color: #4078f2; } .hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: bold; } .hljs-link { text-decoration: underline; }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <MediaPlayerUI/NSObject-Protocol.h> @class NSArray, NSIndexPath, NSString, UITableView, UITableViewCell; @protocol UITableViewDataSource <NSObject> - (UITableViewCell *)tableView:(UITableView *)arg1 cellForRowAtIndexPath:(NSIndexPath *)arg2; - (long long)tableView:(UITableView *)arg1 numberOfRowsInSection:(long long)arg2; @optional - (void)tableView:(UITableView *)arg1 moveRowAtIndexPath:(NSIndexPath *)arg2 toIndexPath:(NSIndexPath *)arg3; - (void)tableView:(UITableView *)arg1 commitEditingStyle:(long long)arg2 forRowAtIndexPath:(NSIndexPath *)arg3; - (long long)tableView:(UITableView *)arg1 sectionForSectionIndexTitle:(NSString *)arg2 atIndex:(long long)arg3; - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)arg1; - (_Bool)tableView:(UITableView *)arg1 canMoveRowAtIndexPath:(NSIndexPath *)arg2; - (_Bool)tableView:(UITableView *)arg1 canEditRowAtIndexPath:(NSIndexPath *)arg2; - (NSString *)tableView:(UITableView *)arg1 titleForFooterInSection:(long long)arg2; - (NSString *)tableView:(UITableView *)arg1 titleForHeaderInSection:(long long)arg2; - (long long)numberOfSectionsInTableView:(UITableView *)arg1; @end
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 %s -verify -fsyntax-only // rdar: // 6734520 typedef int INT1 __attribute__((deprecated("Please avoid INT1"))); // expected-note 3 {{'INT1' has been explicitly marked deprecated here}} typedef INT1 INT2 __attribute__ ((__deprecated__("Please avoid INT2"))); typedef INT1 INT1a; // expected-warning {{'INT1' is deprecated: Please avoid INT1}} typedef INT1 INT1b __attribute__ ((deprecated("Please avoid INT1b"))); INT1 should_be_unavailable; // expected-warning {{'INT1' is deprecated: Please avoid INT1}} INT1a should_not_be_deprecated; INT1 f1(void) __attribute__ ((deprecated("Please avoid f1"))); // expected-note {{'f1' has been explicitly marked deprecated here}} INT1 f2(void); // expected-warning {{'INT1' is deprecated: Please avoid INT1}} typedef enum {red, green, blue} Color __attribute__((deprecated("Please avoid Color"))); // expected-note {{'Color' has been explicitly marked deprecated here}} Color c1; // expected-warning {{'Color' is deprecated: Please avoid Color}} int g1; int g2 __attribute__ ((deprecated("Please avoid g2"))); // expected-note {{'g2' has been explicitly marked deprecated here}} int func1() { int (*pf)() = f1; // expected-warning {{'f1' is deprecated: Please avoid f1}} int i = f2(); return g1 + g2; // expected-warning {{'g2' is deprecated: Please avoid g2}} }
{ "pile_set_name": "Github" }
/* * Copyright 2020 Adobe. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ import {{{componentName}}} from '../'; import {render} from '@testing-library/react'; import React from 'react'; import V2{{componentName}} from '@react/react-spectrum/{{componentName}}'; describe('{{componentName}}', function () { it.each` Name | Component | props ${'{{componentName}}'} | ${ {{~componentName~}} }| $\{{}} ${'V2{{componentName}}'} | ${V2 {{~componentName~}} } | $\{{}} `('$Name handles defaults', function ({Component, props}) { let {getByRole, getByText} = render(<Component {...props}></Component>); expect(true).toBeTruthy(); }); });
{ "pile_set_name": "Github" }
import Ember from 'ember'; const Config = require('electron-config'); const config = new Config(); export default Ember.Route.extend({ model() { var token = config.get('token'); return new Promise(function(resolve, reject){ Ember.$.getJSON(`https://api.github.com/issues?access_token=${token}&filter=subscribed&sort=updated`, function(data) { resolve({mentions: data}); }).fail(function(jqxhr,textStatus,error){ if (error === 'Unauthorized') { this.transitionTo('login'); console.log(error); alert('Could not authenticate'); } }.bind(this)); }.bind(this)); } });
{ "pile_set_name": "Github" }
<div class="mat-elevation-z8"> <table mat-table class="full-width-table" [dataSource]="dataSource" matSort aria-label="Elements"> <!-- Id Column --> <ng-container matColumnDef="id"> <th mat-header-cell *matHeaderCellDef mat-sort-header>Id</th> <td mat-cell *matCellDef="let row">{{row.id}}</td> </ng-container> <!-- Name Column --> <ng-container matColumnDef="name"> <th mat-header-cell *matHeaderCellDef mat-sort-header>Name</th> <td mat-cell *matCellDef="let row">{{row.name}}</td> </ng-container> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> </table> <mat-paginator #paginator [length]="dataSource.data.length" [pageIndex]="0" [pageSize]="50" [pageSizeOptions]="[25, 50, 100, 250]"> </mat-paginator> </div>
{ "pile_set_name": "Github" }
<?php declare(strict_types = 1); return [ 'authorName' => 'Scadrei5', 'authorUrl' => 'https://www.youtube.com/user/Scadrei5', 'cms' => null, 'code' => [ 'html' => '<iframe width="480" height="270" src="https://www.youtube.com/embed/videoseries?list=PL4qTakKkQATKOyZPJG_cAMnRtF7fAIdST" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>', 'width' => 480, 'height' => 270, 'ratio' => 56.25 ], 'description' => 'Disfruta de los vídeos y la música que te gusta, sube material original y comparte el contenido con tus amigos, tu familia y el resto del mundo en YouTube.', 'favicon' => 'https://www.youtube.com/s/desktop/4aac258c/img/favicon.ico', 'feeds' => [], 'icon' => 'https://www.youtube.com/s/desktop/4aac258c/img/favicon_144.png', 'image' => 'https://i.ytimg.com/vi/s7b4ap2_Ht0/hqdefault.jpg', 'keywords' => [ 'vídeo', 'compartir', 'teléfono con cámara', 'teléfono con vídeo', 'gratuito', 'subida' ], 'language' => 'es-ES', 'languages' => [], 'license' => null, 'providerName' => 'YouTube', 'providerUrl' => 'https://www.youtube.com/', 'publishedTime' => null, 'redirect' => null, 'title' => 'De espaldas al patriarcado', 'url' => 'https://www.youtube.com/playlist?list=PL4qTakKkQATKOyZPJG_cAMnRtF7fAIdST', 'linkedData' => [], 'oEmbed' => [ 'thumbnail_height' => 360, 'provider_name' => 'YouTube', 'version' => '1.0', 'html' => '<iframe width="480" height="270" src="https://www.youtube.com/embed/videoseries?list=PL4qTakKkQATKOyZPJG_cAMnRtF7fAIdST" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>', 'title' => 'De espaldas al patriarcado', 'thumbnail_width' => 480, 'width' => 480, 'author_name' => 'Scadrei5', 'height' => 270, 'thumbnail_url' => 'https://i.ytimg.com/vi/s7b4ap2_Ht0/hqdefault.jpg', 'type' => 'video', 'provider_url' => 'https://www.youtube.com/', 'author_url' => 'https://www.youtube.com/user/Scadrei5' ] ];
{ "pile_set_name": "Github" }
<link rel="import" href="test-behavior.html"> <script> Polymer({ is: 'test-element', behaviors: [TestBehavior], }); </script>
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <html> <head> <title>CSS 2.1 Test Suite: generated content</title> <link rel="author" title="Robert O'Callahan" href="mailto:[email protected]" /> <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#before-after-content"/> <meta name="flags" content="" /> <style> table, div.gen { counter-reset:ctr; quotes:"\0022" "\0022" "\0022" "\0022"; } .gen::before { content:counter(ctr) url(square-outline-32x32.png) open-quote "Before " attr(class); counter-increment:ctr; } .gen::after { content:counter(ctr) url(square-outline-32x32.png) "After " attr(class) close-quote; counter-increment:ctr; } table { border:1px solid blue; } td { border:1px solid cyan; } td { border-spacing:0; padding:0; } tr.gen::before, tr.gen::after { display:table-cell; } tbody.gen::before, tbody.gen::after { display:table-row; } table.gen::before, table.gen::after { display:table-row-group; } table.col::before, table.gen.col::after { display:table-column-group; } /* note reordering here! */ table.headfoot::after { display:table-header-group; } table.headfoot::before { display:table-footer-group; } .cell { display:table-cell; } .row { display:table-row; } .rowgroup { display:table-row-group; } .table { display:table; } div.gencell::before, div.gencell::after { display:table-cell; } div.genrow::before, div.genrow::after { display:table-row; } div.genblock::before, div.genblock::after { display:block; } div.geninline::before, div.geninline::after { display:inline; } div { border:1px solid green; margin:5px; } .varyheight::before { height:100px; background:yellow; } .varyheight > div { height:80px; background:orange; } .varyheight::after { height:60px; background:brown; } .varywidth::before { background:yellow; } .varywidth > div { background:orange; } .varywidth::after { background:brown; } </style> </head> <body> <table style="border:none" width="100%"><tr><td style="border:none" valign="top"> <div><table><tbody><tr class="gen"><td>Inner</td></tr></tbody></table></div> <div><table><tbody class="gen"><tr><td>Inner</td></tr></tbody></table></div> <div><table class="gen"><tfoot><tr><td>Inner</td></tr></tfoot></table></div> <div><table class="gen col"><tbody><tr><td>Inner</td></tr></tbody></table></div> <div><table class="gen headfoot"><tbody><tr><td>Inner</td></tr></tbody></table></div> <div><div class="gen table gencell varyheight"><div class="cell">Inner</div></div></div> <div><div class="gen gencell varyheight"><div class="cell">Inner</div></div></div> <div><div class="gen genrow varywidth"><div class="row">Inner</div></div></div> </td><td style="border:none" valign="top"> <div><div class="gen row gencell"><div class="cell">Inner</div></div></div> <div><div class="gen row genblock"><div class="cell">Inner</div></div></div> <div><div class="gen row geninline"><div class="cell">Inner</div></div></div> <div><div class="gen rowgroup genrow"><div class="row"><div class="cell">Inner</div></div></div></div> <div><div class="gen rowgroup gencell"><div class="row"><div class="cell">Inner</div></div></div></div> <div><div class="gen rowgroup genblock"><div class="row"><div class="cell">Inner</div></div></div></div> <div><div class="gen rowgroup geninline"><div class="row"><div class="cell">Inner</div></div></div></div> </tr></td></table> </body> </html>
{ "pile_set_name": "Github" }
--TEST-- Test get_html_translation_table() function : error conditions --FILE-- <?php /* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] ) * Description: Returns the internal translation table used by htmlspecialchars and htmlentities * Source code: ext/standard/html.c */ echo "*** Testing get_html_translation_table() : error conditions ***\n"; // More than expected number of arguments echo "\n-- Testing get_html_translation_table() function with more than expected no. of arguments --\n"; $table = HTML_ENTITIES; $quote_style = ENT_COMPAT; $extra_arg = 10; var_dump( get_html_translation_table($table, $quote_style, "UTF-8", $extra_arg) ); echo "Done\n"; ?> --EXPECTF-- *** Testing get_html_translation_table() : error conditions *** -- Testing get_html_translation_table() function with more than expected no. of arguments -- Warning: get_html_translation_table() expects at most 3 parameters, 4 given in %s on line %d NULL Done
{ "pile_set_name": "Github" }
<?php namespace oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2; /** * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 * @xmlType PrintQualifierType * @xmlName PrintQualifier * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\PrintQualifier */ class PrintQualifier extends PrintQualifierType { } // end class PrintQualifier
{ "pile_set_name": "Github" }
/** * @file IdealMolalSoln.cpp * ThermoPhase object for the ideal molal equation of * state (see \ref thermoprops * and class \link Cantera::IdealMolalSoln IdealMolalSoln\endlink). * * Definition file for a derived class of ThermoPhase that handles variable * pressure standard state methods for calculating thermodynamic properties that * are further based upon activities on the molality scale. The Ideal molal * solution assumes that all molality-based activity coefficients are equal to * one. This turns out, actually, to be highly nonlinear when the solvent * densities get low. */ // This file is part of Cantera. See License.txt in the top-level directory or // at https://cantera.org/license.txt for license and copyright information. #include "cantera/thermo/IdealMolalSoln.h" #include "cantera/thermo/ThermoFactory.h" #include "cantera/base/ctml.h" #include "cantera/base/stringUtils.h" #include <iostream> namespace Cantera { IdealMolalSoln::IdealMolalSoln() : m_formGC(2), IMS_typeCutoff_(0), IMS_X_o_cutoff_(0.20), IMS_gamma_o_min_(0.00001), IMS_gamma_k_min_(10.0), IMS_slopefCut_(0.6), IMS_slopegCut_(0.0), IMS_cCut_(.05), IMS_dfCut_(0.0), IMS_efCut_(0.0), IMS_afCut_(0.0), IMS_bfCut_(0.0), IMS_dgCut_(0.0), IMS_egCut_(0.0), IMS_agCut_(0.0), IMS_bgCut_(0.0) { } IdealMolalSoln::IdealMolalSoln(const std::string& inputFile, const std::string& id_) : MolalityVPSSTP(), m_formGC(2), IMS_typeCutoff_(0), IMS_X_o_cutoff_(0.2), IMS_gamma_o_min_(0.00001), IMS_gamma_k_min_(10.0), IMS_slopefCut_(0.6), IMS_slopegCut_(0.0), IMS_cCut_(.05), IMS_dfCut_(0.0), IMS_efCut_(0.0), IMS_afCut_(0.0), IMS_bfCut_(0.0), IMS_dgCut_(0.0), IMS_egCut_(0.0), IMS_agCut_(0.0), IMS_bgCut_(0.0) { initThermoFile(inputFile, id_); } IdealMolalSoln::IdealMolalSoln(XML_Node& root, const std::string& id_) : MolalityVPSSTP(), m_formGC(2), IMS_typeCutoff_(0), IMS_X_o_cutoff_(0.2), IMS_gamma_o_min_(0.00001), IMS_gamma_k_min_(10.0), IMS_slopefCut_(0.6), IMS_slopegCut_(0.0), IMS_cCut_(.05), IMS_dfCut_(0.0), IMS_efCut_(0.0), IMS_afCut_(0.0), IMS_bfCut_(0.0), IMS_dgCut_(0.0), IMS_egCut_(0.0), IMS_agCut_(0.0), IMS_bgCut_(0.0) { importPhase(root, this); } doublereal IdealMolalSoln::enthalpy_mole() const { getPartialMolarEnthalpies(m_tmpV.data()); return mean_X(m_tmpV); } doublereal IdealMolalSoln::intEnergy_mole() const { getPartialMolarEnthalpies(m_tmpV.data()); return mean_X(m_tmpV); } doublereal IdealMolalSoln::entropy_mole() const { getPartialMolarEntropies(m_tmpV.data()); return mean_X(m_tmpV); } doublereal IdealMolalSoln::gibbs_mole() const { getChemPotentials(m_tmpV.data()); return mean_X(m_tmpV); } doublereal IdealMolalSoln::cp_mole() const { getPartialMolarCp(m_tmpV.data()); return mean_X(m_tmpV); } // ------- Mechanical Equation of State Properties ------------------------ void IdealMolalSoln::calcDensity() { getPartialMolarVolumes(m_tmpV.data()); doublereal dd = meanMolecularWeight() / mean_X(m_tmpV); Phase::assignDensity(dd); } doublereal IdealMolalSoln::isothermalCompressibility() const { return 0.0; } doublereal IdealMolalSoln::thermalExpansionCoeff() const { return 0.0; } void IdealMolalSoln::setDensity(const doublereal rho) { warn_deprecated("IdealMolalSoln::setDensity", "Overloaded function to be removed after Cantera 2.5. " "Error will be thrown by Phase::setDensity instead"); if (rho != density()) { throw CanteraError("IdealMolalSoln::setDensity", "Density is not an independent variable"); } } void IdealMolalSoln::setMolarDensity(const doublereal conc) { warn_deprecated("IdealMolalSoln::setMolarDensity", "Overloaded function to be removed after Cantera 2.5. " "Error will be thrown by Phase::setMolarDensity instead"); if (conc != Phase::molarDensity()) { throw CanteraError("IdealMolalSoln::setMolarDensity", "molarDensity/density is not an independent variable"); } } // ------- Activities and Activity Concentrations Units IdealMolalSoln::standardConcentrationUnits() const { if (m_formGC == 0) { return Units(1.0); // dimensionless } else { // kmol/m^3 for bulk phases return Units(1.0, 0, -static_cast<double>(nDim()), 0, 0, 0, 1); } } void IdealMolalSoln::getActivityConcentrations(doublereal* c) const { if (m_formGC != 1) { double c_solvent = standardConcentration(); getActivities(c); for (size_t k = 0; k < m_kk; k++) { c[k] *= c_solvent; } } else { getActivities(c); for (size_t k = 0; k < m_kk; k++) { double c0 = standardConcentration(k); c[k] *= c0; } } } doublereal IdealMolalSoln::standardConcentration(size_t k) const { switch (m_formGC) { case 0: return 1.0; case 1: return 1.0 / m_speciesMolarVolume[k]; case 2: return 1.0 / m_speciesMolarVolume[0]; default: throw CanteraError("IdealMolalSoln::standardConcentration", "m_formGC is set to an incorrect value. \ Allowed values are 0, 1, and 2"); } } void IdealMolalSoln::getActivities(doublereal* ac) const { _updateStandardStateThermo(); // Update the molality array, m_molalities(). This requires an update due to // mole fractions if (IMS_typeCutoff_ == 0) { calcMolalities(); for (size_t k = 0; k < m_kk; k++) { ac[k] = m_molalities[k]; } double xmolSolvent = moleFraction(0); // Limit the activity coefficient to be finite as the solvent mole // fraction goes to zero. xmolSolvent = std::max(m_xmolSolventMIN, xmolSolvent); ac[0] = exp((xmolSolvent - 1.0)/xmolSolvent); } else { s_updateIMS_lnMolalityActCoeff(); // Now calculate the array of activities. for (size_t k = 1; k < m_kk; k++) { ac[k] = m_molalities[k] * exp(IMS_lnActCoeffMolal_[k]); } double xmolSolvent = moleFraction(0); ac[0] = exp(IMS_lnActCoeffMolal_[0]) * xmolSolvent; } } void IdealMolalSoln::getMolalityActivityCoefficients(doublereal* acMolality) const { if (IMS_typeCutoff_ == 0) { for (size_t k = 0; k < m_kk; k++) { acMolality[k] = 1.0; } double xmolSolvent = moleFraction(0); // Limit the activity coefficient to be finite as the solvent mole // fraction goes to zero. xmolSolvent = std::max(m_xmolSolventMIN, xmolSolvent); acMolality[0] = exp((xmolSolvent - 1.0)/xmolSolvent) / xmolSolvent; } else { s_updateIMS_lnMolalityActCoeff(); std::copy(IMS_lnActCoeffMolal_.begin(), IMS_lnActCoeffMolal_.end(), acMolality); for (size_t k = 0; k < m_kk; k++) { acMolality[k] = exp(acMolality[k]); } } } // ------ Partial Molar Properties of the Solution ----------------- void IdealMolalSoln::getChemPotentials(doublereal* mu) const { // First get the standard chemical potentials. This requires updates of // standard state as a function of T and P These are defined at unit // molality. getStandardChemPotentials(mu); // Update the molality array, m_molalities(). This requires an update due to // mole fractions calcMolalities(); // get the solvent mole fraction double xmolSolvent = moleFraction(0); if (IMS_typeCutoff_ == 0 || xmolSolvent > 3.* IMS_X_o_cutoff_/2.0) { for (size_t k = 1; k < m_kk; k++) { double xx = std::max(m_molalities[k], SmallNumber); mu[k] += RT() * log(xx); } // Do the solvent // -> see my notes double xx = std::max(xmolSolvent, SmallNumber); mu[0] += (RT() * (xmolSolvent - 1.0) / xx); } else { // Update the activity coefficients. This also updates the internal // molality array. s_updateIMS_lnMolalityActCoeff(); for (size_t k = 1; k < m_kk; k++) { double xx = std::max(m_molalities[k], SmallNumber); mu[k] += RT() * (log(xx) + IMS_lnActCoeffMolal_[k]); } double xx = std::max(xmolSolvent, SmallNumber); mu[0] += RT() * (log(xx) + IMS_lnActCoeffMolal_[0]); } } void IdealMolalSoln::getPartialMolarEnthalpies(doublereal* hbar) const { getEnthalpy_RT(hbar); for (size_t k = 0; k < m_kk; k++) { hbar[k] *= RT(); } } void IdealMolalSoln::getPartialMolarEntropies(doublereal* sbar) const { getEntropy_R(sbar); calcMolalities(); if (IMS_typeCutoff_ == 0) { for (size_t k = 1; k < m_kk; k++) { doublereal mm = std::max(SmallNumber, m_molalities[k]); sbar[k] -= GasConstant * log(mm); } double xmolSolvent = moleFraction(0); sbar[0] -= (GasConstant * (xmolSolvent - 1.0) / xmolSolvent); } else { // Update the activity coefficients, This also update the internally // stored molalities. s_updateIMS_lnMolalityActCoeff(); // First we will add in the obvious dependence on the T term out front // of the log activity term doublereal mm; for (size_t k = 1; k < m_kk; k++) { mm = std::max(SmallNumber, m_molalities[k]); sbar[k] -= GasConstant * (log(mm) + IMS_lnActCoeffMolal_[k]); } double xmolSolvent = moleFraction(0); mm = std::max(SmallNumber, xmolSolvent); sbar[0] -= GasConstant *(log(mm) + IMS_lnActCoeffMolal_[0]); } } void IdealMolalSoln::getPartialMolarVolumes(doublereal* vbar) const { getStandardVolumes(vbar); } void IdealMolalSoln::getPartialMolarCp(doublereal* cpbar) const { // Get the nondimensional Gibbs standard state of the species at the T and P // of the solution. getCp_R(cpbar); for (size_t k = 0; k < m_kk; k++) { cpbar[k] *= GasConstant; } } // -------------- Utilities ------------------------------- bool IdealMolalSoln::addSpecies(shared_ptr<Species> spec) { bool added = MolalityVPSSTP::addSpecies(spec); if (added) { m_speciesMolarVolume.push_back(0.0); m_tmpV.push_back(0.0); IMS_lnActCoeffMolal_.push_back(0.0); } return added; } void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_) { MolalityVPSSTP::initThermoXML(phaseNode, id_); if (id_.size() > 0 && phaseNode.id() != id_) { throw CanteraError("IdealMolalSoln::initThermoXML", "phasenode and Id are incompatible"); } // Find the Thermo XML node if (!phaseNode.hasChild("thermo")) { throw CanteraError("IdealMolalSoln::initThermoXML", "no thermo XML node"); } XML_Node& thermoNode = phaseNode.child("thermo"); // Possible change the form of the standard concentrations if (thermoNode.hasChild("standardConc")) { XML_Node& scNode = thermoNode.child("standardConc"); setStandardConcentrationModel(scNode["model"]); } if (thermoNode.hasChild("activityCoefficients")) { XML_Node& acNode = thermoNode.child("activityCoefficients"); std::string modelString = acNode.attrib("model"); if (modelString != "IdealMolalSoln") { throw CanteraError("IdealMolalSoln::initThermoXML", "unknown ActivityCoefficient model: " + modelString); } if (acNode.hasChild("idealMolalSolnCutoff")) { XML_Node& ccNode = acNode.child("idealMolalSolnCutoff"); modelString = ccNode.attrib("model"); if (modelString != "") { setCutoffModel(modelString); if (ccNode.hasChild("gamma_o_limit")) { IMS_gamma_o_min_ = getFloat(ccNode, "gamma_o_limit"); } if (ccNode.hasChild("gamma_k_limit")) { IMS_gamma_k_min_ = getFloat(ccNode, "gamma_k_limit"); } if (ccNode.hasChild("X_o_cutoff")) { IMS_X_o_cutoff_ = getFloat(ccNode, "X_o_cutoff"); } if (ccNode.hasChild("c_0_param")) { IMS_cCut_ = getFloat(ccNode, "c_0_param"); } if (ccNode.hasChild("slope_f_limit")) { IMS_slopefCut_ = getFloat(ccNode, "slope_f_limit"); } if (ccNode.hasChild("slope_g_limit")) { IMS_slopegCut_ = getFloat(ccNode, "slope_g_limit"); } } } else { setCutoffModel("none"); } } } void IdealMolalSoln::initThermo() { MolalityVPSSTP::initThermo(); if (m_input.hasKey("standard-concentration-basis")) { setStandardConcentrationModel(m_input["standard-concentration-basis"].asString()); } if (m_input.hasKey("cutoff")) { auto& cutoff = m_input["cutoff"].as<AnyMap>(); setCutoffModel(cutoff.getString("model", "none")); if (cutoff.hasKey("gamma_o")) { IMS_gamma_o_min_ = cutoff["gamma_o"].asDouble(); } if (cutoff.hasKey("gamma_k")) { IMS_gamma_k_min_ = cutoff["gamma_k"].asDouble(); } if (cutoff.hasKey("X_o")) { IMS_X_o_cutoff_ = cutoff["X_o"].asDouble(); } if (cutoff.hasKey("c_0")) { IMS_cCut_ = cutoff["c_0"].asDouble(); } if (cutoff.hasKey("slope_f")) { IMS_slopefCut_ = cutoff["slope_f"].asDouble(); } if (cutoff.hasKey("slope_g")) { IMS_slopegCut_ = cutoff["slope_g"].asDouble(); } } for (size_t k = 0; k < nSpecies(); k++) { m_speciesMolarVolume[k] = providePDSS(k)->molarVolume(); } if (IMS_typeCutoff_ == 2) { calcIMSCutoffParams_(); } setMoleFSolventMin(1.0E-5); } void IdealMolalSoln::setStandardConcentrationModel(const std::string& model) { if (caseInsensitiveEquals(model, "unity")) { m_formGC = 0; } else if (caseInsensitiveEquals(model, "species-molar-volume") || caseInsensitiveEquals(model, "molar_volume")) { m_formGC = 1; } else if (caseInsensitiveEquals(model, "solvent-molar-volume") || caseInsensitiveEquals(model, "solvent_volume")) { m_formGC = 2; } else { throw CanteraError("IdealMolalSoln::setStandardConcentrationModel", "Unknown standard concentration model '{}'", model); } } void IdealMolalSoln::setCutoffModel(const std::string& model) { if (caseInsensitiveEquals(model, "none")) { IMS_typeCutoff_ = 0; } else if (caseInsensitiveEquals(model, "poly")) { IMS_typeCutoff_ = 1; } else if (caseInsensitiveEquals(model, "polyexp")) { IMS_typeCutoff_ = 2; } else { throw CanteraError("IdealMolalSoln::setCutoffModel", "Unknown cutoff model '{}'", model); } } // ------------ Private and Restricted Functions ------------------ void IdealMolalSoln::s_updateIMS_lnMolalityActCoeff() const { // Calculate the molalities. Currently, the molalities may not be current // with respect to the contents of the State objects' data. calcMolalities(); double xmolSolvent = moleFraction(0); double xx = std::max(m_xmolSolventMIN, xmolSolvent); if (IMS_typeCutoff_ == 0) { for (size_t k = 1; k < m_kk; k++) { IMS_lnActCoeffMolal_[k]= 0.0; } IMS_lnActCoeffMolal_[0] = - log(xx) + (xx - 1.0)/xx; return; } else if (IMS_typeCutoff_ == 1) { if (xmolSolvent > 3.0 * IMS_X_o_cutoff_/2.0) { for (size_t k = 1; k < m_kk; k++) { IMS_lnActCoeffMolal_[k]= 0.0; } IMS_lnActCoeffMolal_[0] = - log(xx) + (xx - 1.0)/xx; return; } else if (xmolSolvent < IMS_X_o_cutoff_/2.0) { double tmp = log(xx * IMS_gamma_k_min_); for (size_t k = 1; k < m_kk; k++) { IMS_lnActCoeffMolal_[k]= tmp; } IMS_lnActCoeffMolal_[0] = log(IMS_gamma_o_min_); return; } else { // If we are in the middle region, calculate the connecting polynomials double xminus = xmolSolvent - IMS_X_o_cutoff_/2.0; double xminus2 = xminus * xminus; double xminus3 = xminus2 * xminus; double x_o_cut2 = IMS_X_o_cutoff_ * IMS_X_o_cutoff_; double x_o_cut3 = x_o_cut2 * IMS_X_o_cutoff_; double h2 = 3.5 * xminus2 / IMS_X_o_cutoff_ - 2.0 * xminus3 / x_o_cut2; double h2_prime = 7.0 * xminus / IMS_X_o_cutoff_ - 6.0 * xminus2 / x_o_cut2; double h1 = (1.0 - 3.0 * xminus2 / x_o_cut2 + 2.0 * xminus3/ x_o_cut3); double h1_prime = (- 6.0 * xminus / x_o_cut2 + 6.0 * xminus2/ x_o_cut3); double h1_g = h1 / IMS_gamma_o_min_; double h1_g_prime = h1_prime / IMS_gamma_o_min_; double alpha = 1.0 / (exp(1.0) * IMS_gamma_k_min_); double h1_f = h1 * alpha; double h1_f_prime = h1_prime * alpha; double f = h2 + h1_f; double f_prime = h2_prime + h1_f_prime; double g = h2 + h1_g; double g_prime = h2_prime + h1_g_prime; double tmp = (xmolSolvent/ g * g_prime + (1.0-xmolSolvent) / f * f_prime); double lngammak = -1.0 - log(f) + tmp * xmolSolvent; double lngammao =-log(g) - tmp * (1.0-xmolSolvent); tmp = log(xmolSolvent) + lngammak; for (size_t k = 1; k < m_kk; k++) { IMS_lnActCoeffMolal_[k]= tmp; } IMS_lnActCoeffMolal_[0] = lngammao; } } else if (IMS_typeCutoff_ == 2) { // Exponentials - trial 2 if (xmolSolvent > IMS_X_o_cutoff_) { for (size_t k = 1; k < m_kk; k++) { IMS_lnActCoeffMolal_[k]= 0.0; } IMS_lnActCoeffMolal_[0] = - log(xx) + (xx - 1.0)/xx; return; } else { double xoverc = xmolSolvent/IMS_cCut_; double eterm = std::exp(-xoverc); double fptmp = IMS_bfCut_ - IMS_afCut_ / IMS_cCut_ - IMS_bfCut_*xoverc + 2.0*IMS_dfCut_*xmolSolvent - IMS_dfCut_*xmolSolvent*xoverc; double f_prime = 1.0 + eterm*fptmp; double f = xmolSolvent + IMS_efCut_ + eterm * (IMS_afCut_ + xmolSolvent * (IMS_bfCut_ + IMS_dfCut_*xmolSolvent)); double gptmp = IMS_bgCut_ - IMS_agCut_ / IMS_cCut_ - IMS_bgCut_*xoverc + 2.0*IMS_dgCut_*xmolSolvent - IMS_dgCut_*xmolSolvent*xoverc; double g_prime = 1.0 + eterm*gptmp; double g = xmolSolvent + IMS_egCut_ + eterm * (IMS_agCut_ + xmolSolvent * (IMS_bgCut_ + IMS_dgCut_*xmolSolvent)); double tmp = (xmolSolvent / g * g_prime + (1.0 - xmolSolvent) / f * f_prime); double lngammak = -1.0 - log(f) + tmp * xmolSolvent; double lngammao =-log(g) - tmp * (1.0-xmolSolvent); tmp = log(xx) + lngammak; for (size_t k = 1; k < m_kk; k++) { IMS_lnActCoeffMolal_[k]= tmp; } IMS_lnActCoeffMolal_[0] = lngammao; } } } void IdealMolalSoln::calcIMSCutoffParams_() { IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_); IMS_efCut_ = 0.0; bool converged = false; for (int its = 0; its < 100 && !converged; its++) { double oldV = IMS_efCut_; IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_) - IMS_efCut_; IMS_bfCut_ = IMS_afCut_ / IMS_cCut_ + IMS_slopefCut_ - 1.0; IMS_dfCut_ = ((- IMS_afCut_/IMS_cCut_ + IMS_bfCut_ - IMS_bfCut_*IMS_X_o_cutoff_/IMS_cCut_) / (IMS_X_o_cutoff_*IMS_X_o_cutoff_/IMS_cCut_ - 2.0 * IMS_X_o_cutoff_)); double tmp = IMS_afCut_ + IMS_X_o_cutoff_*(IMS_bfCut_ + IMS_dfCut_ * IMS_X_o_cutoff_); double eterm = std::exp(-IMS_X_o_cutoff_/IMS_cCut_); IMS_efCut_ = - eterm * (tmp); if (fabs(IMS_efCut_ - oldV) < 1.0E-14) { converged = true; } } if (!converged) { throw CanteraError("IdealMolalSoln::calcCutoffParams_", "failed to converge on the f polynomial"); } converged = false; double f_0 = IMS_afCut_ + IMS_efCut_; double f_prime_0 = 1.0 - IMS_afCut_ / IMS_cCut_ + IMS_bfCut_; IMS_egCut_ = 0.0; for (int its = 0; its < 100 && !converged; its++) { double oldV = IMS_egCut_; double lng_0 = -log(IMS_gamma_o_min_) - f_prime_0 / f_0; IMS_agCut_ = exp(lng_0) - IMS_egCut_; IMS_bgCut_ = IMS_agCut_ / IMS_cCut_ + IMS_slopegCut_ - 1.0; IMS_dgCut_ = ((- IMS_agCut_/IMS_cCut_ + IMS_bgCut_ - IMS_bgCut_*IMS_X_o_cutoff_/IMS_cCut_) / (IMS_X_o_cutoff_*IMS_X_o_cutoff_/IMS_cCut_ - 2.0 * IMS_X_o_cutoff_)); double tmp = IMS_agCut_ + IMS_X_o_cutoff_*(IMS_bgCut_ + IMS_dgCut_ *IMS_X_o_cutoff_); double eterm = std::exp(-IMS_X_o_cutoff_/IMS_cCut_); IMS_egCut_ = - eterm * (tmp); if (fabs(IMS_egCut_ - oldV) < 1.0E-14) { converged = true; } } if (!converged) { throw CanteraError("IdealMolalSoln::calcCutoffParams_", "failed to converge on the g polynomial"); } } }
{ "pile_set_name": "Github" }
foo ->
{ "pile_set_name": "Github" }
*** Settings *** Variables numbers_to_convert.py *** Test Cases *** Convert To Integer [Documentation] FAIL STARTS: 'MyObject' cannot be converted to an integer: ZeroDivisionError: [Template] Test Convert To Integer 1 1 -42 -42 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ... 10**100 ${OBJECT} 42 ${OBJECT_FAILING} This fails! Convert To Integer With Java Objects [Documentation] FAIL STARTS: 'foobar' cannot be converted to an integer: ValueError: [Template] Test Convert To Integer ${JAVA_STRING_INT} ${JAVA_INTEGER} ${JAVA_LONG} ${JAVA_SHORT} ${JAVA_FLOAT} ${JAVA_DOUBLE} ${JAVA_STRING_INVALID} This fails! Convert To Integer With Base [Documentation] FAIL STARTS: 'A' cannot be converted to an integer: ValueError: [Template] Test Convert To Integer 10 10 10 A 10 16 -10 -8 ${8} +10 8 ${8} 10 2 2 -FF 00 -65280 16 1010 1010 170 2 A fails Convert To Integer With Invalid Base [Documentation] FAIL STARTS: '1' cannot be converted to an integer: 'invalid' cannot be converted to an integer: ValueError: Convert To Integer 1 invalid Convert To Integer With Embedded Base [Documentation] FAIL STARTS: '0xXXX' cannot be converted to an integer: ValueError: [Template] Test Convert To Integer 0xf00 3840 -0XF00 -3840 0b10 2 -0B10 -2 +0B10 2 0B10 2832 base=16 # Explicit base wins 0o101 65 0O102 66 - 0x FF 00 -65280 + 0x FF 00 65280 0b 1010 1010 170 0xXXX fails Convert To Integer With Base And Java Objects [Documentation] FAIL STARTS: 'F00' cannot be converted to an integer: ValueError: [Template] Test Convert To Integer ${JAVA_STRING_HEX} 3840 16 ${JAVA_STRING_EMBEDDED_BASE} 3840 ${JAVA_STRING_HEX} fails 8 Convert To Binary [Template] Test Convert To Binary 0 0 1 ${1} -10 ${-2} 0b10 2 prefix=0b -0b10 -2 prefix=0b 0b10 +2 prefix=0b 00001000 10 base=8 length=8 11111111 0xFF -11111111 -0xFF 11111111 +0xFF -100000000 -100 base=16 length=2 B0101 101 base=2 prefix=B length=4 Convert To Octal [Template] Test Convert To Octal 0 0 1 ${1} -2 ${-2} 0o10 8 prefix=0o -0o10 -8 prefix=0o 0o10 +8 prefix=0o 00001000 200 base=16 length=8 52746757 +0xABCDEF length=5 -52746757 -0xABCDEF length=5 xXx007 111 base=2 prefix=xXx length=3 Convert To Hex [Template] Test Convert To Hex 0 0 1 ${1} -2 ${-2} 0xA 10 prefix=0x length=0 -0xA -10 prefix=0x length=0 0xA +0o12 prefix=0x length=0 0000abcd ABCD base=16 length=8 lowercase=yes -0A0a -10 base=10 prefix=0A lowercase=please length=2 Convert To Number [Documentation] FAIL REGEXP: ^'MyObject' cannot be converted to a floating point number: (Attribute|Type)Error: .*$ [Template] Test Convert To Number -10.000 -10 ${OBJECT} 42.0 ${OBJECT_FAILING} This fails! Convert To Number With Java Objects [Documentation] FAIL STARTS: 'foobar' cannot be converted to a floating point number: ValueError: [Template] Test Convert To Number ${JAVA_STRING_INT} 1.0 ${JAVA_STRING_FLOAT} 1.1 ${JAVA_INTEGER} 1.0 ${JAVA_LONG} 1.0 ${JAVA_SHORT} 1.0 ${JAVA_FLOAT} 1.1 ${JAVA_DOUBLE} 1.1 ${JAVA_STRING_INVALID} This fails! Convert To Number With Precision [Documentation] FAIL STARTS: 'invalid' cannot be converted to an integer: ValueError: [Template] Test Convert To Number With Precision 1.01 0 1 1.02 ${0} 1 1.03 ${NONE} 1.03 1.14 1 1.1 9.1 -1 10 1 invalid This fails! Numeric conversions with long types [Template] Numeric conversions with long types # 0x8000000000000000 == sys.maxint+1 on 64bit machines Convert To Integer 0 0 Convert To Integer 42 42 Convert To Integer 0x8000000000000000 9223372036854775808 Convert To Hex 0 0 Convert To Hex 42 2A Convert To Hex 0x8000000000000000 8000000000000000 Convert To Octal 0 0 Convert To Octal 42 52 Convert To Octal 0x8000000000000000 1000000000000000000000 Convert To Binary 0 0 Convert To Binary 42 101010 Convert To Binary 0x8000000000000000 1000000000000000000000000000000000000000000000000000000000000000 Convert To String ${int42} = Convert To Integer 42 Should Not Be Equal ${int42} 42 ${str42} = Convert To String ${int42} Should Be Equal ${str42} 42 Convert To Boolean ${True} = Convert To Boolean True ${False} = Convert To Boolean false Should Be True ${True} == True Should Be True ${False} == False ${one} = Convert To Integer 1 ${zero} = Convert To Integer 0 ${True} = Convert To Boolean ${one} ${False} = Convert To Boolean ${zero} Should Be True ${True} == True Should Be True ${False} == False Create List ${list} = Create List hello world Should Be True ${list} == ['hello','world'] @{list} = Create List hello world Should Be Equal ${list}[0] hello Should Be Equal ${list}[1] world ${one_item} = Create List one item Should Be True ${one_item} == ['one item'] ${empty} = Create List Should Be True ${empty} == [ ] ${int_one} = Convert To Number 1 ${mixed} = Create List one ${int_one} Should Be True ${mixed} == ['one', 1] *** Keywords *** Test Convert To Integer [Arguments] ${item} ${exp}=1 ${base}= ${act} = Convert To Integer ${item} ${base} ${exp} = Evaluate ${exp} Should Be Equal ${act} ${exp} Test Convert To Binary [Arguments] ${exp} ${item} ${base}= ${prefix}= ${length}= ${act} = Convert To Binary ${item} base=${base} ... prefix=${prefix} length=${length} Should Be Equal ${act} ${exp} Test Convert To Octal [Arguments] ${exp} ${item} ${base}= ${prefix}= ${length}= ${act} = Convert To Octal ${item} base=${base} ... prefix=${prefix} length=${length} Should Be Equal ${act} ${exp} Test Convert To Hex [Arguments] ${exp} ${item} ${base}= ${prefix}= ${length}= ${lowercase}= ${act} = Convert To Hex ${item} base=${base} ... prefix=${prefix} length=${length} lowercase=${lowercase} Should Be Equal ${act} ${exp} Test Convert To Number [Arguments] ${item} ${exp}=1.0 ${act} = Convert To Number ${item} Should Be True round(${act}, 6) == ${exp} Test Convert To Number With Precision [Arguments] ${item} ${precision} ${exp} ${act} = Convert To Number ${item} ${precision} Should Be True round(${act}, 6) == ${exp} Numeric conversions with long types [Arguments] ${keyword} ${input} ${expected} ${input} = Evaluate (long if sys.version_info[0] == 2 else int)(${input}) modules=sys ${result} = Run Keyword ${keyword} ${input} Should Be Equal As Strings ${result} ${expected}
{ "pile_set_name": "Github" }
heat_template_version: 2016-10-14 description: > A template which doesn't create any resources supposing that an external loadbalancer is used. parameters: # What version of OpenShift Container Platform to install # This value is used to select the RPM repo for the OCP release to install ocp_version: type: string description: > The version of OpenShift Container Platform to deploy key_name: description: > A pre-submitted SSH key to access the VM hosts type: string constraints: - custom_constraint: nova.keypair image: type: string default: '' flavor: description: > Define the hardware characteristics for the VMs: CPU, Memory, base disk type: string constraints: - custom_constraint: nova.flavor hostname: description: > The load balancer hostname portion of the FQDN type: string constraints: - allowed_pattern: '[a-z0-9\-\.]*' description: Hostname must contain only characters [a-z0-9\-\.]. stack_name: description: Top level stack name. type: string domain_name: description: > All VMs will be placed in this domain type: string app_subdomain: type: string rhn_username: description: > A valid user with entitlements to RHEL and OpenShift software repos type: string rhn_password: description: > The password for the RHN user type: string hidden: true # Red Hat satellite subscription parameters sat6_hostname: type: string description: > The hostname of the Satellite 6 server which will provide software updates default: '' sat6_organization: type: string description: > An organization string provided by Sat6 to group subscriptions default: '' sat6_activationkey: type: string description: > An activation key string provided by Sat6 to enable subscriptions rhn_pool: description: > A subscription pool containing the RHEL and OpenShift software repos OPTIONAL type: string hidden: true extra_rhn_pools: type: comma_delimited_list description: List of rhn pools which will be installed on each node. default: '' ssh_user: description: > The user for SSH access to the VM hosts type: string ansible_public_key: description: > The SSH public key that Ansible will use to access master and node hosts This will be placed on each VM host in /root/.ssh/authorized_keys type: string fixed_subnet: description: > The name or ID of the internal IPv4 space type: string constraints: - custom_constraint: neutron.subnet members: type: comma_delimited_list master_hostname: type: string floatingip_id: type: string floatingip: type: string fixed_network: description: > The name or ID of the internal network type: string constraints: - custom_constraint: neutron.network fixed_subnet: description: > The name or ID of the internal IPv4 space type: string constraints: - custom_constraint: neutron.subnet extra_repository_urls: type: comma_delimited_list description: List of repository URLs which will be installed on each node. default: '' extra_docker_repository_urls: type: comma_delimited_list description: List of docker repository URLs which will be installed on each node, if a repo is insecure use '#insecure' suffix. default: '' # Delay openshift installation until the master is ready to accept timeout: description: Time to wait until the master setup is ready. type: number default: 4000 stack_name: type: string default: '' bastion_node: type: string description: > The name or ID of the bastion instance. default: '' dns_servers: type: comma_delimited_list description: address of dns nameservers reachable in your environment dns_update_key: type: string hidden: true ca_cert: type: string description: Certificate Authority Certificate to be added to trust chain outputs: console_url: description: URL of the OpenShift web console value: str_replace: template: "https://%hostname%:8443/console/" params: '%hostname%': {get_param: hostname} api_url: description: URL entrypoint to the OpenShift API value: str_replace: template: "https://%hostname%:8443/" params: '%hostname%': {get_param: hostname} hostname: description: Loadbalancer hostname value: {get_param: hostname}
{ "pile_set_name": "Github" }
## -*- Autoconf -*- # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) # --------------------------------------------------- # Add --enable-multilib to configure. AC_DEFUN([AM_ENABLE_MULTILIB], [# Default to --enable-multilib AC_ARG_ENABLE(multilib, [ --enable-multilib build many library versions (default)], [case "$enableval" in yes) multilib=yes ;; no) multilib=no ;; *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; esac], [multilib=yes]) # We may get other options which we leave undocumented: # --with-target-subdir, --with-multisrctop, --with-multisubdir # See config-ml.in if you want the gory details. if test "$srcdir" = "."; then if test "$with_target_subdir" != "."; then multi_basedir="$srcdir/$with_multisrctop../$2" else multi_basedir="$srcdir/$with_multisrctop$2" fi else multi_basedir="$srcdir/$2" fi AC_SUBST(multi_basedir) # Even if the default multilib is not a cross compilation, # it may be that some of the other multilibs are. if test $cross_compiling = no && test $multilib = yes \ && test "x${with_multisubdir}" != x ; then cross_compiling=maybe fi AC_OUTPUT_COMMANDS([ # Only add multilib support code if we just rebuilt the top-level # Makefile. case " $CONFIG_FILES " in *" ]m4_default([$1],Makefile)[ "*) ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in ;; esac], [ srcdir="$srcdir" host="$host" target="$target" with_multisubdir="$with_multisubdir" with_multisrctop="$with_multisrctop" with_target_subdir="$with_target_subdir" ac_configure_args="${multilib_arg} ${ac_configure_args}" multi_basedir="$multi_basedir" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} CC="$CC" CXX="$CXX" GFORTRAN="$GFORTRAN" GCJ="$GCJ"])])dnl
{ "pile_set_name": "Github" }
/** * Question Link: https://leetcode.com/problems/word-ladder/ * Primary idea: BFS to go over all possible word paths until the word is exactly * the same as end word, then the path should be the shortest one. * * Time Complexity: O(nm), Space Complexity: O(nm) * n stands for # of words, m stands for length of a word * */ class WordLadder { func ladderLength(_ beginWord: String, _ endWord: String, _ wordList: [String]) -> Int { guard beginWord.count == endWord.count else { return 0 } var queue = [(beginWord, 1)], wordSet = Set<String>(wordList) while !queue.isEmpty { let (word, step) = queue.removeFirst() if word == endWord { return step } // transform word for i in 0..<word.count { var wordArray = Array(word) for char in "abcdefghijklmnopqrstuvwxyz" { guard char != wordArray[i] else { continue } wordArray[i] = char let transformedWord = String(wordArray) guard wordSet.contains(transformedWord) else { continue } wordSet.remove(transformedWord) queue.append((transformedWord, step + 1)) } } } return 0 } }
{ "pile_set_name": "Github" }
// Variables // -------------------------- $fa-font-path: "../fonts" !default; $fa-font-size-base: 14px !default; $fa-line-height-base: 1 !default; //$fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts" !default; // for referencing Bootstrap CDN font files directly $fa-css-prefix: fa !default; $fa-version: "4.7.0" !default; $fa-border-color: #eee !default; $fa-inverse: #fff !default; $fa-li-width: (30em / 14) !default; $fa-var-500px: "\f26e"; $fa-var-address-book: "\f2b9"; $fa-var-address-book-o: "\f2ba"; $fa-var-address-card: "\f2bb"; $fa-var-address-card-o: "\f2bc"; $fa-var-adjust: "\f042"; $fa-var-adn: "\f170"; $fa-var-align-center: "\f037"; $fa-var-align-justify: "\f039"; $fa-var-align-left: "\f036"; $fa-var-align-right: "\f038"; $fa-var-amazon: "\f270"; $fa-var-ambulance: "\f0f9"; $fa-var-american-sign-language-interpreting: "\f2a3"; $fa-var-anchor: "\f13d"; $fa-var-android: "\f17b"; $fa-var-angellist: "\f209"; $fa-var-angle-double-down: "\f103"; $fa-var-angle-double-left: "\f100"; $fa-var-angle-double-right: "\f101"; $fa-var-angle-double-up: "\f102"; $fa-var-angle-down: "\f107"; $fa-var-angle-left: "\f104"; $fa-var-angle-right: "\f105"; $fa-var-angle-up: "\f106"; $fa-var-apple: "\f179"; $fa-var-archive: "\f187"; $fa-var-area-chart: "\f1fe"; $fa-var-arrow-circle-down: "\f0ab"; $fa-var-arrow-circle-left: "\f0a8"; $fa-var-arrow-circle-o-down: "\f01a"; $fa-var-arrow-circle-o-left: "\f190"; $fa-var-arrow-circle-o-right: "\f18e"; $fa-var-arrow-circle-o-up: "\f01b"; $fa-var-arrow-circle-right: "\f0a9"; $fa-var-arrow-circle-up: "\f0aa"; $fa-var-arrow-down: "\f063"; $fa-var-arrow-left: "\f060"; $fa-var-arrow-right: "\f061"; $fa-var-arrow-up: "\f062"; $fa-var-arrows: "\f047"; $fa-var-arrows-alt: "\f0b2"; $fa-var-arrows-h: "\f07e"; $fa-var-arrows-v: "\f07d"; $fa-var-asl-interpreting: "\f2a3"; $fa-var-assistive-listening-systems: "\f2a2"; $fa-var-asterisk: "\f069"; $fa-var-at: "\f1fa"; $fa-var-audio-description: "\f29e"; $fa-var-automobile: "\f1b9"; $fa-var-backward: "\f04a"; $fa-var-balance-scale: "\f24e"; $fa-var-ban: "\f05e"; $fa-var-bandcamp: "\f2d5"; $fa-var-bank: "\f19c"; $fa-var-bar-chart: "\f080"; $fa-var-bar-chart-o: "\f080"; $fa-var-barcode: "\f02a"; $fa-var-bars: "\f0c9"; $fa-var-bath: "\f2cd"; $fa-var-bathtub: "\f2cd"; $fa-var-battery: "\f240"; $fa-var-battery-0: "\f244"; $fa-var-battery-1: "\f243"; $fa-var-battery-2: "\f242"; $fa-var-battery-3: "\f241"; $fa-var-battery-4: "\f240"; $fa-var-battery-empty: "\f244"; $fa-var-battery-full: "\f240"; $fa-var-battery-half: "\f242"; $fa-var-battery-quarter: "\f243"; $fa-var-battery-three-quarters: "\f241"; $fa-var-bed: "\f236"; $fa-var-beer: "\f0fc"; $fa-var-behance: "\f1b4"; $fa-var-behance-square: "\f1b5"; $fa-var-bell: "\f0f3"; $fa-var-bell-o: "\f0a2"; $fa-var-bell-slash: "\f1f6"; $fa-var-bell-slash-o: "\f1f7"; $fa-var-bicycle: "\f206"; $fa-var-binoculars: "\f1e5"; $fa-var-birthday-cake: "\f1fd"; $fa-var-bitbucket: "\f171"; $fa-var-bitbucket-square: "\f172"; $fa-var-bitcoin: "\f15a"; $fa-var-black-tie: "\f27e"; $fa-var-blind: "\f29d"; $fa-var-bluetooth: "\f293"; $fa-var-bluetooth-b: "\f294"; $fa-var-bold: "\f032"; $fa-var-bolt: "\f0e7"; $fa-var-bomb: "\f1e2"; $fa-var-book: "\f02d"; $fa-var-bookmark: "\f02e"; $fa-var-bookmark-o: "\f097"; $fa-var-braille: "\f2a1"; $fa-var-briefcase: "\f0b1"; $fa-var-btc: "\f15a"; $fa-var-bug: "\f188"; $fa-var-building: "\f1ad"; $fa-var-building-o: "\f0f7"; $fa-var-bullhorn: "\f0a1"; $fa-var-bullseye: "\f140"; $fa-var-bus: "\f207"; $fa-var-buysellads: "\f20d"; $fa-var-cab: "\f1ba"; $fa-var-calculator: "\f1ec"; $fa-var-calendar: "\f073"; $fa-var-calendar-check-o: "\f274"; $fa-var-calendar-minus-o: "\f272"; $fa-var-calendar-o: "\f133"; $fa-var-calendar-plus-o: "\f271"; $fa-var-calendar-times-o: "\f273"; $fa-var-camera: "\f030"; $fa-var-camera-retro: "\f083"; $fa-var-car: "\f1b9"; $fa-var-caret-down: "\f0d7"; $fa-var-caret-left: "\f0d9"; $fa-var-caret-right: "\f0da"; $fa-var-caret-square-o-down: "\f150"; $fa-var-caret-square-o-left: "\f191"; $fa-var-caret-square-o-right: "\f152"; $fa-var-caret-square-o-up: "\f151"; $fa-var-caret-up: "\f0d8"; $fa-var-cart-arrow-down: "\f218"; $fa-var-cart-plus: "\f217"; $fa-var-cc: "\f20a"; $fa-var-cc-amex: "\f1f3"; $fa-var-cc-diners-club: "\f24c"; $fa-var-cc-discover: "\f1f2"; $fa-var-cc-jcb: "\f24b"; $fa-var-cc-mastercard: "\f1f1"; $fa-var-cc-paypal: "\f1f4"; $fa-var-cc-stripe: "\f1f5"; $fa-var-cc-visa: "\f1f0"; $fa-var-certificate: "\f0a3"; $fa-var-chain: "\f0c1"; $fa-var-chain-broken: "\f127"; $fa-var-check: "\f00c"; $fa-var-check-circle: "\f058"; $fa-var-check-circle-o: "\f05d"; $fa-var-check-square: "\f14a"; $fa-var-check-square-o: "\f046"; $fa-var-chevron-circle-down: "\f13a"; $fa-var-chevron-circle-left: "\f137"; $fa-var-chevron-circle-right: "\f138"; $fa-var-chevron-circle-up: "\f139"; $fa-var-chevron-down: "\f078"; $fa-var-chevron-left: "\f053"; $fa-var-chevron-right: "\f054"; $fa-var-chevron-up: "\f077"; $fa-var-child: "\f1ae"; $fa-var-chrome: "\f268"; $fa-var-circle: "\f111"; $fa-var-circle-o: "\f10c"; $fa-var-circle-o-notch: "\f1ce"; $fa-var-circle-thin: "\f1db"; $fa-var-clipboard: "\f0ea"; $fa-var-clock-o: "\f017"; $fa-var-clone: "\f24d"; $fa-var-close: "\f00d"; $fa-var-cloud: "\f0c2"; $fa-var-cloud-download: "\f0ed"; $fa-var-cloud-upload: "\f0ee"; $fa-var-cny: "\f157"; $fa-var-code: "\f121"; $fa-var-code-fork: "\f126"; $fa-var-codepen: "\f1cb"; $fa-var-codiepie: "\f284"; $fa-var-coffee: "\f0f4"; $fa-var-cog: "\f013"; $fa-var-cogs: "\f085"; $fa-var-columns: "\f0db"; $fa-var-comment: "\f075"; $fa-var-comment-o: "\f0e5"; $fa-var-commenting: "\f27a"; $fa-var-commenting-o: "\f27b"; $fa-var-comments: "\f086"; $fa-var-comments-o: "\f0e6"; $fa-var-compass: "\f14e"; $fa-var-compress: "\f066"; $fa-var-connectdevelop: "\f20e"; $fa-var-contao: "\f26d"; $fa-var-copy: "\f0c5"; $fa-var-copyright: "\f1f9"; $fa-var-creative-commons: "\f25e"; $fa-var-credit-card: "\f09d"; $fa-var-credit-card-alt: "\f283"; $fa-var-crop: "\f125"; $fa-var-crosshairs: "\f05b"; $fa-var-css3: "\f13c"; $fa-var-cube: "\f1b2"; $fa-var-cubes: "\f1b3"; $fa-var-cut: "\f0c4"; $fa-var-cutlery: "\f0f5"; $fa-var-dashboard: "\f0e4"; $fa-var-dashcube: "\f210"; $fa-var-database: "\f1c0"; $fa-var-deaf: "\f2a4"; $fa-var-deafness: "\f2a4"; $fa-var-dedent: "\f03b"; $fa-var-delicious: "\f1a5"; $fa-var-desktop: "\f108"; $fa-var-deviantart: "\f1bd"; $fa-var-diamond: "\f219"; $fa-var-digg: "\f1a6"; $fa-var-dollar: "\f155"; $fa-var-dot-circle-o: "\f192"; $fa-var-download: "\f019"; $fa-var-dribbble: "\f17d"; $fa-var-drivers-license: "\f2c2"; $fa-var-drivers-license-o: "\f2c3"; $fa-var-dropbox: "\f16b"; $fa-var-drupal: "\f1a9"; $fa-var-edge: "\f282"; $fa-var-edit: "\f044"; $fa-var-eercast: "\f2da"; $fa-var-eject: "\f052"; $fa-var-ellipsis-h: "\f141"; $fa-var-ellipsis-v: "\f142"; $fa-var-empire: "\f1d1"; $fa-var-envelope: "\f0e0"; $fa-var-envelope-o: "\f003"; $fa-var-envelope-open: "\f2b6"; $fa-var-envelope-open-o: "\f2b7"; $fa-var-envelope-square: "\f199"; $fa-var-envira: "\f299"; $fa-var-eraser: "\f12d"; $fa-var-etsy: "\f2d7"; $fa-var-eur: "\f153"; $fa-var-euro: "\f153"; $fa-var-exchange: "\f0ec"; $fa-var-exclamation: "\f12a"; $fa-var-exclamation-circle: "\f06a"; $fa-var-exclamation-triangle: "\f071"; $fa-var-expand: "\f065"; $fa-var-expeditedssl: "\f23e"; $fa-var-external-link: "\f08e"; $fa-var-external-link-square: "\f14c"; $fa-var-eye: "\f06e"; $fa-var-eye-slash: "\f070"; $fa-var-eyedropper: "\f1fb"; $fa-var-fa: "\f2b4"; $fa-var-facebook: "\f09a"; $fa-var-facebook-f: "\f09a"; $fa-var-facebook-official: "\f230"; $fa-var-facebook-square: "\f082"; $fa-var-fast-backward: "\f049"; $fa-var-fast-forward: "\f050"; $fa-var-fax: "\f1ac"; $fa-var-feed: "\f09e"; $fa-var-female: "\f182"; $fa-var-fighter-jet: "\f0fb"; $fa-var-file: "\f15b"; $fa-var-file-archive-o: "\f1c6"; $fa-var-file-audio-o: "\f1c7"; $fa-var-file-code-o: "\f1c9"; $fa-var-file-excel-o: "\f1c3"; $fa-var-file-image-o: "\f1c5"; $fa-var-file-movie-o: "\f1c8"; $fa-var-file-o: "\f016"; $fa-var-file-pdf-o: "\f1c1"; $fa-var-file-photo-o: "\f1c5"; $fa-var-file-picture-o: "\f1c5"; $fa-var-file-powerpoint-o: "\f1c4"; $fa-var-file-sound-o: "\f1c7"; $fa-var-file-text: "\f15c"; $fa-var-file-text-o: "\f0f6"; $fa-var-file-video-o: "\f1c8"; $fa-var-file-word-o: "\f1c2"; $fa-var-file-zip-o: "\f1c6"; $fa-var-files-o: "\f0c5"; $fa-var-film: "\f008"; $fa-var-filter: "\f0b0"; $fa-var-fire: "\f06d"; $fa-var-fire-extinguisher: "\f134"; $fa-var-firefox: "\f269"; $fa-var-first-order: "\f2b0"; $fa-var-flag: "\f024"; $fa-var-flag-checkered: "\f11e"; $fa-var-flag-o: "\f11d"; $fa-var-flash: "\f0e7"; $fa-var-flask: "\f0c3"; $fa-var-flickr: "\f16e"; $fa-var-floppy-o: "\f0c7"; $fa-var-folder: "\f07b"; $fa-var-folder-o: "\f114"; $fa-var-folder-open: "\f07c"; $fa-var-folder-open-o: "\f115"; $fa-var-font: "\f031"; $fa-var-font-awesome: "\f2b4"; $fa-var-fonticons: "\f280"; $fa-var-fort-awesome: "\f286"; $fa-var-forumbee: "\f211"; $fa-var-forward: "\f04e"; $fa-var-foursquare: "\f180"; $fa-var-free-code-camp: "\f2c5"; $fa-var-frown-o: "\f119"; $fa-var-futbol-o: "\f1e3"; $fa-var-gamepad: "\f11b"; $fa-var-gavel: "\f0e3"; $fa-var-gbp: "\f154"; $fa-var-ge: "\f1d1"; $fa-var-gear: "\f013"; $fa-var-gears: "\f085"; $fa-var-genderless: "\f22d"; $fa-var-get-pocket: "\f265"; $fa-var-gg: "\f260"; $fa-var-gg-circle: "\f261"; $fa-var-gift: "\f06b"; $fa-var-git: "\f1d3"; $fa-var-git-square: "\f1d2"; $fa-var-github: "\f09b"; $fa-var-github-alt: "\f113"; $fa-var-github-square: "\f092"; $fa-var-gitlab: "\f296"; $fa-var-gittip: "\f184"; $fa-var-glass: "\f000"; $fa-var-glide: "\f2a5"; $fa-var-glide-g: "\f2a6"; $fa-var-globe: "\f0ac"; $fa-var-google: "\f1a0"; $fa-var-google-plus: "\f0d5"; $fa-var-google-plus-circle: "\f2b3"; $fa-var-google-plus-official: "\f2b3"; $fa-var-google-plus-square: "\f0d4"; $fa-var-google-wallet: "\f1ee"; $fa-var-graduation-cap: "\f19d"; $fa-var-gratipay: "\f184"; $fa-var-grav: "\f2d6"; $fa-var-group: "\f0c0"; $fa-var-h-square: "\f0fd"; $fa-var-hacker-news: "\f1d4"; $fa-var-hand-grab-o: "\f255"; $fa-var-hand-lizard-o: "\f258"; $fa-var-hand-o-down: "\f0a7"; $fa-var-hand-o-left: "\f0a5"; $fa-var-hand-o-right: "\f0a4"; $fa-var-hand-o-up: "\f0a6"; $fa-var-hand-paper-o: "\f256"; $fa-var-hand-peace-o: "\f25b"; $fa-var-hand-pointer-o: "\f25a"; $fa-var-hand-rock-o: "\f255"; $fa-var-hand-scissors-o: "\f257"; $fa-var-hand-spock-o: "\f259"; $fa-var-hand-stop-o: "\f256"; $fa-var-handshake-o: "\f2b5"; $fa-var-hard-of-hearing: "\f2a4"; $fa-var-hashtag: "\f292"; $fa-var-hdd-o: "\f0a0"; $fa-var-header: "\f1dc"; $fa-var-headphones: "\f025"; $fa-var-heart: "\f004"; $fa-var-heart-o: "\f08a"; $fa-var-heartbeat: "\f21e"; $fa-var-history: "\f1da"; $fa-var-home: "\f015"; $fa-var-hospital-o: "\f0f8"; $fa-var-hotel: "\f236"; $fa-var-hourglass: "\f254"; $fa-var-hourglass-1: "\f251"; $fa-var-hourglass-2: "\f252"; $fa-var-hourglass-3: "\f253"; $fa-var-hourglass-end: "\f253"; $fa-var-hourglass-half: "\f252"; $fa-var-hourglass-o: "\f250"; $fa-var-hourglass-start: "\f251"; $fa-var-houzz: "\f27c"; $fa-var-html5: "\f13b"; $fa-var-i-cursor: "\f246"; $fa-var-id-badge: "\f2c1"; $fa-var-id-card: "\f2c2"; $fa-var-id-card-o: "\f2c3"; $fa-var-ils: "\f20b"; $fa-var-image: "\f03e"; $fa-var-imdb: "\f2d8"; $fa-var-inbox: "\f01c"; $fa-var-indent: "\f03c"; $fa-var-industry: "\f275"; $fa-var-info: "\f129"; $fa-var-info-circle: "\f05a"; $fa-var-inr: "\f156"; $fa-var-instagram: "\f16d"; $fa-var-institution: "\f19c"; $fa-var-internet-explorer: "\f26b"; $fa-var-intersex: "\f224"; $fa-var-ioxhost: "\f208"; $fa-var-italic: "\f033"; $fa-var-joomla: "\f1aa"; $fa-var-jpy: "\f157"; $fa-var-jsfiddle: "\f1cc"; $fa-var-key: "\f084"; $fa-var-keyboard-o: "\f11c"; $fa-var-krw: "\f159"; $fa-var-language: "\f1ab"; $fa-var-laptop: "\f109"; $fa-var-lastfm: "\f202"; $fa-var-lastfm-square: "\f203"; $fa-var-leaf: "\f06c"; $fa-var-leanpub: "\f212"; $fa-var-legal: "\f0e3"; $fa-var-lemon-o: "\f094"; $fa-var-level-down: "\f149"; $fa-var-level-up: "\f148"; $fa-var-life-bouy: "\f1cd"; $fa-var-life-buoy: "\f1cd"; $fa-var-life-ring: "\f1cd"; $fa-var-life-saver: "\f1cd"; $fa-var-lightbulb-o: "\f0eb"; $fa-var-line-chart: "\f201"; $fa-var-link: "\f0c1"; $fa-var-linkedin: "\f0e1"; $fa-var-linkedin-square: "\f08c"; $fa-var-linode: "\f2b8"; $fa-var-linux: "\f17c"; $fa-var-list: "\f03a"; $fa-var-list-alt: "\f022"; $fa-var-list-ol: "\f0cb"; $fa-var-list-ul: "\f0ca"; $fa-var-location-arrow: "\f124"; $fa-var-lock: "\f023"; $fa-var-long-arrow-down: "\f175"; $fa-var-long-arrow-left: "\f177"; $fa-var-long-arrow-right: "\f178"; $fa-var-long-arrow-up: "\f176"; $fa-var-low-vision: "\f2a8"; $fa-var-magic: "\f0d0"; $fa-var-magnet: "\f076"; $fa-var-mail-forward: "\f064"; $fa-var-mail-reply: "\f112"; $fa-var-mail-reply-all: "\f122"; $fa-var-male: "\f183"; $fa-var-map: "\f279"; $fa-var-map-marker: "\f041"; $fa-var-map-o: "\f278"; $fa-var-map-pin: "\f276"; $fa-var-map-signs: "\f277"; $fa-var-mars: "\f222"; $fa-var-mars-double: "\f227"; $fa-var-mars-stroke: "\f229"; $fa-var-mars-stroke-h: "\f22b"; $fa-var-mars-stroke-v: "\f22a"; $fa-var-maxcdn: "\f136"; $fa-var-meanpath: "\f20c"; $fa-var-medium: "\f23a"; $fa-var-medkit: "\f0fa"; $fa-var-meetup: "\f2e0"; $fa-var-meh-o: "\f11a"; $fa-var-mercury: "\f223"; $fa-var-microchip: "\f2db"; $fa-var-microphone: "\f130"; $fa-var-microphone-slash: "\f131"; $fa-var-minus: "\f068"; $fa-var-minus-circle: "\f056"; $fa-var-minus-square: "\f146"; $fa-var-minus-square-o: "\f147"; $fa-var-mixcloud: "\f289"; $fa-var-mobile: "\f10b"; $fa-var-mobile-phone: "\f10b"; $fa-var-modx: "\f285"; $fa-var-money: "\f0d6"; $fa-var-moon-o: "\f186"; $fa-var-mortar-board: "\f19d"; $fa-var-motorcycle: "\f21c"; $fa-var-mouse-pointer: "\f245"; $fa-var-music: "\f001"; $fa-var-navicon: "\f0c9"; $fa-var-neuter: "\f22c"; $fa-var-newspaper-o: "\f1ea"; $fa-var-object-group: "\f247"; $fa-var-object-ungroup: "\f248"; $fa-var-odnoklassniki: "\f263"; $fa-var-odnoklassniki-square: "\f264"; $fa-var-opencart: "\f23d"; $fa-var-openid: "\f19b"; $fa-var-opera: "\f26a"; $fa-var-optin-monster: "\f23c"; $fa-var-outdent: "\f03b"; $fa-var-pagelines: "\f18c"; $fa-var-paint-brush: "\f1fc"; $fa-var-paper-plane: "\f1d8"; $fa-var-paper-plane-o: "\f1d9"; $fa-var-paperclip: "\f0c6"; $fa-var-paragraph: "\f1dd"; $fa-var-paste: "\f0ea"; $fa-var-pause: "\f04c"; $fa-var-pause-circle: "\f28b"; $fa-var-pause-circle-o: "\f28c"; $fa-var-paw: "\f1b0"; $fa-var-paypal: "\f1ed"; $fa-var-pencil: "\f040"; $fa-var-pencil-square: "\f14b"; $fa-var-pencil-square-o: "\f044"; $fa-var-percent: "\f295"; $fa-var-phone: "\f095"; $fa-var-phone-square: "\f098"; $fa-var-photo: "\f03e"; $fa-var-picture-o: "\f03e"; $fa-var-pie-chart: "\f200"; $fa-var-pied-piper: "\f2ae"; $fa-var-pied-piper-alt: "\f1a8"; $fa-var-pied-piper-pp: "\f1a7"; $fa-var-pinterest: "\f0d2"; $fa-var-pinterest-p: "\f231"; $fa-var-pinterest-square: "\f0d3"; $fa-var-plane: "\f072"; $fa-var-play: "\f04b"; $fa-var-play-circle: "\f144"; $fa-var-play-circle-o: "\f01d"; $fa-var-plug: "\f1e6"; $fa-var-plus: "\f067"; $fa-var-plus-circle: "\f055"; $fa-var-plus-square: "\f0fe"; $fa-var-plus-square-o: "\f196"; $fa-var-podcast: "\f2ce"; $fa-var-power-off: "\f011"; $fa-var-print: "\f02f"; $fa-var-product-hunt: "\f288"; $fa-var-puzzle-piece: "\f12e"; $fa-var-qq: "\f1d6"; $fa-var-qrcode: "\f029"; $fa-var-question: "\f128"; $fa-var-question-circle: "\f059"; $fa-var-question-circle-o: "\f29c"; $fa-var-quora: "\f2c4"; $fa-var-quote-left: "\f10d"; $fa-var-quote-right: "\f10e"; $fa-var-ra: "\f1d0"; $fa-var-random: "\f074"; $fa-var-ravelry: "\f2d9"; $fa-var-rebel: "\f1d0"; $fa-var-recycle: "\f1b8"; $fa-var-reddit: "\f1a1"; $fa-var-reddit-alien: "\f281"; $fa-var-reddit-square: "\f1a2"; $fa-var-refresh: "\f021"; $fa-var-registered: "\f25d"; $fa-var-remove: "\f00d"; $fa-var-renren: "\f18b"; $fa-var-reorder: "\f0c9"; $fa-var-repeat: "\f01e"; $fa-var-reply: "\f112"; $fa-var-reply-all: "\f122"; $fa-var-resistance: "\f1d0"; $fa-var-retweet: "\f079"; $fa-var-rmb: "\f157"; $fa-var-road: "\f018"; $fa-var-rocket: "\f135"; $fa-var-rotate-left: "\f0e2"; $fa-var-rotate-right: "\f01e"; $fa-var-rouble: "\f158"; $fa-var-rss: "\f09e"; $fa-var-rss-square: "\f143"; $fa-var-rub: "\f158"; $fa-var-ruble: "\f158"; $fa-var-rupee: "\f156"; $fa-var-s15: "\f2cd"; $fa-var-safari: "\f267"; $fa-var-save: "\f0c7"; $fa-var-scissors: "\f0c4"; $fa-var-scribd: "\f28a"; $fa-var-search: "\f002"; $fa-var-search-minus: "\f010"; $fa-var-search-plus: "\f00e"; $fa-var-sellsy: "\f213"; $fa-var-send: "\f1d8"; $fa-var-send-o: "\f1d9"; $fa-var-server: "\f233"; $fa-var-share: "\f064"; $fa-var-share-alt: "\f1e0"; $fa-var-share-alt-square: "\f1e1"; $fa-var-share-square: "\f14d"; $fa-var-share-square-o: "\f045"; $fa-var-shekel: "\f20b"; $fa-var-sheqel: "\f20b"; $fa-var-shield: "\f132"; $fa-var-ship: "\f21a"; $fa-var-shirtsinbulk: "\f214"; $fa-var-shopping-bag: "\f290"; $fa-var-shopping-basket: "\f291"; $fa-var-shopping-cart: "\f07a"; $fa-var-shower: "\f2cc"; $fa-var-sign-in: "\f090"; $fa-var-sign-language: "\f2a7"; $fa-var-sign-out: "\f08b"; $fa-var-signal: "\f012"; $fa-var-signing: "\f2a7"; $fa-var-simplybuilt: "\f215"; $fa-var-sitemap: "\f0e8"; $fa-var-skyatlas: "\f216"; $fa-var-skype: "\f17e"; $fa-var-slack: "\f198"; $fa-var-sliders: "\f1de"; $fa-var-slideshare: "\f1e7"; $fa-var-smile-o: "\f118"; $fa-var-snapchat: "\f2ab"; $fa-var-snapchat-ghost: "\f2ac"; $fa-var-snapchat-square: "\f2ad"; $fa-var-snowflake-o: "\f2dc"; $fa-var-soccer-ball-o: "\f1e3"; $fa-var-sort: "\f0dc"; $fa-var-sort-alpha-asc: "\f15d"; $fa-var-sort-alpha-desc: "\f15e"; $fa-var-sort-amount-asc: "\f160"; $fa-var-sort-amount-desc: "\f161"; $fa-var-sort-asc: "\f0de"; $fa-var-sort-desc: "\f0dd"; $fa-var-sort-down: "\f0dd"; $fa-var-sort-numeric-asc: "\f162"; $fa-var-sort-numeric-desc: "\f163"; $fa-var-sort-up: "\f0de"; $fa-var-soundcloud: "\f1be"; $fa-var-space-shuttle: "\f197"; $fa-var-spinner: "\f110"; $fa-var-spoon: "\f1b1"; $fa-var-spotify: "\f1bc"; $fa-var-square: "\f0c8"; $fa-var-square-o: "\f096"; $fa-var-stack-exchange: "\f18d"; $fa-var-stack-overflow: "\f16c"; $fa-var-star: "\f005"; $fa-var-star-half: "\f089"; $fa-var-star-half-empty: "\f123"; $fa-var-star-half-full: "\f123"; $fa-var-star-half-o: "\f123"; $fa-var-star-o: "\f006"; $fa-var-steam: "\f1b6"; $fa-var-steam-square: "\f1b7"; $fa-var-step-backward: "\f048"; $fa-var-step-forward: "\f051"; $fa-var-stethoscope: "\f0f1"; $fa-var-sticky-note: "\f249"; $fa-var-sticky-note-o: "\f24a"; $fa-var-stop: "\f04d"; $fa-var-stop-circle: "\f28d"; $fa-var-stop-circle-o: "\f28e"; $fa-var-street-view: "\f21d"; $fa-var-strikethrough: "\f0cc"; $fa-var-stumbleupon: "\f1a4"; $fa-var-stumbleupon-circle: "\f1a3"; $fa-var-subscript: "\f12c"; $fa-var-subway: "\f239"; $fa-var-suitcase: "\f0f2"; $fa-var-sun-o: "\f185"; $fa-var-superpowers: "\f2dd"; $fa-var-superscript: "\f12b"; $fa-var-support: "\f1cd"; $fa-var-table: "\f0ce"; $fa-var-tablet: "\f10a"; $fa-var-tachometer: "\f0e4"; $fa-var-tag: "\f02b"; $fa-var-tags: "\f02c"; $fa-var-tasks: "\f0ae"; $fa-var-taxi: "\f1ba"; $fa-var-telegram: "\f2c6"; $fa-var-television: "\f26c"; $fa-var-tencent-weibo: "\f1d5"; $fa-var-terminal: "\f120"; $fa-var-text-height: "\f034"; $fa-var-text-width: "\f035"; $fa-var-th: "\f00a"; $fa-var-th-large: "\f009"; $fa-var-th-list: "\f00b"; $fa-var-themeisle: "\f2b2"; $fa-var-thermometer: "\f2c7"; $fa-var-thermometer-0: "\f2cb"; $fa-var-thermometer-1: "\f2ca"; $fa-var-thermometer-2: "\f2c9"; $fa-var-thermometer-3: "\f2c8"; $fa-var-thermometer-4: "\f2c7"; $fa-var-thermometer-empty: "\f2cb"; $fa-var-thermometer-full: "\f2c7"; $fa-var-thermometer-half: "\f2c9"; $fa-var-thermometer-quarter: "\f2ca"; $fa-var-thermometer-three-quarters: "\f2c8"; $fa-var-thumb-tack: "\f08d"; $fa-var-thumbs-down: "\f165"; $fa-var-thumbs-o-down: "\f088"; $fa-var-thumbs-o-up: "\f087"; $fa-var-thumbs-up: "\f164"; $fa-var-ticket: "\f145"; $fa-var-times: "\f00d"; $fa-var-times-circle: "\f057"; $fa-var-times-circle-o: "\f05c"; $fa-var-times-rectangle: "\f2d3"; $fa-var-times-rectangle-o: "\f2d4"; $fa-var-tint: "\f043"; $fa-var-toggle-down: "\f150"; $fa-var-toggle-left: "\f191"; $fa-var-toggle-off: "\f204"; $fa-var-toggle-on: "\f205"; $fa-var-toggle-right: "\f152"; $fa-var-toggle-up: "\f151"; $fa-var-trademark: "\f25c"; $fa-var-train: "\f238"; $fa-var-transgender: "\f224"; $fa-var-transgender-alt: "\f225"; $fa-var-trash: "\f1f8"; $fa-var-trash-o: "\f014"; $fa-var-tree: "\f1bb"; $fa-var-trello: "\f181"; $fa-var-tripadvisor: "\f262"; $fa-var-trophy: "\f091"; $fa-var-truck: "\f0d1"; $fa-var-try: "\f195"; $fa-var-tty: "\f1e4"; $fa-var-tumblr: "\f173"; $fa-var-tumblr-square: "\f174"; $fa-var-turkish-lira: "\f195"; $fa-var-tv: "\f26c"; $fa-var-twitch: "\f1e8"; $fa-var-twitter: "\f099"; $fa-var-twitter-square: "\f081"; $fa-var-umbrella: "\f0e9"; $fa-var-underline: "\f0cd"; $fa-var-undo: "\f0e2"; $fa-var-universal-access: "\f29a"; $fa-var-university: "\f19c"; $fa-var-unlink: "\f127"; $fa-var-unlock: "\f09c"; $fa-var-unlock-alt: "\f13e"; $fa-var-unsorted: "\f0dc"; $fa-var-upload: "\f093"; $fa-var-usb: "\f287"; $fa-var-usd: "\f155"; $fa-var-user: "\f007"; $fa-var-user-circle: "\f2bd"; $fa-var-user-circle-o: "\f2be"; $fa-var-user-md: "\f0f0"; $fa-var-user-o: "\f2c0"; $fa-var-user-plus: "\f234"; $fa-var-user-secret: "\f21b"; $fa-var-user-times: "\f235"; $fa-var-users: "\f0c0"; $fa-var-vcard: "\f2bb"; $fa-var-vcard-o: "\f2bc"; $fa-var-venus: "\f221"; $fa-var-venus-double: "\f226"; $fa-var-venus-mars: "\f228"; $fa-var-viacoin: "\f237"; $fa-var-viadeo: "\f2a9"; $fa-var-viadeo-square: "\f2aa"; $fa-var-video-camera: "\f03d"; $fa-var-vimeo: "\f27d"; $fa-var-vimeo-square: "\f194"; $fa-var-vine: "\f1ca"; $fa-var-vk: "\f189"; $fa-var-volume-control-phone: "\f2a0"; $fa-var-volume-down: "\f027"; $fa-var-volume-off: "\f026"; $fa-var-volume-up: "\f028"; $fa-var-warning: "\f071"; $fa-var-wechat: "\f1d7"; $fa-var-weibo: "\f18a"; $fa-var-weixin: "\f1d7"; $fa-var-whatsapp: "\f232"; $fa-var-wheelchair: "\f193"; $fa-var-wheelchair-alt: "\f29b"; $fa-var-wifi: "\f1eb"; $fa-var-wikipedia-w: "\f266"; $fa-var-window-close: "\f2d3"; $fa-var-window-close-o: "\f2d4"; $fa-var-window-maximize: "\f2d0"; $fa-var-window-minimize: "\f2d1"; $fa-var-window-restore: "\f2d2"; $fa-var-windows: "\f17a"; $fa-var-won: "\f159"; $fa-var-wordpress: "\f19a"; $fa-var-wpbeginner: "\f297"; $fa-var-wpexplorer: "\f2de"; $fa-var-wpforms: "\f298"; $fa-var-wrench: "\f0ad"; $fa-var-xing: "\f168"; $fa-var-xing-square: "\f169"; $fa-var-y-combinator: "\f23b"; $fa-var-y-combinator-square: "\f1d4"; $fa-var-yahoo: "\f19e"; $fa-var-yc: "\f23b"; $fa-var-yc-square: "\f1d4"; $fa-var-yelp: "\f1e9"; $fa-var-yen: "\f157"; $fa-var-yoast: "\f2b1"; $fa-var-youtube: "\f167"; $fa-var-youtube-play: "\f16a"; $fa-var-youtube-square: "\f166";
{ "pile_set_name": "Github" }
-- setup uart at 9600bps by default with echo uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 1); rawcode, reason = node.bootreason(); -- to get to this mode hold the RESET button, then turn power off, -- then release RESET and lastly turn power on if rawcode == 2 and reason == 6 then print("\nWaiting 2.5 seconds before sleep..."); tmr.alarm(0, 2500, tmr.ALARM_SINGLE, function() node.dsleep(0); end); else local fName = "setup.lc"; if file.open(fName) ~= nil then file.close(fName); dofile(fName); else print(fName.." does not exist !"); end end
{ "pile_set_name": "Github" }
<?php /* * Copyright 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ class Google_Service_GameServices_Rule extends Google_Collection { protected $collection_key = 'permissions'; public $action; protected $conditionsType = 'Google_Service_GameServices_Condition'; protected $conditionsDataType = 'array'; public $description; public $in; protected $logConfigType = 'Google_Service_GameServices_LogConfig'; protected $logConfigDataType = 'array'; public $notIn; public $permissions; public function setAction($action) { $this->action = $action; } public function getAction() { return $this->action; } /** * @param Google_Service_GameServices_Condition */ public function setConditions($conditions) { $this->conditions = $conditions; } /** * @return Google_Service_GameServices_Condition */ public function getConditions() { return $this->conditions; } public function setDescription($description) { $this->description = $description; } public function getDescription() { return $this->description; } public function setIn($in) { $this->in = $in; } public function getIn() { return $this->in; } /** * @param Google_Service_GameServices_LogConfig */ public function setLogConfig($logConfig) { $this->logConfig = $logConfig; } /** * @return Google_Service_GameServices_LogConfig */ public function getLogConfig() { return $this->logConfig; } public function setNotIn($notIn) { $this->notIn = $notIn; } public function getNotIn() { return $this->notIn; } public function setPermissions($permissions) { $this->permissions = $permissions; } public function getPermissions() { return $this->permissions; } }
{ "pile_set_name": "Github" }
<div> <div metal:define-macro="test1"> t1.v1:<span metal:define-slot="val1">test1: val1 should go here</span> </div> <div metal:define-macro="test2"> t2.v1:<span metal:define-slot="val1">test2: val1 should go here</span> t2.v2:<span metal:define-slot="val2">test2 OK: unfilled val2</span> </div> <div metal:use-macro="test1"> <div metal:fill-slot="val2">test1: unused invalid val2</div> <div metal:fill-slot="val1" tal:omit-tag=""> <div metal:use-macro="test2"> <span metal:fill-slot="val1">OK: filled from test2/val1</span> </div> </div> </div> </div>
{ "pile_set_name": "Github" }
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package openpgp implements high level operations on OpenPGP messages. package openpgp // import "golang.org/x/crypto/openpgp" import ( "crypto" _ "crypto/sha256" "hash" "io" "strconv" "golang.org/x/crypto/openpgp/armor" "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/packet" ) // SignatureType is the armor type for a PGP signature. var SignatureType = "PGP SIGNATURE" // readArmored reads an armored block with the given type. func readArmored(r io.Reader, expectedType string) (body io.Reader, err error) { block, err := armor.Decode(r) if err != nil { return } if block.Type != expectedType { return nil, errors.InvalidArgumentError("expected '" + expectedType + "', got: " + block.Type) } return block.Body, nil } // MessageDetails contains the result of parsing an OpenPGP encrypted and/or // signed message. type MessageDetails struct { IsEncrypted bool // true if the message was encrypted. EncryptedToKeyIds []uint64 // the list of recipient key ids. IsSymmetricallyEncrypted bool // true if a passphrase could have decrypted the message. DecryptedWith Key // the private key used to decrypt the message, if any. IsSigned bool // true if the message is signed. SignedByKeyId uint64 // the key id of the signer, if any. SignedBy *Key // the key of the signer, if available. LiteralData *packet.LiteralData // the metadata of the contents UnverifiedBody io.Reader // the contents of the message. // If IsSigned is true and SignedBy is non-zero then the signature will // be verified as UnverifiedBody is read. The signature cannot be // checked until the whole of UnverifiedBody is read so UnverifiedBody // must be consumed until EOF before the data can be trusted. Even if a // message isn't signed (or the signer is unknown) the data may contain // an authentication code that is only checked once UnverifiedBody has // been consumed. Once EOF has been seen, the following fields are // valid. (An authentication code failure is reported as a // SignatureError error when reading from UnverifiedBody.) SignatureError error // nil if the signature is good. Signature *packet.Signature // the signature packet itself, if v4 (default) SignatureV3 *packet.SignatureV3 // the signature packet if it is a v2 or v3 signature decrypted io.ReadCloser } // A PromptFunction is used as a callback by functions that may need to decrypt // a private key, or prompt for a passphrase. It is called with a list of // acceptable, encrypted private keys and a boolean that indicates whether a // passphrase is usable. It should either decrypt a private key or return a // passphrase to try. If the decrypted private key or given passphrase isn't // correct, the function will be called again, forever. Any error returned will // be passed up. type PromptFunction func(keys []Key, symmetric bool) ([]byte, error) // A keyEnvelopePair is used to store a private key with the envelope that // contains a symmetric key, encrypted with that key. type keyEnvelopePair struct { key Key encryptedKey *packet.EncryptedKey } // ReadMessage parses an OpenPGP message that may be signed and/or encrypted. // The given KeyRing should contain both public keys (for signature // verification) and, possibly encrypted, private keys for decrypting. // If config is nil, sensible defaults will be used. func ReadMessage(r io.Reader, keyring KeyRing, prompt PromptFunction, config *packet.Config) (md *MessageDetails, err error) { var p packet.Packet var symKeys []*packet.SymmetricKeyEncrypted var pubKeys []keyEnvelopePair var se *packet.SymmetricallyEncrypted packets := packet.NewReader(r) md = new(MessageDetails) md.IsEncrypted = true // The message, if encrypted, starts with a number of packets // containing an encrypted decryption key. The decryption key is either // encrypted to a public key, or with a passphrase. This loop // collects these packets. ParsePackets: for { p, err = packets.Next() if err != nil { return nil, err } switch p := p.(type) { case *packet.SymmetricKeyEncrypted: // This packet contains the decryption key encrypted with a passphrase. md.IsSymmetricallyEncrypted = true symKeys = append(symKeys, p) case *packet.EncryptedKey: // This packet contains the decryption key encrypted to a public key. md.EncryptedToKeyIds = append(md.EncryptedToKeyIds, p.KeyId) switch p.Algo { case packet.PubKeyAlgoRSA, packet.PubKeyAlgoRSAEncryptOnly, packet.PubKeyAlgoElGamal: break default: continue } var keys []Key if p.KeyId == 0 { keys = keyring.DecryptionKeys() } else { keys = keyring.KeysById(p.KeyId) } for _, k := range keys { pubKeys = append(pubKeys, keyEnvelopePair{k, p}) } case *packet.SymmetricallyEncrypted: se = p break ParsePackets case *packet.Compressed, *packet.LiteralData, *packet.OnePassSignature: // This message isn't encrypted. if len(symKeys) != 0 || len(pubKeys) != 0 { return nil, errors.StructuralError("key material not followed by encrypted message") } packets.Unread(p) return readSignedMessage(packets, nil, keyring) } } var candidates []Key var decrypted io.ReadCloser // Now that we have the list of encrypted keys we need to decrypt at // least one of them or, if we cannot, we need to call the prompt // function so that it can decrypt a key or give us a passphrase. FindKey: for { // See if any of the keys already have a private key available candidates = candidates[:0] candidateFingerprints := make(map[string]bool) for _, pk := range pubKeys { if pk.key.PrivateKey == nil { continue } if !pk.key.PrivateKey.Encrypted { if len(pk.encryptedKey.Key) == 0 { pk.encryptedKey.Decrypt(pk.key.PrivateKey, config) } if len(pk.encryptedKey.Key) == 0 { continue } decrypted, err = se.Decrypt(pk.encryptedKey.CipherFunc, pk.encryptedKey.Key) if err != nil && err != errors.ErrKeyIncorrect { return nil, err } if decrypted != nil { md.DecryptedWith = pk.key break FindKey } } else { fpr := string(pk.key.PublicKey.Fingerprint[:]) if v := candidateFingerprints[fpr]; v { continue } candidates = append(candidates, pk.key) candidateFingerprints[fpr] = true } } if len(candidates) == 0 && len(symKeys) == 0 { return nil, errors.ErrKeyIncorrect } if prompt == nil { return nil, errors.ErrKeyIncorrect } passphrase, err := prompt(candidates, len(symKeys) != 0) if err != nil { return nil, err } // Try the symmetric passphrase first if len(symKeys) != 0 && passphrase != nil { for _, s := range symKeys { key, cipherFunc, err := s.Decrypt(passphrase) if err == nil { decrypted, err = se.Decrypt(cipherFunc, key) if err != nil && err != errors.ErrKeyIncorrect { return nil, err } if decrypted != nil { break FindKey } } } } } md.decrypted = decrypted if err := packets.Push(decrypted); err != nil { return nil, err } return readSignedMessage(packets, md, keyring) } // readSignedMessage reads a possibly signed message if mdin is non-zero then // that structure is updated and returned. Otherwise a fresh MessageDetails is // used. func readSignedMessage(packets *packet.Reader, mdin *MessageDetails, keyring KeyRing) (md *MessageDetails, err error) { if mdin == nil { mdin = new(MessageDetails) } md = mdin var p packet.Packet var h hash.Hash var wrappedHash hash.Hash FindLiteralData: for { p, err = packets.Next() if err != nil { return nil, err } switch p := p.(type) { case *packet.Compressed: if err := packets.Push(p.Body); err != nil { return nil, err } case *packet.OnePassSignature: if !p.IsLast { return nil, errors.UnsupportedError("nested signatures") } h, wrappedHash, err = hashForSignature(p.Hash, p.SigType) if err != nil { md = nil return } md.IsSigned = true md.SignedByKeyId = p.KeyId keys := keyring.KeysByIdUsage(p.KeyId, packet.KeyFlagSign) if len(keys) > 0 { md.SignedBy = &keys[0] } case *packet.LiteralData: md.LiteralData = p break FindLiteralData } } if md.SignedBy != nil { md.UnverifiedBody = &signatureCheckReader{packets, h, wrappedHash, md} } else if md.decrypted != nil { md.UnverifiedBody = checkReader{md} } else { md.UnverifiedBody = md.LiteralData.Body } return md, nil } // hashForSignature returns a pair of hashes that can be used to verify a // signature. The signature may specify that the contents of the signed message // should be preprocessed (i.e. to normalize line endings). Thus this function // returns two hashes. The second should be used to hash the message itself and // performs any needed preprocessing. func hashForSignature(hashId crypto.Hash, sigType packet.SignatureType) (hash.Hash, hash.Hash, error) { if !hashId.Available() { return nil, nil, errors.UnsupportedError("hash not available: " + strconv.Itoa(int(hashId))) } h := hashId.New() switch sigType { case packet.SigTypeBinary: return h, h, nil case packet.SigTypeText: return h, NewCanonicalTextHash(h), nil } return nil, nil, errors.UnsupportedError("unsupported signature type: " + strconv.Itoa(int(sigType))) } // checkReader wraps an io.Reader from a LiteralData packet. When it sees EOF // it closes the ReadCloser from any SymmetricallyEncrypted packet to trigger // MDC checks. type checkReader struct { md *MessageDetails } func (cr checkReader) Read(buf []byte) (n int, err error) { n, err = cr.md.LiteralData.Body.Read(buf) if err == io.EOF { mdcErr := cr.md.decrypted.Close() if mdcErr != nil { err = mdcErr } } return } // signatureCheckReader wraps an io.Reader from a LiteralData packet and hashes // the data as it is read. When it sees an EOF from the underlying io.Reader // it parses and checks a trailing Signature packet and triggers any MDC checks. type signatureCheckReader struct { packets *packet.Reader h, wrappedHash hash.Hash md *MessageDetails } func (scr *signatureCheckReader) Read(buf []byte) (n int, err error) { n, err = scr.md.LiteralData.Body.Read(buf) scr.wrappedHash.Write(buf[:n]) if err == io.EOF { var p packet.Packet p, scr.md.SignatureError = scr.packets.Next() if scr.md.SignatureError != nil { return } var ok bool if scr.md.Signature, ok = p.(*packet.Signature); ok { scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignature(scr.h, scr.md.Signature) } else if scr.md.SignatureV3, ok = p.(*packet.SignatureV3); ok { scr.md.SignatureError = scr.md.SignedBy.PublicKey.VerifySignatureV3(scr.h, scr.md.SignatureV3) } else { scr.md.SignatureError = errors.StructuralError("LiteralData not followed by Signature") return } // The SymmetricallyEncrypted packet, if any, might have an // unsigned hash of its own. In order to check this we need to // close that Reader. if scr.md.decrypted != nil { mdcErr := scr.md.decrypted.Close() if mdcErr != nil { err = mdcErr } } } return } // CheckDetachedSignature takes a signed file and a detached signature and // returns the signer if the signature is valid. If the signer isn't known, // ErrUnknownIssuer is returned. func CheckDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) { var issuerKeyId uint64 var hashFunc crypto.Hash var sigType packet.SignatureType var keys []Key var p packet.Packet packets := packet.NewReader(signature) for { p, err = packets.Next() if err == io.EOF { return nil, errors.ErrUnknownIssuer } if err != nil { return nil, err } switch sig := p.(type) { case *packet.Signature: if sig.IssuerKeyId == nil { return nil, errors.StructuralError("signature doesn't have an issuer") } issuerKeyId = *sig.IssuerKeyId hashFunc = sig.Hash sigType = sig.SigType case *packet.SignatureV3: issuerKeyId = sig.IssuerKeyId hashFunc = sig.Hash sigType = sig.SigType default: return nil, errors.StructuralError("non signature packet found") } keys = keyring.KeysByIdUsage(issuerKeyId, packet.KeyFlagSign) if len(keys) > 0 { break } } if len(keys) == 0 { panic("unreachable") } h, wrappedHash, err := hashForSignature(hashFunc, sigType) if err != nil { return nil, err } if _, err := io.Copy(wrappedHash, signed); err != nil && err != io.EOF { return nil, err } for _, key := range keys { switch sig := p.(type) { case *packet.Signature: err = key.PublicKey.VerifySignature(h, sig) case *packet.SignatureV3: err = key.PublicKey.VerifySignatureV3(h, sig) default: panic("unreachable") } if err == nil { return key.Entity, nil } } return nil, err } // CheckArmoredDetachedSignature performs the same actions as // CheckDetachedSignature but expects the signature to be armored. func CheckArmoredDetachedSignature(keyring KeyRing, signed, signature io.Reader) (signer *Entity, err error) { body, err := readArmored(signature, SignatureType) if err != nil { return } return CheckDetachedSignature(keyring, signed, body) }
{ "pile_set_name": "Github" }
// Copyright 2017 DAIMTO ([Linda Lawton](https://twitter.com/LindaLawtonDK)) : [www.daimto.com](http://www.daimto.com/) // // 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. //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by DAIMTO-Google-apis-Sample-generator 1.0.0 // Template File Name: methodTemplate.tt // Build date: 2017-10-08 // C# generater version: 1.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ // About // // Unoffical sample for the Fusiontables v2 API for C#. // This sample is designed to be used with the Google .Net client library. (https://github.com/google/google-api-dotnet-client) // // API Description: API for working with Fusion Tables data. // API Documentation Link https://developers.google.com/fusiontables // // Discovery Doc https://www.googleapis.com/discovery/v1/apis/Fusiontables/v2/rest // //------------------------------------------------------------------------------ // Installation // // This sample code uses the Google .Net client library (https://github.com/google/google-api-dotnet-client) // // NuGet package: // // Location: https://www.nuget.org/packages/Google.Apis.Fusiontables.v2/ // Install Command: PM> Install-Package Google.Apis.Fusiontables.v2 // //------------------------------------------------------------------------------ using Google.Apis.Fusiontables.v2; using Google.Apis.Fusiontables.v2.Data; using System; namespace GoogleSamplecSharpSample.Fusiontablesv2.Methods { public static class StyleSample { /// <summary> /// Deletes a style. /// Documentation https://developers.google.com/fusiontables/v2/reference/style/delete /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Fusiontables service.</param> /// <param name="tableId">Table from which the style is being deleted</param> /// <param name="styleId">Identifier (within a table) for the style being deleted</param> public static void Delete(FusiontablesService service, string tableId, int? styleId) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (tableId == null) throw new ArgumentNullException(tableId); if (styleId == null) throw new ArgumentNullException(styleId); // Make the request. service.Style.Delete(tableId, styleId).Execute(); } catch (Exception ex) { throw new Exception("Request Style.Delete failed.", ex); } } /// <summary> /// Gets a specific style. /// Documentation https://developers.google.com/fusiontables/v2/reference/style/get /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Fusiontables service.</param> /// <param name="tableId">Table to which the requested style belongs</param> /// <param name="styleId">Identifier (integer) for a specific style in a table</param> /// <returns>StyleSettingResponse</returns> public static StyleSetting Get(FusiontablesService service, string tableId, int? styleId) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (tableId == null) throw new ArgumentNullException(tableId); if (styleId == null) throw new ArgumentNullException(styleId); // Make the request. return service.Style.Get(tableId, styleId).Execute(); } catch (Exception ex) { throw new Exception("Request Style.Get failed.", ex); } } /// <summary> /// Adds a new style for the table. /// Documentation https://developers.google.com/fusiontables/v2/reference/style/insert /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Fusiontables service.</param> /// <param name="tableId">Table for which a new style is being added</param> /// <param name="body">A valid Fusiontables v2 body.</param> /// <returns>StyleSettingResponse</returns> public static StyleSetting Insert(FusiontablesService service, string tableId, StyleSetting body) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (body == null) throw new ArgumentNullException("body"); if (tableId == null) throw new ArgumentNullException(tableId); // Make the request. return service.Style.Insert(body, tableId).Execute(); } catch (Exception ex) { throw new Exception("Request Style.Insert failed.", ex); } } public class StyleListOptionalParms { /// Maximum number of styles to return. Optional. Default is 5. public int? MaxResults { get; set; } /// Continuation token specifying which result page to return. Optional. public string PageToken { get; set; } } /// <summary> /// Retrieves a list of styles. /// Documentation https://developers.google.com/fusiontables/v2/reference/style/list /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Fusiontables service.</param> /// <param name="tableId">Table whose styles are being listed</param> /// <param name="optional">Optional paramaters.</param> /// <returns>StyleSettingListResponse</returns> public static StyleSettingList List(FusiontablesService service, string tableId, StyleListOptionalParms optional = null) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (tableId == null) throw new ArgumentNullException(tableId); // Building the initial request. var request = service.Style.List(tableId); // Applying optional parameters to the request. request = (StyleResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional); // Requesting data. return request.Execute(); } catch (Exception ex) { throw new Exception("Request Style.List failed.", ex); } } /// <summary> /// Updates an existing style. This method supports patch semantics. /// Documentation https://developers.google.com/fusiontables/v2/reference/style/patch /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Fusiontables service.</param> /// <param name="tableId">Table whose style is being updated.</param> /// <param name="styleId">Identifier (within a table) for the style being updated.</param> /// <param name="body">A valid Fusiontables v2 body.</param> /// <returns>StyleSettingResponse</returns> public static StyleSetting Patch(FusiontablesService service, string tableId, int? styleId, StyleSetting body) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (body == null) throw new ArgumentNullException("body"); if (tableId == null) throw new ArgumentNullException(tableId); if (styleId == null) throw new ArgumentNullException(styleId); // Make the request. return service.Style.Patch(body, tableId, styleId).Execute(); } catch (Exception ex) { throw new Exception("Request Style.Patch failed.", ex); } } /// <summary> /// Updates an existing style. /// Documentation https://developers.google.com/fusiontables/v2/reference/style/update /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Fusiontables service.</param> /// <param name="tableId">Table whose style is being updated.</param> /// <param name="styleId">Identifier (within a table) for the style being updated.</param> /// <param name="body">A valid Fusiontables v2 body.</param> /// <returns>StyleSettingResponse</returns> public static StyleSetting Update(FusiontablesService service, string tableId, int? styleId, StyleSetting body) { try { // Initial validation. if (service == null) throw new ArgumentNullException("service"); if (body == null) throw new ArgumentNullException("body"); if (tableId == null) throw new ArgumentNullException(tableId); if (styleId == null) throw new ArgumentNullException(styleId); // Make the request. return service.Style.Update(body, tableId, styleId).Execute(); } catch (Exception ex) { throw new Exception("Request Style.Update failed.", ex); } } } public static class SampleHelpers { /// <summary> /// Using reflection to apply optional parameters to the request. /// /// If the optonal parameters are null then we will just return the request as is. /// </summary> /// <param name="request">The request. </param> /// <param name="optional">The optional parameters. </param> /// <returns></returns> public static object ApplyOptionalParms(object request, object optional) { if (optional == null) return request; System.Reflection.PropertyInfo[] optionalProperties = (optional.GetType()).GetProperties(); foreach (System.Reflection.PropertyInfo property in optionalProperties) { // Copy value from optional parms to the request. They should have the same names and datatypes. System.Reflection.PropertyInfo piShared = (request.GetType()).GetProperty(property.Name); if (property.GetValue(optional, null) != null) // TODO Test that we do not add values for items that are null piShared.SetValue(request, property.GetValue(optional, null), null); } return request; } } }
{ "pile_set_name": "Github" }
# custom_paint_example A new Flutter project. ## Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is your first Flutter project: - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) For help getting started with Flutter, view our [online documentation](https://flutter.io/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference.
{ "pile_set_name": "Github" }
CSS.AllowTricky TYPE: bool DEFAULT: false VERSION: 3.1.0 --DESCRIPTION-- This parameter determines whether or not to allow "tricky" CSS properties and values. Tricky CSS properties/values can drastically modify page layout or be used for deceptive practices but do not directly constitute a security risk. For example, <code>display:none;</code> is considered a tricky property that will only be allowed if this directive is set to true. --# vim: et sw=4 sts=4
{ "pile_set_name": "Github" }
{ "language": "x86-64-assembly", "slug": "x86-64-assembly", "active": true, "blurb": "x86-64 assembly is a low-level programming language, typically used in boot loaders, device drivers, and operating system kernels.", "version": 3, "online_editor": { "indent_style": "space", "indent_size": 4 }, "exercises": { "concept": [ { "slug": "basics", "uuid": "0e1dd0cf-cdd7-48a9-861e-7253b5d3cabd", "concepts": ["basics"], "prerequisites": [] } ], "practice": [] } }
{ "pile_set_name": "Github" }
#include "io.h" int main(void) { long long rs, rt, ach, acl; long long result, resulth, resultl; rs = 0x00FFBBAA; rt = 0x4B231000; resulth = 0x4b0f01; resultl = 0x71f8a000; __asm ("mult $ac1, %2, %3\n\t" "mfhi %0, $ac1\n\t" "mflo %1, $ac1\n\t" : "=r"(ach), "=r"(acl) : "r"(rs), "r"(rt) ); if ((ach != resulth) || (acl != resultl)) { printf("mult wrong\n"); return -1; } return 0; }
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <!-- The file is converted from allegro_hand_description_left.xacro from the unofficial ROS package of Allegro Hand (https://github.com/felixduvallet/ allegro-hand-ros/tree/master/allegro_hand_description). The conversion is applied using the ROS package xacro to convert into urdf files. The model files (.obj files and .mtl files) are converted from the .STL files from the same source. The physical parameters of the model in the cited unofficial fork of the Allegro hand have non-physical values. More precisely, many of the inertia matrices are not SPD. Therefore we recomputed all the inertia matrices for this URDF model in Drake. These values are estimated from the provided geometry and using a constant density approximation on each component. We used the best available value of mass available to us. Joint damping values are estimated based on the expected angular velocity of each joint and using a typical load of about 200 gr being held by the hand. This allows us to estimate a typical torque at the joints which, together with a nominal value of angular velocity, allows us to estimate a reasonable magnitude for joint damping. It is worth noting that the unofficial version of these files were providing non-physical values as much as 300 times larger. The effort limits of the joints are justified to 0.7 Nm according to the manufacturer's specs (http://www.simlab.co.kr/Allegro-Hand.htm# Specifications). The collision geometry for link_13 (thumb base) has been omitted in this version. It frequently led to meaningless collisions with other hand geometries but its omission is justified because it is small enough that its removal is unlikely to cause us to miss meaningful collisions. --> <robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="allegro_hand_left"> <!-- Base link --> <link name="hand_root"> <origin xyz="0 0 0"/> </link> <joint name="root_to_base" type="fixed"> <parent link="hand_root"/> <child link="palm_link"/> <origin xyz="0 0 0.095"/> </joint> <!-- PALM --> <link name="palm_link"> <visual> <geometry> <mesh filename="../meshes/base_link_left.obj"/> </geometry> <origin rpy="-1.5707963259 0 0" xyz="0 0 0 "/> <material name="black"> <color rgba="0.2 0.2 0.2 1"/> </material> </visual> <collision> <origin rpy="0 0 0" xyz="-0.009300 0 -0.0475"/> <geometry> <box size="0.0408 0.1130 0.095"/> </geometry> </collision> <inertial> <origin rpy="0 0 0" xyz="0 0 0"/> <mass value="0.4154"/> <inertia ixx="2.089e-03" ixy="-0.0036e-03" ixz="0.2233e-03" iyy="1.829e-03" iyz="-0.018e-03" izz="0.4825e-03"/> </inertial> </link> <!-- [LINK 0, 4, 8] --> <link name="link_8"> <visual> <geometry> <mesh filename="../meshes/link_0.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0164"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.0082"/> </collision> <inertial> <mass value="0.0119"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.95377e-06" ixy="3.03372e-09" ixz="8.92323e-08" iyy="1.17908e-06" iyz="-3.7069e-08" izz="1.49673e-06"/> </inertial> </link> <joint name="joint_8" type="revolute"> <axis xyz="0 0 -1"/> <limit effort="0.7" lower="-0.47" upper="0.47" velocity="7"/> <parent link="palm_link"/> <child link="link_8"/> <origin rpy="0.08726646255 0 0" xyz="0 0.0435 -0.001542"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_8_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_8_motor"/> <joint name="joint_8"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 1, 5, 9] --> <link name="link_9"> <visual> <geometry> <mesh filename="../meshes/link_1.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.054"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.027"/> </collision> <inertial> <mass value="0.065"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="7.192e-05" ixy="0" ixz="0" iyy="7.438e-05" iyz="7.322e-07" izz="5.406e-06"/> </inertial> </link> <joint name="joint_9" type="revolute"> <limit effort="0.7" lower="-0.196" upper="1.61" velocity="7"/> <axis xyz="0 1 0"/> <parent link="link_8"/> <child link="link_9"/> <origin xyz="0 0 0.0164"/> <dynamics damping="1.5e-2" friction="5"/> </joint> <transmission name="joint_9_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_9_motor"/> <joint name="joint_9"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 2, 6, 10]--> <link name="link_10"> <visual> <geometry> <mesh filename="../meshes/link_2.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0384"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.0192"/> </collision> <inertial> <mass value="0.0355"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="3.16925e-05" ixy="1.07094e-09" ixz="-4.91273e-09" iyy="3.10516e-05" iyz="3.87549e-08" izz="3.20319e-06"/> </inertial> </link> <joint name="joint_10" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.174" upper="1.709" velocity="7"/> <parent link="link_9"/> <child link="link_10"/> <origin xyz="0 0 0.054"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_10_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_10_motor"/> <joint name="joint_10"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 3, 7, 11] --> <link name="link_11"> <visual> <geometry> <mesh filename="../meshes/link_3.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0267"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.01335"/> </collision> <inertial> <mass value="0.0096"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="2.13975e-06" ixy="1.59554e-09" ixz="-7.47528e-09" iyy="1.52036e-06" iyz="-9.89336e-09" izz="1.20271e-06"/> </inertial> </link> <joint name="joint_11" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.227" upper="1.618" velocity="7"/> <parent link="link_10"/> <child link="link_11"/> <origin xyz="0 0 0.0384"/> <dynamics damping="1.5e-2" friction="12"/> </joint> <transmission name="joint_11_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_11_motor"/> <joint name="joint_11"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [FINGER TIP] --> <link name="link_11_tip"> <visual> <geometry> <mesh filename="../meshes/link_3.0_tip.obj"/> </geometry> <material name="white"> <color rgba=".9 .9 .9 1"/> </material> </visual> <collision> <geometry> <sphere radius="0.012"/> </geometry> </collision> <inertial> <mass value="0.0168"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.19599e-05" ixy="0" ixz="0" iyy="1.19598e-05" iyz="0" izz="1.10345e-06"/> </inertial> </link> <joint name="joint_11_tip" type="fixed"> <parent link="link_11"/> <child link="link_11_tip"/> <origin rpy="0 0 0" xyz="0 0 0.0267"/> </joint> <!-- [LINK 0, 4, 8] --> <link name="link_4"> <visual> <geometry> <mesh filename="../meshes/link_0.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0164"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.0082"/> </collision> <inertial> <mass value="0.0119"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.95377e-06" ixy="3.03372e-09" ixz="8.92323e-08" iyy="1.17908e-06" iyz="-3.7069e-08" izz="1.49673e-06"/> </inertial> </link> <joint name="joint_4" type="revolute"> <axis xyz="0 0 -1"/> <limit effort="0.7" lower="-0.47" upper="0.47" velocity="7"/> <parent link="palm_link"/> <child link="link_4"/> <origin rpy="0.0 0 0" xyz="0 0 0.0007"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_4_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_4_motor"/> <joint name="joint_4"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 1, 5, 9] --> <link name="link_5"> <visual> <geometry> <mesh filename="../meshes/link_1.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.054"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.027"/> </collision> <inertial> <mass value="0.065"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="7.19218e-05" ixy="0" ixz="0" iyy="7.4377e-05" iyz="7.32186e-07" izz="5.40622e-06"/> </inertial> </link> <joint name="joint_5" type="revolute"> <limit effort="0.7" lower="-0.196" upper="1.61" velocity="7"/> <axis xyz="0 1 0"/> <parent link="link_4"/> <child link="link_5"/> <origin xyz="0 0 0.0164"/> <dynamics damping="1.5e-2" friction="5"/> </joint> <transmission name="joint_5_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_5_motor"/> <joint name="joint_5"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 2, 6, 10]--> <link name="link_6"> <visual> <geometry> <mesh filename="../meshes/link_2.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0384"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.0192"/> </collision> <inertial> <mass value="0.0355"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="3.16925e-05" ixy="1.07094e-09" ixz="-4.91273e-09" iyy="3.10516e-05" iyz="3.87549e-08" izz="3.20319e-06"/> </inertial> </link> <joint name="joint_6" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.174" upper="1.709" velocity="7"/> <parent link="link_5"/> <child link="link_6"/> <origin xyz="0 0 0.054"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_6_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_6_motor"/> <joint name="joint_6"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 3, 7, 11] --> <link name="link_7"> <visual> <geometry> <mesh filename="../meshes/link_3.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0267"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.01335"/> </collision> <inertial> <mass value="0.0096"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="2.13975e-06" ixy="1.59554e-09" ixz="-7.47528e-09" iyy="1.52036e-06" iyz="-9.89336e-09" izz="1.20271e-06"/> </inertial> </link> <joint name="joint_7" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.227" upper="1.618" velocity="7"/> <parent link="link_6"/> <child link="link_7"/> <origin xyz="0 0 0.0384"/> <dynamics damping="1.5e-2" friction="12"/> </joint> <transmission name="joint_7_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_7_motor"/> <joint name="joint_7"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [FINGER TIP] --> <link name="link_7_tip"> <visual> <geometry> <mesh filename="../meshes/link_3.0_tip.obj"/> </geometry> <material name="white"> <color rgba=".9 .9 .9 1"/> </material> </visual> <collision> <geometry> <sphere radius="0.012"/> </geometry> </collision> <inertial> <mass value="0.0168"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.19599e-05" ixy="0" ixz="0" iyy="1.19598e-05" iyz="0" izz="1.10345e-06"/> </inertial> </link> <joint name="joint_7_tip" type="fixed"> <parent link="link_7"/> <child link="link_7_tip"/> <origin rpy="0 0 0" xyz="0 0 0.0267"/> </joint> <!-- [LINK 0, 4, 8] --> <link name="link_0"> <visual> <geometry> <mesh filename="../meshes/link_0.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0164"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.0082"/> </collision> <inertial> <mass value="0.0119"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.95377e-06" ixy="3.03372e-09" ixz="8.92323e-08" iyy="1.17908e-06" iyz="-3.7069e-08" izz="1.49673e-06"/> </inertial> </link> <joint name="joint_0" type="revolute"> <axis xyz="0 0 -1"/> <limit effort="0.7" lower="-0.47" upper="0.47" velocity="7"/> <parent link="palm_link"/> <child link="link_0"/> <origin rpy="0.08726646255 0 0" xyz="0 -0.0435 -0.001542"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_0_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_0_motor"/> <joint name="joint_0"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 1, 5, 9] --> <link name="link_1"> <visual> <geometry> <mesh filename="../meshes/link_1.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.054"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.027"/> </collision> <inertial> <mass value="0.065"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="7.19218e-05" ixy="0" ixz="0" iyy="7.4377e-05" iyz="7.32186e-07" izz="5.40622e-06"/> </inertial> </link> <joint name="joint_1" type="revolute"> <limit effort="0.7" lower="-0.196" upper="1.61" velocity="7"/> <axis xyz="0 1 0"/> <parent link="link_0"/> <child link="link_1"/> <origin xyz="0 0 0.0164"/> <dynamics damping="1.5e-2" friction="5"/> </joint> <transmission name="joint_1_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_1_motor"/> <joint name="joint_1"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 2, 6, 10]--> <link name="link_2"> <visual> <geometry> <mesh filename="../meshes/link_2.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0384"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.0192"/> </collision> <inertial> <mass value="0.0355"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="3.16925e-05" ixy="1.07094e-09" ixz="-4.91273e-09" iyy="3.10516e-05" iyz="3.87549e-08" izz="3.20319e-06"/> </inertial> </link> <joint name="joint_2" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.174" upper="1.709" velocity="7"/> <parent link="link_1"/> <child link="link_2"/> <origin xyz="0 0 0.054"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_2_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_2_motor"/> <joint name="joint_2"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 3, 7, 11] --> <link name="link_3"> <visual> <geometry> <mesh filename="../meshes/link_3.0.obj"/> </geometry> <material name="black"/> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0267"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.01335"/> </collision> <inertial> <mass value="0.0096"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="2.13975e-06" ixy="1.59554e-09" ixz="-7.47528e-09" iyy="1.52036e-06" iyz="-9.89336e-09" izz="1.20271e-06"/> </inertial> </link> <joint name="joint_3" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.227" upper="1.618" velocity="7"/> <parent link="link_2"/> <child link="link_3"/> <origin xyz="0 0 0.0384"/> <dynamics damping="1.5e-2" friction="12"/> </joint> <transmission name="joint_3_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_3_motor"/> <joint name="joint_3"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [FINGER TIP] --> <link name="link_3_tip"> <visual> <geometry> <mesh filename="../meshes/link_3.0_tip.obj"/> </geometry> <material name="white"> <color rgba=".9 .9 .9 1"/> </material> </visual> <collision> <geometry> <sphere radius="0.012"/> </geometry> </collision> <inertial> <mass value="0.0168"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.19599e-05" ixy="0" ixz="0" iyy="1.19598e-05" iyz="0" izz="1.10345e-06"/> </inertial> </link> <joint name="joint_3_tip" type="fixed"> <parent link="link_3"/> <child link="link_3_tip"/> <origin rpy="0 0 0" xyz="0 0 0.0267"/> </joint> <!-- [LINK 12] --> <link name="link_12"> <visual> <geometry> <mesh filename="../meshes/link_12.0_left.obj"/> </geometry> <material name="black"> <color rgba=".2 .2 .2 1"/> </material> <origin rpy="3.1415926518 0 0" xyz="0 0 0"/> </visual> <collision> <geometry> <box size="0.0358 0.034 0.0455"/> </geometry> <origin rpy="0 0 0" xyz="-0.0179 0.009 0.0145"/> </collision> <inertial> <mass value="0.0176"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="8.13883e-06" ixy="-2.55226e-06" ixz="3.89933e-06" iyy="1.31421e-05" iyz="1.46267e-06" izz="1.00171e-05"/> </inertial> </link> <joint name="joint_12" type="revolute"> <axis xyz="1 0 0"/> <limit effort="0.7" lower="0.263" upper="1.396" velocity="7"/> <parent link="palm_link"/> <child link="link_12"/> <origin rpy="0 -1.65806278845 1.5707963259" xyz="-0.0182 -0.019333 -0.045987"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_12_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_12_motor"/> <joint name="joint_12"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 13] --> <link name="link_13"> <visual> <geometry> <mesh filename="../meshes/link_13.0.obj"/> </geometry> <material name="black"> <color rgba=".2 .2 .2 1"/> </material> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0177"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.00885"/> </collision> <inertial> <mass value="0.0119"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.9263e-06" ixy="3.05433e-09" ixz="8.86582e-08" iyy="1.15276e-06" iyz="-3.64521e-08" izz="1.4957e-06"/> </inertial> </link> <joint name="joint_13" type="revolute"> <axis xyz="0 0 -1"/> <limit effort="0.7" lower="-0.105" upper="1.163" velocity="7"/> <parent link="link_12"/> <child link="link_13"/> <origin xyz="-0.027 -0.005 0.0399"/> <dynamics damping="1.5e-2" friction="5"/> </joint> <transmission name="joint_13_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_13_motor"/> <joint name="joint_13"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 14] --> <link name="link_14"> <visual> <geometry> <mesh filename="../meshes/link_14.0.obj"/> </geometry> <material name="black"> </material> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0514"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.0257"/> </collision> <inertial> <mass value="0.038"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="3.67044e-05" ixy="1.02277e-09" ixz="1.4854e-07" iyy="3.54042e-05" iyz="-3.67203e-08" izz="3.63275e-06"/> </inertial> </link> <joint name="joint_14" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.189" upper="1.644" velocity="7"/> <parent link="link_13"/> <child link="link_14"/> <origin xyz="0 0 0.0177"/> <dynamics damping="1.5e-2" friction="10"/> </joint> <transmission name="joint_14_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_14_motor"/> <joint name="joint_14"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [LINK 15] --> <link name="link_15"> <visual> <geometry> <mesh filename="../meshes/link_15.0.obj"/> </geometry> <material name="black"> </material> </visual> <collision> <geometry> <box size="0.0196 0.0275 0.0423"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0.02115"/> </collision> <inertial> <mass value="0.0388"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="4.30919e-05" ixy="0" ixz="0" iyy="3.85425e-05" iyz="-3.0146e-08" izz="1.72974e-05"/> </inertial> </link> <joint name="joint_15" type="revolute"> <axis xyz="0 1 0"/> <limit effort="0.7" lower="-0.162" upper="1.719" velocity="7"/> <parent link="link_14"/> <child link="link_15"/> <origin xyz="0 0 0.0514"/> <dynamics damping="1.5e-2" friction="12"/> </joint> <transmission name="joint_15_trans" type="transmission_interface/SimpleTransmission"> <actuator name="joint_15_motor"/> <joint name="joint_15"/> <mechanicalReduction>1</mechanicalReduction> <motorTorqueConstant>1</motorTorqueConstant> </transmission> <!-- [FINGER TIP] --> <link name="link_15_tip"> <visual> <geometry> <mesh filename="../meshes/link_15.0_tip.obj"/> </geometry> <material name="white"> <color rgba=".9 .9 .9 1"/> </material> </visual> <collision> <geometry> <sphere radius="0.012"/> </geometry> <origin rpy="0 0 0" xyz="0 0 0"/> </collision> <inertial> <mass value="0.0168"/> <origin rpy="0 0 0" xyz="0 0 0"/> <inertia ixx="1.19599e-05" ixy="0" ixz="0" iyy="1.19598e-05" iyz="0" izz="1.10345e-06"/> </inertial> </link> <joint name="joint_15_tip" type="fixed"> <parent link="link_15"/> <child link="link_15_tip"/> <origin rpy="0 0 0" xyz="0 0 0.0423"/> </joint> </robot>
{ "pile_set_name": "Github" }
/* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package containers import ( "context" "time" "github.com/gogo/protobuf/types" ) // Container represents the set of data pinned by a container. Unless otherwise // noted, the resources here are considered in use by the container. // // The resources specified in this object are used to create tasks from the container. type Container struct { // ID uniquely identifies the container in a nameapace. // // This property is required and cannot be changed after creation. ID string // Labels provide metadata extension for a contaienr. // // These are optional and fully mutable. Labels map[string]string // Image specifies the image reference used for a container. // // This property is optional and mutable. Image string // Runtime specifies which runtime should be used when launching container // tasks. // // This property is required and immutable. Runtime RuntimeInfo // Spec should carry the the runtime specification used to implement the // container. // // This field is required but mutable. Spec *types.Any // SnapshotKey specifies the snapshot key to use for the container's root // filesystem. When starting a task from this container, a caller should // look up the mounts from the snapshot service and include those on the // task create request. // // This field is not required but mutable. SnapshotKey string // Snapshotter specifies the snapshotter name used for rootfs // // This field is not required but immutable. Snapshotter string // CreatedAt is the time at which the container was created. CreatedAt time.Time // UpdatedAt is the time at which the container was updated. UpdatedAt time.Time // Extensions stores client-specified metadata Extensions map[string]types.Any } // RuntimeInfo holds runtime specific information type RuntimeInfo struct { Name string Options *types.Any } // Store interacts with the underlying container storage type Store interface { Get(ctx context.Context, id string) (Container, error) // List returns containers that match one or more of the provided filters. List(ctx context.Context, filters ...string) ([]Container, error) // Create a container in the store from the provided container. Create(ctx context.Context, container Container) (Container, error) // Update the container with the provided container object. ID must be set. // // If one or more fieldpaths are provided, only the field corresponding to // the fieldpaths will be mutated. Update(ctx context.Context, container Container, fieldpaths ...string) (Container, error) // Delete a container using the id. // // nil will be returned on success. If the container is not known to the // store, ErrNotFound will be returned. Delete(ctx context.Context, id string) error }
{ "pile_set_name": "Github" }
package com.windmt; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @author yibo */ @SpringBootApplication public class ConfigClientApplication { public static void main(String[] args) { SpringApplication.run(ConfigClientApplication.class, args); } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2012-2013 Axel Tillequin ([email protected]) # published under GPLv2 license # import expressions: from amoco.cas.expressions import * # reference documentation: # The SPARC Architecture Manual Version 8, Revision SAV080SI9308. # registers : # ----------- NWINDOWS = 32 # in [2,32] # general registers: R = [reg("r%d" % x, 32) for x in range(520)] # fpu registers: f = [reg("f%d" % x, 32) for x in range(32)] # coprocessor registers: c = [reg("c%d" % x, 32) for x in range(32)] # symbols for r0 ... r7: g0, g1, g2, g3, g4, g5, g6, g7 = (reg("g%d" % x, 32) for x in range(8)) # window registers symbols: o0, o1, o2, o3, o4, o5, o6, o7 = (reg("o%d" % x, 32) for x in range(8)) l0, l1, l2, l3, l4, l5, l6, l7 = (reg("l%d" % x, 32) for x in range(8)) i0, i1, i2, i3, i4, i5, i6, i7 = (reg("i%d" % x, 32) for x in range(8)) r = [ g0, g1, g2, g3, g4, g5, g6, g7, o0, o1, o2, o3, o4, o5, o6, o7, l0, l1, l2, l3, l4, l5, l6, l7, i0, i1, i2, i3, i4, i5, i6, i7, ] fp = i6 i6.ref = "fp" sp = o6 o6.ref = "sp" psr = reg("psr", 32) # Processor State Register wim = reg("wim", 32) # Window Invalid Mask tbr = reg("tbr", 32) # Trap Base Register y = reg("y", 32) # Multiply/Divide Register # Program Counters pc = reg("pc", 32) # current npc = reg("npc", 32) # next # implementation-dependent Ancillary State Registers asr = [reg("asr%d" % x, 32) for x in range(32)] # fpu control/status registers: fsr = reg("fsr", 32) # Floating-point State Register fq = reg("fq", 32) # implementation-dependent Floating-point Deffered-Trap Queue # coprocessor control/status registers: csr = reg("csr", 32) # implementation-dependent coprocessor State Register cq = reg("cq", 32) # implementation-dependent Coprocessor Deffered-Trap Queue def hi(r): return slc(r, 10, 22) def lo(r): return slc(r, 0, 10) registers = r + [psr, y, pc, npc] # psr symbols: impl = slc(psr, 28, 4) # implementation ver = slc(psr, 24, 4) # version icc = slc(psr, 20, 4) # condition codes: nf = slc(icc, 3, 1) # negative flag zf = slc(icc, 2, 1) # zero flag vf = slc(icc, 1, 1) # overflow flag cf = slc(icc, 0, 1) # carry flag EC = slc(psr, 13, 1) # enable coprocessor EF = slc(psr, 12, 1) # enable floating-point PIL = slc(psr, 8, 4) # proc_interrupt_level S = slc(psr, 7, 1) # supervisor mode PS = slc(psr, 6, 1) # previous supervisor ET = slc(psr, 5, 1) # enable Trap cwp = slc(psr, 0, 4) # current window pointer # tbr symbols: tba = slc(tbr, 12, 20) # trap base address tt = slc(tbr, 4, 8) # trap type # fsr symbols: RD = slc(fsr, 30, 2) # rounding direction (0: nearest, 1: 0, 2:+inf, 3=-inf) TEM = slc(fsr, 23, 5) # trap enable mask NS = slc(fsr, 22, 1) # non-standard fp fver = slc(fsr, 17, 3) # FPU architecture version ftt = slc(fsr, 14, 3) # fp trap type (see table 4-4, p.36) qne = slc(fsr, 13, 1) # fsr FQ not empty fcc = slc(fsr, 10, 2) # condition codes (=,<,>,?) aexc = slc(fsr, 5, 5) # IEEE 754 fp exceptions accumulator cexc = slc(fsr, 0, 5) # current IEEE 754 exception
{ "pile_set_name": "Github" }
/** * Default theme for reveal.js. * * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se */ // Default mixins and settings ----------------- @import "../template/mixins"; @import "../template/settings"; // --------------------------------------------- // Include theme-specific fonts @font-face { font-family: 'League Gothic'; src: url('../../lib/font/league_gothic-webfont.eot'); src: url('../../lib/font/league_gothic-webfont.eot?#iefix') format('embedded-opentype'), url('../../lib/font/league_gothic-webfont.woff') format('woff'), url('../../lib/font/league_gothic-webfont.ttf') format('truetype'), url('../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular') format('svg'); font-weight: normal; font-style: normal; } @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); // Override theme settings (see ../template/settings.scss) $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); // Background generator @mixin bodyBackground() { @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) ); } // Theme template ------------------------------ @import "../template/theme"; // ---------------------------------------------
{ "pile_set_name": "Github" }
package fr.adrienbrault.idea.symfony2plugin.twig.utils; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.util.indexing.FileBasedIndex; import com.jetbrains.twig.TwigFile; import fr.adrienbrault.idea.symfony2plugin.stubs.indexes.TwigBlockIndexExtension; import fr.adrienbrault.idea.symfony2plugin.stubs.indexes.TwigExtendsStubIndex; import fr.adrienbrault.idea.symfony2plugin.templating.util.TwigUtil; import org.jetbrains.annotations.NotNull; import java.util.Collection; import java.util.HashSet; import java.util.Set; /** * @author Daniel Espendiller <[email protected]> */ public class TwigFileUtil { /** * Visit parent Twig files eg on "embed" tag and provide all files in this path until root file */ @NotNull public static Collection<VirtualFile> collectParentFiles(boolean includeSelf, @NotNull Collection<PsiFile> psiFiles) { return collectParentFiles(includeSelf, psiFiles.toArray(new PsiFile[psiFiles.size()])); } /** * Visit parent Twig files eg on "embed" tag and provide all files in this path until root file */ @NotNull public static Collection<VirtualFile> collectParentFiles(boolean includeSelf, @NotNull PsiFile... psiFiles) { Set<VirtualFile> virtualFiles = new HashSet<>(); for (PsiFile psiFile : psiFiles) { VirtualFile sourceFile = psiFile.getVirtualFile(); if(includeSelf) { virtualFiles.add(sourceFile); } visitParentFiles(psiFile, 0, virtualFiles); } return virtualFiles; } private static void visitParentFiles(@NotNull PsiFile file, int depth, Collection<VirtualFile> virtualFiles) { // limit recursive calls if(depth++ > 20) { return; } Set<VirtualFile> myVirtualFiles = new HashSet<>(); Set<String> templates = new HashSet<>(); FileBasedIndex.getInstance() .getValues(TwigBlockIndexExtension.KEY, "use", GlobalSearchScope.fileScope(file)) .forEach(templates::addAll); FileBasedIndex.getInstance() .getFileData(TwigExtendsStubIndex.KEY, file.getVirtualFile(), file.getProject()) .forEach((templateName, aVoid) -> templates.add(templateName)); for (String template : templates) { for (VirtualFile virtualFile : TwigUtil.getTemplateFiles(file.getProject(), template)) { if (!virtualFiles.contains(virtualFile)) { myVirtualFiles.add(virtualFile); virtualFiles.add(virtualFile); } } } // visit files in this scope for(VirtualFile virtualFile : myVirtualFiles) { PsiFile psiFile = PsiManager.getInstance(file.getProject()).findFile(virtualFile); if(psiFile instanceof TwigFile) { visitParentFiles(psiFile, depth, virtualFiles); } } } }
{ "pile_set_name": "Github" }
TEMPLATE = app QT += gui-private SOURCES = \ cubemap.cpp RESOURCES = cubemap.qrc
{ "pile_set_name": "Github" }
Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 660 York Street, Suite 102, San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
{ "pile_set_name": "Github" }
{%load static%} <!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <title>Alize</title> <link rel="stylesheet" href="{%static 'css/search.css'%}"> <link rel="stylesheet" href="{%static 'css/app.css'%}"> </head> <body> <form action="/yasintoy"> <div class="search"> <svg class="search-svg" viewBox="0 0 320 70" data-init="M160,3 L160,3 a27,27 0 0,1 0,54 L160,57 a27,27 0 0,1 0,-54 M197,67 181.21,51.21" data-mid="M160,3 L160,3 a27,27 0 0,1 0,54 L160,57 a27,27 0 0,1 0,-54 M179.5,49.5 179.5,49.5" data-active="M27,3 L293,3 a27,27 0 0,1 0,54 L27,57 a27,27 0 0,1 0,-54 M179.5,49.5 179.5,49.5"> <path class="search-svg__path" d="M160,3 L160,3 a27,27 0 0,1 0,54 L160,57 a27,27 0 0,1 0,-54 M197,67 181.21,51.21" /> </svg> <input type="text" class="search-input" /> <div class="search-close"></div> <div class="circle"></div> </form> </div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.3.0/snap.svg-min.js'></script> <script src="{%static 'js/search.js'%}"></script> <script src="{%static 'js/app.min.js'%}"></script> </body> </html>
{ "pile_set_name": "Github" }
/* SPX - A simple profiler for PHP * Copyright (C) 2017-2020 Sylvain Lassaut <[email protected]> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * 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 <https://www.gnu.org/licenses/>. */ #define _GNU_SOURCE #include <sys/time.h> #include <sys/resource.h> #include "spx_resource_stats.h" static inline size_t spx_resource_stats_wall_time_coarse(void); static inline size_t spx_resource_stats_cpu_time_coarse(void); void spx_resource_stats_init(void) { } void spx_resource_stats_shutdown(void) { } #define TIMESPEC_TO_NS(ts) ((ts).tv_sec * 1000 * 1000 * 1000 + (ts).tv_nsec) size_t spx_resource_stats_wall_time(void) { #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 101200) return spx_resource_stats_wall_time_coarse(); #else struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return TIMESPEC_TO_NS(ts); #endif } size_t spx_resource_stats_cpu_time(void) { #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 101200) return spx_resource_stats_cpu_time_coarse(); #else struct timespec ts; clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts); return TIMESPEC_TO_NS(ts); #endif } void spx_resource_stats_io(size_t * in, size_t * out) { // MacOS doesn't expose any per-process I/O counters equivalent to linux // procfs. *in = 0; *out = 0; } // Coarser (usec) wall time for macOS < Sierra static inline size_t spx_resource_stats_wall_time_coarse(void) { struct timeval tv; int ret = 0; ret = gettimeofday(&tv, NULL); if (ret == 0) { return 1000 * ( tv.tv_sec * 1000 * 1000 + tv.tv_usec ); } return ret; } // Coarser (usec) cpu use time for macOS < Sierra static inline size_t spx_resource_stats_cpu_time_coarse(void) { struct rusage ru; getrusage(RUSAGE_SELF, &ru); return 1000 * ( (ru.ru_utime.tv_sec + ru.ru_stime.tv_sec ) * 1000 * 1000 + (ru.ru_utime.tv_usec + ru.ru_stime.tv_usec) ); }
{ "pile_set_name": "Github" }
1 1 1 2 2 1 5 5 1 7 7 1 8 8 1 9 9 1 13 13 1 15 15 1 18 18 1 19 19 1 21 1 2 22 2 2 25 5 2 27 7 2 28 8 2 29 9 2 33 13 2 35 15 2 38 18 2 39 19 2 41 1 3 42 2 3 45 5 3 47 7 3 48 8 3 49 9 3 53 13 3 55 15 3 58 18 3 59 19 3 61 1 4 65 5 4 67 7 4 68 8 4 69 9 4 70 10 4 73 13 4 74 14 4 75 15 4 78 18 4 79 19 4
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_181) on Tue Jul 07 00:34:31 BST 2020 --> <title>LayoutInfoUtils</title> <meta name="date" content="2020-07-07"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="LayoutInfoUtils"; } } catch(err) { } //--> var methods = {"i0":9,"i1":9,"i2":9,"i3":9}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- @generated --> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/facebook/litho/widget/LayoutInfo.ViewportFiller.html" title="interface in com.facebook.litho.widget"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/facebook/litho/widget/LinearLayoutInfo.html" title="class in com.facebook.litho.widget"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/facebook/litho/widget/LayoutInfoUtils.html" target="_top">Frames</a></li> <li><a href="LayoutInfoUtils.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.facebook.litho.widget</div> <h2 title="Class LayoutInfoUtils" class="title">Class LayoutInfoUtils</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="https://d.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>com.facebook.litho.widget.LayoutInfoUtils</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">LayoutInfoUtils</span> extends <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block">Utility class for calculating the wrapped height of given holders.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/LayoutInfoUtils.html#computeLinearLayoutWrappedHeight-LinearLayoutManager-int-java.util.List-">computeLinearLayoutWrappedHeight</a></span>(LinearLayoutManager&nbsp;linearLayoutManager, int&nbsp;maxHeight, <a href="https://d.android.com/reference/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../com/facebook/litho/widget/ComponentTreeHolder.html" title="class in com.facebook.litho.widget">ComponentTreeHolder</a>&gt;&nbsp;componentTreeHolders)</code> <div class="block">Return the accumulated height of ComponentTreeHolders, or return the if the accumulated height is higher than the .</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/LayoutInfoUtils.html#getBottomDecorationHeight-RecyclerView.LayoutManager-int-">getBottomDecorationHeight</a></span>(RecyclerView.LayoutManager&nbsp;layoutManager, int&nbsp;position)</code>&nbsp;</td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/LayoutInfoUtils.html#getMaxHeightInRow-int-int-java.util.List-">getMaxHeightInRow</a></span>(int&nbsp;start, int&nbsp;end, <a href="https://d.android.com/reference/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../com/facebook/litho/widget/ComponentTreeHolder.html" title="class in com.facebook.litho.widget">ComponentTreeHolder</a>&gt;&nbsp;componentTreeHolders)</code> <div class="block">Return the max height in the , the range is from position to position (excluded).</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/LayoutInfoUtils.html#getTopDecorationHeight-RecyclerView.LayoutManager-int-">getTopDecorationHeight</a></span>(RecyclerView.LayoutManager&nbsp;layoutManager, int&nbsp;position)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.<a href="https://d.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://d.android.com/reference/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getTopDecorationHeight-RecyclerView.LayoutManager-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTopDecorationHeight</h4> <pre>public static&nbsp;int&nbsp;getTopDecorationHeight(RecyclerView.LayoutManager&nbsp;layoutManager, int&nbsp;position)</pre> </li> </ul> <a name="getBottomDecorationHeight-RecyclerView.LayoutManager-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getBottomDecorationHeight</h4> <pre>public static&nbsp;int&nbsp;getBottomDecorationHeight(RecyclerView.LayoutManager&nbsp;layoutManager, int&nbsp;position)</pre> </li> </ul> <a name="computeLinearLayoutWrappedHeight-LinearLayoutManager-int-java.util.List-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>computeLinearLayoutWrappedHeight</h4> <pre>public static&nbsp;int&nbsp;computeLinearLayoutWrappedHeight(LinearLayoutManager&nbsp;linearLayoutManager, int&nbsp;maxHeight, <a href="https://d.android.com/reference/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../com/facebook/litho/widget/ComponentTreeHolder.html" title="class in com.facebook.litho.widget">ComponentTreeHolder</a>&gt;&nbsp;componentTreeHolders)</pre> <div class="block">Return the accumulated height of ComponentTreeHolders, or return the if the accumulated height is higher than the .</div> </li> </ul> <a name="getMaxHeightInRow-int-int-java.util.List-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getMaxHeightInRow</h4> <pre>public static&nbsp;int&nbsp;getMaxHeightInRow(int&nbsp;start, int&nbsp;end, <a href="https://d.android.com/reference/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../com/facebook/litho/widget/ComponentTreeHolder.html" title="class in com.facebook.litho.widget">ComponentTreeHolder</a>&gt;&nbsp;componentTreeHolders)</pre> <div class="block">Return the max height in the , the range is from position to position (excluded).</div> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/facebook/litho/widget/LayoutInfo.ViewportFiller.html" title="interface in com.facebook.litho.widget"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/facebook/litho/widget/LinearLayoutInfo.html" title="class in com.facebook.litho.widget"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/facebook/litho/widget/LayoutInfoUtils.html" target="_top">Frames</a></li> <li><a href="LayoutInfoUtils.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
/* * © Copyright 2018 Alyssa Rosenzweig * Copyright (C) 2019 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <panfrost-misc.h> #include <panfrost-job.h> #include "pan_bo.h" #include "pan_context.h" /* TODO: What does this actually have to be? */ #define ALIGNMENT 128 /* Transient command stream pooling: command stream uploads try to simply copy * into whereever we left off. If there isn't space, we allocate a new entry * into the pool and copy there */ struct panfrost_transfer panfrost_allocate_transient(struct panfrost_batch *batch, size_t sz) { /* Pad the size */ sz = ALIGN_POT(sz, ALIGNMENT); /* Find or create a suitable BO */ struct panfrost_bo *bo = NULL; unsigned offset = 0; bool fits_in_current = (batch->transient_offset + sz) < TRANSIENT_SLAB_SIZE; if (likely(batch->transient_bo && fits_in_current)) { /* We can reuse the current BO, so get it */ bo = batch->transient_bo; /* Use the specified offset */ offset = batch->transient_offset; batch->transient_offset = offset + sz; } else { size_t bo_sz = sz < TRANSIENT_SLAB_SIZE ? TRANSIENT_SLAB_SIZE : ALIGN_POT(sz, 4096); /* We can't reuse the current BO, but we can create a new one. * We don't know what the BO will be used for, so let's flag it * RW and attach it to both the fragment and vertex/tiler jobs. * TODO: if we want fine grained BO assignment we should pass * flags to this function and keep the read/write, * fragment/vertex+tiler pools separate. */ bo = panfrost_batch_create_bo(batch, bo_sz, 0, PAN_BO_ACCESS_PRIVATE | PAN_BO_ACCESS_RW | PAN_BO_ACCESS_VERTEX_TILER | PAN_BO_ACCESS_FRAGMENT); if (sz < TRANSIENT_SLAB_SIZE) { batch->transient_bo = bo; batch->transient_offset = offset + sz; } } struct panfrost_transfer ret = { .cpu = bo->cpu + offset, .gpu = bo->gpu + offset, }; return ret; } mali_ptr panfrost_upload_transient(struct panfrost_batch *batch, const void *data, size_t sz) { struct panfrost_transfer transfer = panfrost_allocate_transient(batch, sz); memcpy(transfer.cpu, data, sz); return transfer.gpu; }
{ "pile_set_name": "Github" }
presig: 0 postsig:1648 c: 0.9994 lenerr:1648
{ "pile_set_name": "Github" }
"""Module for handling problem feedback.""" from datetime import datetime from voluptuous import Length, Required, Schema import api from api import check, log_action, PicoException, validate feedback_schema = Schema( { Required("liked"): check( ("liked must be a boolean", [lambda x: type(x) == bool]) ), "comment": check( ("The comment must be no more than 500 characters", [str, Length(max=500)]) ), "timeSpent": check(("Time spend must be a number", [int])), "source": check( ("The source must be no more than 500 characters", [str, Length(max=10)]) ), } ) def get_problem_feedback(pid=None, tid=None, uid=None, count_only=False): """ Retrieve feedback for a given problem, team, or user. Args: pid: the problem id tid: the team id uid: the user id count_only: only sums likes dislikes instead of full feedback entries Returns: A list of problem feedback entries. """ db = api.db.get_conn() match = {} if pid is not None: match.update({"pid": pid}) if tid is not None: match.update({"tid": tid}) if uid is not None: match.update({"uid": uid}) if count_only: likes = {"feedback.liked": True} likes.update(match) dislikes = {"feedback.liked": False} dislikes.update(match) return { "likes": db.problem_feedback.count_documents(likes), "dislikes": db.problem_feedback.count_documents(dislikes), } else: return list(db.problem_feedback.find(match, {"_id": 0})) @log_action def upsert_feedback(pid, feedback): """ Add or update problem feedback in the database. Args: pid: the problem id feedback: the problem feedback. Raises: PicoException if provided pid does not exist """ db = api.db.get_conn() uid = api.user.get_user()["uid"] # Make sure the problem actually exists. if not api.problem.get_problem(pid, {"pid": 1}): raise PicoException("Problem not found", 404) team = api.user.get_team(uid=uid) solved = pid in api.problem.get_solved_pids(tid=team["tid"]) validate(feedback_schema, feedback) # update feedback if already present if get_problem_feedback(pid=pid, uid=uid) != []: db.problem_feedback.update( {"pid": pid, "uid": uid}, {"$set": {"timestamp": datetime.utcnow(), "feedback": feedback}}, ) else: db.problem_feedback.insert( { "pid": pid, "uid": uid, "tid": team["tid"], "solved": solved, "timestamp": datetime.utcnow(), "feedback": feedback, } ) # @TODO achievement processing needs to be fixed/reviewed # api.achievement.process_achievements("review", { # "uid": uid, # "tid": team['tid'], # "pid": pid # })
{ "pile_set_name": "Github" }
/* * Copyright (C) 2009 Realtek Semiconductor Corp. * All Rights Reserved. * * This program is the proprietary software of Realtek Semiconductor * Corporation and/or its licensors, and only be used, duplicated, * modified or distributed under the authorized license from Realtek. * * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. * * $Revision: 14202 $ * $Date: 2010-11-16 15:13:00 +0800 (星期二, 16 十一月 2010) $ * * Purpose : RTL8367B switch high-level API for RTL8367B * Feature : Field selector related functions * */ #include "rtl8367b_asicdrv_hsb.h" /* Function Name: * rtl8367b_setAsicFieldSelector * Description: * Set user defined field selectors in HSB * Input: * index - index of field selector 0-15 * format - Format of field selector * offset - Retrieving data offset * Output: * None * Return: * RT_ERR_OK - Success * RT_ERR_SMI - SMI access error * RT_ERR_OUT_OF_RANGE - input parameter out of range * Note: * System support 16 user defined field selctors. * Each selector can be enabled or disable. User can defined retrieving 16-bits in many predefiend * standard l2/l3/l4 payload. */ ret_t rtl8367b_setAsicFieldSelector(rtk_uint32 index, rtk_uint32 format, rtk_uint32 offset) { rtk_uint32 regData; if(index > RTL8367B_FIELDSEL_FORMAT_NUMBER) return RT_ERR_OUT_OF_RANGE; if(format >= FIELDSEL_FORMAT_END) return RT_ERR_OUT_OF_RANGE; regData = (((format << RTL8367B_FIELD_SELECTOR_FORMAT_OFFSET) & RTL8367B_FIELD_SELECTOR_FORMAT_MASK ) | ((offset << RTL8367B_FIELD_SELECTOR_OFFSET_OFFSET) & RTL8367B_FIELD_SELECTOR_OFFSET_MASK )); return rtl8367b_setAsicReg(RTL8367B_FIELD_SELECTOR_REG(index), regData); } /* Function Name: * rtl8367b_getAsicFieldSelector * Description: * Get user defined field selectors in HSB * Input: * index - index of field selector 0-15 * pFormat - Format of field selector * pOffset - Retrieving data offset * Output: * None * Return: * RT_ERR_OK - Success * RT_ERR_SMI - SMI access error * Note: * None */ ret_t rtl8367b_getAsicFieldSelector(rtk_uint32 index, rtk_uint32* pFormat, rtk_uint32* pOffset) { ret_t retVal; rtk_uint32 regData; retVal = rtl8367b_getAsicReg(RTL8367B_FIELD_SELECTOR_REG(index), &regData); if(retVal != RT_ERR_OK) return retVal; *pFormat = ((regData & RTL8367B_FIELD_SELECTOR_FORMAT_MASK) >> RTL8367B_FIELD_SELECTOR_FORMAT_OFFSET); *pOffset = ((regData & RTL8367B_FIELD_SELECTOR_OFFSET_MASK) >> RTL8367B_FIELD_SELECTOR_OFFSET_OFFSET); return RT_ERR_OK; }
{ "pile_set_name": "Github" }
--- layout: "default" title: "create" description: "Swift documentation for 'create': A class whose instances contain a property of type Header and raw." keywords: "create,func,swift,documentation" root: "/v3.0" --- <div class="declaration" id="func-create_-int-makingheaderwith_-managedbuffer-header-element-throws-header"> <a class="toggle-link" data-toggle="collapse" href="#comment-func-create_-int-makingheaderwith_-managedbuffer-header-element-throws-header">final class func create(<wbr>_:<wbr> Int, makingHeaderWith: (ManagedBuffer&lt;Header, Element&gt;) throws -&gt; Header)</a> <div class="comment collapse" id="comment-func-create_-int-makingheaderwith_-managedbuffer-header-element-throws-header"><div class="p"> <p>A class whose instances contain a property of type <code>Header</code> and raw storage for an array of <code>Element</code>, whose size is determined at instance creation.</p> <p>Note that the <code>Element</code> array is suitably-aligned <strong>raw memory</strong>. You are expected to construct and---if necessary---destroy objects there yourself, using the APIs on <code>UnsafeMutablePointer&lt;Element&gt;</code>. Typical usage stores a count and capacity in <code>Header</code> and destroys any live elements in the <code>deinit</code> of a subclass. <strong>Note:</strong> Subclasses must not have any stored properties; any storage needed should be included in <code>Header</code>. Create a new instance of the most-derived class, calling <code>factory</code> on the partially-constructed object to generate an initial <code>Header</code>.</p> <h4>Declaration</h4> <code class="language-swift">final class func create(minimumCapacity: Int, makingHeaderWith factory: (ManagedBuffer&lt;Header, Element&gt;) throws -&gt; Header) rethrows -&gt; ManagedBuffer&lt;Header, Element&gt;</code> </div></div> </div>
{ "pile_set_name": "Github" }
//===--- fwd_decl_of_nested_class_defined_later.cc - test input file ------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // This tests a particular situation which until recently IWYU did not // handle correctly. In certain cases, it would have unnecessarily recommended // a forward declaration *outside* of a class definition which really // belonged inside the class definition. #include <utility> class Foo { private: int Bar() { // The bug was that in the AST tree that IWYU generates, a // CXXMethodDecl node representing the pair destructor declaration // intervened in the chain from the node corresponding to the use // of Baz up to the CXXMethodDecl node for Bar. This caused // IsNodeInsideCXXMethodBody to return false for the node // corresponding to the use of Baz. // The fix was to not stop at the destructor declaration when // walking up the tree, since the context was not the body of the // destructor. return std::make_pair(Baz(), 0).second; } struct Baz { int value_; }; }; /**** IWYU_SUMMARY (tests/cxx/fwd_decl_of_nested_class_defined_later.cc has correct #includes/fwd-decls) ***** IWYU_SUMMARY */
{ "pile_set_name": "Github" }
/* * Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, * version 2 with the GNU Classpath Exception, which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ package org.glassfish.test.jms.activationproperties.ejb; import java.util.logging.*; import jakarta.annotation.Resource; import jakarta.ejb.*; import jakarta.inject.Inject; import jakarta.jms.*; @MessageDriven(mappedName = "jms/jms_unit_test_Topic", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "jakarta.jms.Topic"), @ActivationConfigProperty(propertyName = "clientId", propertyValue = "abc"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NonDurable") }) public class NewMessageBean implements MessageListener { private static final Logger logger = Logger.getLogger(NewMessageBean.class.getName()); @Resource private MessageDrivenContext mdc; @Resource(mappedName = "jms/jms_unit_result_Queue") private Queue resultQueue; @Resource(mappedName = "jms/jms_unit_test_QCF") private QueueConnectionFactory qconFactory; public NewMessageBean() { } @Override @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public void onMessage(Message message) { sendMsg(message); } private void sendMsg(Message msg) { QueueConnection qcon = null; QueueSession qsession = null; QueueSender qsender = null; try { qcon = qconFactory.createQueueConnection(); qcon.start(); qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); qsender = qsession.createSender(resultQueue); TextMessage message = qsession.createTextMessage(); message.setText("Hello World!"); qsender.send(message); } catch (Exception e) { throw new EJBException(e); } finally { try { if (qsender != null) qsender.close(); if (qsession != null) qsession.close(); if (qcon != null) qcon.close(); } catch (Exception e) { throw new EJBException(e); } } } }
{ "pile_set_name": "Github" }
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.network; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.util.ArrayList; import org.apache.activemq.broker.BrokerFactory; import org.apache.activemq.broker.BrokerService; /** * Test network reconnects over SSH tunnels. This case can be especially tricky * since the SSH tunnels fool the TCP transport into thinking that they are * initially connected. * */ public class SSHTunnelNetworkReconnectTest extends NetworkReconnectTest { ArrayList<Process> processes = new ArrayList<Process>(); @Override protected BrokerService createFirstBroker() throws Exception { return BrokerFactory .createBroker(new URI("xbean:org/apache/activemq/network/ssh-reconnect-broker1.xml")); } @Override protected BrokerService createSecondBroker() throws Exception { return BrokerFactory .createBroker(new URI("xbean:org/apache/activemq/network/ssh-reconnect-broker2.xml")); } @Override protected void setUp() throws Exception { startProcess("ssh -Nn -L60006:localhost:61616 localhost"); startProcess("ssh -Nn -L60007:localhost:61617 localhost"); super.setUp(); } @Override protected void tearDown() throws Exception { super.tearDown(); for (Process p : processes) { p.destroy(); } } private void startProcess(String command) throws IOException { final Process process = Runtime.getRuntime().exec(command); processes.add(process); new Thread("stdout: " + command) { @Override public void run() { try { InputStream is = process.getInputStream(); int c; while ((c = is.read()) >= 0) { System.out.write(c); } } catch (IOException e) { } } }.start(); new Thread("stderr: " + command) { @Override public void run() { try { InputStream is = process.getErrorStream(); int c; while ((c = is.read()) >= 0) { System.err.write(c); } } catch (IOException e) { } } }.start(); } }
{ "pile_set_name": "Github" }
<?php namespace yii\easyii\modules\guestbook\api; use Yii; use yii\data\ActiveDataProvider; use yii\helpers\Url; use yii\widgets\LinkPager; use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\easyii\modules\guestbook\models\Guestbook as GuestbookModel; use yii\easyii\widgets\ReCaptcha; /** * Guestbook module API * @package yii\easyii\modules\guestbook\api * * @method static string form(array $options = []) Returns fully worked standalone html form. * @method static array items(array $options = []) Get list of guestbook posts as PostObject objects * @method static array save(array $attributes) If you using your own form, this function will be useful for manual saving guestbook posts. * @method static mixed last(int $limit = 1) Get last posts as PostObject objects * @method static string pages() returns pagination html generated by yii\widgets\LinkPager widget. * @method static \stdClass pagination() returns yii\data\Pagination object. */ class Guestbook extends \yii\easyii\components\API { const SENT_VAR = 'guestbook_sent'; private $_adp; private $_last; private $_items; private $_defaultFormOptions = [ 'errorUrl' => '', 'successUrl' => '' ]; public function api_items($options = []) { if(!$this->_items){ $this->_items = []; $query = GuestbookModel::find()->status(GuestbookModel::STATUS_ON)->sortDate(); if(!empty($options['where'])){ $query->andFilterWhere($options['where']); } $this->_adp = new ActiveDataProvider([ 'query' => $query, 'pagination' => !empty($options['pagination']) ? $options['pagination'] : [] ]); foreach($this->_adp->models as $model){ $this->_items[] = new PostObject($model); } } return $this->_items; } public function api_last($limit = 1) { if($limit === 1 && $this->_last){ return $this->_last; } $result = []; foreach(GuestbookModel::find()->status(GuestbookModel::STATUS_ON)->sortDate()->limit($limit)->all() as $item){ $result[] = new PostObject($item); } if($limit > 1){ return $result; } else { $this->_last = count($result) ? $result[0] : null; return $this->_last; } } public function api_form($options = []) { $model = new GuestbookModel; $settings = Yii::$app->getModule('admin')->activeModules['guestbook']->settings; $options = array_merge($this->_defaultFormOptions, $options); ob_start(); $form = ActiveForm::begin([ 'enableClientValidation' => true, 'action' => Url::to(['/admin/guestbook/send']) ]); echo Html::hiddenInput('errorUrl', $options['errorUrl'] ? $options['errorUrl'] : Url::current([self::SENT_VAR => 0])); echo Html::hiddenInput('successUrl', $options['successUrl'] ? $options['successUrl'] : Url::current([self::SENT_VAR => 1])); echo $form->field($model, 'name'); if($settings['enableTitle']) echo $form->field($model, 'title'); if($settings['enableEmail']) echo $form->field($model, 'email'); echo $form->field($model, 'text')->textarea(); if($settings['enableCaptcha']) echo $form->field($model, 'reCaptcha')->widget(ReCaptcha::className()); echo Html::submitButton(Yii::t('easyii', 'Send'), ['class' => 'btn btn-primary']); ActiveForm::end(); return ob_get_clean(); } public function api_save($data) { $model = new GuestbookModel($data); $model->scenario = 'send'; if ($model->save()) { return ['result' => 'success']; } else { return ['result' => 'error', 'error' => $model->getErrors()]; } } public function api_pagination() { return $this->_adp ? $this->_adp->pagination : null; } public function api_pages() { return $this->_adp ? LinkPager::widget(['pagination' => $this->_adp->pagination]) : ''; } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: b2e335125ba714f65bdbc46186251274 ModelImporter: serializedVersion: 23 fileIDToRecycleName: 100000: Chest 100002: Head 100004: Hips 100006: Jaw 100008: JawEnd 100010: LeftEye 100012: LeftFoot 100014: LeftHand 100016: LeftIndexDistal 100018: LeftIndexDistalEnd 100020: LeftIndexIntermediate 100022: LeftIndexProximal 100024: LeftLowerArm 100026: LeftLowerLeg 100028: LeftMiddleDistal 100030: LeftMiddleDistalEnd 100032: LeftMiddleIntermediate 100034: LeftMiddleProximal 100036: LeftPinkyDistal 100038: LeftPinkyDistalEnd 100040: LeftPinkyIntermediate 100042: LeftPinkyProximal 100044: LeftRingDistal 100046: LeftRingDistalEnd 100048: LeftRingIntermediate 100050: LeftRingProximal 100052: LeftShoulder 100054: LeftThumbDistal 100056: LeftThumbDistalEnd 100058: LeftThumbIntermediate 100060: LeftThumbProximal 100062: LeftToes 100064: LeftToesEnd 100066: LeftUpperArm 100068: LeftUpperLeg 100070: //RootNode 100072: Neck 100074: RightEye 100076: RightFoot 100078: RightHand 100080: RightIndexDistal 100082: RightIndexDistalEnd 100084: RightIndexIntermediate 100086: RightIndexProximal 100088: RightLowerArm 100090: RightLowerLeg 100092: RightMiddleDistal 100094: RightMiddleDistalEnd 100096: RightMiddleIntermediate 100098: RightMiddleProximal 100100: RightPinkyDistal 100102: RightPinkyDistalEnd 100104: RightPinkyIntermediate 100106: RightPinkyProximal 100108: RightRingDistal 100110: RightRingDistalEnd 100112: RightRingIntermediate 100114: RightRingProximal 100116: RightShoulder 100118: RightThumbDistal 100120: RightThumbDistalEnd 100122: RightThumbIntermediate 100124: RightThumbProximal 100126: RightToes 100128: RightToesEnd 100130: RightUpperArm 100132: RightUpperLeg 100134: Root 100136: Spine 100138: UpperChest 400000: Chest 400002: Head 400004: Hips 400006: Jaw 400008: JawEnd 400010: LeftEye 400012: LeftFoot 400014: LeftHand 400016: LeftIndexDistal 400018: LeftIndexDistalEnd 400020: LeftIndexIntermediate 400022: LeftIndexProximal 400024: LeftLowerArm 400026: LeftLowerLeg 400028: LeftMiddleDistal 400030: LeftMiddleDistalEnd 400032: LeftMiddleIntermediate 400034: LeftMiddleProximal 400036: LeftPinkyDistal 400038: LeftPinkyDistalEnd 400040: LeftPinkyIntermediate 400042: LeftPinkyProximal 400044: LeftRingDistal 400046: LeftRingDistalEnd 400048: LeftRingIntermediate 400050: LeftRingProximal 400052: LeftShoulder 400054: LeftThumbDistal 400056: LeftThumbDistalEnd 400058: LeftThumbIntermediate 400060: LeftThumbProximal 400062: LeftToes 400064: LeftToesEnd 400066: LeftUpperArm 400068: LeftUpperLeg 400070: //RootNode 400072: Neck 400074: RightEye 400076: RightFoot 400078: RightHand 400080: RightIndexDistal 400082: RightIndexDistalEnd 400084: RightIndexIntermediate 400086: RightIndexProximal 400088: RightLowerArm 400090: RightLowerLeg 400092: RightMiddleDistal 400094: RightMiddleDistalEnd 400096: RightMiddleIntermediate 400098: RightMiddleProximal 400100: RightPinkyDistal 400102: RightPinkyDistalEnd 400104: RightPinkyIntermediate 400106: RightPinkyProximal 400108: RightRingDistal 400110: RightRingDistalEnd 400112: RightRingIntermediate 400114: RightRingProximal 400116: RightShoulder 400118: RightThumbDistal 400120: RightThumbDistalEnd 400122: RightThumbIntermediate 400124: RightThumbProximal 400126: RightToes 400128: RightToesEnd 400130: RightUpperArm 400132: RightUpperLeg 400134: Root 400136: Spine 400138: UpperChest 7400000: Falling 7400002: Falling_Mirror 9500000: //RootNode 2186277476908879412: ImportLogs externalObjects: {} materials: importMaterials: 1 materialName: 0 materialSearch: 1 materialLocation: 1 animations: legacyGenerateAnimations: 4 bakeSimulation: 0 resampleCurves: 1 optimizeGameObjects: 0 motionNodeName: rigImportErrors: rigImportWarnings: "Copied Avatar Rig Configuration mis-match. Bone length in copied configuration does not match position in animation file:\n\t'Spine' : position error = 4.519341 mm\n" animationImportErrors: animationImportWarnings: "\nClip 'Take 001' has import animation warnings that might lower retargeting quality:\nNote: Activate translation DOF on avatar to improve retargeting quality.\n\t'Spine' has translation animation that will be discarded.\n" animationRetargetingWarnings: animationDoRetargetingWarnings: 0 importAnimatedCustomProperties: 0 importConstraints: 0 animationCompression: 1 animationRotationError: 0.5 animationPositionError: 0.5 animationScaleError: 0.5 animationWrapMode: 0 extraExposedTransformPaths: [] extraUserProperties: [] clipAnimations: - serializedVersion: 16 name: Falling takeName: Take 001 firstFrame: 1 lastFrame: 40 wrapMode: 0 orientationOffsetY: 0 level: 0 cycleOffset: 0 loop: 0 hasAdditiveReferencePose: 0 loopTime: 1 loopBlend: 1 loopBlendOrientation: 0 loopBlendPositionY: 0 loopBlendPositionXZ: 0 keepOriginalOrientation: 0 keepOriginalPositionY: 1 keepOriginalPositionXZ: 0 heightFromFeet: 0 mirror: 0 bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 curves: [] events: [] transformMask: [] maskType: 3 maskSource: {instanceID: 0} additiveReferencePoseFrame: 0 - serializedVersion: 16 name: Falling_Mirror takeName: Take 001 firstFrame: 1 lastFrame: 40 wrapMode: 0 orientationOffsetY: 0 level: 0 cycleOffset: 0 loop: 0 hasAdditiveReferencePose: 0 loopTime: 1 loopBlend: 1 loopBlendOrientation: 0 loopBlendPositionY: 0 loopBlendPositionXZ: 0 keepOriginalOrientation: 0 keepOriginalPositionY: 1 keepOriginalPositionXZ: 0 heightFromFeet: 0 mirror: 1 bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 curves: [] events: [] transformMask: [] maskType: 3 maskSource: {instanceID: 0} additiveReferencePoseFrame: 0 isReadable: 1 meshes: lODScreenPercentages: [] globalScale: 1 meshCompression: 0 addColliders: 0 importVisibility: 1 importBlendShapes: 1 importCameras: 1 importLights: 1 swapUVChannels: 0 generateSecondaryUV: 0 useFileUnits: 1 optimizeMeshForGPU: 1 keepQuads: 0 weldVertices: 1 preserveHierarchy: 0 indexFormat: 0 secondaryUVAngleDistortion: 8 secondaryUVAreaDistortion: 15.000001 secondaryUVHardAngle: 88 secondaryUVPackMargin: 4 useFileScale: 1 previousCalculatedGlobalScale: 0.01 hasPreviousCalculatedGlobalScale: 1 tangentSpace: normalSmoothAngle: 60 normalImportMode: 0 tangentImportMode: 3 normalCalculationMode: 4 importAnimation: 1 copyAvatar: 1 humanDescription: serializedVersion: 2 human: - boneName: Hips humanName: Hips limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftUpperLeg humanName: LeftUpperLeg limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightUpperLeg humanName: RightUpperLeg limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftLowerLeg humanName: LeftLowerLeg limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightLowerLeg humanName: RightLowerLeg limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftFoot humanName: LeftFoot limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightFoot humanName: RightFoot limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: Spine humanName: Spine limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: Chest humanName: Chest limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: Neck humanName: Neck limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: Head humanName: Head limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftShoulder humanName: LeftShoulder limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightShoulder humanName: RightShoulder limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftUpperArm humanName: LeftUpperArm limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightUpperArm humanName: RightUpperArm limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftLowerArm humanName: LeftLowerArm limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightLowerArm humanName: RightLowerArm limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftHand humanName: LeftHand limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightHand humanName: RightHand limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftToes humanName: LeftToes limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightToes humanName: RightToes limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: Jaw humanName: Jaw limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftThumbProximal humanName: Left Thumb Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftThumbIntermediate humanName: Left Thumb Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftThumbDistal humanName: Left Thumb Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftIndexProximal humanName: Left Index Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftIndexIntermediate humanName: Left Index Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftIndexDistal humanName: Left Index Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftMiddleProximal humanName: Left Middle Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftMiddleIntermediate humanName: Left Middle Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftMiddleDistal humanName: Left Middle Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftRingProximal humanName: Left Ring Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftRingIntermediate humanName: Left Ring Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftRingDistal humanName: Left Ring Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftPinkyProximal humanName: Left Little Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftPinkyIntermediate humanName: Left Little Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: LeftPinkyDistal humanName: Left Little Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightThumbProximal humanName: Right Thumb Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightThumbIntermediate humanName: Right Thumb Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightThumbDistal humanName: Right Thumb Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightIndexProximal humanName: Right Index Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightIndexIntermediate humanName: Right Index Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightIndexDistal humanName: Right Index Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightMiddleProximal humanName: Right Middle Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightMiddleIntermediate humanName: Right Middle Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightMiddleDistal humanName: Right Middle Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightRingProximal humanName: Right Ring Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightRingIntermediate humanName: Right Ring Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightRingDistal humanName: Right Ring Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightPinkyProximal humanName: Right Little Proximal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightPinkyIntermediate humanName: Right Little Intermediate limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: RightPinkyDistal humanName: Right Little Distal limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 - boneName: UpperChest humanName: UpperChest limit: min: {x: 0, y: 0, z: 0} max: {x: 0, y: 0, z: 0} value: {x: 0, y: 0, z: 0} length: 0 modified: 0 skeleton: - name: defaultmale_rig(Clone) parentName: position: {x: 0, y: 0, z: 0} rotation: {x: 0, y: 0, z: 0, w: 1} scale: {x: 1, y: 1, z: 1} - name: Body parentName: defaultmale_rig(Clone) position: {x: -0, y: 0, z: 0} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: Root parentName: defaultmale_rig(Clone) position: {x: -5.5577125e-16, y: -8.507635e-10, z: 0.0000000042381267} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: Hips parentName: Root position: {x: 1.1827783e-16, y: 0.99710166, z: 0.011954045} rotation: {x: 0.5, y: -0.5, z: -0.5, w: 0.5} scale: {x: 1, y: 1, z: 1} - name: LeftUpperLeg parentName: Hips position: {x: 0.05013466, y: -0.0024317312, z: 0.089999996} rotation: {x: 0, y: 0, z: 0.99998796, w: 0.004908496} scale: {x: 1, y: 1, z: 1} - name: LeftLowerLeg parentName: LeftUpperLeg position: {x: -0.43576738, y: 8.0373204e-16, z: -2.3092638e-16} rotation: {x: 0, y: 0, z: -0.041384947, w: 0.9991433} scale: {x: 1, y: 1, z: 1} - name: LeftFoot parentName: LeftLowerLeg position: {x: -0.4248355, y: 3.2196466e-16, z: 1.9539925e-16} rotation: {x: 0, y: 0, z: 0.04628874, w: 0.9989281} scale: {x: 1, y: 1, z: 1} - name: LeftToes parentName: LeftFoot position: {x: -0.0758718, y: -0.17069253, z: 5.1514347e-16} rotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} scale: {x: 1, y: 1, z: 1} - name: LeftToesEnd parentName: LeftToes position: {x: -0.054048985, y: -9.722308e-18, z: 1.0302869e-15} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightUpperLeg parentName: Hips position: {x: 0.05013466, y: -0.0024317356, z: -0.089999996} rotation: {x: 0, y: 0, z: -0.004908496, w: 0.99998796} scale: {x: 1, y: 1, z: 1} - name: RightLowerLeg parentName: RightUpperLeg position: {x: 0.43576697, y: -4.867446e-10, z: 1.9539925e-16} rotation: {x: 0, y: 0, z: -0.041384947, w: 0.9991433} scale: {x: 1, y: 1, z: 1} - name: RightFoot parentName: RightLowerLeg position: {x: 0.42483592, y: 0.00000004328955, z: 1.9539925e-16} rotation: {x: 0, y: 0, z: 0.04628874, w: 0.9989281} scale: {x: 1, y: 1, z: 1} - name: RightToes parentName: RightFoot position: {x: 0.0758718, y: 0.1706926, z: 1.0658141e-16} rotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} scale: {x: 1, y: 1, z: 1} - name: RightToesEnd parentName: RightToes position: {x: 0.054049, y: 4.2188474e-17, z: 3.5527136e-17} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: Spine parentName: Hips position: {x: -0.0763707, y: 0.0041095037, z: 1.3457705e-17} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: Chest parentName: Spine position: {x: -0.102159195, y: 0, z: 3.418214e-17} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: UpperChest parentName: Chest position: {x: -0.099863835, y: 3.837587e-10, z: 4.2860933e-17} rotation: {x: 0, y: 0, z: 0.02762249, w: 0.9996185} scale: {x: 1, y: 1, z: 1} - name: Neck parentName: UpperChest position: {x: -0.22944902, y: 0, z: 3.8648323e-18} rotation: {x: 0, y: 0, z: -0.16252996, w: 0.98670363} scale: {x: 1, y: 1, z: 1} - name: Head parentName: Neck position: {x: -0.09720324, y: -3.5527136e-17, z: -7.336409e-18} rotation: {x: 0, y: 0, z: 0.13521273, w: 0.9908166} scale: {x: 1, y: 1, z: 1} - name: LeftEye parentName: Head position: {x: -0.04963602, y: 0.11306743, z: 0.03} rotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} scale: {x: 1, y: 1, z: 1} - name: RightEye parentName: Head position: {x: -0.04963885, y: 0.11306744, z: -0.029689595} rotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} scale: {x: 1, y: 1, z: 1} - name: Jaw parentName: Head position: {x: 0.020377725, y: 0.023429718, z: 0.000011341149} rotation: {x: -0.00011591564, y: 0.00007256035, z: -0.8476265, w: 0.53059345} scale: {x: 1, y: 1, z: 1} - name: JawEnd parentName: Jaw position: {x: -0.094900064, y: 1.8092883e-17, z: 4.9371638e-17} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftShoulder parentName: UpperChest position: {x: -0.14809349, y: 0.018417658, z: 0.041293867} rotation: {x: -0.48599797, y: 0.51362044, z: 0.48599797, w: 0.51362044} scale: {x: 1, y: 1, z: 1} - name: LeftUpperArm parentName: LeftShoulder position: {x: -0.14904714, y: 0.021559998, z: -0.026150007} rotation: {x: 0.0000000010905377, y: -0.0096692005, z: 0.0000001127794, w: 0.99995327} scale: {x: 1, y: 1, z: 1} - name: LeftLowerArm parentName: LeftUpperArm position: {x: -0.25980794, y: 1.2984311e-16, z: 1.3635393e-16} rotation: {x: 0.000000001217143, y: 0.010789105, z: -0.00000011280568, w: 0.9999418} scale: {x: 1, y: 1, z: 1} - name: LeftHand parentName: LeftLowerArm position: {x: -0.25833747, y: -4.1848454e-17, z: 7.817271e-16} rotation: {x: 0, y: -0.0011199615, z: -0, w: 0.9999994} scale: {x: 1, y: 1, z: 1} - name: LeftThumbProximal parentName: LeftHand position: {x: -0.032763172, y: -0.019399941, z: 0.032587297} rotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} scale: {x: 1, y: 1, z: 1} - name: LeftThumbIntermediate parentName: LeftThumbProximal position: {x: -0.015590345, y: -0.02269687, z: -0.0022699998} rotation: {x: 0.00000017615224, y: 0.00000044237117, z: 0.46174863, w: 0.8870109} scale: {x: 1, y: 1, z: 1} - name: LeftThumbDistal parentName: LeftThumbIntermediate position: {x: -0.03139568, y: 0, z: 2.8111882e-17} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftThumbDistalEnd parentName: LeftThumbDistal position: {x: -0.032299604, y: -1.2479823e-16, z: -3.2554504e-16} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftPinkyProximal parentName: LeftHand position: {x: -0.09005295, y: -0.01086029, z: -0.033707228} rotation: {x: 1, y: 0.00000048059263, z: 0.000000045818194, w: 0.000000002879936} scale: {x: 1, y: 1, z: 1} - name: LeftPinkyIntermediate parentName: LeftPinkyProximal position: {x: -0.020319965, y: -0.000000009765624, z: -9.310237e-10} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftPinkyDistal parentName: LeftPinkyIntermediate position: {x: -0.019660275, y: -0.000000018897165, z: -0.0000000018015959} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftPinkyDistalEnd parentName: LeftPinkyDistal position: {x: -0.021771478, y: -0.000000020926425, z: -0.0000000019950588} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftRingProximal parentName: LeftHand position: {x: -0.10098182, y: -0.008680271, z: -0.01518866} rotation: {x: 1, y: 0, z: -0, w: 0.000000002879931} scale: {x: 1, y: 1, z: 1} - name: LeftRingIntermediate parentName: LeftRingProximal position: {x: -0.028015258, y: -0.00000006713867, z: -6.120983e-11} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftRingDistal parentName: LeftRingIntermediate position: {x: -0.029936645, y: -0.00000014348656, z: 0} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftRingDistalEnd parentName: LeftRingDistal position: {x: -0.026132211, y: -0.00000012525189, z: 0} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftMiddleProximal parentName: LeftHand position: {x: -0.10176471, y: -0.009200126, z: 0.0076735215} rotation: {x: 1, y: 0.000001953623, z: 5.6263126e-15, w: 0.0000000028799376} scale: {x: 1, y: 1, z: 1} - name: LeftMiddleIntermediate parentName: LeftMiddleProximal position: {x: -0.03811528, y: -0.00000007446289, z: 2.8247632e-11} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftMiddleDistal parentName: LeftMiddleIntermediate position: {x: -0.027341224, y: -0.0000001068289, z: 0} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftMiddleDistalEnd parentName: LeftMiddleDistal position: {x: -0.029609164, y: -0.00000011569029, z: 0} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftIndexProximal parentName: LeftHand position: {x: -0.10144374, y: -0.010422724, z: 0.032279857} rotation: {x: 1, y: -0.00000080360593, z: -0.00000003485639, w: 0.0000000028799356} scale: {x: 1, y: 1, z: 1} - name: LeftIndexIntermediate parentName: LeftIndexProximal position: {x: -0.03038064, y: 0.000000024414062, z: 0.0000000010589601} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftIndexDistal parentName: LeftIndexIntermediate position: {x: -0.023295304, y: 0.00000006185455, z: 0.0000000026829414} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: LeftIndexDistalEnd parentName: LeftIndexDistal position: {x: -0.027728153, y: 0.000000044565017, z: 0.000000001933008} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightShoulder parentName: UpperChest position: {x: -0.14809349, y: 0.018417655, z: -0.041293897} rotation: {x: 0.51362044, y: 0.48599797, z: -0.51362044, w: 0.48599797} scale: {x: 1, y: 1, z: 1} - name: RightUpperArm parentName: RightShoulder position: {x: 0.14904709, y: -0.021559998, z: 0.026150005} rotation: {x: 0.0000000010905377, y: -0.0096692005, z: 0.0000001127794, w: 0.99995327} scale: {x: 1, y: 1, z: 1} - name: RightLowerArm parentName: RightUpperArm position: {x: 0.2598076, y: -0.000000058593667, z: 0.0000000065556907} rotation: {x: 0.000000001217143, y: 0.010789105, z: -0.00000011280568, w: 0.9999418} scale: {x: 1, y: 1, z: 1} - name: RightHand parentName: RightLowerArm position: {x: 0.25833765, y: 8.2224006e-13, z: -0.0000000040112766} rotation: {x: 0, y: -0.0011199615, z: -0, w: 0.9999994} scale: {x: 1, y: 1, z: 1} - name: RightThumbProximal parentName: RightHand position: {x: 0.032763, y: 0.019399999, z: -0.03258728} rotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} scale: {x: 1, y: 1, z: 1} - name: RightThumbIntermediate parentName: RightThumbProximal position: {x: 0.015591, y: 0.0226969, z: 0.0022699998} rotation: {x: 0.00000017597144, y: 0.00000044227704, z: 0.46174863, w: 0.8870109} scale: {x: 1, y: 1, z: 1} - name: RightThumbDistal parentName: RightThumbIntermediate position: {x: 0.031395752, y: -0.00000016593874, z: 0.00000001956757} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightThumbDistalEnd parentName: RightThumbDistal position: {x: 0.032299694, y: 0.00000041872633, z: 0.000000020130532} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightPinkyProximal parentName: RightHand position: {x: 0.09005299, y: 0.01086, z: 0.03370722} rotation: {x: 1, y: 0.0000009611853, z: 0.00000009163637, w: 0.00000048049026} scale: {x: 1, y: 1, z: 1} - name: RightPinkyIntermediate parentName: RightPinkyProximal position: {x: 0.02032, y: 0.0000000390623, z: 0.0000000037241212} rotation: {x: 0.00000067755235, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightPinkyDistal parentName: RightPinkyIntermediate position: {x: 0.01966, y: 0.00000003779355, z: 0.0000000036031094} rotation: {x: 0.00000052042185, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightPinkyDistalEnd parentName: RightPinkyDistal position: {x: 0.021772001, y: 0.000000041853575, z: 0.000000003990134} rotation: {x: 0.00000086590364, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightRingProximal parentName: RightHand position: {x: 0.100981995, y: 0.00868, z: 0.0151886195} rotation: {x: 1, y: 0, z: -0, w: 6.123234e-17} scale: {x: 1, y: 1, z: 1} - name: RightRingIntermediate parentName: RightRingProximal position: {x: 0.028015, y: -3.6322944e-13, z: 2.509104e-16} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightRingDistal parentName: RightRingIntermediate position: {x: 0.029937, y: -3.8795632e-13, z: 2.7311487e-16} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightRingDistalEnd parentName: RightRingDistal position: {x: 0.026131999, y: -3.3821833e-13, z: 2.3536727e-16} rotation: {x: 0, y: -0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightMiddleProximal parentName: RightHand position: {x: 0.101765, y: 0.0092, z: -0.0076735197} rotation: {x: 1, y: 0.000003907246, z: 7.633312e-12, w: 0.0000019536299} scale: {x: 1, y: 1, z: 1} - name: RightMiddleIntermediate parentName: RightMiddleProximal position: {x: 0.038115, y: 0.00000029784886, z: 1.164116e-12} rotation: {x: 0.0000027608096, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightMiddleDistal parentName: RightMiddleIntermediate position: {x: 0.027341, y: 0.00000021365567, z: -3.446715e-13} rotation: {x: 0.0000021149021, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightMiddleDistalEnd parentName: RightMiddleDistal position: {x: 0.029609999, y: 0.00000023138672, z: -1.3519946e-12} rotation: {x: 0.000003517392, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightIndexProximal parentName: RightHand position: {x: 0.10144399, y: 0.010419999, z: -0.03227988} rotation: {x: 1, y: -0.0000016072119, z: -0.00000006971279, w: 0.0000008035582} scale: {x: 1, y: 1, z: 1} - name: RightIndexIntermediate parentName: RightIndexProximal position: {x: 0.030381, y: -0.00000009765779, z: -0.0000000042359667} rotation: {x: 0.0000011344717, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightIndexDistal parentName: RightIndexIntermediate position: {x: 0.023294998, y: -0.000000074880305, z: -0.000000003247809} rotation: {x: 0.00000087025205, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} - name: RightIndexDistalEnd parentName: RightIndexDistal position: {x: 0.027727999, y: -0.000000089129905, z: -0.0000000038657064} rotation: {x: 0.0000014476384, y: 0, z: -0, w: 1} scale: {x: 1, y: 1, z: 1} armTwist: 0.5 foreArmTwist: 0.5 upperLegTwist: 0.5 legTwist: 0.5 armStretch: 0.05 legStretch: 0.05 feetSpacing: 0 rootMotionBoneName: rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} hasTranslationDoF: 1 hasExtraRoot: 1 skeletonHasParents: 1 lastHumanDescriptionAvatarSource: {fileID: 9000000, guid: 20d97ea0953936148b25caa82b5e14f9, type: 3} animationType: 3 humanoidOversampling: 1 additionalBone: 0 userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
################################################################# # Adds a build target called "coverage" for code coverage. # # This compiles the code using special GCC flags, run the tests, # and then generates a nice HTML output. This new "coverage" make # target will only be available if you build using GCC in Debug # mode. If any of the required programs (lcov and genhtml) were # not found, a FATAL_ERROR message is printed. # # If not already done, this code will set ENABLE_TEST to ON. # # To build the code coverage and open it in your browser do this: # # mkdir debug # cd debug # cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON .. # make -j4 # make coverage # xdg-open coverage/index.html ################################################################# # Find programs we need FIND_PROGRAM(LCOV_EXECUTABLE lcov DOC "Full path to lcov executable") FIND_PROGRAM(GENHTML_EXECUTABLE genhtml DOC "Full path to genhtml executable") MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE) # Check, compiler, build types and programs are available IF(NOT CMAKE_COMPILER_IS_GNUCC) MESSAGE(FATAL_ERROR "Coverage can only be built on GCC") ELSEIF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") MESSAGE(FATAL_ERROR "Coverage can only be built in Debug mode") ELSEIF(NOT LCOV_EXECUTABLE) MESSAGE(FATAL_ERROR "lcov executable not found") ELSEIF(NOT GENHTML_EXECUTABLE) MESSAGE(FATAL_ERROR "genhtml executable not found") ENDIF(NOT CMAKE_COMPILER_IS_GNUCC) # Enable testing if not already done SET(ENABLE_TEST ON) ################################################################# # Set special compiler and linker flags for test coverage ################################################################# # 0. Enable debug: -g SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") # 1. Disable optimizations: -O0 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0") # 2. Enable all kind of warnings: SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W") # 3. Enable special coverage flag (HINT: --coverage is a synonym for -fprofile-arcs -ftest-coverage) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") ################################################################# ADD_CUSTOM_TARGET(coverage COMMAND ${CMAKE_COMMAND} -E echo "Beginning test coverage. Output is written to coverage.log." COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-1/5: Reset all execution counts to zero" COMMAND ${LCOV_EXECUTABLE} --directory . --zerocounters > coverage.log 2>&1 COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-2/5: Run testrunner" COMMAND ${CMAKE_CTEST_COMMAND} >> coverage.log 2>&1 COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-3/5: Collect coverage data" COMMAND ${LCOV_EXECUTABLE} --capture --directory . --output-file "./coverage.info" >> coverage.log 2>&1 COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-4/5: Generate HTML from coverage data" COMMAND ${GENHTML_EXECUTABLE} "coverage.info" --title="libarchive-${LIBARCHIVE_VERSION_STRING}" --show-details --legend --output-directory "./coverage" >> coverage.log 2>&1 COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-5/5: Open test coverage HTML output in browser: xdg-open ./coverage/index.html" COMMENT "Runs testrunner and generates coverage output (formats: .info and .html)")
{ "pile_set_name": "Github" }
{ "accountLinkingWhitelistedDomains": null, "asin": "B01M0J61HH", "averageRating": 0, "canDisable": true, "capabilities": null, "category": null, "description": "Random Facts gives out a random fact when the user prompts the skill for one. Each time, it will give a new random fact.", "enablement": null, "exampleInteractions": [ "Alexa open random facts", "Alexa ask random facts", "" ], "firstReleaseDate": 1475647944.583, "homepageLinkText": null, "homepageLinkUrl": null, "id": "amzn1.ask.skill.ca44c58d-c4e2-467b-b047-76388cc70885", "imageAltText": "Random Facts icon", "imageUrl": "https://github.com/dale3h/alexa-skills-list/raw/master/skills/B01M0J61HH/skill_icon", "inAppPurchasingSupported": false, "launchPhrase": "random facts", "name": "Random Facts", "numberOfReviews": 0, "pamsPartnerId": null, "permissions": null, "privacyPolicyUrl": null, "shortDescription": "Random Facts gives out a random fact when the user asks for one.", "skillTypes": null, "stage": "live", "termsOfUseUrl": null, "vendorId": "M3PN926TOAH4M6", "vendorName": "Dogbeast" }
{ "pile_set_name": "Github" }
{ "id": "shipstation", "title": "ShipStation Developer Portal", "description": "# Integrating with ShipStation\n\nShipStation strives to streamline shipping for online sellers, no matter where they sell their products online. We are continuously adding new marketplaces, shopping carts, and integration tools, because we know the e-commerce space is growing. \nAs a result, we’ve worked hard to provide developer resources to build custom integrations with ShipStation. If you’re interested in becoming a partner of ours, drop us a line by [filling out this form](http://www.shipstation.com/partners/shipstation-api-custom-store/) and we’ll get in touch.\n\nThere are two methods to integrate with ShipStation:\n\n* Custom Store Integration\n\n* ShipStation API\n\n## Custom Store Integration\n\nLooking for a more 1-to-1 relationship between ShipStation and your chosen selling platform? The Custom Store Integration is the ticket. Our custom store integration is just like any of our other selling channel integration, and could be eligible (based on internal review) as a branded option within the ShipStation admin. It also allows the user to sync orders within ShipStation in a single click, in addition to ShipStation automatically sending shipment status and tracking information \nupdates back to your cart or marketplace once a label is created. It’s the best way to sync up orders with ShipStation and have the most seamless experience.\n\nThe Custom Store allows you to perform two major functions:\n\n* Provide order information to ShipStation, including recipient address, products, customers, etc.\n\n* Receive tracking information when an order is shipped, including shipping method, shipping status, tracking number, and more\n\nTo integrate with the Custom Store, you must expose a web page that renders XML that adheres to the specification defined in the Custom Store Integration Guide. \nWe refer to this page as your “XML Endpoint”. If you can provide us an XML Endpoint, we can *pull* data from your endpoint just like we do with other marketplaces like eBay and Amazon.\n\n**To find out more about our Custom Store Integration, click here: [Custom Store Integration Guide](https://help.shipstation.com/hc/en-us/articles/205928478)**\n\n## ShipStation API\n\nOur API is available for any plan, and allows for read access to almost all data in your account, and write access to create specific objects, like Orders, Customers, and Products. \nThe API is a great way to get data directly to and from ShipStation, like creating products, customers, and querying order & shipping data. Please note that an API integration will not allow you to use your own MarketplaceID that could eventually be branded with your company's logo (see the Custom Store Integration above for that functionality).\n\n**This API allows developers to build applications that interface with the ShipStation platform. The API can be used to automate many tasks including:**\n\n+ Managing Orders\n\n+ Managing Shipments\n\n+ Creating Shipping Labels\n\n+ Retrieving Shipping Rates\n\n+ and more!!!\n\n**To learn more about our API, please review our API documentation below.**\n\n## Which one should I pick?\n\nThe method that's right for your integration very much depends on the type of integration you're planning on implementing. A Custom Store allows ShipStation to *pull* order information from your platform the very same way we *pull* data from marketplaces such as eBay, Amazon, and Shopify. Once an order has been shipped in ShipStation, ShipStation automatically *pushes* tracking information back to your custom store. Though the functionality afforded by this approach is limited to these 2 main functions, much of the *heavy lifting* is performed by ShipStation. Importing orders \nand sending tracking information is performed automatically by ShipStation, as long as your XML endpoint is available to receive our data.\n\nAn API integration, on the other hand, exposes much more functionality, but requires that the developer do much of the heavy lifting. Orders must be *pushed* to ShipStation by using our \"/orders/CreateOrder\" endpoint. The API allows developers to perform functions such as tagging an order, \nshipping an order, creating a shipping label (without an order), retrieving shipping rates, adding funds to a carrier account, creating a warehouse, listing products, and much more. The functionality the API affords are typical actions that a user would perform if using the web app.\n\n### Considerations\n\n* **Will your integration be the main order management tool for the online seller?** If so, the API's broader range of functionality may be the best option.\n\n* **Would you like your store integration to be a branded marketplace within the ShipStation admin?** When you integrate using the Custom Store Integration, you could be eligible to have your company branded within the ShipStation admin. A branded store could have the plugin's logo in the app,\nas well as an easier store setup, order sync, and reporting. Please note, ShipStation makes the final decision, based on integration and partner requirements, on which custom stores are branded within our application.\n\n# ShipStation API Requirements\n\n## End Point\n\nEndpoints are located at the following domain https://ssapi.shipstation.com/ and will need to have a specific reference added to return data. PLEASE NOTE: You cannot access this URL directly and must reference one of the specific endpoints below.\n\n## Authentication\n\nThe ShipStation API uses [Basic HTTP authentication](http://en.wikipedia.org/wiki/Basic_access_authentication). Use your ShipStation ``API Key`` as the username and ``API Secret`` as the password. You can find your ``API Key`` as the username and ``API Secret`` under Settings at https://ss.shipstation.com/#/settings/api .\n\nThe Authorization header is constructed as follows:\n\n+ Username (``API KEY``) and password (``API Secret``) are combined into a string \"username:password\"\n\n+ The resulting string is then encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line\n\n+ The authorization method and a space i.e. \"Basic \" is then put before the encoded string.\n\nFor example, if the ``API KEY`` given is 'ShipStation' and the ``API Secret`` is 'Rocks' then the header is formed as follows:\n\n+ Authorization: Basic U2hpcFN0YXRpb246Um9ja3M=\n\n## API Rate Limits\n\nIn an effort to ensure consistent application performance and increased scalability, we have implemented rate limiting on the ShipStation API. Your integration will need to be able to handle HTTP rate limiting status messages as defined below:\n\n**Response Headers**\n\nAll responses will include headers with status information about rate limiting.\n\n1. X-Rate-Limit-Limit: the maximum number of requests per minute to the endpoint\n\n2. X-Rate-Limit-Remaining: the available requests remaining in the current window\n\n3. X-Rate-Limit-Reset: the number of seconds remaining until the next window begins\n\n**Hitting the Limit**\n\nIf your application hits the rate limit, an HTTP 429 will be returned with this body:\n\n```\n{\n \"message\": \"Too Many Requests\"\n}\n```\n\nAnd these headers, assuming it is 40 seconds into the current window:\n\n```\n{\n \"X-Rate-Limit-Limit\": 60,\n \"X-Rate-Limit-Remaining\": 0,\n \"X-Rate-Limit-Reset\": 20\n}\n```\n\nWhen the limit is reached, your application should stop making requests until X-Rate-Limit-Reset seconds have elapsed. The current Rate limit for each set of the API Key and Secret is 40 requests per minute.\n\nIf you have any issues with the API, please email us at <[email protected]>\n\n## Server Responses\n\nStatus Code | Description\n------------|-------------\n``200`` | OK - The request was successful (some API calls may return 201 instead).\n``201`` | Created - The request was successful and a resource was created.\n``204`` | No Content - The request was successful but there is no representation to return (that is, the response is empty).\n``400`` | Bad Request - The request could not be understood or was missing required parameters.\n``401`` | Unauthorized - Authentication failed or user does not have permissions for the requested operation.\n``403`` | Forbidden - Access denied.\n``404`` | Not Found - Resource was not found.\n``405`` | Method Not Allowed - Requested method is not supported for the specified resource.\n``429`` | Too Many Requests - Exceeded ShipStation API limits. When the limit is reached, your application should stop making requests until X-Rate-Limit-Reset seconds have elapsed.\n``500`` | Internal Server Error - ShipStation has encountered an error.\n\n## DateTime Format and Time Zone\n\nShipStation uses the ISO 8601 combined format for dateTime stamps being submitted to and returned from the API. Please be sure to submit all dateTime values as follows:\n\nyyyy-mm-dd hh:mm:ss (24 hour notation). Example - ``2016-11-29 23:59:59``\n\nThe time zone represented in all API responses is PST/PDT. Similarly, ShipStation asks that you make all time zone convertions and submit any dateTime requests in PST/PDT.", "security": {}, "logo": { "url": "https://s3-us-west-2.amazonaws.com/datafire-logos/shipstation.jpg" }, "actionCount": 51, "definitions": { "Add_Funds": { "title": "Add_Funds" }, "Add_FundsModel": { "title": "Add_FundsModel" }, "Add_Tag_to_Order": { "title": "Add_Tag_to_Order" }, "Assign_User_to_Order": { "title": "Assign_User_to_Order" }, "Create/Update_Multiple_Orders": { "title": "Create/Update_Multiple_Orders" }, "Create/Update_Order": { "title": "Create/Update_Order" }, "Create_Label_for_Order": { "title": "Create_Label_for_Order" }, "Create_Shipment_Label": { "title": "Create_Shipment_Label" }, "Create_Warehouse": { "title": "Create_Warehouse" }, "Customer": { "title": "Customer" }, "CustomerModel": { "title": "CustomerModel" }, "Deactivate_Store": { "title": "Deactivate_Store" }, "Get/Delete_Order": { "title": "Get/Delete_Order" }, "Get/Delete_OrderModel": { "title": "Get/Delete_OrderModel" }, "Get/Update_Store": { "title": "Get/Update_Store" }, "Get/Update_StoreModel": { "title": "Get/Update_StoreModel" }, "Get/Update_Warehouse": { "title": "Get/Update_Warehouse" }, "Get/Update_WarehouseModel": { "title": "Get/Update_WarehouseModel" }, "Get/Update_a_Product": { "title": "Get/Update_a_Product" }, "Get/Update_a_ProductModel": { "title": "Get/Update_a_ProductModel" }, "Get_Carrier": { "title": "Get_Carrier" }, "Get_CarrierModel": { "title": "Get_CarrierModel" }, "Get_Delete_Order": { "title": "Get_Delete_Order" }, "Get_Delete_OrderModel": { "title": "Get_Delete_OrderModel" }, "Get_Rates": { "title": "Get_Rates" }, "Get_Store_Refresh_Status": { "title": "Get_Store_Refresh_Status" }, "Get_Update_Store": { "title": "Get_Update_Store" }, "Get_Update_StoreModel": { "title": "Get_Update_StoreModel" }, "Get_Update_Warehouse": { "title": "Get_Update_Warehouse" }, "Get_Update_WarehouseModel": { "title": "Get_Update_WarehouseModel" }, "Get_Update_a_Product": { "title": "Get_Update_a_Product" }, "Get_Update_a_ProductModel": { "title": "Get_Update_a_ProductModel" }, "Hold_Order_Until": { "title": "Hold_Order_Until" }, "List_Carriers": { "title": "List_Carriers" }, "List_CarriersModel": { "title": "List_CarriersModel" }, "List_Customers": { "title": "List_Customers" }, "List_CustomersModel": { "title": "List_CustomersModel" }, "List_Fulfillments": { "title": "List_Fulfillments" }, "List_FulfillmentsModel": { "title": "List_FulfillmentsModel" }, "List_Marketplaces": { "title": "List_Marketplaces" }, "List_Orders": { "title": "List_Orders" }, "List_OrdersModel": { "title": "List_OrdersModel" }, "List_Orders_by_Tag": { "title": "List_Orders_by_Tag" }, "List_Packages": { "title": "List_Packages" }, "List_PackagesModel": { "title": "List_PackagesModel" }, "List_Products": { "title": "List_Products" }, "List_ProductsModel": { "title": "List_ProductsModel" }, "List_Services": { "title": "List_Services" }, "List_ServicesModel": { "title": "List_ServicesModel" }, "List_Shipments": { "title": "List_Shipments" }, "List_ShipmentsModel": { "title": "List_ShipmentsModel" }, "List_Stores": { "title": "List_Stores" }, "List_Tags": { "title": "List_Tags" }, "List_TagsModel": { "title": "List_TagsModel" }, "List_Users": { "title": "List_Users" }, "List_UsersModel": { "title": "List_UsersModel" }, "List_Warehouses": { "title": "List_Warehouses" }, "List_Webhooks": { "title": "List_Webhooks" }, "Mark_an_Order_as_Shipped": { "title": "Mark_an_Order_as_Shipped" }, "Reactivate_Store": { "title": "Reactivate_Store" }, "Refresh_Store": { "title": "Refresh_Store" }, "Register_Account": { "title": "Register_Account" }, "Register_AccountModel": { "title": "Register_AccountModel" }, "Remove_Tag_from_Order": { "title": "Remove_Tag_from_Order" }, "Restore_Order_from_On_Hold": { "title": "Restore_Order_from_On_Hold" }, "Subscribe_to_Webhook": { "title": "Subscribe_to_Webhook" }, "Subscribe_to_WebhookModel": { "title": "Subscribe_to_WebhookModel" }, "Unassign_User_from_Order": { "title": "Unassign_User_from_Order" }, "Unsubscribe_to_Webhook": { "title": "Unsubscribe_to_Webhook" }, "Void_Label": { "title": "Void_Label" } }, "actions": [ { "id": "accounts.listtags.get", "title": "accounts.listtags.get", "description": "Lists all tags defined for this account.", "inputSchema": {}, "outputSchema": {} }, { "id": "accounts.registeraccount.post", "title": "accounts.registeraccount.post", "description": "Creates a new ShipStation account and generates an apiKey and apiSecret to be used by the newly created account. PLEASE NOTE: This endpoint does not require API key and API Secret credentials. The Authorization header can be left off. Use of this specific endpoint requires approval, and is meant only for direct partners of ShipStation. This is the only endpoint to require approval. All other endpoints listed in this document can be accessed by submitting proper authorization credentials in the header of the request. To become a direct partner of ShipStation, or to request more information on becoming a direct partner, we recommend reaching out to our Partners and Integrations team here: https://info.shipstation.com/become-a-partner-api-and-custom-store-integrations\n\nThe body of this request has the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``firstName`` | string, required | First Name\n``lastName`` | string, required | Last Name\n``email`` | string, required | Email address. This will also be the username of the account.\n``password`` | string, required | Password to set for account access.\n``companyName`` | string, optional | Name of Company.\n``addr1`` | string, optional | Company Address - Street 1\n``addr2`` | string, optional | Company Address - Street 2\n``city`` | string, optional | Company Address - City\n``state`` | string, optional | Company Address - State \n``zip`` | string, optional | Company Address - Zip Code\n``countryCode`` |string, optional | Company Address - Country. Please use a 2-character country code.\n``phone`` | string, optional | Company Phone number.", "inputSchema": {}, "outputSchema": {} }, { "id": "carriers.get", "title": "carriers.get", "description": "Lists all shipping providers connected to this account.", "inputSchema": {}, "outputSchema": {} }, { "id": "carriers.addfunds.post", "title": "carriers.addfunds.post", "description": "Adds funds to a carrier account using the payment information on file. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n ``carrierCode`` | string, required | The carrier to add funds to.\n ``amount`` | number, required | The dollar amount to add to the account. The minimum value that can be added is $10.00. The maximum value is $10,000.00.", "inputSchema": {}, "outputSchema": {} }, { "id": "carriers.getcarrier_carrierCode_carrierCode.get", "title": "carriers.getcarrier_carrierCode_carrierCode.get", "description": "Retrieves the shipping carrier account details for the specified carrierCode. Use this method to determine a carrier's account balance.", "inputSchema": { "type": "object", "properties": { "carrierCode": { "type": "string", "description": "The code for the carrier account to retrieve." } }, "additionalProperties": false, "required": [ "carrierCode" ] }, "outputSchema": {} }, { "id": "carriers.listpackages_carrierCode_carrierCode.get", "title": "carriers.listpackages_carrierCode_carrierCode.get", "description": "Retrieves a list of packages for the specified carrier", "inputSchema": { "type": "object", "properties": { "carrierCode": { "type": "string", "description": "The carrier's code" } }, "additionalProperties": false, "required": [ "carrierCode" ] }, "outputSchema": {} }, { "id": "carriers.listservices_carrierCode_carrierCode.get", "title": "carriers.listservices_carrierCode_carrierCode.get", "description": "Retrieves the list of available shipping services provided by the specified carrier", "inputSchema": { "type": "object", "properties": { "carrierCode": { "type": "string", "description": "The carrier's code" } }, "additionalProperties": false, "required": [ "carrierCode" ] }, "outputSchema": {} }, { "id": "customers.customerId.get", "title": "customers.customerId.get", "description": "Get Customer", "inputSchema": { "type": "object", "properties": { "customerId": { "type": "number", "description": "The system generated identifier for the Customer." } }, "additionalProperties": false, "required": [ "customerId" ] }, "outputSchema": {} }, { "id": "customers_stateCode_stateCode_countryCode_countryCode_tagId_tagId_marketplaceId_marketplaceId_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "title": "customers_stateCode_stateCode_countryCode_countryCode_tagId_tagId_marketplaceId_marketplaceId_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "description": "Obtains a list of customers that match the specified criteria.", "inputSchema": { "type": "object", "properties": { "stateCode": { "type": "string", "description": "Returns customers that reside in the specified stateCode." }, "countryCode": { "type": "string", "description": "Returns customers that reside in the specified countryCode." }, "marketplaceId": { "type": "number", "description": "Returns customers that purchased items from the specified marketplaceId." }, "tagId": { "type": "number", "description": "Returns customers that have been tagged with the specified tagId." }, "sortBy": { "type": "string", "description": "Sorts the order of the response based off the specified value.", "enum": [ "Name", "ModifyDate", "CreateDate" ] }, "sortDir": { "type": "string", "description": "Sets the direction of the sort order.", "enum": [ "ASC", "DESC" ] }, "page": { "type": "number", "description": "Page number.", "default": 1 }, "pageSize": { "type": "number", "description": "Requested page size. Max value is 500.", "default": 100 } }, "additionalProperties": false, "required": [ "stateCode", "countryCode", "marketplaceId", "tagId", "sortBy", "sortDir", "page", "pageSize" ] }, "outputSchema": {} }, { "id": "fulfillments.get", "title": "fulfillments.get", "description": "List Fulfillments w/o parameters", "inputSchema": {}, "outputSchema": {} }, { "id": "fulfillments_fulfillmentId_fulfillmentId_orderId_orderId_orderNumber_orderNumber_trackingNumber_trackingNumber_recipientName_recipientName_createDateStart_createDateStart_createDateEnd_createDateEnd_shipDateStart_shipDateStart_shipDateEnd_shipDateEnd_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "title": "fulfillments_fulfillmentId_fulfillmentId_orderId_orderId_orderNumber_orderNumber_trackingNumber_trackingNumber_recipientName_recipientName_createDateStart_createDateStart_createDateEnd_createDateEnd_shipDateStart_shipDateStart_shipDateEnd_shipDateEnd_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "description": "Obtains a list of fulfillments that match the specified criteria. Please note the following:\n\n- Orders that have been marked as shipped either through the UI or the API will appear in the response as they are considered fulfillments.\n\nAll of the available filters are optional. They do not need to be included in the URL. If you do include them, here's what the URL may look like:\n\nUrl format with filters:\n\n```\nfulfillments?fulfillmentId={fulfillmentId}\n&orderId={orderId}\n&orderNumber={orderNumber}\n&trackingNumber={trackingNumber}\n&recipientName={recipientName}\n&createDateStart={createDateStart}\n&createDateEnd={createDateEnd}\n&shipDateStart={shipDateStart}\n&shipDateEnd={shipDateEnd}\n&sortBy={sortBy}\n&sortDir={sortDir}\n&page={page}\n&pageSize={pageSize}\n```", "inputSchema": { "type": "object", "properties": { "fulfillmentId": { "type": "number", "description": "Returns the fulfillment with the specified fulfillment ID." }, "orderId": { "type": "number", "description": "Returns fulfillments whose orders have the specified order ID." }, "orderNumber": { "type": "string", "description": "Returns fulfillments whose orders have the specified order number." }, "trackingNumber": { "type": "string", "description": "Returns fulfillments with the specified tracking number." }, "recipientName": { "type": "string", "description": "Returns fulfillments shipped to the specified recipient name." }, "createDateStart": { "type": "string", "description": "Returns fulfillments created on or after the specified ``createDate``" }, "createDateEnd": { "type": "string", "description": "Returns fulfillments created on or before the specified ``createDate``" }, "shipDateStart": { "type": "string", "description": "Returns fulfillments with the ``shipDate`` on or after the specified date" }, "shipDateEnd": { "type": "string", "description": "Returns fulfillments with the ``shipDate`` on or before the specified date" }, "sortBy": { "type": "string", "description": "Sort the responses by a set value. The response will be sorted based off the ascending dates (oldest to most current.) If left empty, the response will be sorted by ascending ``createDate``.", "enum": [ "ShipDate", "CreateDate" ] }, "sortDir": { "type": "string", "description": "Sets the direction of the sort order.", "enum": [ "ASC", "DESC" ] }, "page": { "type": "number", "description": "page number.", "default": 1 }, "pageSize": { "type": "number", "description": "page size.", "default": 100 } }, "additionalProperties": false, "required": [ "fulfillmentId", "orderId", "orderNumber", "trackingNumber", "recipientName", "createDateStart", "createDateEnd", "shipDateStart", "shipDateEnd", "sortBy", "sortDir", "page", "pageSize" ] }, "outputSchema": {} }, { "id": "orders.get", "title": "orders.get", "description": "List Orders w/o parameters", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.addtag.post", "title": "orders.addtag.post", "description": "Adds a tag to an order. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderId`` | number, required | Identifies the order that will be tagged.\n``tagId`` | number, required | Identifies the tag that will be applied to the order.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.assignuser.post", "title": "orders.assignuser.post", "description": "Assigns a user to an order. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderIds`` | number, required | Identifies set of orders that will be assigned the user. Please note that if ANY of the orders within the array are not found, no orders will have a user assigned to them.\n``userId`` | number, required | Identifies the user that will be applied to the orders. It should contain a GUID of the user to be assigned to the array of orders.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.createlabelfororder.post", "title": "orders.createlabelfororder.post", "description": "Creates a shipping label for a given order. The ``labelData`` field returned in the response is a base64 encoded PDF value. Simply decode and save the output as a PDF file to retrieve a printable label. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderId`` | number, required | Identifies the order that will be shipped.\n``carrierCode`` | string, required | The code for the carrier that is to be used for the label.\n``serviceCode`` | string, required | The code for the shipping service that is to be used for the label.\n``confirmation`` | string, required | The type of delivery confirmation that is to be used once the shipment is created. Possible values: ``none``, ``delivery``, ``signature``, ``adult_signature``, and ``direct_signature``. ``direct_signature`` is available for FedEx only.\n``shipDate`` | string, required | The date the order should be shipped.\n``weight`` | Weight, optional | Weight of the order. Use the [**Weight**](http://www.shipstation.com/developer-api/#/reference/model-weight) model.\n``dimensions`` | Dimensions, optional | Dimensions of the order. Use [**Dimensions**](http://www.shipstation.com/developer-api/#/reference/model-dimensions) model.\n``insuranceOptions`` | InsuranceOptions, optional | The shipping insurance information associated with this label. Use the [**InsuranceOptions**](http://www.shipstation.com/developer-api/#/reference/model-insuranceoptions) model.\n``internationalOptions`` | InternationalOptions, optional | Customs information that can be used to generate customs documents for international orders. Use the [**InternationalOptions**](http://www.shipstation.com/developer-api/#/reference/model-internationaloptions) model.\n``advancedOptions`` | AdvancedOptions, optional | Various advanced options that may be available depending on the shipping carrier that is used to ship the order. Use the Customs information that can be used to generate customs documents for international orders. Use the [**AdvancedOptions**](http://www.shipstation.com/developer-api/#/reference/model-advancedoptions) model.\n``testLabel`` | boolean, required | Specifies whether a test label should be created.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.createorder.post", "title": "orders.createorder.post", "description": "If the ``orderKey`` is specified, the method becomes idempotent and the existing order with that key will be updated. Note: Only orders in an open status in ShipStation (``awaiting_payment``,``awaiting_shipment``, and ``on_hold``) can be updated through this method. ``cancelled`` and ``shipped`` are locked from modification through the API. The body of this request should specify an [**Order**](https://www.shipstation.com/developer-api/#/reference/model-order) object:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderNumber`` | string, required | A user-defined order number used to identify an order.\n``orderKey`` | string, optional | A user-provided key that should be unique to each order. If an orderKey is not provided, ShipStation will create a new order and generate a unique orderKey for that order. If the orderKey *is* provided, the **createorder** method will either: create a new order if the provided orderKey is not found, or, update the existing order if the orderKey is found.\n``orderDate`` | string, required | The date the order was placed.\n``paymentDate`` | string, optional | The date the order was paid for.\n``shipByDate`` | string, optional | The date the order is to be shipped before or on. This field is a suggested value generated by the order source/platform/cart and passed to ShipStation.\n``orderStatus`` | string, required | The order's status. Possible values: ``awaiting_payment``, ``awaiting_shipment``, ``shipped``, ``on_hold``, ``cancelled``\n``customerUsername`` | string, optional | The customer's username.\n``customerEmail`` | string, optional | The customer's email address.\n``billTo`` | Address, required | The recipients billing address. Use the [**Address**](https://www.shipstation.com/developer-api/#/reference/model-address) model.\n``shipTo`` | Address, required | The recipient's shipping address. Use the [**Address**](http://www.shipstation.com/developer-api/#/reference/model-address) model.\n``items`` | OrderItem, optional | An array of item objects. Use an array of [**OrderItem**](http://www.shipstation.com/developer-api/#/reference/model-orderitem) models.\n``amountPaid`` | number, optional | The total amount paid for the Order.\n``taxAmount`` | number, optional | The total tax amount for the Order.\n``shippingAmount`` | number, optional | Shipping amount paid by the customer, if any.\n``customerNotes`` | string, optional | Notes left by the customer when placing the order.\n``internalNotes`` | string, optional | Private notes that are only visible to the seller.\n``gift`` | boolean, optional | Specifies whether or not this Order is a gift\n``giftMessage`` | string, optional | Gift message left by the customer when placing the order.\n``paymentMethod`` | string, optional | Identifies the shipping service selected by the customer when placing this order.\n``requestedShippingService`` | string, optional |Identifies the shipping service selected by the customer when placing this order. This value is given to ShipStation by the marketplace/cart and helps identify what shipping service the customer selected upon checkout.\n``carrierCode`` | string, optional | The code for the carrier that is to be used(or was used) when this order is shipped(was shipped).\n``serviceCode`` | string, optional | The code for the shipping service that is to be used(or was used) when this order is shipped(was shipped).\n``packageCode`` | string, optional | The code for the package type that is to be used(or was used) when this order is shipped(was shipped).\n``confirmation`` | string, optional | The type of delivery confirmation that is to be used(or was used) when this order is shipped(was shipped). Possible values: ``none``, ``delivery``, ``signature``, ``adult_signature``, and ``direct_signature``. ``direct_signature`` is available for FedEx only. \n``shipDate`` | string, optional | The date the order was shipped.\n``weight`` | Weight, optional | Weight of the order. Use the [**Weight**](http://www.shipstation.com/developer-api/#/reference/model-weight) model.\n``dimensions`` | Dimensions, optional | Dimensions of the order. Use the [**Dimensions**](http://www.shipstation.com/developer-api/#/reference/model-dimensions) model.\n``insuranceOptions`` | InsuranceOptions, optional | The shipping insurance information associated with this order. Use the [**InsuranceOptions**](http://www.shipstation.com/developer-api/#/reference/model-insuranceoptions) model.\n``internationalOptions`` | InternationalOptions, optional | Customs information that can be used to generate customs documents for international orders. Use the [**InternationalOptions**](http://www.shipstation.com/developer-api/#/reference/model-internationaloptions) model.\n``advancedOptions`` | AdvancedOptions, optional | Various advanced options that may be available depending on the shipping carrier that is used to ship the order. Use the [**AdvancedOptions**](http://www.shipstation.com/developer-api/#/reference/model-advancedoptions) model.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.createorders.post", "title": "orders.createorders.post", "description": "This endpoint can be used to create or update multiple orders in one request. If the ``orderKey`` is specified in an order, the existing order with that key will be updated. Note: Only orders in an open status in ShipStation (``awaiting_payment``,``awaiting_shipment``, and ``on_hold``) can be updated through this method. ``cancelled`` and ``shipped`` are locked from modification through the API.\n\nData Type |Description\n-------------------|-------------------\nOrder, required | An array of [**Order**](http://www.shipstation.com/developer-api/#/reference/model-order) objects (maximum of 100 per request)", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.holduntil.post", "title": "orders.holduntil.post", "description": "This method will change the status of the given order to On Hold until the date specified, when the status will automatically change to Awaiting Shipment.\n\nThe body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderId`` | number, required | Identifies the order that will be held.\n``holdUntilDate`` | string, required | Date when order is moved from ``on_hold`` status to ``awaiting_shipment``.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.listbytag_orderStatus_orderStatus_tagId_tagId_page_page_pageSize_pageSize.get", "title": "orders.listbytag_orderStatus_orderStatus_tagId_tagId_page_page_pageSize_pageSize.get", "description": "Lists all orders that match the specified status and tag ID.\n\nUrl format with filters:\n\n```\n/listbytag?orderStatus={orderStatus}\n&tagId={tagId}\n&page={page}\n&pageSize={pageSize}\n```", "inputSchema": { "type": "object", "properties": { "orderStatus": { "type": "string", "description": "The order's status.", "enum": [ "awaiting_payment", "awaiting_shipment", "pending_fulfillment", "shipped", "on_hold", "cancelled" ] }, "tagId": { "type": "number", "description": "ID of the tag. Call Accounts/ListTags to obtain a list of tags for this account." }, "page": { "type": "string", "description": "Page number", "default": "1" }, "pageSize": { "type": "string", "description": "Requested page size. Max value is 500.", "default": "100" } }, "additionalProperties": false, "required": [ "orderStatus", "tagId", "page", "pageSize" ] }, "outputSchema": {} }, { "id": "orders.markasshipped.post", "title": "orders.markasshipped.post", "description": "Marks an order as shipped without creating a label in ShipStation. The body of this request has the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n ``orderId`` | number, required | Identifies the order that will be marked as shipped.\n ``carrierCode`` | string, required | Code of the carrier that is marked as having shipped the order.\n ``shipDate`` | string, optional | Date order was shipped.\n ``trackingNumber`` | string, optional | Tracking number of shipment.\n ``notifyCustomer`` | boolean, optional | Specifies whether the customer should be notified of the shipment. Default value: false\n ``notifySalesChannel`` | boolean, optional | Specifies whether the sales channel should be notified of the shipment. Default value: false", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.removetag.post", "title": "orders.removetag.post", "description": "Removes a tag from the specified order. The body of this request has the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderId`` | number, required | Identifies the order whose tag will be removed.\n``tagId`` | number, required | Identifies the tag to remove.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.restorefromhold.post", "title": "orders.restorefromhold.post", "description": "This method will change the status of the given order from On Hold to Awaiting Shipment. This endpoint is used when a holdUntil Date is attached to an order.\n\nThe body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderId`` | number, required | Identifies the order that will be restored to ``awaiting_shipment`` from ``on_hold``.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.unassignuser.post", "title": "orders.unassignuser.post", "description": "Unassigns a user from an order. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``orderIds`` | number, required | Identifies set of orders that will have the user unassigned. Please note that if ANY of the orders within the array are not found, then no orders will have their users unassigned.", "inputSchema": {}, "outputSchema": {} }, { "id": "orders.orderId.delete", "title": "orders.orderId.delete", "description": "Removes order from ShipStation's UI. Note this is a \"soft\" delete action so the order will still exist in the database, but will be set to ``inactive``", "inputSchema": { "type": "object", "properties": { "orderId": { "type": "string", "description": "The system generated identifier for the order." } }, "additionalProperties": false, "required": [ "orderId" ] }, "outputSchema": {} }, { "id": "orders.orderId.get", "title": "orders.orderId.get", "description": "Retrieves a single order from the database.", "inputSchema": { "type": "object", "properties": { "orderId": { "type": "string", "description": "The system generated identifier for the order." } }, "additionalProperties": false, "required": [ "orderId" ] }, "outputSchema": {} }, { "id": "orders_customerName_customerName_itemKeyword_itemKeyword_createDateStart_createDateStart_createDateEnd_createDateEnd_modifyDateStart_modifyDateStart_modifyDateEnd_modifyDateEnd_orderDateStart_orderDateStart_orderDateEnd_orderDateEnd_orderNumber_orderNumber_orderStatus_orderStatus_paymentDateStart_paymentDateStart_paymentDateEnd_paymentDateEnd_storeId_storeId_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "title": "orders_customerName_customerName_itemKeyword_itemKeyword_createDateStart_createDateStart_createDateEnd_createDateEnd_modifyDateStart_modifyDateStart_modifyDateEnd_modifyDateEnd_orderDateStart_orderDateStart_orderDateEnd_orderDateEnd_orderNumber_orderNumber_orderStatus_orderStatus_paymentDateStart_paymentDateStart_paymentDateEnd_paymentDateEnd_storeId_storeId_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "description": "Obtains a list of orders that match the specified criteria. All of the available filters are optional. They do not need to be included in the URL. If you do include them, here's what the URL may look like:\n\nUrl format with filters:\n\n```\n/orders?customerName={customerName}\n&itemKeyword={itemKeyword}\n&createDateStart={createDateStart}\n&createDateEnd={createDateEnd}\n&modifyDateStart={modifyDateStart}\n&modifyDateEnd={modifyDateEnd}\n&orderDateStart={orderDateStart}\n&orderDateEnd={orderDateEnd}\n&orderNumber={orderNumber}\n&orderStatus={orderStatus}\n&paymentDateStart={paymentDateStart}\n&paymentDateEnd={paymentDateEnd}\n&storeId={storeId}\n&sortBy={sortBy}\n&sortDir={sortDir}\n&page={page}\n&pageSize={pageSize}\n```", "inputSchema": { "type": "object", "properties": { "customerName": { "type": "string", "description": "Returns orders that match the specified name." }, "itemKeyword": { "type": "string", "description": "Returns orders that contain items that match the specified keyword. Fields searched are Sku, Description, and Options" }, "createDateStart": { "type": "string", "description": "Returns orders that were created in ShipStation after the specified date" }, "createDateEnd": { "type": "string", "description": "Returns orders that were created in ShipStation before the specified date" }, "modifyDateStart": { "type": "string", "description": "Returns orders that were modified after the specified date" }, "modifyDateEnd": { "type": "string", "description": "Returns orders that were modified before the specified date" }, "orderDateStart": { "type": "string", "description": "Returns orders greater than the specified date" }, "orderDateEnd": { "type": "string", "description": "Returns orders less than or equal to the specified date" }, "orderNumber": { "type": "string", "description": "Filter by order number, performs a \"starts with\" search." }, "orderStatus": { "type": "string", "description": "Filter by order status. If left empty, orders of all statuses are returned.", "enum": [ "awaiting_payment", "awaiting_shipment", "pending_fulfillment", "shipped", "on_hold", "cancelled" ] }, "paymentDateStart": { "type": "string", "description": "Returns orders that were paid after the specified date" }, "paymentDateEnd": { "type": "string", "description": "Returns orders that were paid before the specified date" }, "storeId": { "type": "number", "description": "Filters orders to a single store. Call List Stores to obtain a list of store Ids." }, "sortBy": { "type": "string", "description": "Sort the responses by a set value. The response will be sorted based off the ascending dates (oldest to most current.) If left empty, the response will be sorted by ascending ``orderId``.", "enum": [ "OrderDate", "ModifyDate", "CreateDate" ] }, "sortDir": { "type": "string", "description": "Sets the direction of the sort order.", "enum": [ "ASC", "DESC" ] }, "page": { "type": "string", "description": "Page number", "default": "1" }, "pageSize": { "type": "string", "description": "Requested page size. Max value is 500.", "default": "100" } }, "additionalProperties": false, "required": [ "customerName", "itemKeyword", "createDateStart", "createDateEnd", "modifyDateStart", "modifyDateEnd", "orderDateStart", "orderDateEnd", "orderNumber", "orderStatus", "paymentDateStart", "paymentDateEnd", "storeId", "sortBy", "sortDir", "page", "pageSize" ] }, "outputSchema": {} }, { "id": "products.get", "title": "products.get", "description": "List Products w/o parameters", "inputSchema": {}, "outputSchema": {} }, { "id": "products.productId.get", "title": "products.productId.get", "description": "Get Product", "inputSchema": { "type": "object", "properties": { "productId": { "type": "number", "description": "The system generated identifier for the Product." } }, "additionalProperties": false, "required": [ "productId" ] }, "outputSchema": {} }, { "id": "products.productId.put", "title": "products.productId.put", "description": "Updates an existing product. This call does not currently support partial updates. The entire resource must be provided in the body of the request.", "inputSchema": { "type": "object", "properties": { "productId": { "type": "number", "description": "The system generated identifier for the Product." } }, "additionalProperties": false, "required": [ "productId" ] }, "outputSchema": {} }, { "id": "products_sku_sku_name_name_productCategoryId_productCategoryId_productTypeId_productTypeId_tagId_tagId_startDate_startDate_endDate_endDate_showInactive_showInactive_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "title": "products_sku_sku_name_name_productCategoryId_productCategoryId_productTypeId_productTypeId_tagId_tagId_startDate_startDate_endDate_endDate_showInactive_showInactive_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "description": "Obtains a list of products that match the specified criteria. All of the available filters are optional. They do not need to be included in the URL. If you do include them, here's what the URL may look like:\n\nUrl format with filters:\n\n```\n/products?sku={sku}\n&name={name}\n&productCategoryId={productCategoryId}\n&productTypeId={productTypeId}\n&tagId={tagId}\n&startDate={startDate}\n&endDate={endDate}\n&showInactive={showInactive}\n&sortBy={sortBy}\n&sortDir={sortDir}\n&page={page}\n&pageSize={pageSize}\n```", "inputSchema": { "type": "object", "properties": { "sku": { "type": "string", "description": "Returns products that match the specified SKU." }, "name": { "type": "string", "description": "Returns products that match the specified product name." }, "productCategoryId": { "type": "string", "description": "Returns products that match the specified productCategoryId." }, "productTypeId": { "type": "string", "description": "Returns products that match the specified productTypeId." }, "tagId": { "type": "string", "description": "Returns products that match the specified tagId." }, "startDate": { "type": "string", "description": "Returns products that were created after the specified date." }, "endDate": { "type": "string", "description": "Returns products that were created before the specified date." }, "sortBy": { "type": "string", "description": "Sorts the order of the response based off the specified value.", "enum": [ "SKU", "ModifyDate", "CreateDate" ] }, "sortDir": { "type": "string", "description": "Sets the direction of the sort order.", "enum": [ "ASC", "DESC" ] }, "page": { "type": "string", "description": "Page number.", "default": "1" }, "pageSize": { "type": "string", "description": "Requested page size. Max value is 500.", "default": "100" }, "showInactive": { "type": "string", "description": "Specifies whether the list should include inactive products.", "default": "false" } }, "additionalProperties": false, "required": [ "sku", "name", "productCategoryId", "productTypeId", "tagId", "startDate", "endDate", "sortBy", "sortDir", "page", "pageSize", "showInactive" ] }, "outputSchema": {} }, { "id": "shipments.get", "title": "shipments.get", "description": "List Shipments w/o parameters", "inputSchema": {}, "outputSchema": {} }, { "id": "shipments.createlabel.post", "title": "shipments.createlabel.post", "description": "Creates a shipping label. The ``labelData`` field returned in the response is a base64 encoded PDF value. Simply decode and save the output as a PDF file to retrieve a printable label. The body of this request has the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n ``carrierCode`` | string, required | Identifies the carrier to be used for this label.\n ``serviceCode`` | string, required | Identifies the shipping service to be used for this label.\n ``packageCode`` | string, required | Identifies the packing type that should be used for this label.\n ``confirmation`` | string, optional | Identifies the delivery confirmation type to be used for this label.\n ``shipDate`` | string, required | The date the shipment will be shipped.\n ``weight`` | Weight, required | Shipment's weight. Use the [**Weight**](https://www.shipstation.com/developer-api/#/reference/model-weight) model.\n ``dimensions`` | Dimensions, optional | Shipment's dimensions. Use the [**Dimensions**](https://www.shipstation.com/developer-api/#/reference/model-dimensions) model.\n ``shipFrom`` | Address, required | Address indicating shipment's origin. Use the [**Address**](https://www.shipstation.com/developer-api/#/reference/model-address) model.\n ``shipTo`` | Address, required | Address indicating shipment's destination. Use the [**Address**](https://www.shipstation.com/developer-api/#/reference/model-address) model.\n ``insuranceOptions`` | InsuranceOptions, optional | The shipping insurance information associated with this order. \n ``internationalOptions`` | InternationalOptions, optional | Customs information that can be used to generate customs documents for international orders. Use the [**InternationalOptions**](https://www.shipstation.com/developer-api/#/reference/model-internationaloptions) model.\n ``advancedOptions`` | AdvancedOptions, optional | Various advanced options that may be available depending on the shipping carrier that is used to ship the order. Use the [**AdvancedOptions**](https://www.shipstation.com/developer-api/#/reference/model-advancedoptions) model. \n ``testLabel`` | boolean, optional | Specifies whether a test label should be created. Default value: false.", "inputSchema": {}, "outputSchema": {} }, { "id": "shipments.getrates.post", "title": "shipments.getrates.post", "description": "Retrieves shipping rates for the specified shipping details. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n ``carrierCode`` | string, required | Returns rates for the specified carrier.\n ``serviceCode`` | string, optional | Returns rates for the specified shipping service.\n ``packageCode`` | string, optional | Returns rates for the specified package type.\n ``fromPostalCode`` | string, required | Originating postal code.\n ``toState`` | string, optional | Destination State/Province. Please use two-character state/province abbreviation. Note this field is required for the following carriers: UPS\n ``toCountry`` | string, required | Destination Country. Please use the two-character ISO country code.\n ``toPostalCode`` | string, required | Destination Postal Code.\n ``toCity`` | string, optional | Destination City.\n ``weight`` | Weight, required | Shipment's weight. Use ``Weight`` object.\n ``dimensions`` | Dimensions, optional | Shipment's dimensions. Use ``Dimensions`` object. \n ``confirmation`` | string, optional | Returns rates that account for the specified delivery confirmation type.\n ``residential`` | boolean, optional | Returns rates that account for the specified delivery confirmation type. Default value: false", "inputSchema": {}, "outputSchema": {} }, { "id": "shipments.voidlabel.post", "title": "shipments.voidlabel.post", "description": "Voids the specified label by shipmentId. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n ``shipmentId`` | number, required | ID of the shipment to void.", "inputSchema": {}, "outputSchema": {} }, { "id": "shipments_recipientName_recipientName_recipientCountryCode_recipientCountryCode_orderNumber_orderNumber_orderId_orderId_carrierCode_carrierCode_serviceCode_serviceCode_trackingNumber_trackingNumber_createDateStart_createDateStart_createDateEnd_createDateEnd_shipDateStart_shipDateStart_shipDateEnd_shipDateEnd_voidDateStart_voidDateStart_voidDateEnd_voidDateEnd_includeShipmentItems_includeShipmentItems_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "title": "shipments_recipientName_recipientName_recipientCountryCode_recipientCountryCode_orderNumber_orderNumber_orderId_orderId_carrierCode_carrierCode_serviceCode_serviceCode_trackingNumber_trackingNumber_createDateStart_createDateStart_createDateEnd_createDateEnd_shipDateStart_shipDateStart_shipDateEnd_shipDateEnd_voidDateStart_voidDateStart_voidDateEnd_voidDateEnd_includeShipmentItems_includeShipmentItems_sortBy_sortBy_sortDir_sortDir_page_page_pageSize_pageSize.get", "description": "Obtains a list of shipments that match the specified criteria. Please note the following:\n\n- Only valid shipments with labels generated in ShipStation will be returned in the response. Orders that have been marked as shipped either through the UI or the API will not appear as they are considered external shipments.\n\n- To include every shipment's associated shipmentItems in the response, be sure to set the `includeShipmentItems` parameter to `true`.\n\nAll of the available filters are optional. They do not need to be included in the URL. If you do include them, here's what the URL may look like:\n\nUrl format with filters:\n\n```\nshipments?recipientName={recipientName}\n&recipientCountryCode={recipientCountryCode}\n&orderNumber={orderNumber}\n&orderId={orderId}\n&carrierCode={carrierCode}\n&serviceCode={serviceCode}\n&trackingNumber={trackingNumber}\n&createDateStart={createDateStart}\n&createDateEnd={createDateEnd}\n&shipDateStart={shipDateStart}\n&shipDateEnd={shipDateEnd}\n&voidDateStart={voidDateStart}\n&voidDateEnd={voidDateEnd}\n&includeShipmentItems={includeShipmentItems}\n&sortBy={sortBy}\n&sortDir={sortDir}\n&page={page}\n&pageSize={pageSize}\n```", "inputSchema": { "type": "object", "properties": { "recipientName": { "type": "string", "description": "Returns shipments shipped to the specified recipient name." }, "recipientCountryCode": { "type": "string", "description": "Returns shipments shipped to the specified country code." }, "orderNumber": { "type": "string", "description": "Returns shipments whose orders have the specified order number." }, "orderId": { "type": "number", "description": "Returns shipments whose orders have the specified order ID." }, "carrierCode": { "type": "string", "description": "Returns shipments shipped with the specified carrier." }, "serviceCode": { "type": "string", "description": "Returns shipments shipped with the specified shipping service." }, "trackingNumber": { "type": "string", "description": "Returns shipments with the specified tracking number." }, "createDateStart": { "type": "string", "description": "Returns shipments created on or after the specified ``createDate``" }, "createDateEnd": { "type": "string", "description": "Returns shipments created on or before the specified ``createDate``" }, "shipDateStart": { "type": "string", "description": "Returns shipments with the ``shipDate`` on or after the specified date" }, "shipDateEnd": { "type": "string", "description": "Returns shipments with the ``shipDate`` on or before the specified date" }, "voidDateStart": { "type": "string", "description": "Returns shipments voided on or after the specified date" }, "voidDateEnd": { "type": "string", "description": "Returns shipments voided on or before the specified date" }, "includeShipmentItems": { "type": "boolean", "description": "Specifies whether to include shipment items with results Default value: false." }, "sortBy": { "type": "string", "description": "Sort the responses by a set value. The response will be sorted based off the ascending dates (oldest to most current.) If left empty, the response will be sorted by ascending ``createDate``.", "enum": [ "ShipDate", "CreateDate" ] }, "sortDir": { "type": "string", "description": "Sets the direction of the sort order.", "enum": [ "ASC", "DESC" ] }, "page": { "type": "number", "description": "page number.", "default": 1 }, "pageSize": { "type": "number", "description": "page size.", "default": 100 } }, "additionalProperties": false, "required": [ "recipientName", "recipientCountryCode", "orderNumber", "orderId", "carrierCode", "serviceCode", "trackingNumber", "createDateStart", "createDateEnd", "shipDateStart", "shipDateEnd", "voidDateStart", "voidDateEnd", "includeShipmentItems", "sortBy", "sortDir", "page", "pageSize" ] }, "outputSchema": {} }, { "id": "stores.deactivate.post", "title": "stores.deactivate.post", "description": "Deactivates the specified store.\n\nThe body of this request has the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``storeId`` | number, required | ID of the store to deactivate.", "inputSchema": {}, "outputSchema": {} }, { "id": "stores.getrefreshstatus_storeId_storeId.get", "title": "stores.getrefreshstatus_storeId_storeId.get", "description": "Retrieves the refresh status of a given store.", "inputSchema": { "type": "object", "properties": { "storeId": { "type": "number", "description": "Specifies the store whose status will be retrieved." } }, "additionalProperties": false, "required": [ "storeId" ] }, "outputSchema": {} }, { "id": "stores.marketplaces.get", "title": "stores.marketplaces.get", "description": "Lists the marketplaces that can be integrated with ShipStation.", "inputSchema": {}, "outputSchema": {} }, { "id": "stores.reactivate.post", "title": "stores.reactivate.post", "description": "Reactivates the specified store. Note: stores are active by default\n\nThe body of this request has the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``storeId`` | number, required | ID of the store to reactivate.", "inputSchema": {}, "outputSchema": {} }, { "id": "stores.refreshstore_storeId_storeId_refreshDate_refreshDate.post", "title": "stores.refreshstore_storeId_storeId_refreshDate_refreshDate.post", "description": "Initiates a store refresh.", "inputSchema": { "type": "object", "properties": { "storeId": { "type": "number", "description": "Specifies the store which will get refreshed. If the storeId is not specified, a store refresh will be initiated for all refreshable stores on that account." }, "refreshDate": { "type": "string", "description": "Specifies the starting date for new order imports. If the refreshDate is not specified, ShipStation will use the last recorded refreshDate for that store." } }, "additionalProperties": false, "required": [ "storeId", "refreshDate" ] }, "outputSchema": {} }, { "id": "stores.storeId.get", "title": "stores.storeId.get", "description": "Get Store", "inputSchema": { "type": "object", "properties": { "storeId": { "type": "number", "description": "A unique ID generated by ShipStation and assigned to each store." } }, "additionalProperties": false, "required": [ "storeId" ] }, "outputSchema": {} }, { "id": "stores.storeId.put", "title": "stores.storeId.put", "description": "Updates an existing store. This call does not currently support partial updates. The entire resource must be provided in the body of the request.", "inputSchema": { "type": "object", "properties": { "storeId": { "type": "number", "description": "A unique ID generated by ShipStation and assigned to each store." }, "body": { "$ref": "#/definitions/Get_Update_StoreModel" } }, "additionalProperties": false, "required": [ "storeId" ] }, "outputSchema": {} }, { "id": "stores_showInactive_showInactive_marketplaceId_marketplaceId.get", "title": "stores_showInactive_showInactive_marketplaceId_marketplaceId.get", "description": "Retrieve the list of installed stores on the account.", "inputSchema": { "type": "object", "properties": { "showInactive": { "type": "boolean", "description": "Determines whether inactive stores will be returned in the list of stores.", "default": false }, "marketplaceId": { "type": "number", "description": "Returns stores of this marketplace type." } }, "additionalProperties": false, "required": [ "showInactive", "marketplaceId" ] }, "outputSchema": {} }, { "id": "users_showInactive_showInactive.get", "title": "users_showInactive_showInactive.get", "description": "List Users", "inputSchema": { "type": "object", "properties": { "showInactive": { "type": "boolean", "description": "Determines whether inactive users will be returned in the response.", "default": false } }, "additionalProperties": false, "required": [ "showInactive" ] }, "outputSchema": {} }, { "id": "warehouses.get", "title": "warehouses.get", "description": "Retrieves a list of your Ship From Locations (formerly known as warehouses).", "inputSchema": {}, "outputSchema": {} }, { "id": "warehouses.createwarehouse.post", "title": "warehouses.createwarehouse.post", "description": "Adds a Ship From Location (formerly known as warehouse) to your account. The body of this request should specify the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n ``warehouseName`` | string, optional | Name of Ship From Location.\n ``originAddress`` | Address, required | The origin address. Shipping rates will be calculated from this address. Use the [**Address**](https://www.shipstation.com/developer-api/#/reference/model-address) model.\n ``returnAddress`` | Address, optional | The return address. If a \"returnAddress\" is not specified, your \"originAddress\" will be used as your \"returnAddress\". Use the [**Address**](https://www.shipstation.com/developer-api/#/reference/model-address) model.\n ``isDefault`` | boolean, optional | Specifies whether or not this will be your default Ship From Location.", "inputSchema": {}, "outputSchema": {} }, { "id": "warehouses.warehouseId.get", "title": "warehouses.warehouseId.get", "description": "Returns a list of active Ship From Locations (formerly known as warehouses) on the ShipStation account. Warehouses are now called \"Ship From Locations\" in the UI.", "inputSchema": { "type": "object", "properties": { "warehouseId": { "type": "number", "description": "A unique ID generated by ShipStation and assigned to each Ship From Location (formerly known as warehouse)." } }, "additionalProperties": false, "required": [ "warehouseId" ] }, "outputSchema": {} }, { "id": "warehouses.warehouseId.put", "title": "warehouses.warehouseId.put", "description": "Updates an existing Ship From Location (formerly known as warehouse). This call does not currently support partial updates. The entire resource must be provided in the body of the request. If a \"returnAddress\" object is not specified, your \"originAddress\" will be used as your \"returnAddress\".", "inputSchema": { "type": "object", "properties": { "warehouseId": { "type": "number", "description": "A unique ID generated by ShipStation and assigned to each Ship From Location (formerly known as warehouse)." }, "body": { "$ref": "#/definitions/Get_Update_WarehouseModel" } }, "additionalProperties": false, "required": [ "warehouseId" ] }, "outputSchema": {} }, { "id": "webhooks.get", "title": "webhooks.get", "description": "Retrieves a list of registered webhooks for the account", "inputSchema": {}, "outputSchema": {} }, { "id": "webhooks.subscribe.post", "title": "webhooks.subscribe.post", "description": "Subscribes to a specific type of webhook. If a ``store_id`` is passed in, the webhooks will only be triggered for that specific ``store_id``.\nThe ``event`` type that is passed in will determine what type of webhooks will be sent.\n\nNOTE: Webhooks will be sent to the URL specified in the ``target_url``. The HTTP request will be sent via POST and will contain a [**webhook JSON object**](https://www.shipstation.com/developer-api/#/reference/model-webhook) in the body.\n\nThe body of this request to subscribe has the following attributes:\n\nName |Data Type |Description\n-------------------|-------------------|-------------------\n``target_url`` | string, required | The URL to send the webhooks to\n``event`` | string, required | The type of webhook to subscribe to. Must contain one of the following values: ORDER_NOTIFY, ITEM_ORDER_NOTIFY, SHIP_NOTIFY, ITEM_SHIP_NOTIFY\n``store_id`` | int, optional | If passed in, the webhooks will only be triggered for this ``store_id``\n``friendly_name`` | string, optional | Display name for the webhook", "inputSchema": {}, "outputSchema": {} }, { "id": "webhooks.webhookId.delete", "title": "webhooks.webhookId.delete", "description": "Unsubscribes from a certain webhook.", "inputSchema": { "type": "object", "properties": { "webhookId": { "type": "number", "description": "A unique ID generated by ShipStation and assigned to each webhook." } }, "additionalProperties": false, "required": [ "webhookId" ] }, "outputSchema": {} } ], "directory": "generated", "tags": [ "ecommerce" ] }
{ "pile_set_name": "Github" }
<div class="mb-3 bg-white fb-card rounded"> <div class="card-body"> <span class="card_social_ribbon"> <i class="fab fa-facebook-f"></i> </span> <div class="text-center"> <img class="rounded-circle" src="https://graph.facebook.com/{{$userProfile->social_id}}/picture?type=large" alt="{{$userProfile->first_name}} {{$userProfile->last_name}}"/> <h5 class="card-title no-space">{{$userProfile->first_name}} {{$userProfile->last_name}}</h5> <p class="card-text">{{$userProfile->email}}</p> </div> <div class="row"> <div class="col-md-6"> <div class="text-center"> <h5>***</h5> <h6>Followers</h6> </div> </div> <div class="col-md-6"> <div class="text-center"> <h5>{{$userProfile->friendship_counts}}</h5> <h6>Friends</h6> </div> </div> </div> </div> <div class="card-footer bg-transparent"> @if(session()->get('user')['userDetails']->userPlanDetails->social_report == 1) <a href="{{env('APP_URL')}}report/{{$userProfile->account_id}}/{{$userProfile->account_type}}" class="btn btn-outline-dark col-md-12 margin-top-10">View Reports</a> @else <a href="#" class="btn btn-outline-dark col-md-12 margin-top-10" onclick="planCheck({{session()->get('user')['userDetails']->userPlanDetails->social_report}})">View Reports</a> @endif </div> </div> @if ( null !== $socioboard_accounts) <div class="row m-0"> <span class="col-12 p-0 text-dark font-weight-bold">SocioBoard Facebook accounts</span> @foreach($socioboard_accounts->facebook as $account) <a href="{{route('socialNetworkDashboard', ['socialNetwork' => 'facebook', 'account_id' => $account->account_id])}}" class="col-6 col-md-4 col-sm-6 col-xs-6 p-0"> <div class="card-body bg-white p-1"> <img src="{{$account->profile_pic_url}}" style="max-width: 70px;" /> <div class="frnd_card"> <span class="frnd_name">{{$account->first_name}} {{$account->last_name}}</span> </div> </div> </a> @endforeach </div> @endif {{--Changed by Aishwarya in order to check plan--}} @include('User::dashboard.incPlanChangeJs')
{ "pile_set_name": "Github" }
# sent_id = weblog-juancole.com_juancole_20030911085700_ENG_20030911_085700-0022 # text = It should continue to be defanged. 1 It it PRON PRP Case=Nom|Gender=Neut|Number=Sing|Person=3|PronType=Prs 3 nsubj 3:nsubj|6:nsubj:xsubj _ 2 should should AUX MD VerbForm=Fin 3 aux 3:aux _ 3 continue continue VERB VB VerbForm=Inf 0 root 0:root _ 4 to to PART TO _ 6 mark 6:mark _ 5 be be AUX VB VerbForm=Inf 6 aux:pass 6:aux:pass _ 6 defanged defange VERB VBN Tense=Past|VerbForm=Part|Voice=Pass 3 xcomp 3:xcomp SpaceAfter=No 7 . . PUNCT . _ 3 punct 3:punct _ # sent_id = weblog-blogspot.com_healingiraq_20040409053012_ENG_20040409_053012-0015 # text = So what happened? 1 So so ADV RB _ 3 advmod 3:advmod _ 2 what what PRON WP PronType=Int 3 nsubj 3:nsubj _ 3 happened happen VERB VBD Mood=Ind|Tense=Past|VerbForm=Fin 0 root 0:root SpaceAfter=No 4 ? ? PUNCT . _ 3 punct 3:punct _ # sent_id = weblog-typepad.com_ripples_20040407125600_ENG_20040407_125600-0055 # text = That too was stopped. 1 That that PRON DT Number=Sing|PronType=Dem 4 nsubj:pass 4:nsubj:pass _ 2 too too ADV RB _ 4 advmod 4:advmod _ 3 was be AUX VBD Mood=Ind|Number=Sing|Person=3|Tense=Past|VerbForm=Fin 4 aux:pass 4:aux:pass _ 4 stopped stop VERB VBN Tense=Past|VerbForm=Part|Voice=Pass 0 root 0:root SpaceAfter=No 5 . . PUNCT . _ 4 punct 4:punct _
{ "pile_set_name": "Github" }
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/base/clipboard/clipboard_format_type.h" #import <Cocoa/Cocoa.h> #include "base/strings/sys_string_conversions.h" #include "ui/base/clipboard/clipboard_constants.h" namespace ui { // ClipboardFormatType implementation. ClipboardFormatType::ClipboardFormatType() : data_(nil) {} ClipboardFormatType::ClipboardFormatType(NSString* native_format) : data_([native_format retain]) {} ClipboardFormatType::ClipboardFormatType(const ClipboardFormatType& other) : data_([other.data_ retain]) {} ClipboardFormatType& ClipboardFormatType::operator=( const ClipboardFormatType& other) { if (this != &other) { [data_ release]; data_ = [other.data_ retain]; } return *this; } bool ClipboardFormatType::Equals(const ClipboardFormatType& other) const { return [data_ isEqualToString:other.data_]; } ClipboardFormatType::~ClipboardFormatType() { [data_ release]; } std::string ClipboardFormatType::Serialize() const { return base::SysNSStringToUTF8(data_); } // static ClipboardFormatType ClipboardFormatType::Deserialize( const std::string& serialization) { return ClipboardFormatType(base::SysUTF8ToNSString(serialization)); } std::string ClipboardFormatType::GetName() const { return Serialize(); } bool ClipboardFormatType::operator<(const ClipboardFormatType& other) const { return [data_ compare:other.data_] == NSOrderedAscending; } // Various predefined ClipboardFormatTypes. // static ClipboardFormatType ClipboardFormatType::GetType( const std::string& format_string) { return ClipboardFormatType::Deserialize(format_string); } // static const ClipboardFormatType& ClipboardFormatType::GetUrlType() { static base::NoDestructor<ClipboardFormatType> type(NSURLPboardType); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetPlainTextType() { static base::NoDestructor<ClipboardFormatType> type(NSPasteboardTypeString); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetFilenameType() { static base::NoDestructor<ClipboardFormatType> type(NSFilenamesPboardType); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetHtmlType() { static base::NoDestructor<ClipboardFormatType> type(NSHTMLPboardType); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetRtfType() { static base::NoDestructor<ClipboardFormatType> type(NSRTFPboardType); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetBitmapType() { static base::NoDestructor<ClipboardFormatType> type(NSTIFFPboardType); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetWebKitSmartPasteType() { static base::NoDestructor<ClipboardFormatType> type(kWebSmartPastePboardType); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetWebCustomDataType() { static base::NoDestructor<ClipboardFormatType> type(kWebCustomDataPboardType); return *type; } // static const ClipboardFormatType& ClipboardFormatType::GetPepperCustomDataType() { static base::NoDestructor<ClipboardFormatType> type( kPepperCustomDataPboardType); return *type; } } // namespace ui
{ "pile_set_name": "Github" }
#-- encoding: UTF-8 #-- copyright # ChiliProject is a project management system. # # Copyright (C) 2010-2013 the ChiliProject Team # # 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. # # See doc/COPYRIGHT.rdoc for more details. #++ require File.expand_path('../../test_helper', __FILE__) class ProjectTest < ActiveSupport::TestCase fixtures :all def setup @ecookbook = Project.find(1) @ecookbook_sub1 = Project.find(3) User.current = nil end should_validate_presence_of :name should_validate_presence_of :identifier should_validate_uniqueness_of :identifier context "associations" do should_have_many :members should_have_many :users, :through => :members should_have_many :member_principals should_have_many :principals, :through => :member_principals should_have_many :enabled_modules should_have_many :issues should_have_many :issue_changes, :through => :issues should_have_many :versions should_have_many :time_entries should_have_many :queries should_have_many :documents should_have_many :news should_have_many :issue_categories should_have_many :boards should_have_many :changesets, :through => :repository should_have_one :repository should_have_one :wiki should_have_and_belong_to_many :trackers should_have_and_belong_to_many :issue_custom_fields end def test_truth assert_kind_of Project, @ecookbook assert_equal "eCookbook", @ecookbook.name end def test_default_attributes with_settings :default_projects_public => '1' do assert_equal true, Project.new.is_public assert_equal false, Project.new(:is_public => false).is_public end with_settings :default_projects_public => '0' do assert_equal false, Project.new.is_public assert_equal true, Project.new(:is_public => true).is_public end with_settings :sequential_project_identifiers => '1' do assert !Project.new.identifier.blank? assert Project.new(:identifier => '').identifier.blank? end with_settings :sequential_project_identifiers => '0' do assert Project.new.identifier.blank? assert !Project.new(:identifier => 'test').blank? end with_settings :default_projects_modules => ['issue_tracking', 'repository'] do assert_equal ['issue_tracking', 'repository'], Project.new.enabled_module_names end assert_equal Tracker.all, Project.new.trackers assert_equal Tracker.find(1, 3).sort_by(&:id), Project.new(:tracker_ids => [1, 3]).trackers.sort_by(&:id) end def test_update assert_equal "eCookbook", @ecookbook.name @ecookbook.name = "eCook" assert @ecookbook.save, @ecookbook.errors.full_messages.join("; ") @ecookbook.reload assert_equal "eCook", @ecookbook.name end def test_validate_identifier to_test = {"abc" => true, "ab12" => true, "ab-12" => true, "ab_12" => true, "12" => false, "new" => false} to_test.each do |identifier, valid| p = Project.new p.identifier = identifier p.valid? assert_equal valid, p.errors.on('identifier').nil? end end def test_members_should_be_active_users Project.all.each do |project| assert_nil project.members.detect {|m| !(m.user.is_a?(User) && m.user.active?) } end end def test_users_should_be_active_users Project.all.each do |project| assert_nil project.users.detect {|u| !(u.is_a?(User) && u.active?) } end end def test_archive user = @ecookbook.members.first.user @ecookbook.archive @ecookbook.reload assert [email protected]? assert @ecookbook.archived? assert !user.projects.include?(@ecookbook) # Subproject are also archived assert [email protected]? assert @ecookbook.descendants.active.empty? end def test_archive_should_fail_if_versions_are_used_by_non_descendant_projects # Assign an issue of a project to a version of a child project Issue.find(4).update_attribute :fixed_version_id, 4 assert_no_difference "Project.count(:all, :conditions => 'status = #{Project::STATUS_ARCHIVED}')" do assert_equal false, @ecookbook.archive end @ecookbook.reload assert @ecookbook.active? end def test_unarchive user = @ecookbook.members.first.user @ecookbook.archive # A subproject of an archived project can not be unarchived assert !@ecookbook_sub1.unarchive # Unarchive project assert @ecookbook.unarchive @ecookbook.reload assert @ecookbook.active? assert [email protected]? assert user.projects.include?(@ecookbook) # Subproject can now be unarchived @ecookbook_sub1.reload assert @ecookbook_sub1.unarchive end def test_destroy # 2 active members assert_equal 2, @ecookbook.members.size # and 1 is locked assert_equal 3, Member.find(:all, :conditions => ['project_id = ?', @ecookbook.id]).size # some boards assert @ecookbook.boards.any? @ecookbook.destroy # make sure that the project non longer exists assert_raise(ActiveRecord::RecordNotFound) { Project.find(@ecookbook.id) } # make sure related data was removed assert_nil Member.first(:conditions => {:project_id => @ecookbook.id}) assert_nil Board.first(:conditions => {:project_id => @ecookbook.id}) assert_nil Issue.first(:conditions => {:project_id => @ecookbook.id}) end def test_destroying_root_projects_should_clear_data Project.roots.each do |root| root.destroy end assert_equal 0, Project.count, "Projects were not deleted: #{Project.all.inspect}" assert_equal 0, Member.count, "Members were not deleted: #{Member.all.inspect}" assert_equal 0, MemberRole.count assert_equal 0, Issue.count assert_equal 0, IssueJournal.count assert_equal 0, Attachment.count assert_equal 0, EnabledModule.count assert_equal 0, IssueCategory.count assert_equal 0, IssueRelation.count assert_equal 0, Board.count assert_equal 0, Message.count assert_equal 0, News.count assert_equal 0, Query.count(:conditions => "project_id IS NOT NULL") assert_equal 0, Repository.count assert_equal 0, Changeset.count assert_equal 0, Change.count assert_equal 0, Comment.count assert_equal 0, TimeEntry.count assert_equal 0, Version.count assert_equal 0, Watcher.count assert_equal 0, Wiki.count assert_equal 0, WikiPage.count assert_equal 0, WikiContent.count assert_equal 0, WikiContentJournal.count assert_equal 0, Project.connection.select_all("SELECT * FROM projects_trackers").size assert_equal 0, Project.connection.select_all("SELECT * FROM custom_fields_projects").size assert_equal 0, CustomValue.count(:conditions => {:customized_type => ['Project', 'Issue', 'TimeEntry', 'Version']}) end def test_move_an_orphan_project_to_a_root_project sub = Project.find(2) sub.set_parent! @ecookbook assert_equal @ecookbook.id, sub.parent.id @ecookbook.reload assert_equal 4, @ecookbook.children.size end def test_move_an_orphan_project_to_a_subproject sub = Project.find(2) assert sub.set_parent!(@ecookbook_sub1) end def test_move_a_root_project_to_a_project sub = @ecookbook assert sub.set_parent!(Project.find(2)) end def test_should_not_move_a_project_to_its_children sub = @ecookbook assert !(sub.set_parent!(Project.find(3))) end def test_set_parent_should_add_roots_in_alphabetical_order ProjectCustomField.delete_all Project.delete_all Project.create!(:name => 'Project C', :identifier => 'project-c').set_parent!(nil) Project.create!(:name => 'Project B', :identifier => 'project-b').set_parent!(nil) Project.create!(:name => 'Project D', :identifier => 'project-d').set_parent!(nil) Project.create!(:name => 'Project A', :identifier => 'project-a').set_parent!(nil) assert_equal 4, Project.count assert_equal Project.all.sort_by(&:name), Project.all.sort_by(&:lft) end def test_set_parent_should_add_children_in_alphabetical_order ProjectCustomField.delete_all parent = Project.create!(:name => 'Parent', :identifier => 'parent') Project.create!(:name => 'Project C', :identifier => 'project-c').set_parent!(parent) Project.create!(:name => 'Project B', :identifier => 'project-b').set_parent!(parent) Project.create!(:name => 'Project D', :identifier => 'project-d').set_parent!(parent) Project.create!(:name => 'Project A', :identifier => 'project-a').set_parent!(parent) parent.reload assert_equal 4, parent.children.size assert_equal parent.children.sort_by(&:name), parent.children end def test_rebuild_should_sort_children_alphabetically ProjectCustomField.delete_all parent = Project.create!(:name => 'Parent', :identifier => 'parent') Project.create!(:name => 'Project C', :identifier => 'project-c').move_to_child_of(parent) Project.create!(:name => 'Project B', :identifier => 'project-b').move_to_child_of(parent) Project.create!(:name => 'Project D', :identifier => 'project-d').move_to_child_of(parent) Project.create!(:name => 'Project A', :identifier => 'project-a').move_to_child_of(parent) Project.update_all("lft = NULL, rgt = NULL") Project.rebuild! parent.reload assert_equal 4, parent.children.size assert_equal parent.children.sort_by(&:name), parent.children end def test_set_parent_should_update_issue_fixed_version_associations_when_a_fixed_version_is_moved_out_of_the_hierarchy # Parent issue with a hierarchy project's fixed version parent_issue = Issue.find(1) parent_issue.update_attribute(:fixed_version_id, 4) parent_issue.reload assert_equal 4, parent_issue.fixed_version_id # Should keep fixed versions for the issues issue_with_local_fixed_version = Issue.find(5) issue_with_local_fixed_version.update_attribute(:fixed_version_id, 4) issue_with_local_fixed_version.reload assert_equal 4, issue_with_local_fixed_version.fixed_version_id # Local issue with hierarchy fixed_version issue_with_hierarchy_fixed_version = Issue.find(13) issue_with_hierarchy_fixed_version.update_attribute(:fixed_version_id, 6) issue_with_hierarchy_fixed_version.reload assert_equal 6, issue_with_hierarchy_fixed_version.fixed_version_id # Move project out of the issue's hierarchy moved_project = Project.find(3) moved_project.set_parent!(Project.find(2)) parent_issue.reload issue_with_local_fixed_version.reload issue_with_hierarchy_fixed_version.reload assert_equal 4, issue_with_local_fixed_version.fixed_version_id, "Fixed version was not keep on an issue local to the moved project" assert_equal nil, issue_with_hierarchy_fixed_version.fixed_version_id, "Fixed version is still set after moving the Project out of the hierarchy where the version is defined in" assert_equal nil, parent_issue.fixed_version_id, "Fixed version is still set after moving the Version out of the hierarchy for the issue." end def test_parent p = Project.find(6).parent assert p.is_a?(Project) assert_equal 5, p.id end def test_ancestors a = Project.find(6).ancestors assert a.first.is_a?(Project) assert_equal [1, 5], a.collect(&:id) end def test_root r = Project.find(6).root assert r.is_a?(Project) assert_equal 1, r.id end def test_children c = Project.find(1).children assert c.first.is_a?(Project) assert_equal [5, 3, 4], c.collect(&:id) end def test_descendants d = Project.find(1).descendants assert d.first.is_a?(Project) assert_equal [5, 6, 3, 4], d.collect(&:id) end def test_allowed_parents_should_be_empty_for_non_member_user Role.non_member.add_permission!(:add_project) user = User.find(9) assert user.memberships.empty? User.current = user assert Project.new.allowed_parents.compact.empty? end def test_allowed_parents_with_add_subprojects_permission Role.find(1).remove_permission!(:add_project) Role.find(1).add_permission!(:add_subprojects) User.current = User.find(2) # new project assert !Project.new.allowed_parents.include?(nil) assert Project.new.allowed_parents.include?(Project.find(1)) # existing root project assert Project.find(1).allowed_parents.include?(nil) # existing child assert Project.find(3).allowed_parents.include?(Project.find(1)) assert !Project.find(3).allowed_parents.include?(nil) end def test_allowed_parents_with_add_project_permission Role.find(1).add_permission!(:add_project) Role.find(1).remove_permission!(:add_subprojects) User.current = User.find(2) # new project assert Project.new.allowed_parents.include?(nil) assert !Project.new.allowed_parents.include?(Project.find(1)) # existing root project assert Project.find(1).allowed_parents.include?(nil) # existing child assert Project.find(3).allowed_parents.include?(Project.find(1)) assert Project.find(3).allowed_parents.include?(nil) end def test_allowed_parents_with_add_project_and_subprojects_permission Role.find(1).add_permission!(:add_project) Role.find(1).add_permission!(:add_subprojects) User.current = User.find(2) # new project assert Project.new.allowed_parents.include?(nil) assert Project.new.allowed_parents.include?(Project.find(1)) # existing root project assert Project.find(1).allowed_parents.include?(nil) # existing child assert Project.find(3).allowed_parents.include?(Project.find(1)) assert Project.find(3).allowed_parents.include?(nil) end def test_users_by_role users_by_role = Project.find(1).users_by_role assert_kind_of Hash, users_by_role role = Role.find(1) assert_kind_of Array, users_by_role[role] assert users_by_role[role].include?(User.find(2)) end def test_rolled_up_trackers parent = Project.find(1) parent.trackers = Tracker.find([1,2]) child = parent.children.find(3) assert_equal [1, 2], parent.tracker_ids assert_equal [2, 3], child.trackers.collect(&:id) assert_kind_of Tracker, parent.rolled_up_trackers.first assert_equal Tracker.find(1), parent.rolled_up_trackers.first assert_equal [1, 2, 3], parent.rolled_up_trackers.collect(&:id) assert_equal [2, 3], child.rolled_up_trackers.collect(&:id) end def test_rolled_up_trackers_should_ignore_archived_subprojects parent = Project.find(1) parent.trackers = Tracker.find([1,2]) child = parent.children.find(3) child.trackers = Tracker.find([1,3]) parent.children.each(&:archive) assert_equal [1,2], parent.rolled_up_trackers.collect(&:id) end context "#rolled_up_versions" do setup do @project = Project.generate! @parent_version_1 = Version.generate!(:project => @project) @parent_version_2 = Version.generate!(:project => @project) end should "include the versions for the current project" do assert_same_elements [@parent_version_1, @parent_version_2], @project.rolled_up_versions end should "include versions for a subproject" do @subproject = Project.generate! @subproject.set_parent!(@project) @subproject_version = Version.generate!(:project => @subproject) assert_same_elements [ @parent_version_1, @parent_version_2, @subproject_version ], @project.rolled_up_versions end should "include versions for a sub-subproject" do @subproject = Project.generate! @subproject.set_parent!(@project) @sub_subproject = Project.generate! @sub_subproject.set_parent!(@subproject) @sub_subproject_version = Version.generate!(:project => @sub_subproject) @project.reload assert_same_elements [ @parent_version_1, @parent_version_2, @sub_subproject_version ], @project.rolled_up_versions end should "only check active projects" do @subproject = Project.generate! @subproject.set_parent!(@project) @subproject_version = Version.generate!(:project => @subproject) assert @subproject.archive @project.reload assert [email protected]? assert_same_elements [@parent_version_1, @parent_version_2], @project.rolled_up_versions end end def test_shared_versions_none_sharing p = Project.find(5) v = Version.create!(:name => 'none_sharing', :project => p, :sharing => 'none') assert p.shared_versions.include?(v) assert !p.children.first.shared_versions.include?(v) assert !p.root.shared_versions.include?(v) assert !p.siblings.first.shared_versions.include?(v) assert !p.root.siblings.first.shared_versions.include?(v) end def test_shared_versions_descendants_sharing p = Project.find(5) v = Version.create!(:name => 'descendants_sharing', :project => p, :sharing => 'descendants') assert p.shared_versions.include?(v) assert p.children.first.shared_versions.include?(v) assert !p.root.shared_versions.include?(v) assert !p.siblings.first.shared_versions.include?(v) assert !p.root.siblings.first.shared_versions.include?(v) end def test_shared_versions_hierarchy_sharing p = Project.find(5) v = Version.create!(:name => 'hierarchy_sharing', :project => p, :sharing => 'hierarchy') assert p.shared_versions.include?(v) assert p.children.first.shared_versions.include?(v) assert p.root.shared_versions.include?(v) assert !p.siblings.first.shared_versions.include?(v) assert !p.root.siblings.first.shared_versions.include?(v) end def test_shared_versions_tree_sharing p = Project.find(5) v = Version.create!(:name => 'tree_sharing', :project => p, :sharing => 'tree') assert p.shared_versions.include?(v) assert p.children.first.shared_versions.include?(v) assert p.root.shared_versions.include?(v) assert p.siblings.first.shared_versions.include?(v) assert !p.root.siblings.first.shared_versions.include?(v) end def test_shared_versions_system_sharing p = Project.find(5) v = Version.create!(:name => 'system_sharing', :project => p, :sharing => 'system') assert p.shared_versions.include?(v) assert p.children.first.shared_versions.include?(v) assert p.root.shared_versions.include?(v) assert p.siblings.first.shared_versions.include?(v) assert p.root.siblings.first.shared_versions.include?(v) end def test_shared_versions parent = Project.find(1) child = parent.children.find(3) private_child = parent.children.find(5) assert_equal [1,2,3], parent.version_ids.sort assert_equal [4], child.version_ids assert_equal [6], private_child.version_ids assert_equal [7], Version.find_all_by_sharing('system').collect(&:id) assert_equal 6, parent.shared_versions.size parent.shared_versions.each do |version| assert_kind_of Version, version end assert_equal [1,2,3,4,6,7], parent.shared_versions.collect(&:id).sort end def test_shared_versions_should_ignore_archived_subprojects parent = Project.find(1) child = parent.children.find(3) child.archive parent.reload assert_equal [1,2,3], parent.version_ids.sort assert_equal [4], child.version_ids assert !parent.shared_versions.collect(&:id).include?(4) end def test_shared_versions_visible_to_user user = User.find(3) parent = Project.find(1) child = parent.children.find(5) assert_equal [1,2,3], parent.version_ids.sort assert_equal [6], child.version_ids versions = parent.shared_versions.visible(user) assert_equal 4, versions.size versions.each do |version| assert_kind_of Version, version end assert !versions.collect(&:id).include?(6) end def test_next_identifier ProjectCustomField.delete_all Project.create!(:name => 'last', :identifier => 'p2008040') assert_equal 'p2008041', Project.next_identifier end def test_next_identifier_first_project Project.delete_all assert_nil Project.next_identifier end def test_enabled_module_names with_settings :default_projects_modules => ['issue_tracking', 'repository'] do project = Project.new project.enabled_module_names = %w(issue_tracking news) assert_equal %w(issue_tracking news), project.enabled_module_names.sort end end def test_enabled_module_names_should_not_recreate_enabled_modules project = Project.find(1) # Remove one module modules = project.enabled_modules.slice(0..-2) assert modules.any? assert_difference 'EnabledModule.count', -1 do project.enabled_module_names = modules.collect(&:name) end project.reload # Ids should be preserved assert_equal project.enabled_module_ids.sort, modules.collect(&:id).sort end def test_copy_from_existing_project source_project = Project.find(1) copied_project = Project.copy_from(1) assert copied_project # Cleared attributes assert copied_project.id.blank? assert copied_project.name.blank? assert copied_project.identifier.blank? # Duplicated attributes assert_equal source_project.description, copied_project.description assert_equal source_project.enabled_modules, copied_project.enabled_modules assert_equal source_project.trackers, copied_project.trackers # Default attributes assert_equal 1, copied_project.status end def test_activities_should_use_the_system_activities project = Project.find(1) assert_equal project.activities, TimeEntryActivity.find(:all, :conditions => {:active => true} ) end def test_activities_should_use_the_project_specific_activities project = Project.find(1) overridden_activity = TimeEntryActivity.new({:name => "Project", :project => project}) assert overridden_activity.save! assert project.activities.include?(overridden_activity), "Project specific Activity not found" end def test_activities_should_not_include_the_inactive_project_specific_activities project = Project.find(1) overridden_activity = TimeEntryActivity.new({:name => "Project", :project => project, :parent => TimeEntryActivity.find(:first), :active => false}) assert overridden_activity.save! assert !project.activities.include?(overridden_activity), "Inactive Project specific Activity found" end def test_activities_should_not_include_project_specific_activities_from_other_projects project = Project.find(1) overridden_activity = TimeEntryActivity.new({:name => "Project", :project => Project.find(2)}) assert overridden_activity.save! assert !project.activities.include?(overridden_activity), "Project specific Activity found on a different project" end def test_activities_should_handle_nils overridden_activity = TimeEntryActivity.new({:name => "Project", :project => Project.find(1), :parent => TimeEntryActivity.find(:first)}) TimeEntryActivity.delete_all # No activities project = Project.find(1) assert project.activities.empty? # No system, one overridden assert overridden_activity.save! project.reload assert_equal [overridden_activity], project.activities end def test_activities_should_override_system_activities_with_project_activities project = Project.find(1) parent_activity = TimeEntryActivity.find(:first) overridden_activity = TimeEntryActivity.new({:name => "Project", :project => project, :parent => parent_activity}) assert overridden_activity.save! assert project.activities.include?(overridden_activity), "Project specific Activity not found" assert !project.activities.include?(parent_activity), "System Activity found when it should have been overridden" end def test_activities_should_include_inactive_activities_if_specified project = Project.find(1) overridden_activity = TimeEntryActivity.new({:name => "Project", :project => project, :parent => TimeEntryActivity.find(:first), :active => false}) assert overridden_activity.save! assert project.activities(true).include?(overridden_activity), "Inactive Project specific Activity not found" end test 'activities should not include active System activities if the project has an override that is inactive' do project = Project.find(1) system_activity = TimeEntryActivity.find_by_name('Design') assert system_activity.active? overridden_activity = TimeEntryActivity.generate!(:project => project, :parent => system_activity, :active => false) assert overridden_activity.save! assert !project.activities.include?(overridden_activity), "Inactive Project specific Activity not found" assert !project.activities.include?(system_activity), "System activity found when the project has an inactive override" end def test_close_completed_versions Version.update_all("status = 'open'") project = Project.find(1) assert_not_nil project.versions.detect {|v| v.completed? && v.status == 'open'} assert_not_nil project.versions.detect {|v| !v.completed? && v.status == 'open'} project.close_completed_versions project.reload assert_nil project.versions.detect {|v| v.completed? && v.status != 'closed'} assert_not_nil project.versions.detect {|v| !v.completed? && v.status == 'open'} end context "Project#copy" do setup do ProjectCustomField.destroy_all # Custom values are a mess to isolate in tests Project.destroy_all :identifier => "copy-test" @source_project = Project.find(2) @project = Project.new(:name => 'Copy Test', :identifier => 'copy-test') @project.trackers = @source_project.trackers @project.enabled_module_names = @source_project.enabled_modules.collect(&:name) end should "copy issues" do @source_project.issues << Issue.generate!(:status => IssueStatus.find_by_name('Closed'), :subject => "copy issue status", :tracker_id => 1, :assigned_to_id => 2, :project_id => @source_project.id) assert @project.valid? assert @project.issues.empty? assert @project.copy(@source_project) assert_equal @source_project.issues.size, @project.issues.size @project.issues.each do |issue| assert issue.valid? assert ! issue.assigned_to.blank? assert_equal @project, issue.project end copied_issue = @project.issues.first(:conditions => {:subject => "copy issue status"}) assert copied_issue assert copied_issue.status assert_equal "Closed", copied_issue.status.name end should "change the new issues to use the copied version" do User.current = User.find(1) assigned_version = Version.generate!(:name => "Assigned Issues", :status => 'open') @source_project.versions << assigned_version assert_equal 3, @source_project.versions.size Issue.generate_for_project!(@source_project, :fixed_version_id => assigned_version.id, :subject => "change the new issues to use the copied version", :tracker_id => 1, :project_id => @source_project.id) assert @project.copy(@source_project) @project.reload copied_issue = @project.issues.first(:conditions => {:subject => "change the new issues to use the copied version"}) assert copied_issue assert copied_issue.fixed_version assert_equal "Assigned Issues", copied_issue.fixed_version.name # Same name assert_not_equal assigned_version.id, copied_issue.fixed_version.id # Different record end should "copy issue relations" do Setting.cross_project_issue_relations = '1' second_issue = Issue.generate!(:status_id => 5, :subject => "copy issue relation", :tracker_id => 1, :assigned_to_id => 2, :project_id => @source_project.id) source_relation = IssueRelation.generate!(:issue_from => Issue.find(4), :issue_to => second_issue, :relation_type => "relates") source_relation_cross_project = IssueRelation.generate!(:issue_from => Issue.find(1), :issue_to => second_issue, :relation_type => "duplicates") assert @project.copy(@source_project) assert_equal @source_project.issues.count, @project.issues.count copied_issue = @project.issues.find_by_subject("Issue on project 2") # Was #4 copied_second_issue = @project.issues.find_by_subject("copy issue relation") # First issue with a relation on project assert_equal 1, copied_issue.relations.size, "Relation not copied" copied_relation = copied_issue.relations.first assert_equal "relates", copied_relation.relation_type assert_equal copied_second_issue.id, copied_relation.issue_to_id assert_not_equal source_relation.id, copied_relation.id # Second issue with a cross project relation assert_equal 2, copied_second_issue.relations.size, "Relation not copied" copied_relation = copied_second_issue.relations.select {|r| r.relation_type == 'duplicates'}.first assert_equal "duplicates", copied_relation.relation_type assert_equal 1, copied_relation.issue_from_id, "Cross project relation not kept" assert_not_equal source_relation_cross_project.id, copied_relation.id end should "copy memberships" do assert @project.valid? assert @project.members.empty? assert @project.copy(@source_project) assert_equal @source_project.memberships.size, @project.memberships.size @project.memberships.each do |membership| assert membership assert_equal @project, membership.project end end should "copy memberships with groups and additional roles" do group = Group.create!(:lastname => "Copy group") user = User.find(7) group.users << user # group role Member.create!(:project_id => @source_project.id, :principal => group, :role_ids => [2]) member = Member.find_by_user_id_and_project_id(user.id, @source_project.id) # additional role member.role_ids = [1] assert @project.copy(@source_project) member = Member.find_by_user_id_and_project_id(user.id, @project.id) assert_not_nil member assert_equal [1, 2], member.role_ids.sort end should "copy project specific queries" do assert @project.valid? assert @project.queries.empty? assert @project.copy(@source_project) assert_equal @source_project.queries.size, @project.queries.size @project.queries.each do |query| assert query assert_equal @project, query.project end end should "copy versions" do @source_project.versions << Version.generate! @source_project.versions << Version.generate! assert @project.versions.empty? assert @project.copy(@source_project) assert_equal @source_project.versions.size, @project.versions.size @project.versions.each do |version| assert version assert_equal @project, version.project end end should "copy wiki" do assert_difference 'Wiki.count' do assert @project.copy(@source_project) end assert @project.wiki assert_not_equal @source_project.wiki, @project.wiki assert_equal "Start page", @project.wiki.start_page end should "copy wiki pages and content with hierarchy" do assert_difference 'WikiPage.count', @source_project.wiki.pages.size do assert @project.copy(@source_project) end assert @project.wiki assert_equal @source_project.wiki.pages.size, @project.wiki.pages.size @project.wiki.pages.each do |wiki_page| assert wiki_page.content assert !@source_project.wiki.pages.include?(wiki_page) end parent = @project.wiki.find_page('Parent_page') child1 = @project.wiki.find_page('Child_page_1') child2 = @project.wiki.find_page('Child_page_2') assert_equal parent, child1.parent assert_equal parent, child2.parent end should "copy issue categories" do assert @project.copy(@source_project) assert_equal 2, @project.issue_categories.size @project.issue_categories.each do |issue_category| assert !@source_project.issue_categories.include?(issue_category) end end should "copy boards" do assert @project.copy(@source_project) assert_equal 1, @project.boards.size @project.boards.each do |board| assert !@source_project.boards.include?(board) end end should "change the new issues to use the copied issue categories" do issue = Issue.find(4) issue.update_attribute(:category_id, 3) assert @project.copy(@source_project) @project.issues.each do |issue| assert issue.category assert_equal "Stock management", issue.category.name # Same name assert_not_equal IssueCategory.find(3), issue.category # Different record end end should "limit copy with :only option" do assert @project.members.empty? assert @project.issue_categories.empty? assert @source_project.issues.any? assert @project.copy(@source_project, :only => ['members', 'issue_categories']) assert @project.members.any? assert @project.issue_categories.any? assert @project.issues.empty? end end context "#start_date" do setup do ProjectCustomField.destroy_all # Custom values are a mess to isolate in tests @project = Project.generate!(:identifier => 'test0') @project.trackers << Tracker.generate! end should "be nil if there are no issues on the project" do assert_nil @project.start_date end should "be tested when issues have no start date" should "be the earliest start date of it's issues" do early = 7.days.ago.to_date Issue.generate_for_project!(@project, :start_date => Date.today) Issue.generate_for_project!(@project, :start_date => early) assert_equal early, @project.start_date end end context "#due_date" do setup do ProjectCustomField.destroy_all # Custom values are a mess to isolate in tests @project = Project.generate!(:identifier => 'test0') @project.trackers << Tracker.generate! end should "be nil if there are no issues on the project" do assert_nil @project.due_date end should "be tested when issues have no due date" should "be the latest due date of it's issues" do future = 7.days.from_now.to_date Issue.generate_for_project!(@project, :due_date => future) Issue.generate_for_project!(@project, :due_date => Date.today) assert_equal future, @project.due_date end should "be the latest due date of it's versions" do future = 7.days.from_now.to_date @project.versions << Version.generate!(:effective_date => future) @project.versions << Version.generate!(:effective_date => Date.today) assert_equal future, @project.due_date end should "pick the latest date from it's issues and versions" do future = 7.days.from_now.to_date far_future = 14.days.from_now.to_date Issue.generate_for_project!(@project, :due_date => far_future) @project.versions << Version.generate!(:effective_date => future) assert_equal far_future, @project.due_date end end context "Project#completed_percent" do setup do ProjectCustomField.destroy_all # Custom values are a mess to isolate in tests @project = Project.generate!(:identifier => 'test0') @project.trackers << Tracker.generate! end context "no versions" do should "be 100" do assert_equal 100, @project.completed_percent end end context "with versions" do should "return 0 if the versions have no issues" do Version.generate!(:project => @project) Version.generate!(:project => @project) assert_equal 0, @project.completed_percent end should "return 100 if the version has only closed issues" do v1 = Version.generate!(:project => @project) Issue.generate_for_project!(@project, :status => IssueStatus.find_by_name('Closed'), :fixed_version => v1) v2 = Version.generate!(:project => @project) Issue.generate_for_project!(@project, :status => IssueStatus.find_by_name('Closed'), :fixed_version => v2) assert_equal 100, @project.completed_percent end should "return the averaged completed percent of the versions (not weighted)" do v1 = Version.generate!(:project => @project) Issue.generate_for_project!(@project, :status => IssueStatus.find_by_name('New'), :estimated_hours => 10, :done_ratio => 50, :fixed_version => v1) v2 = Version.generate!(:project => @project) Issue.generate_for_project!(@project, :status => IssueStatus.find_by_name('New'), :estimated_hours => 10, :done_ratio => 50, :fixed_version => v2) assert_equal 50, @project.completed_percent end end end context "#notified_users" do setup do @project = Project.generate! @role = Role.generate! @user_with_membership_notification = User.generate!(:mail_notification => 'selected') Member.generate!(:project => @project, :roles => [@role], :principal => @user_with_membership_notification, :mail_notification => true) @all_events_user = User.generate!(:mail_notification => 'all') Member.generate!(:project => @project, :roles => [@role], :principal => @all_events_user) @no_events_user = User.generate!(:mail_notification => 'none') Member.generate!(:project => @project, :roles => [@role], :principal => @no_events_user) @only_my_events_user = User.generate!(:mail_notification => 'only_my_events') Member.generate!(:project => @project, :roles => [@role], :principal => @only_my_events_user) @only_assigned_user = User.generate!(:mail_notification => 'only_assigned') Member.generate!(:project => @project, :roles => [@role], :principal => @only_assigned_user) @only_owned_user = User.generate!(:mail_notification => 'only_owner') Member.generate!(:project => @project, :roles => [@role], :principal => @only_owned_user) end should "include members with a mail notification" do assert @project.notified_users.include?(@user_with_membership_notification) end should "include users with the 'all' notification option" do assert @project.notified_users.include?(@all_events_user) end should "not include users with the 'none' notification option" do assert [email protected]_users.include?(@no_events_user) end should "not include users with the 'only_my_events' notification option" do assert [email protected]_users.include?(@only_my_events_user) end should "not include users with the 'only_assigned' notification option" do assert [email protected]_users.include?(@only_assigned_user) end should "not include users with the 'only_owner' notification option" do assert [email protected]_users.include?(@only_owned_user) end end end
{ "pile_set_name": "Github" }
/** * Copyright (C) 2014 MongoDB Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * 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 <http://www.gnu.org/licenses/>. * * As a special exception, the copyright holders give permission to link the * code of portions of this program with the OpenSSL library under certain * conditions as described in each individual source file and distribute * linked combinations including the program with the OpenSSL library. You * must comply with the GNU Affero General Public License in all respects for * all of the code used other than as permitted herein. If you modify file(s) * with this exception, you may extend this exception to your version of the * file(s), but you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. If you delete this * exception statement from all source files in the program, then also delete * it in the license file. */ #include "mongo/platform/basic.h" #include "mongo/db/repl/repl_set_heartbeat_response.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" namespace mongo { namespace repl { namespace { using std::unique_ptr; bool stringContains(const std::string& haystack, const std::string& needle) { return haystack.find(needle) != std::string::npos; } TEST(ReplSetHeartbeatResponse, DefaultConstructThenSlowlyBuildToFullObj) { int fieldsSet = 2; ReplSetHeartbeatResponse hbResponse; ReplSetHeartbeatResponse hbResponseObjRoundTripChecker; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(false, hbResponse.hasElectionTime()); ASSERT_EQUALS(false, hbResponse.hasIsElectable()); ASSERT_EQUALS(false, hbResponse.hasTime()); ASSERT_EQUALS(false, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(false, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(-1, hbResponse.getConfigVersion()); BSONObj hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); Status initializeResult = Status::OK(); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toString()); // set version hbResponse.setConfigVersion(1); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(false, hbResponse.hasElectionTime()); ASSERT_EQUALS(false, hbResponse.hasIsElectable()); ASSERT_EQUALS(false, hbResponse.hasTime()); ASSERT_EQUALS(false, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(false, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toString()); // set setname hbResponse.setSetName("rs0"); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(false, hbResponse.hasElectionTime()); ASSERT_EQUALS(false, hbResponse.hasIsElectable()); ASSERT_EQUALS(false, hbResponse.hasTime()); ASSERT_EQUALS(false, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(false, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toString()); // set electionTime hbResponse.setElectionTime(Timestamp(10, 0)); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(false, hbResponse.hasIsElectable()); ASSERT_EQUALS(false, hbResponse.hasTime()); ASSERT_EQUALS(false, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(false, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toString()); // set durableOpTime hbResponse.setDurableOpTime(OpTime(Timestamp(10), 0)); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(false, hbResponse.hasIsElectable()); ASSERT_EQUALS(false, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(false, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set appliedOpTime hbResponse.setAppliedOpTime(OpTime(Timestamp(50), 0)); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(false, hbResponse.hasIsElectable()); ASSERT_EQUALS(false, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set time hbResponse.setTime(Seconds(10)); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(false, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set electable hbResponse.setElectable(true); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(false, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); ASSERT_EQUALS(true, hbResponseObj["e"].trueValue()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set config ReplSetConfig config; hbResponse.setConfig(config); ++fieldsSet; ASSERT_EQUALS(false, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(true, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); ASSERT_EQUALS(config.toBSON().toString(), hbResponse.getConfig().toBSON().toString()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); ASSERT_EQUALS(true, hbResponseObj["e"].trueValue()); ASSERT_EQUALS(config.toBSON().toString(), hbResponseObj["config"].Obj().toString()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set state hbResponse.setState(MemberState(MemberState::RS_SECONDARY)); ++fieldsSet; ASSERT_EQUALS(true, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(true, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(false, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS(MemberState(MemberState::RS_SECONDARY).toString(), hbResponse.getState().toString()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); ASSERT_EQUALS(config.toBSON().toString(), hbResponse.getConfig().toBSON().toString()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); ASSERT_EQUALS(true, hbResponseObj["e"].trueValue()); ASSERT_EQUALS(config.toBSON().toString(), hbResponseObj["config"].Obj().toString()); ASSERT_EQUALS(2, hbResponseObj["state"].numberLong()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set stateDisagreement hbResponse.noteStateDisagreement(); ++fieldsSet; ASSERT_EQUALS(true, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(true, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(false, hbResponse.isReplSet()); ASSERT_EQUALS(true, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS(MemberState(MemberState::RS_SECONDARY).toString(), hbResponse.getState().toString()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); ASSERT_EQUALS(config.toBSON().toString(), hbResponse.getConfig().toBSON().toString()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); ASSERT_EQUALS(true, hbResponseObj["e"].trueValue()); ASSERT_EQUALS(config.toBSON().toString(), hbResponseObj["config"].Obj().toString()); ASSERT_EQUALS(2, hbResponseObj["state"].numberLong()); ASSERT_EQUALS(false, hbResponseObj["mismatch"].trueValue()); ASSERT_EQUALS(true, hbResponseObj["stateDisagreement"].trueValue()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set replSet hbResponse.noteReplSet(); ++fieldsSet; ASSERT_EQUALS(true, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(true, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(true, hbResponse.isReplSet()); ASSERT_EQUALS(true, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS(MemberState(MemberState::RS_SECONDARY).toString(), hbResponse.getState().toString()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort(), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); ASSERT_EQUALS(config.toBSON().toString(), hbResponse.getConfig().toBSON().toString()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); ASSERT_EQUALS(true, hbResponseObj["e"].trueValue()); ASSERT_EQUALS(config.toBSON().toString(), hbResponseObj["config"].Obj().toString()); ASSERT_EQUALS(2, hbResponseObj["state"].numberLong()); ASSERT_EQUALS(false, hbResponseObj["mismatch"].trueValue()); ASSERT_EQUALS(true, hbResponseObj["stateDisagreement"].trueValue()); ASSERT_EQUALS(true, hbResponseObj["rs"].trueValue()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set syncingTo hbResponse.setSyncingTo(HostAndPort("syncTarget")); ++fieldsSet; ASSERT_EQUALS(true, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(true, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(true, hbResponse.isReplSet()); ASSERT_EQUALS(true, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS(MemberState(MemberState::RS_SECONDARY).toString(), hbResponse.getState().toString()); ASSERT_EQUALS("", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort("syncTarget"), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); ASSERT_EQUALS(config.toBSON().toString(), hbResponse.getConfig().toBSON().toString()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); ASSERT_EQUALS(true, hbResponseObj["e"].trueValue()); ASSERT_EQUALS(config.toBSON().toString(), hbResponseObj["config"].Obj().toString()); ASSERT_EQUALS(2, hbResponseObj["state"].numberLong()); ASSERT_EQUALS(false, hbResponseObj["mismatch"].trueValue()); ASSERT_EQUALS(true, hbResponseObj["stateDisagreement"].trueValue()); ASSERT_EQUALS(true, hbResponseObj["rs"].trueValue()); ASSERT_EQUALS("syncTarget:27017", hbResponseObj["syncingTo"].String()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set hbmsg hbResponse.setHbMsg("lub dub"); ASSERT_EQUALS(true, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(true, hbResponse.hasConfig()); ASSERT_EQUALS(false, hbResponse.isMismatched()); ASSERT_EQUALS(true, hbResponse.isReplSet()); ASSERT_EQUALS(true, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS(MemberState(MemberState::RS_SECONDARY).toString(), hbResponse.getState().toString()); ASSERT_EQUALS("lub dub", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort("syncTarget"), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); ASSERT_EQUALS(config.toBSON().toString(), hbResponse.getConfig().toBSON().toString()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(fieldsSet, hbResponseObj.nFields()); ASSERT_EQUALS("rs0", hbResponseObj["set"].String()); ASSERT_EQUALS("lub dub", hbResponseObj["hbmsg"].String()); ASSERT_EQUALS(1, hbResponseObj["v"].Number()); ASSERT_EQUALS(Timestamp(10, 0), hbResponseObj["electionTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 50), hbResponseObj["opTime"].timestamp()); ASSERT_EQUALS(Timestamp(0, 10), hbResponseObj["durableOpTime"]["ts"].timestamp()); ASSERT_EQUALS(10, hbResponseObj["time"].numberLong()); ASSERT_EQUALS(true, hbResponseObj["e"].trueValue()); ASSERT_EQUALS(config.toBSON().toString(), hbResponseObj["config"].Obj().toString()); ASSERT_EQUALS(2, hbResponseObj["state"].numberLong()); ASSERT_EQUALS(false, hbResponseObj["mismatch"].trueValue()); ASSERT_EQUALS(true, hbResponseObj["stateDisagreement"].trueValue()); ASSERT_EQUALS(true, hbResponseObj["rs"].trueValue()); ASSERT_EQUALS("syncTarget:27017", hbResponseObj["syncingTo"].String()); initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(hbResponseObj.toString(), hbResponseObjRoundTripChecker.toBSON(false).toString()); // set mismatched hbResponse.noteMismatched(); ASSERT_EQUALS(true, hbResponse.hasState()); ASSERT_EQUALS(true, hbResponse.hasElectionTime()); ASSERT_EQUALS(true, hbResponse.hasIsElectable()); ASSERT_EQUALS(true, hbResponse.hasTime()); ASSERT_EQUALS(true, hbResponse.hasDurableOpTime()); ASSERT_EQUALS(true, hbResponse.hasAppliedOpTime()); ASSERT_EQUALS(true, hbResponse.hasConfig()); ASSERT_EQUALS(true, hbResponse.isMismatched()); ASSERT_EQUALS(true, hbResponse.isReplSet()); ASSERT_EQUALS(true, hbResponse.isStateDisagreement()); ASSERT_EQUALS("rs0", hbResponse.getReplicaSetName()); ASSERT_EQUALS(MemberState(MemberState::RS_SECONDARY).toString(), hbResponse.getState().toString()); ASSERT_EQUALS("lub dub", hbResponse.getHbMsg()); ASSERT_EQUALS(HostAndPort("syncTarget"), hbResponse.getSyncingTo()); ASSERT_EQUALS(1, hbResponse.getConfigVersion()); ASSERT_EQUALS(Timestamp(10, 0), hbResponse.getElectionTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 10), 0), hbResponse.getDurableOpTime()); ASSERT_EQUALS(OpTime(Timestamp(0, 50), 0), hbResponse.getAppliedOpTime()); ASSERT_EQUALS(Seconds(10), hbResponse.getTime()); ASSERT_EQUALS(true, hbResponse.isElectable()); ASSERT_EQUALS(config.toBSON().toString(), hbResponse.getConfig().toBSON().toString()); hbResponseObj = hbResponse.toBSON(false); ASSERT_EQUALS(2, hbResponseObj.nFields()); ASSERT_EQUALS(true, hbResponseObj["mismatch"].trueValue()); // NOTE: Does not check round-trip. Once noteMismached is set the bson will return an error // from initialize parsing. initializeResult = hbResponseObjRoundTripChecker.initialize(hbResponseObj, 0); ASSERT_NOT_EQUALS(Status::OK(), initializeResult); ASSERT_EQUALS(ErrorCodes::InconsistentReplicaSetNames, initializeResult.code()); } TEST(ReplSetHeartbeatResponse, InitializeWrongElectionTimeType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "electionTime" << "hello"); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"electionTime\" field in response to replSetHeartbeat command to " "have type Date or Timestamp, but found type string", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeWrongTimeType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "time" << "hello"); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"time\" field in response to replSetHeartbeat command to " "have a numeric type, but found type string", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeWrongDurableOpTimeType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "durableOpTime" << "hello"); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS("\"durableOpTime\" had the wrong type. Expected object, found string", result.reason()); BSONObj initializerObj2 = BSON("ok" << 1.0 << "durableOpTime" << OpTime().getTimestamp()); Status result2 = hbResponse.initialize(initializerObj2, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result2); ASSERT_EQUALS("\"durableOpTime\" had the wrong type. Expected object, found timestamp", result2.reason()); } TEST(ReplSetHeartbeatResponse, InitializeWrongAppliedOpTimeType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "opTime" << "hello"); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"opTime\" field in response to replSetHeartbeat command to " "have type Date or Timestamp, but found type string", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeMemberStateWrongType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "state" << "hello"); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"state\" field in response to replSetHeartbeat command to " "have type NumberInt or NumberLong, but found type string", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeMemberStateTooLow) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "state" << -1); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::BadValue, result); ASSERT_EQUALS( "Value for \"state\" in response to replSetHeartbeat is out of range; " "legal values are non-negative and no more than 10", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeMemberStateTooHigh) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "state" << 11); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::BadValue, result); ASSERT_EQUALS( "Value for \"state\" in response to replSetHeartbeat is out of range; " "legal values are non-negative and no more than 10", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeVersionWrongType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "v" << "hello"); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"v\" field in response to replSetHeartbeat to " "have type NumberInt, but found string", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeReplSetNameWrongType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "v" << 2 << // needs a version to get this far in initialize() "set" << 4); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"set\" field in response to replSetHeartbeat to " "have type String, but found int", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeHeartbeatMeessageWrongType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "v" << 2 << // needs a version to get this far in initialize() "hbmsg" << 4); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"hbmsg\" field in response to replSetHeartbeat to " "have type String, but found int", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeSyncingToWrongType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "v" << 2 << // needs a version to get this far in initialize() "syncingTo" << 4); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"syncingTo\" field in response to replSetHeartbeat to " "have type String, but found int", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeConfigWrongType) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "v" << 2 << // needs a version to get this far in initialize() "config" << 4); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::TypeMismatch, result); ASSERT_EQUALS( "Expected \"config\" in response to replSetHeartbeat to " "have type Object, but found int", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeBadConfig) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 1.0 << "v" << 2 << // needs a version to get this far in initialize() "config" << BSON("illegalFieldName" << 2)); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::BadValue, result); ASSERT_EQUALS("Unexpected field illegalFieldName in replica set configuration", result.reason()); } TEST(ReplSetHeartbeatResponse, InitializeBothElectionTimeTypesSameResult) { ReplSetHeartbeatResponse hbResponseDate; ReplSetHeartbeatResponse hbResponseTimestamp; BSONObjBuilder initializerDate; BSONObjBuilder initializerTimestamp; Date_t electionTime = Date_t::fromMillisSinceEpoch(974132); initializerDate.append("ok", 1.0); initializerDate.append("v", 1); initializerDate.appendDate("electionTime", electionTime); Status result = hbResponseDate.initialize(initializerDate.obj(), 0); ASSERT_EQUALS(Status::OK(), result); initializerTimestamp.append("ok", 1.0); initializerTimestamp.append("v", 1); initializerTimestamp.appendTimestamp("electionTime", electionTime.toULL()); result = hbResponseTimestamp.initialize(initializerTimestamp.obj(), 0); ASSERT_EQUALS(Status::OK(), result); ASSERT_EQUALS(hbResponseTimestamp.getElectionTime(), hbResponseTimestamp.getElectionTime()); } TEST(ReplSetHeartbeatResponse, InitializeBothOpTimeTypesSameResult) { ReplSetHeartbeatResponse hbResponseDate; ReplSetHeartbeatResponse hbResponseTimestamp; BSONObjBuilder initializerDate; BSONObjBuilder initializerTimestamp; Date_t opTime = Date_t::fromMillisSinceEpoch(974132); initializerDate.append("ok", 1.0); initializerDate.append("v", 1); initializerDate.appendDate("opTime", opTime); Status result = hbResponseDate.initialize(initializerDate.obj(), 0); ASSERT_EQUALS(Status::OK(), result); initializerTimestamp.append("ok", 1.0); initializerTimestamp.append("v", 1); initializerTimestamp.appendTimestamp("opTime", opTime.toULL()); result = hbResponseTimestamp.initialize(initializerTimestamp.obj(), 0); ASSERT_EQUALS(Status::OK(), result); ASSERT_EQUALS(hbResponseTimestamp.getAppliedOpTime(), hbResponseTimestamp.getAppliedOpTime()); } TEST(ReplSetHeartbeatResponse, NoConfigStillInitializing) { ReplSetHeartbeatResponse hbResp; std::string msg = "still initializing"; Status result = hbResp.initialize(BSON("ok" << 1.0 << "rs" << true << "hbmsg" << msg), 0); ASSERT_EQUALS(Status::OK(), result); ASSERT_EQUALS(true, hbResp.isReplSet()); ASSERT_EQUALS(msg, hbResp.getHbMsg()); } TEST(ReplSetHeartbeatResponse, InvalidResponseOpTimeMissesConfigVersion) { ReplSetHeartbeatResponse hbResp; std::string msg = "still initializing"; Status result = hbResp.initialize(BSON("ok" << 1.0 << "opTime" << Timestamp()), 0); ASSERT_EQUALS(ErrorCodes::NoSuchKey, result.code()); ASSERT_TRUE(stringContains(result.reason(), "\"v\"")) << result.reason() << " doesn't contain 'v' field required error msg"; } TEST(ReplSetHeartbeatResponse, MismatchedRepliSetNames) { ReplSetHeartbeatResponse hbResponse; BSONObj initializerObj = BSON("ok" << 0.0 << "mismatch" << true); Status result = hbResponse.initialize(initializerObj, 0); ASSERT_EQUALS(ErrorCodes::InconsistentReplicaSetNames, result.code()); } TEST(ReplSetHeartbeatResponse, AuthFailure) { ReplSetHeartbeatResponse hbResp; std::string errMsg = "Unauthorized"; Status result = hbResp.initialize( BSON("ok" << 0.0 << "errmsg" << errMsg << "code" << ErrorCodes::Unauthorized), 0); ASSERT_EQUALS(ErrorCodes::Unauthorized, result.code()); ASSERT_EQUALS(errMsg, result.reason()); } TEST(ReplSetHeartbeatResponse, ServerError) { ReplSetHeartbeatResponse hbResp; std::string errMsg = "Random Error"; Status result = hbResp.initialize(BSON("ok" << 0.0 << "errmsg" << errMsg), 0); ASSERT_EQUALS(ErrorCodes::UnknownError, result.code()); ASSERT_EQUALS(errMsg, result.reason()); } } // namespace } // namespace repl } // namespace mongo
{ "pile_set_name": "Github" }
-----BEGIN PRIVATE KEY----- MIGUAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHoweAIBAQQhALoiXMjOXuPkNVT6 g/8PnBmXj8wEvWXCyrpO+fh9EMTdoAoGCCqGSM49AwEHoUQDQgAEMzBNZ4wx6os0 rWIqn8QuOTHH3arXAxQrMopO4OycMBgcwyN1kz+bLW/ICx8BgEapGkyA6/8Grvjd dmyMaU4+gg== -----END PRIVATE KEY-----
{ "pile_set_name": "Github" }
<?php namespace mindplay\test\lib; /** * The xTest::fail() method throws and catches this exception, in order to * interrupt the execution of a failed test. */ class xTestException extends \Exception { const FAIL = 0; const PHP_ERROR = 1; }
{ "pile_set_name": "Github" }
{ "symbol": "SXAG", "name": "sXAG", "type": "ERC20", "address": "0x6A22e5e94388464181578Aa7A6B869e00fE27846", "ens_address": "", "decimals": 18, "website": "https://www.synthetix.io/tokens/", "logo": { "src": "", "width": "", "height": "", "ipfs_hash": "" }, "support": { "email": "", "url": "" }, "social": { "blog": "", "chat": "", "facebook": "", "forum": "", "github": "", "gitter": "", "instagram": "", "linkedin": "", "reddit": "", "slack": "", "telegram": "", "twitter": "", "youtube": "" } }
{ "pile_set_name": "Github" }
/* * Copyright (c) by Jaroslav Kysela <[email protected]> * Creative Labs, Inc. * Routines for IRQ control of EMU10K1 chips * * BUGS: * -- * * TODO: * -- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include <linux/time.h> #include <sound/core.h> #include <sound/emu10k1.h> irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id) { struct snd_emu10k1 *emu = dev_id; unsigned int status, status2, orig_status, orig_status2; int handled = 0; int timeout = 0; while (((status = inl(emu->port + IPR)) != 0) && (timeout < 1000)) { timeout++; orig_status = status; handled = 1; if ((status & 0xffffffff) == 0xffffffff) { snd_printk(KERN_INFO "snd-emu10k1: Suspected sound card removal\n"); break; } if (status & IPR_PCIERROR) { snd_printk(KERN_ERR "interrupt: PCI error\n"); snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE); status &= ~IPR_PCIERROR; } if (status & (IPR_VOLINCR|IPR_VOLDECR|IPR_MUTE)) { if (emu->hwvol_interrupt) emu->hwvol_interrupt(emu, status); else snd_emu10k1_intr_disable(emu, INTE_VOLINCRENABLE|INTE_VOLDECRENABLE|INTE_MUTEENABLE); status &= ~(IPR_VOLINCR|IPR_VOLDECR|IPR_MUTE); } if (status & IPR_CHANNELLOOP) { int voice; int voice_max = status & IPR_CHANNELNUMBERMASK; u32 val; struct snd_emu10k1_voice *pvoice = emu->voices; val = snd_emu10k1_ptr_read(emu, CLIPL, 0); for (voice = 0; voice <= voice_max; voice++) { if (voice == 0x20) val = snd_emu10k1_ptr_read(emu, CLIPH, 0); if (val & 1) { if (pvoice->use && pvoice->interrupt != NULL) { pvoice->interrupt(emu, pvoice); snd_emu10k1_voice_intr_ack(emu, voice); } else { snd_emu10k1_voice_intr_disable(emu, voice); } } val >>= 1; pvoice++; } val = snd_emu10k1_ptr_read(emu, HLIPL, 0); for (voice = 0; voice <= voice_max; voice++) { if (voice == 0x20) val = snd_emu10k1_ptr_read(emu, HLIPH, 0); if (val & 1) { if (pvoice->use && pvoice->interrupt != NULL) { pvoice->interrupt(emu, pvoice); snd_emu10k1_voice_half_loop_intr_ack(emu, voice); } else { snd_emu10k1_voice_half_loop_intr_disable(emu, voice); } } val >>= 1; pvoice++; } status &= ~IPR_CHANNELLOOP; } status &= ~IPR_CHANNELNUMBERMASK; if (status & (IPR_ADCBUFFULL|IPR_ADCBUFHALFFULL)) { if (emu->capture_interrupt) emu->capture_interrupt(emu, status); else snd_emu10k1_intr_disable(emu, INTE_ADCBUFENABLE); status &= ~(IPR_ADCBUFFULL|IPR_ADCBUFHALFFULL); } if (status & (IPR_MICBUFFULL|IPR_MICBUFHALFFULL)) { if (emu->capture_mic_interrupt) emu->capture_mic_interrupt(emu, status); else snd_emu10k1_intr_disable(emu, INTE_MICBUFENABLE); status &= ~(IPR_MICBUFFULL|IPR_MICBUFHALFFULL); } if (status & (IPR_EFXBUFFULL|IPR_EFXBUFHALFFULL)) { if (emu->capture_efx_interrupt) emu->capture_efx_interrupt(emu, status); else snd_emu10k1_intr_disable(emu, INTE_EFXBUFENABLE); status &= ~(IPR_EFXBUFFULL|IPR_EFXBUFHALFFULL); } if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) { if (emu->midi.interrupt) emu->midi.interrupt(emu, status); else snd_emu10k1_intr_disable(emu, INTE_MIDITXENABLE|INTE_MIDIRXENABLE); status &= ~(IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY); } if (status & (IPR_A_MIDITRANSBUFEMPTY2|IPR_A_MIDIRECVBUFEMPTY2)) { if (emu->midi2.interrupt) emu->midi2.interrupt(emu, status); else snd_emu10k1_intr_disable(emu, INTE_A_MIDITXENABLE2|INTE_A_MIDIRXENABLE2); status &= ~(IPR_A_MIDITRANSBUFEMPTY2|IPR_A_MIDIRECVBUFEMPTY2); } if (status & IPR_INTERVALTIMER) { if (emu->timer) snd_timer_interrupt(emu->timer, emu->timer->sticks); else snd_emu10k1_intr_disable(emu, INTE_INTERVALTIMERENB); status &= ~IPR_INTERVALTIMER; } if (status & (IPR_GPSPDIFSTATUSCHANGE|IPR_CDROMSTATUSCHANGE)) { if (emu->spdif_interrupt) emu->spdif_interrupt(emu, status); else snd_emu10k1_intr_disable(emu, INTE_GPSPDIFENABLE|INTE_CDSPDIFENABLE); status &= ~(IPR_GPSPDIFSTATUSCHANGE|IPR_CDROMSTATUSCHANGE); } if (status & IPR_FXDSP) { if (emu->dsp_interrupt) emu->dsp_interrupt(emu); else snd_emu10k1_intr_disable(emu, INTE_FXDSPENABLE); status &= ~IPR_FXDSP; } if (status & IPR_P16V) { while ((status2 = inl(emu->port + IPR2)) != 0) { u32 mask = INTE2_PLAYBACK_CH_0_LOOP; /* Full Loop */ struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]); struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice); //printk(KERN_INFO "status2=0x%x\n", status2); orig_status2 = status2; if(status2 & mask) { if(pvoice->use) { snd_pcm_period_elapsed(pvoice->epcm->substream); } else { snd_printk(KERN_ERR "p16v: status: 0x%08x, mask=0x%08x, pvoice=%p, use=%d\n", status2, mask, pvoice, pvoice->use); } } if(status2 & 0x110000) { //printk(KERN_INFO "capture int found\n"); if(cvoice->use) { //printk(KERN_INFO "capture period_elapsed\n"); snd_pcm_period_elapsed(cvoice->epcm->substream); } } outl(orig_status2, emu->port + IPR2); /* ack all */ } status &= ~IPR_P16V; } if (status) { unsigned int bits; snd_printk(KERN_ERR "emu10k1: unhandled interrupt: 0x%08x\n", status); //make sure any interrupts we don't handle are disabled: bits = INTE_FXDSPENABLE | INTE_PCIERRORENABLE | INTE_VOLINCRENABLE | INTE_VOLDECRENABLE | INTE_MUTEENABLE | INTE_MICBUFENABLE | INTE_ADCBUFENABLE | INTE_EFXBUFENABLE | INTE_GPSPDIFENABLE | INTE_CDSPDIFENABLE | INTE_INTERVALTIMERENB | INTE_MIDITXENABLE | INTE_MIDIRXENABLE; if (emu->audigy) bits |= INTE_A_MIDITXENABLE2 | INTE_A_MIDIRXENABLE2; snd_emu10k1_intr_disable(emu, bits); } outl(orig_status, emu->port + IPR); /* ack all */ } if (timeout == 1000) snd_printk(KERN_INFO "emu10k1 irq routine failure\n"); return IRQ_RETVAL(handled); }
{ "pile_set_name": "Github" }
package gorush import ( "context" "errors" "sync" ) // InitWorkers for initialize all workers. func InitWorkers(ctx context.Context, wg *sync.WaitGroup, workerNum int64, queueNum int64) { LogAccess.Info("worker number is ", workerNum, ", queue number is ", queueNum) QueueNotification = make(chan PushNotification, queueNum) for i := int64(0); i < workerNum; i++ { go startWorker(ctx, wg, i) } } // SendNotification is send message to iOS, Android or Huawei func SendNotification(ctx context.Context, req PushNotification) { if PushConf.Core.Sync { defer req.WaitDone() } switch req.Platform { case PlatFormIos: PushToIOS(req) case PlatFormAndroid: PushToAndroid(req) case PlatFormHuawei: PushToHuawei(req) } } func startWorker(ctx context.Context, wg *sync.WaitGroup, num int64) { defer wg.Done() for notification := range QueueNotification { SendNotification(ctx, notification) } LogAccess.Info("closed the worker num ", num) } // markFailedNotification adds failure logs for all tokens in push notification func markFailedNotification(notification *PushNotification, reason string) { LogError.Error(reason) for _, token := range notification.Tokens { notification.AddLog(getLogPushEntry(FailedPush, token, *notification, errors.New(reason))) } notification.WaitDone() } // queueNotification add notification to queue list. func queueNotification(ctx context.Context, req RequestPush) (int, []LogPushEntry) { var count int wg := sync.WaitGroup{} newNotification := []*PushNotification{} for i := range req.Notifications { notification := &req.Notifications[i] switch notification.Platform { case PlatFormIos: if !PushConf.Ios.Enabled { continue } case PlatFormAndroid: if !PushConf.Android.Enabled { continue } case PlatFormHuawei: if !PushConf.Huawei.Enabled { continue } } newNotification = append(newNotification, notification) } log := make([]LogPushEntry, 0, count) for _, notification := range newNotification { if PushConf.Core.Sync { notification.wg = &wg notification.log = &log notification.AddWaitCount() } if !tryEnqueue(*notification, QueueNotification) { markFailedNotification(notification, "max capacity reached") } count += len(notification.Tokens) // Count topic message if notification.To != "" { count++ } } if PushConf.Core.Sync { wg.Wait() } StatStorage.AddTotalCount(int64(count)) return count, log } // tryEnqueue tries to enqueue a job to the given job channel. Returns true if // the operation was successful, and false if enqueuing would not have been // possible without blocking. Job is not enqueued in the latter case. func tryEnqueue(job PushNotification, jobChan chan<- PushNotification) bool { select { case jobChan <- job: return true default: return false } }
{ "pile_set_name": "Github" }
SUBROUTINE CSYR2KF( UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB, $ BETA, C, LDC ) * .. Scalar Arguments .. CHARACTER*1 UPLO, TRANS INTEGER N, K, LDA, LDB, LDC COMPLEX ALPHA, BETA * .. Array Arguments .. COMPLEX A( LDA, * ), B( LDB, * ), C( LDC, * ) * .. * * Purpose * ======= * * CSYR2K performs one of the symmetric rank 2k operations * * C := alpha*A*B' + alpha*B*A' + beta*C, * * or * * C := alpha*A'*B + alpha*B'*A + beta*C, * * where alpha and beta are scalars, C is an n by n symmetric matrix * and A and B are n by k matrices in the first case and k by n * matrices in the second case. * * Parameters * ========== * * UPLO - CHARACTER*1. * On entry, UPLO specifies whether the upper or lower * triangular part of the array C is to be referenced as * follows: * * UPLO = 'U' or 'u' Only the upper triangular part of C * is to be referenced. * * UPLO = 'L' or 'l' Only the lower triangular part of C * is to be referenced. * * Unchanged on exit. * * TRANS - CHARACTER*1. * On entry, TRANS specifies the operation to be performed as * follows: * * TRANS = 'N' or 'n' C := alpha*A*B' + alpha*B*A' + * beta*C. * * TRANS = 'T' or 't' C := alpha*A'*B + alpha*B'*A + * beta*C. * * Unchanged on exit. * * N - INTEGER. * On entry, N specifies the order of the matrix C. N must be * at least zero. * Unchanged on exit. * * K - INTEGER. * On entry with TRANS = 'N' or 'n', K specifies the number * of columns of the matrices A and B, and on entry with * TRANS = 'T' or 't', K specifies the number of rows of the * matrices A and B. K must be at least zero. * Unchanged on exit. * * ALPHA - COMPLEX . * On entry, ALPHA specifies the scalar alpha. * Unchanged on exit. * * A - COMPLEX array of DIMENSION ( LDA, ka ), where ka is * k when TRANS = 'N' or 'n', and is n otherwise. * Before entry with TRANS = 'N' or 'n', the leading n by k * part of the array A must contain the matrix A, otherwise * the leading k by n part of the array A must contain the * matrix A. * Unchanged on exit. * * LDA - INTEGER. * On entry, LDA specifies the first dimension of A as declared * in the calling (sub) program. When TRANS = 'N' or 'n' * then LDA must be at least max( 1, n ), otherwise LDA must * be at least max( 1, k ). * Unchanged on exit. * * B - COMPLEX array of DIMENSION ( LDB, kb ), where kb is * k when TRANS = 'N' or 'n', and is n otherwise. * Before entry with TRANS = 'N' or 'n', the leading n by k * part of the array B must contain the matrix B, otherwise * the leading k by n part of the array B must contain the * matrix B. * Unchanged on exit. * * LDB - INTEGER. * On entry, LDB specifies the first dimension of B as declared * in the calling (sub) program. When TRANS = 'N' or 'n' * then LDB must be at least max( 1, n ), otherwise LDB must * be at least max( 1, k ). * Unchanged on exit. * * BETA - COMPLEX . * On entry, BETA specifies the scalar beta. * Unchanged on exit. * * C - COMPLEX array of DIMENSION ( LDC, n ). * Before entry with UPLO = 'U' or 'u', the leading n by n * upper triangular part of the array C must contain the upper * triangular part of the symmetric matrix and the strictly * lower triangular part of C is not referenced. On exit, the * upper triangular part of the array C is overwritten by the * upper triangular part of the updated matrix. * Before entry with UPLO = 'L' or 'l', the leading n by n * lower triangular part of the array C must contain the lower * triangular part of the symmetric matrix and the strictly * upper triangular part of C is not referenced. On exit, the * lower triangular part of the array C is overwritten by the * lower triangular part of the updated matrix. * * LDC - INTEGER. * On entry, LDC specifies the first dimension of C as declared * in the calling (sub) program. LDC must be at least * max( 1, n ). * Unchanged on exit. * * * Level 3 Blas routine. * * -- Written on 8-February-1989. * Jack Dongarra, Argonne National Laboratory. * Iain Duff, AERE Harwell. * Jeremy Du Croz, Numerical Algorithms Group Ltd. * Sven Hammarling, Numerical Algorithms Group Ltd. * * * .. External Functions .. LOGICAL LSAME EXTERNAL LSAME * .. External Subroutines .. EXTERNAL XERBLA * .. Intrinsic Functions .. INTRINSIC MAX * .. Local Scalars .. LOGICAL UPPER INTEGER I, INFO, J, L, NROWA COMPLEX TEMP1, TEMP2 * .. Parameters .. COMPLEX ONE PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) ) COMPLEX ZERO PARAMETER ( ZERO = ( 0.0E+0, 0.0E+0 ) ) * .. * .. Executable Statements .. * * Test the input parameters. * IF( LSAME( TRANS, 'N' ) )THEN NROWA = N ELSE NROWA = K END IF UPPER = LSAME( UPLO, 'U' ) * INFO = 0 IF( ( .NOT.UPPER ).AND. $ ( .NOT.LSAME( UPLO , 'L' ) ) )THEN INFO = 1 ELSE IF( ( .NOT.LSAME( TRANS, 'N' ) ).AND. $ ( .NOT.LSAME( TRANS, 'T' ) ) )THEN INFO = 2 ELSE IF( N .LT.0 )THEN INFO = 3 ELSE IF( K .LT.0 )THEN INFO = 4 ELSE IF( LDA.LT.MAX( 1, NROWA ) )THEN INFO = 7 ELSE IF( LDB.LT.MAX( 1, NROWA ) )THEN INFO = 9 ELSE IF( LDC.LT.MAX( 1, N ) )THEN INFO = 12 END IF IF( INFO.NE.0 )THEN CALL XERBLA( 'CSYR2K', INFO ) RETURN END IF * * Quick return if possible. * IF( ( N.EQ.0 ).OR. $ ( ( ( ALPHA.EQ.ZERO ).OR.( K.EQ.0 ) ).AND.( BETA.EQ.ONE ) ) ) $ RETURN * * And when alpha.eq.zero. * IF( ALPHA.EQ.ZERO )THEN IF( UPPER )THEN IF( BETA.EQ.ZERO )THEN DO 20, J = 1, N DO 10, I = 1, J C( I, J ) = ZERO 10 CONTINUE 20 CONTINUE ELSE DO 40, J = 1, N DO 30, I = 1, J C( I, J ) = BETA*C( I, J ) 30 CONTINUE 40 CONTINUE END IF ELSE IF( BETA.EQ.ZERO )THEN DO 60, J = 1, N DO 50, I = J, N C( I, J ) = ZERO 50 CONTINUE 60 CONTINUE ELSE DO 80, J = 1, N DO 70, I = J, N C( I, J ) = BETA*C( I, J ) 70 CONTINUE 80 CONTINUE END IF END IF RETURN END IF * * Start the operations. * IF( LSAME( TRANS, 'N' ) )THEN * * Form C := alpha*A*B' + alpha*B*A' + C. * IF( UPPER )THEN DO 130, J = 1, N IF( BETA.EQ.ZERO )THEN DO 90, I = 1, J C( I, J ) = ZERO 90 CONTINUE ELSE IF( BETA.NE.ONE )THEN DO 100, I = 1, J C( I, J ) = BETA*C( I, J ) 100 CONTINUE END IF DO 120, L = 1, K IF( ( A( J, L ).NE.ZERO ).OR. $ ( B( J, L ).NE.ZERO ) )THEN TEMP1 = ALPHA*B( J, L ) TEMP2 = ALPHA*A( J, L ) DO 110, I = 1, J C( I, J ) = C( I, J ) + A( I, L )*TEMP1 + $ B( I, L )*TEMP2 110 CONTINUE END IF 120 CONTINUE 130 CONTINUE ELSE DO 180, J = 1, N IF( BETA.EQ.ZERO )THEN DO 140, I = J, N C( I, J ) = ZERO 140 CONTINUE ELSE IF( BETA.NE.ONE )THEN DO 150, I = J, N C( I, J ) = BETA*C( I, J ) 150 CONTINUE END IF DO 170, L = 1, K IF( ( A( J, L ).NE.ZERO ).OR. $ ( B( J, L ).NE.ZERO ) )THEN TEMP1 = ALPHA*B( J, L ) TEMP2 = ALPHA*A( J, L ) DO 160, I = J, N C( I, J ) = C( I, J ) + A( I, L )*TEMP1 + $ B( I, L )*TEMP2 160 CONTINUE END IF 170 CONTINUE 180 CONTINUE END IF ELSE * * Form C := alpha*A'*B + alpha*B'*A + C. * IF( UPPER )THEN DO 210, J = 1, N DO 200, I = 1, J TEMP1 = ZERO TEMP2 = ZERO DO 190, L = 1, K TEMP1 = TEMP1 + A( L, I )*B( L, J ) TEMP2 = TEMP2 + B( L, I )*A( L, J ) 190 CONTINUE IF( BETA.EQ.ZERO )THEN C( I, J ) = ALPHA*TEMP1 + ALPHA*TEMP2 ELSE C( I, J ) = BETA *C( I, J ) + $ ALPHA*TEMP1 + ALPHA*TEMP2 END IF 200 CONTINUE 210 CONTINUE ELSE DO 240, J = 1, N DO 230, I = J, N TEMP1 = ZERO TEMP2 = ZERO DO 220, L = 1, K TEMP1 = TEMP1 + A( L, I )*B( L, J ) TEMP2 = TEMP2 + B( L, I )*A( L, J ) 220 CONTINUE IF( BETA.EQ.ZERO )THEN C( I, J ) = ALPHA*TEMP1 + ALPHA*TEMP2 ELSE C( I, J ) = BETA *C( I, J ) + $ ALPHA*TEMP1 + ALPHA*TEMP2 END IF 230 CONTINUE 240 CONTINUE END IF END IF * RETURN * * End of CSYR2K. * END
{ "pile_set_name": "Github" }
#ifndef CAFFE_UTIL_MATH_FUNCTIONS_H_ #define CAFFE_UTIL_MATH_FUNCTIONS_H_ #include <stdint.h> #include <cmath> // for std::fabs and std::signbit #include "glog/logging.h" #include "caffe/common.hpp" #include "caffe/util/device_alternate.hpp" #include "caffe/util/mkl_alternate.hpp" namespace caffe { // Caffe gemm provides a simpler interface to the gemm functions, with the // limitation that the data has to be contiguous in memory. template <typename Dtype> void caffe_cpu_gemm(const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const Dtype alpha, const Dtype* A, const Dtype* B, const Dtype beta, Dtype* C); template <typename Dtype> void caffe_cpu_gemv(const CBLAS_TRANSPOSE TransA, const int M, const int N, const Dtype alpha, const Dtype* A, const Dtype* x, const Dtype beta, Dtype* y); template <typename Dtype> void caffe_axpy(const int N, const Dtype alpha, const Dtype* X, Dtype* Y); template <typename Dtype> void caffe_cpu_axpby(const int N, const Dtype alpha, const Dtype* X, const Dtype beta, Dtype* Y); template <typename Dtype> void caffe_copy(const int N, const Dtype *X, Dtype *Y); template <typename Dtype> void caffe_set(const int N, const Dtype alpha, Dtype *X); inline void caffe_memset(const size_t N, const int alpha, void* X) { memset(X, alpha, N); // NOLINT(caffe/alt_fn) } template <typename Dtype> void caffe_add_scalar(const int N, const Dtype alpha, Dtype *X); template <typename Dtype> void caffe_scal(const int N, const Dtype alpha, Dtype *X); template <typename Dtype> void caffe_sqr(const int N, const Dtype* a, Dtype* y); template <typename Dtype> void caffe_add(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_sub(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_mul(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_div(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_powx(const int n, const Dtype* a, const Dtype b, Dtype* y); unsigned int caffe_rng_rand(); template <typename Dtype> Dtype caffe_nextafter(const Dtype b); template <typename Dtype> void caffe_rng_uniform(const int n, const Dtype a, const Dtype b, Dtype* r); template <typename Dtype> void caffe_rng_gaussian(const int n, const Dtype mu, const Dtype sigma, Dtype* r); template <typename Dtype> void caffe_rng_bernoulli(const int n, const Dtype p, int* r); template <typename Dtype> void caffe_rng_bernoulli(const int n, const Dtype p, unsigned int* r); template <typename Dtype> void caffe_exp(const int n, const Dtype* a, Dtype* y); template <typename Dtype> void caffe_log(const int n, const Dtype* a, Dtype* y); template <typename Dtype> void caffe_abs(const int n, const Dtype* a, Dtype* y); template <typename Dtype> Dtype caffe_cpu_dot(const int n, const Dtype* x, const Dtype* y); template <typename Dtype> Dtype caffe_cpu_strided_dot(const int n, const Dtype* x, const int incx, const Dtype* y, const int incy); // Returns the sum of the absolute values of the elements of vector x template <typename Dtype> Dtype caffe_cpu_asum(const int n, const Dtype* x); // the branchless, type-safe version from // http://stackoverflow.com/questions/1903954/is-there-a-standard-sign-function-signum-sgn-in-c-c template<typename Dtype> inline int8_t caffe_sign(Dtype val) { return (Dtype(0) < val) - (val < Dtype(0)); } // The following two macros are modifications of DEFINE_VSL_UNARY_FUNC // in include/caffe/util/mkl_alternate.hpp authored by @Rowland Depp. // Please refer to commit 7e8ef25c7 of the boost-eigen branch. // Git cherry picking that commit caused a conflict hard to resolve and // copying that file in convenient for code reviewing. // So they have to be pasted here temporarily. #define DEFINE_CAFFE_CPU_UNARY_FUNC(name, operation) \ template<typename Dtype> \ void caffe_cpu_##name(const int n, const Dtype* x, Dtype* y) { \ CHECK_GT(n, 0); CHECK(x); CHECK(y); \ for (int i = 0; i < n; ++i) { \ operation; \ } \ } // output is 1 for the positives, 0 for zero, and -1 for the negatives DEFINE_CAFFE_CPU_UNARY_FUNC(sign, y[i] = caffe_sign<Dtype>(x[i])); // This returns a nonzero value if the input has its sign bit set. // The name sngbit is meant to avoid conflicts with std::signbit in the macro. // The extra parens are needed because CUDA < 6.5 defines signbit as a macro, // and we don't want that to expand here when CUDA headers are also included. DEFINE_CAFFE_CPU_UNARY_FUNC(sgnbit, \ y[i] = static_cast<bool>((std::signbit)(x[i]))); DEFINE_CAFFE_CPU_UNARY_FUNC(fabs, y[i] = std::fabs(x[i])); template <typename Dtype> void caffe_cpu_scale(const int n, const Dtype alpha, const Dtype *x, Dtype* y); #ifndef CPU_ONLY // GPU // Decaf gpu gemm provides an interface that is almost the same as the cpu // gemm function - following the c convention and calling the fortran-order // gpu code under the hood. template <typename Dtype> void caffe_gpu_gemm(const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const Dtype alpha, const Dtype* A, const Dtype* B, const Dtype beta, Dtype* C); template <typename Dtype> void caffe_gpu_gemv(const CBLAS_TRANSPOSE TransA, const int M, const int N, const Dtype alpha, const Dtype* A, const Dtype* x, const Dtype beta, Dtype* y); template <typename Dtype> void caffe_gpu_axpy(const int N, const Dtype alpha, const Dtype* X, Dtype* Y); template <typename Dtype> void caffe_gpu_axpby(const int N, const Dtype alpha, const Dtype* X, const Dtype beta, Dtype* Y); void caffe_gpu_memcpy(const size_t N, const void *X, void *Y); template <typename Dtype> void caffe_gpu_set(const int N, const Dtype alpha, Dtype *X); inline void caffe_gpu_memset(const size_t N, const int alpha, void* X) { #ifndef CPU_ONLY CUDA_CHECK(cudaMemset(X, alpha, N)); // NOLINT(caffe/alt_fn) #else NO_GPU; #endif } template <typename Dtype> void caffe_gpu_add_scalar(const int N, const Dtype alpha, Dtype *X); template <typename Dtype> void caffe_gpu_scal(const int N, const Dtype alpha, Dtype *X); template <typename Dtype> void caffe_gpu_add(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_gpu_sub(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_gpu_mul(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_gpu_div(const int N, const Dtype* a, const Dtype* b, Dtype* y); template <typename Dtype> void caffe_gpu_abs(const int n, const Dtype* a, Dtype* y); template <typename Dtype> void caffe_gpu_exp(const int n, const Dtype* a, Dtype* y); template <typename Dtype> void caffe_gpu_log(const int n, const Dtype* a, Dtype* y); template <typename Dtype> void caffe_gpu_powx(const int n, const Dtype* a, const Dtype b, Dtype* y); // caffe_gpu_rng_uniform with two arguments generates integers in the range // [0, UINT_MAX]. void caffe_gpu_rng_uniform(const int n, unsigned int* r); // caffe_gpu_rng_uniform with four arguments generates floats in the range // (a, b] (strictly greater than a, less than or equal to b) due to the // specification of curandGenerateUniform. With a = 0, b = 1, just calls // curandGenerateUniform; with other limits will shift and scale the outputs // appropriately after calling curandGenerateUniform. template <typename Dtype> void caffe_gpu_rng_uniform(const int n, const Dtype a, const Dtype b, Dtype* r); template <typename Dtype> void caffe_gpu_rng_gaussian(const int n, const Dtype mu, const Dtype sigma, Dtype* r); template <typename Dtype> void caffe_gpu_rng_bernoulli(const int n, const Dtype p, int* r); template <typename Dtype> void caffe_gpu_dot(const int n, const Dtype* x, const Dtype* y, Dtype* out); template <typename Dtype> void caffe_gpu_asum(const int n, const Dtype* x, Dtype* y); template<typename Dtype> void caffe_gpu_sign(const int n, const Dtype* x, Dtype* y); template<typename Dtype> void caffe_gpu_sgnbit(const int n, const Dtype* x, Dtype* y); template <typename Dtype> void caffe_gpu_fabs(const int n, const Dtype* x, Dtype* y); template <typename Dtype> void caffe_gpu_scale(const int n, const Dtype alpha, const Dtype *x, Dtype* y); #define DEFINE_AND_INSTANTIATE_GPU_UNARY_FUNC(name, operation) \ template<typename Dtype> \ __global__ void name##_kernel(const int n, const Dtype* x, Dtype* y) { \ CUDA_KERNEL_LOOP(index, n) { \ operation; \ } \ } \ template <> \ void caffe_gpu_##name<float>(const int n, const float* x, float* y) { \ /* NOLINT_NEXT_LINE(whitespace/operators) */ \ name##_kernel<float><<<CAFFE_GET_BLOCKS(n), CAFFE_CUDA_NUM_THREADS>>>( \ n, x, y); \ } \ template <> \ void caffe_gpu_##name<double>(const int n, const double* x, double* y) { \ /* NOLINT_NEXT_LINE(whitespace/operators) */ \ name##_kernel<double><<<CAFFE_GET_BLOCKS(n), CAFFE_CUDA_NUM_THREADS>>>( \ n, x, y); \ } #endif // !CPU_ONLY } // namespace caffe #endif // CAFFE_UTIL_MATH_FUNCTIONS_H_
{ "pile_set_name": "Github" }
(**************************************************************************) (* *) (* OCaml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright 1996 Institut National de Recherche en Informatique et *) (* en Automatique. *) (* *) (* All rights reserved. This file is distributed under the terms of *) (* the GNU Lesser General Public License version 2.1, with the *) (* special exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) (* Predefined type constructors (with special typing rules in typecore) *) open Path open Types open Btype let builtin_idents = ref [] let wrap create s = let id = create s in builtin_idents := (s, id) :: !builtin_idents; id let ident_create = wrap Ident.create let ident_create_predef_exn = wrap Ident.create_predef_exn let ident_int = ident_create "int" and ident_char = ident_create "char" and ident_bytes = ident_create "bytes" and ident_float = ident_create "float" and ident_bool = ident_create "bool" and ident_unit = ident_create "unit" and ident_exn = ident_create "exn" and ident_array = ident_create "array" and ident_list = ident_create "list" and ident_option = ident_create "option" and ident_nativeint = ident_create "nativeint" and ident_int32 = ident_create "int32" and ident_int64 = ident_create "int64" and ident_lazy_t = ident_create "lazy_t" and ident_string = ident_create "string" and ident_extension_constructor = ident_create "extension_constructor" and ident_floatarray = ident_create "floatarray" let path_int = Pident ident_int and path_char = Pident ident_char and path_bytes = Pident ident_bytes and path_float = Pident ident_float and path_bool = Pident ident_bool and path_unit = Pident ident_unit and path_exn = Pident ident_exn and path_array = Pident ident_array and path_list = Pident ident_list and path_option = Pident ident_option and path_nativeint = Pident ident_nativeint and path_int32 = Pident ident_int32 and path_int64 = Pident ident_int64 and path_lazy_t = Pident ident_lazy_t and path_string = Pident ident_string and path_extension_constructor = Pident ident_extension_constructor and path_floatarray = Pident ident_floatarray let type_int = newgenty (Tconstr(path_int, [], ref Mnil)) and type_char = newgenty (Tconstr(path_char, [], ref Mnil)) and type_bytes = newgenty (Tconstr(path_bytes, [], ref Mnil)) and type_float = newgenty (Tconstr(path_float, [], ref Mnil)) and type_bool = newgenty (Tconstr(path_bool, [], ref Mnil)) and type_unit = newgenty (Tconstr(path_unit, [], ref Mnil)) and type_exn = newgenty (Tconstr(path_exn, [], ref Mnil)) and type_array t = newgenty (Tconstr(path_array, [t], ref Mnil)) and type_list t = newgenty (Tconstr(path_list, [t], ref Mnil)) and type_option t = newgenty (Tconstr(path_option, [t], ref Mnil)) and type_nativeint = newgenty (Tconstr(path_nativeint, [], ref Mnil)) and type_int32 = newgenty (Tconstr(path_int32, [], ref Mnil)) and type_int64 = newgenty (Tconstr(path_int64, [], ref Mnil)) and type_lazy_t t = newgenty (Tconstr(path_lazy_t, [t], ref Mnil)) and type_string = newgenty (Tconstr(path_string, [], ref Mnil)) and type_extension_constructor = newgenty (Tconstr(path_extension_constructor, [], ref Mnil)) and type_floatarray = newgenty (Tconstr(path_floatarray, [], ref Mnil)) let ident_match_failure = ident_create_predef_exn "Match_failure" and ident_out_of_memory = ident_create_predef_exn "Out_of_memory" and ident_invalid_argument = ident_create_predef_exn "Invalid_argument" and ident_failure = ident_create_predef_exn "Failure" and ident_not_found = ident_create_predef_exn "Not_found" and ident_sys_error = ident_create_predef_exn "Sys_error" and ident_end_of_file = ident_create_predef_exn "End_of_file" and ident_division_by_zero = ident_create_predef_exn "Division_by_zero" and ident_stack_overflow = ident_create_predef_exn "Stack_overflow" and ident_sys_blocked_io = ident_create_predef_exn "Sys_blocked_io" and ident_assert_failure = ident_create_predef_exn "Assert_failure" and ident_undefined_recursive_module = ident_create_predef_exn "Undefined_recursive_module" let all_predef_exns = [ ident_match_failure; ident_out_of_memory; ident_invalid_argument; ident_failure; ident_not_found; ident_sys_error; ident_end_of_file; ident_division_by_zero; ident_stack_overflow; ident_sys_blocked_io; ident_assert_failure; ident_undefined_recursive_module; ] let path_match_failure = Pident ident_match_failure and path_assert_failure = Pident ident_assert_failure and path_undefined_recursive_module = Pident ident_undefined_recursive_module let decl_abstr = {type_params = []; type_arity = 0; type_kind = Type_abstract; type_loc = Location.none; type_private = Asttypes.Public; type_manifest = None; type_variance = []; type_newtype_level = None; type_attributes = []; type_immediate = false; type_unboxed = unboxed_false_default_false; } let decl_abstr_imm = {decl_abstr with type_immediate = true} let cstr id args = { cd_id = id; cd_args = Cstr_tuple args; cd_res = None; cd_loc = Location.none; cd_attributes = []; } let ident_false = ident_create "false" and ident_true = ident_create "true" and ident_void = ident_create "()" and ident_nil = ident_create "[]" and ident_cons = ident_create "::" and ident_none = ident_create "None" and ident_some = ident_create "Some" let common_initial_env add_type add_extension empty_env = let decl_bool = {decl_abstr with type_kind = Type_variant([cstr ident_false []; cstr ident_true []]); type_immediate = true} and decl_unit = {decl_abstr with type_kind = Type_variant([cstr ident_void []]); type_immediate = true} and decl_exn = {decl_abstr with type_kind = Type_open} and decl_array = let tvar = newgenvar() in {decl_abstr with type_params = [tvar]; type_arity = 1; type_variance = [Variance.full]} and decl_list = let tvar = newgenvar() in {decl_abstr with type_params = [tvar]; type_arity = 1; type_kind = Type_variant([cstr ident_nil []; cstr ident_cons [tvar; type_list tvar]]); type_variance = [Variance.covariant]} and decl_option = let tvar = newgenvar() in {decl_abstr with type_params = [tvar]; type_arity = 1; type_kind = Type_variant([cstr ident_none []; cstr ident_some [tvar]]); type_variance = [Variance.covariant]} and decl_lazy_t = let tvar = newgenvar() in {decl_abstr with type_params = [tvar]; type_arity = 1; type_variance = [Variance.covariant]} in let add_extension id l = add_extension id { ext_type_path = path_exn; ext_type_params = []; ext_args = Cstr_tuple l; ext_ret_type = None; ext_private = Asttypes.Public; ext_loc = Location.none; ext_attributes = [{Asttypes.txt="ocaml.warn_on_literal_pattern"; loc=Location.none}, Parsetree.PStr[]] } in add_extension ident_match_failure [newgenty (Ttuple[type_string; type_int; type_int])] ( add_extension ident_out_of_memory [] ( add_extension ident_stack_overflow [] ( add_extension ident_invalid_argument [type_string] ( add_extension ident_failure [type_string] ( add_extension ident_not_found [] ( add_extension ident_sys_blocked_io [] ( add_extension ident_sys_error [type_string] ( add_extension ident_end_of_file [] ( add_extension ident_division_by_zero [] ( add_extension ident_assert_failure [newgenty (Ttuple[type_string; type_int; type_int])] ( add_extension ident_undefined_recursive_module [newgenty (Ttuple[type_string; type_int; type_int])] ( add_type ident_int64 decl_abstr ( add_type ident_int32 decl_abstr ( add_type ident_nativeint decl_abstr ( add_type ident_lazy_t decl_lazy_t ( add_type ident_option decl_option ( add_type ident_list decl_list ( add_type ident_array decl_array ( add_type ident_exn decl_exn ( add_type ident_unit decl_unit ( add_type ident_bool decl_bool ( add_type ident_float decl_abstr ( add_type ident_string decl_abstr ( add_type ident_char decl_abstr_imm ( add_type ident_int decl_abstr_imm ( add_type ident_extension_constructor decl_abstr ( add_type ident_floatarray decl_abstr ( empty_env)))))))))))))))))))))))))))) let build_initial_env add_type add_exception empty_env = let common = common_initial_env add_type add_exception empty_env in let safe_string = add_type ident_bytes decl_abstr common in let decl_bytes_unsafe = {decl_abstr with type_manifest = Some type_string} in let unsafe_string = add_type ident_bytes decl_bytes_unsafe common in (safe_string, unsafe_string) let builtin_values = List.map (fun id -> (Ident.name id, id)) all_predef_exns (* Start non-predef identifiers at 1000. This way, more predefs can be defined in this file (above!) without breaking .cmi compatibility. *) let _ = Ident.set_current_time 999 let builtin_idents = List.rev !builtin_idents
{ "pile_set_name": "Github" }
package billing_test import ( "context" "testing" "time" "github.com/getfider/fider/app" "github.com/getfider/fider/app/pkg/bus" "github.com/getfider/fider/app/pkg/env" "github.com/getfider/fider/app/models" "github.com/getfider/fider/app/models/cmd" "github.com/getfider/fider/app/models/dto" "github.com/getfider/fider/app/models/query" . "github.com/getfider/fider/app/pkg/assert" "github.com/getfider/fider/app/services/billing" ) func TestCreateCustomer_WithSubscription(t *testing.T) { RegisterT(t) if !env.IsBillingEnabled() { return } bus.Init(billing.Service{}) tenant := &models.Tenant{ ID: 2, Name: "Game Inc.", Subdomain: "gameinc", Billing: &models.TenantBilling{}, } ctx := context.WithValue(context.Background(), app.TenantCtxKey, tenant) err := bus.Dispatch(ctx, &cmd.CreateBillingCustomer{}) Expect(err).IsNil() Expect(tenant.Billing.StripeCustomerID).IsNotEmpty() err = bus.Dispatch(ctx, &cmd.UpdatePaymentInfo{ Input: &dto.CreateEditBillingPaymentInfo{ Email: "[email protected]", Card: &dto.CreateEditBillingPaymentInfoCard{ Token: "tok_visa", }, }, }) Expect(err).IsNil() createSubscription := &cmd.CreateBillingSubscription{PlanID: "plan_EKTT1YWe1Zmrtp"} err = bus.Dispatch(ctx, createSubscription) Expect(err).IsNil() Expect(tenant.Billing.StripeSubscriptionID).IsNotEmpty() Expect(tenant.Billing.StripePlanID).Equals("plan_EKTT1YWe1Zmrtp") invoiceQuery := &query.GetUpcomingInvoice{} err = bus.Dispatch(ctx, invoiceQuery) Expect(err).IsNil() Expect(int(invoiceQuery.Result.AmountDue)).Equals(900) Expect(invoiceQuery.Result.Currency).Equals("USD") err = bus.Dispatch(ctx, &cmd.CancelBillingSubscription{}) Expect(err).IsNil() Expect(tenant.Billing.SubscriptionEndsAt).IsNotNil() err = bus.Dispatch(ctx, &cmd.DeleteBillingCustomer{}) Expect(err).IsNil() } var forUnitTestingTenant = &models.Tenant{ ID: 5, Name: "For Unit Testing (DO NOT DELETE)", Subdomain: "unittesting", Billing: &models.TenantBilling{ StripeCustomerID: "cus_EICBuXBIkhI2EV", }, } func TestUpdatePaymentInfo(t *testing.T) { RegisterT(t) if !env.IsBillingEnabled() { return } bus.Init(billing.Service{}) var firstCardID string ctx := context.WithValue(context.Background(), app.TenantCtxKey, forUnitTestingTenant) err := bus.Dispatch(ctx, &cmd.ClearPaymentInfo{}) Expect(err).IsNil() //Creating a new card err = bus.Dispatch(ctx, &cmd.UpdatePaymentInfo{ Input: &dto.CreateEditBillingPaymentInfo{ Email: "[email protected]", VATNumber: "IE1234", Card: &dto.CreateEditBillingPaymentInfoCard{ Token: "tok_visa", }, AddressCountry: "IE", }, }) Expect(err).IsNil() paymentInfoQuery := &query.GetPaymentInfo{} err = bus.Dispatch(ctx, paymentInfoQuery) Expect(err).IsNil() info := paymentInfoQuery.Result firstCardID = info.StripeCardID Expect(info.StripeCardID).IsNotEmpty() Expect(info.Email).Equals("[email protected]") Expect(info.VATNumber).Equals("IE1234") Expect(info.CardBrand).Equals("Visa") Expect(info.CardCountry).Equals("US") Expect(info.CardLast4).Equals("4242") Expect(int(info.CardExpMonth)).Equals(int(time.Now().Month())) Expect(int(info.CardExpYear)).Equals(time.Now().Year() + 1) Expect(info.Name).Equals("") Expect(info.AddressLine1).Equals("") Expect(info.AddressLine2).Equals("") Expect(info.AddressCity).Equals("") Expect(info.AddressState).Equals("") Expect(info.AddressPostalCode).Equals("") Expect(info.AddressCountry).Equals("") //Update existing card err = bus.Dispatch(ctx, &cmd.UpdatePaymentInfo{ Input: &dto.CreateEditBillingPaymentInfo{ Email: "[email protected]", Name: "Jon Snow", AddressLine1: "Street 1", AddressLine2: "Av. ABC", AddressCity: "New York", AddressState: "NYC", AddressPostalCode: "12098", AddressCountry: "US", }, }) Expect(err).IsNil() paymentInfoQuery = &query.GetPaymentInfo{} err = bus.Dispatch(ctx, paymentInfoQuery) Expect(err).IsNil() info = paymentInfoQuery.Result Expect(info.Name).Equals("Jon Snow") Expect(info.VATNumber).Equals("") Expect(info.CardLast4).Equals("4242") Expect(info.AddressLine1).Equals("Street 1") Expect(info.AddressLine2).Equals("Av. ABC") Expect(info.AddressCity).Equals("New York") Expect(info.AddressState).Equals("NYC") Expect(info.AddressPostalCode).Equals("12098") Expect(info.AddressCountry).Equals("US") //Replace card err = bus.Dispatch(ctx, &cmd.UpdatePaymentInfo{ Input: &dto.CreateEditBillingPaymentInfo{ Email: "[email protected]", Card: &dto.CreateEditBillingPaymentInfoCard{ Token: "tok_br", }, }, }) Expect(err).IsNil() paymentInfoQuery = &query.GetPaymentInfo{} err = bus.Dispatch(ctx, paymentInfoQuery) Expect(err).IsNil() info = paymentInfoQuery.Result Expect(info.StripeCardID).IsNotEmpty() Expect(info.StripeCardID).NotEquals(firstCardID) Expect(info.Email).Equals("[email protected]") Expect(info.VATNumber).Equals("") Expect(info.CardBrand).Equals("Visa") Expect(info.CardCountry).Equals("BR") Expect(info.CardLast4).Equals("0002") Expect(int(info.CardExpMonth)).Equals(int(time.Now().Month())) Expect(int(info.CardExpYear)).Equals(time.Now().Year() + 1) Expect(info.Name).Equals("") Expect(info.AddressLine1).Equals("") Expect(info.AddressLine2).Equals("") Expect(info.AddressCity).Equals("") Expect(info.AddressState).Equals("") Expect(info.AddressPostalCode).Equals("") Expect(info.AddressCountry).Equals("") } func TestListPlans(t *testing.T) { RegisterT(t) if !env.IsBillingEnabled() { return } bus.Init(billing.Service{}) ctx := context.Background() q := &query.ListBillingPlans{CountryCode: "US"} err := bus.Dispatch(ctx, q) Expect(err).IsNil() Expect(q.Result).HasLen(3) Expect(q.Result[0].ID).Equals("plan_EKTT1YWe1Zmrtp") Expect(q.Result[0].Name).Equals("Starter") Expect(q.Result[0].Currency).Equals("USD") Expect(q.Result[0].MaxUsers).Equals(200) Expect(q.Result[1].ID).Equals("plan_DoK187GZcnFpKY") Expect(q.Result[1].Name).Equals("Business (monthly)") Expect(q.Result[1].Currency).Equals("USD") Expect(q.Result[1].MaxUsers).Equals(0) Expect(q.Result[2].ID).Equals("plan_DpN9SkJMjNTvLd") Expect(q.Result[2].Name).Equals("Business (yearly)") Expect(q.Result[2].Currency).Equals("USD") Expect(q.Result[2].MaxUsers).Equals(0) q = &query.ListBillingPlans{CountryCode: "DE"} err = bus.Dispatch(ctx, q) Expect(err).IsNil() Expect(q.Result).HasLen(3) Expect(q.Result[0].ID).Equals("plan_EKTSnrGmj5BuKI") Expect(q.Result[0].Name).Equals("Starter") Expect(q.Result[0].Currency).Equals("EUR") Expect(q.Result[0].MaxUsers).Equals(200) Expect(q.Result[1].ID).Equals("plan_EKPnahGhiTEnCc") Expect(q.Result[1].Name).Equals("Business (monthly)") Expect(q.Result[1].Currency).Equals("EUR") Expect(q.Result[1].MaxUsers).Equals(0) Expect(q.Result[2].ID).Equals("plan_EKTU4xD7LNI9dO") Expect(q.Result[2].Name).Equals("Business (yearly)") Expect(q.Result[2].Currency).Equals("EUR") Expect(q.Result[2].MaxUsers).Equals(0) }
{ "pile_set_name": "Github" }
@import "~antd/lib/style/themes/default.less"; .exception { display: flex; align-items: center; padding-top: 180px; height: 100%; .imgBlock { flex: 0 0 55.5%; width: 55.5%; padding-right: 152px; zoom: 1; &:before, &:after { content: " "; display: table; } &:after { clear: both; visibility: hidden; font-size: 0; height: 0; } } .imgEle { height: 360px; width: 100%; max-width: 430px; float: right; background-repeat: no-repeat; background-position: 50% 50%; background-size: 100% 100%; } .content { flex: auto; h1 { color: #434e59; font-size: 72px; font-weight: 600; line-height: 72px; margin-bottom: 24px; } .desc { color: @text-color-secondary; font-size: 20px; line-height: 28px; margin-bottom: 16px; } .actions { button:not(:last-child) { margin-right: 8px; } } } } @media screen and (max-width: @screen-xl) { .exception { .imgBlock { padding-right: 88px; } } } @media screen and (max-width: @screen-sm) { .exception { display: block; text-align: center; .imgBlock { padding-right: 0; margin: 0 auto 24px; } } } @media screen and (max-width: @screen-xs) { .exception { .imgBlock { margin-bottom: -24px; overflow: hidden; } } }
{ "pile_set_name": "Github" }
<Type Name="ResponseMessageTypesAttribute" FullName="Beagrep.ResponseMessageTypesAttribute"> <TypeSignature Language="C#" Value="public class ResponseMessageTypesAttribute : Beagrep.Util.TypeCacheAttribute" /> <AssemblyInfo> <AssemblyName>Beagrep</AssemblyName> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>Beagrep.Util.TypeCacheAttribute</BaseTypeName> </Base> <Interfaces /> <Attributes> <Attribute> <AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly)</AttributeName> </Attribute> </Attributes> <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public ResponseMessageTypesAttribute (Type[] message_types);" /> <MemberType>Constructor</MemberType> <Parameters> <Parameter Name="message_types" Type="System.Type[]"> <Attributes> <Attribute> <AttributeName>System.ParamArray</AttributeName> </Attribute> </Attributes> </Parameter> </Parameters> <Docs> <param name="message_types">To be added.</param> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Member> </Members> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> </Type>
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0 /* * USB Serial Converter Bus specific functions * * Copyright (C) 2002 Greg Kroah-Hartman ([email protected]) */ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/tty.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> #include <linux/usb/serial.h> static int usb_serial_device_match(struct device *dev, struct device_driver *drv) { struct usb_serial_driver *driver; const struct usb_serial_port *port; /* * drivers are already assigned to ports in serial_probe so it's * a simple check here. */ port = to_usb_serial_port(dev); if (!port) return 0; driver = to_usb_serial_driver(drv); if (driver == port->serial->type) return 1; return 0; } static int usb_serial_device_probe(struct device *dev) { struct usb_serial_driver *driver; struct usb_serial_port *port; struct device *tty_dev; int retval = 0; int minor; port = to_usb_serial_port(dev); if (!port) return -ENODEV; /* make sure suspend/resume doesn't race against port_probe */ retval = usb_autopm_get_interface(port->serial->interface); if (retval) return retval; driver = port->serial->type; if (driver->port_probe) { retval = driver->port_probe(port); if (retval) goto err_autopm_put; } minor = port->minor; tty_dev = tty_port_register_device(&port->port, usb_serial_tty_driver, minor, dev); if (IS_ERR(tty_dev)) { retval = PTR_ERR(tty_dev); goto err_port_remove; } usb_autopm_put_interface(port->serial->interface); dev_info(&port->serial->dev->dev, "%s converter now attached to ttyUSB%d\n", driver->description, minor); return 0; err_port_remove: if (driver->port_remove) driver->port_remove(port); err_autopm_put: usb_autopm_put_interface(port->serial->interface); return retval; } static int usb_serial_device_remove(struct device *dev) { struct usb_serial_driver *driver; struct usb_serial_port *port; int retval = 0; int minor; int autopm_err; port = to_usb_serial_port(dev); if (!port) return -ENODEV; /* * Make sure suspend/resume doesn't race against port_remove. * * Note that no further runtime PM callbacks will be made if * autopm_get fails. */ autopm_err = usb_autopm_get_interface(port->serial->interface); minor = port->minor; tty_unregister_device(usb_serial_tty_driver, minor); driver = port->serial->type; if (driver->port_remove) retval = driver->port_remove(port); dev_info(dev, "%s converter now disconnected from ttyUSB%d\n", driver->description, minor); if (!autopm_err) usb_autopm_put_interface(port->serial->interface); return retval; } static ssize_t new_id_store(struct device_driver *driver, const char *buf, size_t count) { struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); ssize_t retval = usb_store_new_id(&usb_drv->dynids, usb_drv->id_table, driver, buf, count); if (retval >= 0 && usb_drv->usb_driver != NULL) retval = usb_store_new_id(&usb_drv->usb_driver->dynids, usb_drv->usb_driver->id_table, &usb_drv->usb_driver->drvwrap.driver, buf, count); return retval; } static ssize_t new_id_show(struct device_driver *driver, char *buf) { struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); return usb_show_dynids(&usb_drv->dynids, buf); } static DRIVER_ATTR_RW(new_id); static struct attribute *usb_serial_drv_attrs[] = { &driver_attr_new_id.attr, NULL, }; ATTRIBUTE_GROUPS(usb_serial_drv); static void free_dynids(struct usb_serial_driver *drv) { struct usb_dynid *dynid, *n; spin_lock(&drv->dynids.lock); list_for_each_entry_safe(dynid, n, &drv->dynids.list, node) { list_del(&dynid->node); kfree(dynid); } spin_unlock(&drv->dynids.lock); } struct bus_type usb_serial_bus_type = { .name = "usb-serial", .match = usb_serial_device_match, .probe = usb_serial_device_probe, .remove = usb_serial_device_remove, .drv_groups = usb_serial_drv_groups, }; int usb_serial_bus_register(struct usb_serial_driver *driver) { int retval; driver->driver.bus = &usb_serial_bus_type; spin_lock_init(&driver->dynids.lock); INIT_LIST_HEAD(&driver->dynids.list); retval = driver_register(&driver->driver); return retval; } void usb_serial_bus_deregister(struct usb_serial_driver *driver) { free_dynids(driver); driver_unregister(&driver->driver); }
{ "pile_set_name": "Github" }
--- author: kapnobatai136 type: normal category: how to links: - '[Imported Spreadsheet](https://docs.google.com/spreadsheets/d/1l8zWrzpvPwYNtqvYUxWO2y3KJtFmKVidrAFmpPmaPyo/edit?usp=sharing){website}' --- # Import Options --- ## Content After your file has been uploaded a new pop-up window will appear asking you to select several **"import options"**. ![importing-options](https://img.enkipro.com/f284439a2d4cd2537cc6362382b838b0.png) At the very top, you have your file name. The first option to choose from is the **import location**. We chose `Replace spreadsheet` because the one we are working in is empty. Depending on your use case, you might choose different options like creating a new sheet or spreadsheet entirely. The next option is the `Separator type`. Your best bet is going with the `Detect automatically` option. > 💡 If you have a custom `.txt` file, then choose the `Custom` option and input the character that is used for value delimitation. The last option is used to tell spreadsheets to convert text from the updated file into numbers, dates, and formulas. > 💡 When importing an Excel file type, the only available option is **import location**. Lastly, click `Import data` and you're done 🎉! > 💡 Check the *Learn more* section if you want to see how the imported spreadsheet looks like. --- ## Practice Which of the following isn't an option when importing a file in Google Sheets? ??? - Convert file - Separator type - Import location --- ## Revision Which of the following isn't an option when importing a file in Google Sheets? ??? - Convert file - Separator type - Import location
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using NBitcoin; using Nethereum.RLP; using Stratis.SmartContracts.Core.Hashing; namespace Stratis.SmartContracts.Core.Receipts { /// <summary> /// Holds information about the result of smart contract transaction executions. /// </summary> public class Receipt { #region Consensus Properties /// <summary> /// State root after smart contract execution. Note that if contract failed this will be the same as previous state. /// </summary> public uint256 PostState { get; } /// <summary> /// The gas price used for this transaction. /// </summary> public ulong GasPrice { get; } /// <summary> /// Gas consumed in this smart contract execution. /// </summary> public ulong GasUsed { get; } /// <summary> /// The amount sent with this transaction. /// </summary> public ulong Amount { get; } /// <summary> /// Bloom data representing all of the indexed logs contained inside this receipt. /// </summary> public Bloom Bloom { get; } /// <summary> /// Logs created during contract execution. /// </summary> public Log[] Logs { get; } #endregion #region Storage Properties /// <summary> /// Hash of the transaction. /// </summary> public uint256 TransactionHash { get; } /// <summary> /// Block hash of the block this transaction was contained in. /// Needs public set as hash can only be stored after transaction is stored in block. /// </summary> public uint256 BlockHash { get; set; } /// <summary> /// The height of the block. Nullable for backwards-compatibility with receipt data saved before this field was introduced. /// </summary> public ulong? BlockNumber { get; } /// <summary> /// Address of the sender of the transaction. /// </summary> public uint160 From { get; } /// <summary> /// Contract address sent to in the CALL. Null if CREATE. /// </summary> public uint160 To { get; } /// <summary> /// Method name sent in the CALL. Null if CREATE. /// </summary> public string MethodName { get; } /// <summary> /// Contract address created in this CREATE. Null if CALL. /// </summary> public uint160 NewContractAddress { get; } /// <summary> /// Whether execution completed successfully. /// </summary> public bool Success { get; } /// <summary> /// The result of the execution, serialized as a string. /// </summary> public string Result { get; } /// <summary> /// If execution didn't complete successfully, the error will be stored here. /// Could be an exception that occurred inside a contract or a message (e.g. method not found.) /// </summary> public string ErrorMessage { get; } #endregion /// <summary> /// Creates receipt with both consensus and storage fields and generates bloom. /// </summary> public Receipt(uint256 postState, ulong gasUsed, Log[] logs, uint256 transactionHash, uint160 from, uint160 to, uint160 newContractAddress, bool success, string result, string errorMessage, ulong gasPrice, ulong amount, string methodName = null, ulong? blockNumber = null) : this(postState, gasUsed, logs, BuildBloom(logs), transactionHash, null, @from, to, newContractAddress, success, result, errorMessage, gasPrice, amount, methodName, blockNumber) { } /// <summary> /// Creates receipt with consensus fields and generates bloom. /// </summary> public Receipt(uint256 postState, ulong gasUsed, Log[] logs) : this(postState, gasUsed, logs, BuildBloom(logs), null, null, null, null, null, false, null, null, 0, 0, null, null) { } /// <summary> /// Used for serialization. /// </summary> private Receipt( uint256 postState, ulong gasUsed, Log[] logs, Bloom bloom) : this(postState, gasUsed, logs, bloom, null, null, null, null, null, false, null, null, 0, 0, null, null) { } private Receipt(uint256 postState, ulong gasUsed, Log[] logs, Bloom bloom, uint256 transactionHash, uint256 blockHash, uint160 @from, uint160 to, uint160 newContractAddress, bool success, string result, string errorMessage, ulong gasPrice, ulong amount, string methodName, ulong? blockNumber) { this.PostState = postState; this.GasPrice = gasPrice; this.GasUsed = gasUsed; this.Logs = logs; this.Bloom = bloom; this.TransactionHash = transactionHash; this.BlockHash = blockHash; this.From = from; this.To = to; this.NewContractAddress = newContractAddress; this.Success = success; this.Result = result; this.ErrorMessage = errorMessage; this.Amount = amount; this.MethodName = methodName; this.BlockNumber = blockNumber; } /// <summary> /// Get the bits for all of the logs in this receipt. /// </summary> private static Bloom BuildBloom(Log[] logs) { var bloom = new Bloom(); foreach(Log log in logs) { bloom.Or(log.GetBloom()); } return bloom; } #region Consensus Serialization /// <summary> /// Parse a receipt into the consensus data. /// </summary> public byte[] ToConsensusBytesRlp() { IList<byte[]> encodedLogs = this.Logs.Select(x => RLP.EncodeElement(x.ToBytesRlp())).ToList(); return RLP.EncodeList( RLP.EncodeElement(this.PostState.ToBytes()), RLP.EncodeElement(BitConverter.GetBytes(this.GasUsed)), RLP.EncodeElement(this.Bloom.ToBytes()), RLP.EncodeElement(RLP.EncodeList(encodedLogs.ToArray())) ); } /// <summary> /// Parse a Receipt from the stored consensus data. /// </summary> public static Receipt FromConsensusBytesRlp(byte[] bytes) { RLPCollection list = RLP.Decode(bytes); RLPCollection innerList = (RLPCollection) list[0]; RLPCollection logList = RLP.Decode(innerList[3].RLPData); RLPCollection innerLogList = (RLPCollection)logList[0]; Log[] logs = innerLogList.Select(x => Log.FromBytesRlp(x.RLPData)).ToArray(); return new Receipt( new uint256(innerList[0].RLPData), BitConverter.ToUInt64(innerList[1].RLPData), logs, new Bloom(innerList[2].RLPData) ); } /// <summary> /// Get a hash of the consensus receipt. /// </summary> public uint256 GetHash() { return new uint256(HashHelper.Keccak256(this.ToConsensusBytesRlp())); } #endregion #region Storage Serialization /// <summary> /// Parse a whole receipt from stored bytes. /// </summary> public static Receipt FromStorageBytesRlp(byte[] bytes) { RLPCollection list = RLP.Decode(bytes); RLPCollection innerList = (RLPCollection)list[0]; RLPCollection logList = RLP.Decode(innerList[3].RLPData); RLPCollection innerLogList = (RLPCollection)logList[0]; Log[] logs = innerLogList.Select(x => Log.FromBytesRlp(x.RLPData)).ToArray(); // Method name is the 15th item to be added. Existing receipts without this data will throw exceptions without this check. var hasMethodName = innerList.Count > 14; // Block number is the 16th item to be added. var hasBlockNumber = innerList.Count > 15; var receipt = new Receipt( new uint256(innerList[0].RLPData), BitConverter.ToUInt64(innerList[1].RLPData), logs, new Bloom(innerList[2].RLPData), new uint256(innerList[4].RLPData), new uint256(innerList[5].RLPData), new uint160(innerList[6].RLPData), innerList[7].RLPData != null ? new uint160(innerList[7].RLPData) : null, innerList[8].RLPData != null ? new uint160(innerList[8].RLPData) : null, BitConverter.ToBoolean(innerList[9].RLPData), innerList[10].RLPData != null ? Encoding.UTF8.GetString(innerList[10].RLPData) : null, innerList[11].RLPData != null ? Encoding.UTF8.GetString(innerList[11].RLPData) : null, BitConverter.ToUInt64(innerList[12].RLPData), BitConverter.ToUInt64(innerList[13].RLPData), hasMethodName && innerList[14].RLPData != null ? Encoding.UTF8.GetString(innerList[14].RLPData) : null, hasBlockNumber && innerList[15].RLPData != null ? BitConverter.ToUInt64(innerList[15].RLPData) : (ulong?) null); return receipt; } /// <summary> /// Serialize a receipt into bytes to be stored. /// </summary> public byte[] ToStorageBytesRlp() { IList<byte[]> encodedLogs = this.Logs.Select(x => RLP.EncodeElement(x.ToBytesRlp())).ToList(); return RLP.EncodeList( RLP.EncodeElement(this.PostState.ToBytes()), RLP.EncodeElement(BitConverter.GetBytes(this.GasUsed)), RLP.EncodeElement(this.Bloom.ToBytes()), RLP.EncodeElement(RLP.EncodeList(encodedLogs.ToArray())), RLP.EncodeElement(this.TransactionHash.ToBytes()), RLP.EncodeElement(this.BlockHash.ToBytes()), RLP.EncodeElement(this.From.ToBytes()), RLP.EncodeElement(this.To?.ToBytes()), RLP.EncodeElement(this.NewContractAddress?.ToBytes()), RLP.EncodeElement(BitConverter.GetBytes(this.Success)), RLP.EncodeElement(Encoding.UTF8.GetBytes(this.Result ?? "")), RLP.EncodeElement(Encoding.UTF8.GetBytes(this.ErrorMessage ?? "")), RLP.EncodeElement(BitConverter.GetBytes(this.GasPrice)), RLP.EncodeElement(BitConverter.GetBytes(this.Amount)), RLP.EncodeElement(Encoding.UTF8.GetBytes(this.MethodName ?? "")), RLP.EncodeElement(this.BlockNumber.HasValue ? BitConverter.GetBytes(this.BlockNumber.Value) : null) ); } #endregion } }
{ "pile_set_name": "Github" }
// go run mksyscall.go -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) { r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fchmodat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlJoin(cmd int, arg2 string) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg2) if err != nil { return } r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg3) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(arg4) if err != nil { return } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) { var _p0 unsafe.Pointer if len(payload) > 0 { _p0 = unsafe.Pointer(&payload[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(arg) if err != nil { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(source) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(target) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 unsafe.Pointer if len(payload) > 0 { _p2 = unsafe.Pointer(&payload[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtimex(buf *Timex) (state int, err error) { r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) state = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGetres(clockid int32, res *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) { _, _, e1 := Syscall6(SYS_CLOCK_NANOSLEEP, uintptr(clockid), uintptr(flags), uintptr(unsafe.Pointer(request)), uintptr(unsafe.Pointer(remain)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func DeleteModule(name string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(oldfd int, newfd int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate1(flag int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FinitModule(fd int, params string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(params) if err != nil { return } _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flistxattr(fd int, dest []byte) (sz int, err error) { var _p0 unsafe.Pointer if len(dest) > 0 { _p0 = unsafe.Pointer(&dest[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fremovexattr(fd int, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrandom(buf []byte, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0) tid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InitModule(moduleImage []byte, params string) (err error) { var _p0 unsafe.Pointer if len(moduleImage) > 0 { _p0 = unsafe.Pointer(&moduleImage[0]) } else { _p0 = unsafe.Pointer(&_zero) } var _p1 *byte _p1, err = BytePtrFromString(params) if err != nil { return } _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Llistxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lremovexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MemfdCreate(name string, flags int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PivotRoot(newroot string, putold string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(newroot) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(putold) if err != nil { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { _, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(callback) if err != nil { return } r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setns(fd int, nstype int) (err error) { _, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Signalfd(fd int, mask *Sigset_t, flags int) { SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { SyscallNoError(SYS_SYNC, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Syncfs(fd int) (err error) { _, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (err error) { _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unshare(flags int) (err error) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func exitThread(code int) (err error) { _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func faccessat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } _, _, e1 := Syscall6(SYS_NAME_TO_HANDLE_AT, uintptr(dirFD), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(fh)), uintptr(unsafe.Pointer(mountID)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_OPEN_BY_HANDLE_AT, uintptr(mountFD), uintptr(unsafe.Pointer(fh)), uintptr(flags)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsgid(gid int) (err error) { _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsuid(uid int) (err error) { _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return }
{ "pile_set_name": "Github" }
import {ClientType} from "./clientType"; import {Constants} from "./constants"; import {UrlUtils} from "./urlUtils"; import {ClipperState} from "./clipperUI/clipperState"; export module ClipperUrls { export function generateFeedbackUrl(clipperState: ClipperState, usid: string, logCategory: string): string { let generatedFeedbackUrl = UrlUtils.addUrlQueryValue(Constants.Urls.clipperFeedbackUrl, "LogCategory", logCategory); generatedFeedbackUrl = UrlUtils.addUrlQueryValue(generatedFeedbackUrl, "originalUrl", clipperState.pageInfo.rawUrl); generatedFeedbackUrl = UrlUtils.addUrlQueryValue(generatedFeedbackUrl, "clipperId", clipperState.clientInfo.clipperId); generatedFeedbackUrl = UrlUtils.addUrlQueryValue(generatedFeedbackUrl, "usid", usid); generatedFeedbackUrl = UrlUtils.addUrlQueryValue(generatedFeedbackUrl, "type", ClientType[clipperState.clientInfo.clipperType]); generatedFeedbackUrl = UrlUtils.addUrlQueryValue(generatedFeedbackUrl, "version", clipperState.clientInfo.clipperVersion); return generatedFeedbackUrl; } export function generateSignInUrl(clipperId: string, sessionId: string, authType: string): string { return addAuthenticationQueryValues(Constants.Urls.Authentication.signInUrl, clipperId, sessionId, authType); } export function generateSignOutUrl(clipperId: string, sessionId: string, authType: string): string { return addAuthenticationQueryValues(Constants.Urls.Authentication.signOutUrl, clipperId, sessionId, authType); } function addAuthenticationQueryValues(originalUrl: string, clipperId: string, sessionId: string, authType: string): string { let authenticationUrl = UrlUtils.addUrlQueryValue(originalUrl, Constants.Urls.QueryParams.authType, authType); authenticationUrl = UrlUtils.addUrlQueryValue(authenticationUrl, Constants.Urls.QueryParams.clipperId, clipperId); authenticationUrl = UrlUtils.addUrlQueryValue(authenticationUrl, Constants.Urls.QueryParams.userSessionId, sessionId); return authenticationUrl; } }
{ "pile_set_name": "Github" }
/* ------------------------------------------------------------------ * Copyright (C) 1998-2009 PacketVideo * * 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. * ------------------------------------------------------------------- */ /**************************************************************************************** Portions of this file are derived from the following 3GPP standard: 3GPP TS 26.073 ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec Available from http://www.3gpp.org (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) Permission to distribute, modify and use this file under the standard license terms listed above has been obtained from the copyright holder. ****************************************************************************************/ /* ------------------------------------------------------------------------------ Filename: inter_36_tab.cpp ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: None Local Stores/Buffers/Pointers Needed: None Global Stores/Buffers/Pointers Needed: None Outputs: None Pointers and Buffers Modified: None Local Stores Modified: None Global Stores Modified: None ------------------------------------------------------------------------------ FUNCTION DESCRIPTION File : inter_36.tab Purpose : Tables for interpolating the normalized correlation with 1/3 or 1/6 resolution. ------------------------------------------------------------------------------ REQUIREMENTS None ------------------------------------------------------------------------------ REFERENCES None ------------------------------------------------------------------------------ PSEUDO-CODE ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "inter_36_tab.h" /*--------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; DEFINES ; Include all pre-processor statements here. Include conditional ; compile variables also. ----------------------------------------------------------------------------*/ #define UP_SAMP_MAX 6 #define FIR_SIZE (UP_SAMP_MAX*L_INTER_SRCH+1) /*---------------------------------------------------------------------------- ; LOCAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; LOCAL STORE/BUFFER/POINTER DEFINITIONS ; Variable declaration - defined here and used outside this module ----------------------------------------------------------------------------*/ /* 1/6 resolution interpolation filter (-3 dB at 3600 Hz) */ /* Note: The IS641 (7.4) 1/3 resolution filter is simply a subsampled version of the 1/6 resolution filter, i.e. it uses every second coefficient: inter_3[k] = inter_6[2*k], 0 <= k <= 3*L_INTER_SRCH */ const Word16 inter_6[FIR_SIZE] = { 29519, 28316, 24906, 19838, 13896, 7945, 2755, -1127, -3459, -4304, -3969, -2899, -1561, -336, 534, 970, 1023, 823, 516, 220, 0, -131, -194, -215, 0 }; /*---------------------------------------------------------------------------- ; EXTERNAL FUNCTION REFERENCES ; Declare functions defined elsewhere and referenced in this module ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES ; Declare variables used in this module but defined elsewhere ----------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif /*---------------------------------------------------------------------------- ; FUNCTION CODE ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; Define all local variables ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; Function body here ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; Return nothing or data or data pointer ----------------------------------------------------------------------------*/
{ "pile_set_name": "Github" }
{ "gender": "male", "species": "lion", "birthday": "7-29", "games": { "nl": { "personality": "smug", "clothes": "military-uniform", "song": "K.K. Moody", "phrase": "precisely", "skill": "Drawing circles", "goal": "Professor", "fear": "Monster Mask", "quote": "Love is blind.", "siblings": "Eldest of 10 kids", "favoriteStyle": "Historical", "dislikedStyle": "Flashy", "favoriteColor": "gray", "coffee": { "beans": "Mocha", "milk": "Lots of milk", "sugar": "Three spoonfuls of sugar" } }, "nh": { "personality": "smug", "phrase": "precisely", "song": "K.K. Moody" } }, "name": "Lionel", "id": "lionel" }
{ "pile_set_name": "Github" }
# frozen_string_literal: true require_relative "../setting" module Byebug # # Setting to customize the number of byebug commands to be saved in history. # class HistsizeSetting < Setting DEFAULT = 256 def banner "Maximum number of commands that can be stored in byebug history" end def to_s "Maximum size of byebug's command history is #{value}" end end end
{ "pile_set_name": "Github" }
FROM {{ namespace }}/{{ infra_image_prefix }}base:{{ tag }} {% block labels %} LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" {% endblock %} {% block storm %}{% endblock %} {% import "macros.j2" as macros with context %} {{ macros.configure_user(name='storm', homedir='/opt/storm') }} {% if base_package_type == 'rpm' %} {% set storm_packages = [ 'java-1.8.0-openjdk-headless', ] %} {% elif base_package_type == 'deb' %} {% if base_distro == 'debian' %} {% set java_version = '11' %} {% elif base_distro == 'ubuntu' %} {% set java_version = '8' %} {% endif %} {% set storm_packages = [ 'openjdk-' + java_version + '-jre-headless', ] %} {% endif %} {{ macros.install_packages(storm_packages | customizable("packages")) }} {% block storm_version %} ENV storm_version=1.2.2 ENV storm_url=https://archive.apache.org/dist/storm/apache-storm-${storm_version}/apache-storm-${storm_version}.tar.gz ENV storm_pkg_sha512sum=0a1120b8df7b22edc75f0a412d625841f72f3fb8e9ff5d413d510908d68ea1f0c17d68c1a7f1eda427b40902452e9efcae902c36499b558592e41cc1079de2e0 {% endblock %} {% block storm_install %} RUN curl -sSL -o /tmp/storm.tgz ${storm_url} \ && echo "${storm_pkg_sha512sum} /tmp/storm.tgz" | sha512sum -c \ && tar --strip 1 -xvf /tmp/storm.tgz -C /opt/storm \ && rm -f /tmp/storm.tgz {% endblock %} {% block storm_python_version %} # NOTE(dszumski): Storm needs to be told where the Py3 interpreter lives {% if distro_python_version.startswith('3') %} ENV PYTHON={{ '/usr/bin/python' ~ distro_python_version }} {% endif %} {% endblock %} COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN chmod 755 /usr/local/bin/kolla_extend_start {% block storm_footer %}{% endblock %} {% block footer %}{% endblock %} USER storm
{ "pile_set_name": "Github" }
# # Copyright (C) 2015 Red Hat, 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. # SHELL := /bin/bash all: build build: gobuild mvn clean install gobuild: CGO_ENABLED=0 GO15VENDOREXPERIMENT=1 go build -a ./cmd/generate/generate.go ./generate > src/main/resources/schema/kube-schema.json ./generate validation > src/main/resources/schema/validation-schema.json
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>canvas</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="gitgraph.js"></script> <script type="text/javascript" src="draw.js"></script> </head> <body> <canvas id="graph-canvas" width="110" height="600" style="float:left"> </canvas> <div> <ul id="graph-raw-list" style="float:left"> <li> <span class="node-relation">* </span> </li><li> <span class="node-relation">|\ </span> </li><li> <span class="node-relation">* \ </span> </li><li> <span class="node-relation">|\ \ </span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">| | * </span> </li><li> <span class="node-relation">| | |\ </span> </li><li> <span class="node-relation">| |_|/ </span> </li><li> <span class="node-relation">|/| | </span> </li><li> <span class="node-relation">| | *</span> </li><li> <span class="node-relation">| * |</span> </li><li> <span class="node-relation">| * | </span> </li><li> <span class="node-relation">| |\ \ </span> </li><li> <span class="node-relation">| |/ / </span> </li><li> <span class="node-relation">|/| | </span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | | </span> </li><li> <span class="node-relation">|\ \ \ </span> </li><li> <span class="node-relation">| |_|/ </span> </li><li> <span class="node-relation">|/| | </span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">| | *</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">| |/ </span> </li><li> <span class="node-relation">|/| </span> </li><li> <span class="node-relation">* |</span> </li><li> <span class="node-relation">| | *</span> </li><li> <span class="node-relation">| | *</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">| |/ </span> </li><li> <span class="node-relation">|/| </span> </li><li> <span class="node-relation">| | * </span> </li><li> <span class="node-relation">| | |\ </span> </li><li> <span class="node-relation">| |_|/ </span> </li><li> <span class="node-relation">|/| | </span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | | </span> </li><li> <span class="node-relation">|\ \ \ </span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">* | | | </span> </li><li> <span class="node-relation">|\ \ \ \ </span> </li><li> <span class="node-relation">| |_|_|/ </span> </li><li> <span class="node-relation">|/| | | </span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| | * | </span> </li><li> <span class="node-relation">| | |\ \ </span> </li><li> <span class="node-relation">| | |/ / </span> </li><li> <span class="node-relation">| |/| | </span> </li><li> <span class="node-relation">| | * |</span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| | | * </span> </li><li> <span class="node-relation">| | | |\ </span> </li><li> <span class="node-relation">| |_|_|/ </span> </li><li> <span class="node-relation">|/| | | </span> </li><li> <span class="node-relation">* | | | </span> </li><li> <span class="node-relation">|\ \ \ \ </span> </li><li> <span class="node-relation">| |/ / / </span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| |_|/ </span> </li><li> <span class="node-relation">|/| | </span> </li><li> <span class="node-relation">| * |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | | </span> </li><li> <span class="node-relation">|\ \ \ </span> </li><li> <span class="node-relation">| |/ / </span> </li><li> <span class="node-relation">* | | </span> </li><li> <span class="node-relation">|\ \ \ </span> </li><li> <span class="node-relation">| | | | *</span> </li><li> <span class="node-relation">| * | | |</span> </li><li> <span class="node-relation">| / / / </span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| * | |</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| | | *</span> </li><li> <span class="node-relation">| |_|/ </span> </li><li> <span class="node-relation">|/| | </span> </li><li> <span class="node-relation">* | |</span> </li><li> <span class="node-relation">* | | </span> </li><li> <span class="node-relation">|\ \ \ </span> </li><li> <span class="node-relation">| | |/ </span> </li><li> <span class="node-relation">| |/| </span> </li><li> <span class="node-relation">| * | </span> </li><li> <span class="node-relation">| |\ \ </span> </li><li> <span class="node-relation">| | |/ </span> </li><li> <span class="node-relation">| | *</span> </li><li> <span class="node-relation">* | | </span> </li><li> <span class="node-relation">|\ \ \ </span> </li><li> <span class="node-relation">| |/ / </span> </li><li> <span class="node-relation">|/| / </span> </li><li> <span class="node-relation">| |/ </span> </li><li> <span class="node-relation">* |</span> </li><li> <span class="node-relation">| *</span> </li><li> <span class="node-relation">| *</span> </li><li> <span class="node-relation">* |</span> </li><li> <span class="node-relation">* |</span> </li><li> <span class="node-relation">* | </span> </li><li> <span class="node-relation">|\ \ </span> </li><li> <span class="node-relation">| |/ </span> </li><li> <span class="node-relation">| *</span> </li><li> <span class="node-relation">|/ </span> </li><li> <span class="node-relation">*</span> </li><li> <span class="node-relation">*</span> </li> </ul> </div> </body> <style type="text/css" media="screen"> ul {margin:0} li {list-style-type:none; height:20px} li .node-relation {font-family:'Bitstream Vera Sans Mono', 'Courier', monospace;} </style> </html>
{ "pile_set_name": "Github" }
/* * Axelor Business Solutions * * Copyright (C) 2020 Axelor (<http://axelor.com>). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * 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 <http://www.gnu.org/licenses/>. */ package com.axelor.apps.base.service; import com.axelor.apps.base.db.Partner; import com.axelor.apps.base.db.PartnerPriceList; import com.axelor.apps.base.db.PriceList; import com.axelor.apps.base.db.repo.PartnerPriceListRepository; import com.axelor.apps.base.db.repo.PartnerRepository; import com.axelor.apps.base.db.repo.PriceListRepository; import com.axelor.apps.base.exceptions.IExceptionMessage; import com.axelor.apps.base.service.app.AppBaseService; import com.axelor.apps.tool.StringTool; import com.axelor.exception.AxelorException; import com.axelor.exception.db.repo.TraceBackRepository; import com.axelor.i18n.I18n; import com.axelor.inject.Beans; import com.google.inject.Inject; import java.time.LocalDate; import java.util.Comparator; import java.util.List; import java.util.Set; import java.util.stream.Collectors; public class PartnerPriceListServiceImpl implements PartnerPriceListService { protected AppBaseService appBaseService; @Inject public PartnerPriceListServiceImpl(AppBaseService appBaseService) { this.appBaseService = appBaseService; } @Override public void checkDates(PartnerPriceList partnerPriceList) throws AxelorException { Set<PriceList> priceListSet = partnerPriceList.getPriceListSet(); if (priceListSet == null) { return; } Set<PriceList> sortedPriceListSet = priceListSet.stream() .sorted( Comparator.comparing( priceList -> priceList.getApplicationBeginDate() != null ? priceList.getApplicationBeginDate() : LocalDate.MIN)) .collect(Collectors.toSet()); LocalDate beginDate; LocalDate previousEndDate = LocalDate.MIN; String previousTitle = ""; for (PriceList priceList : sortedPriceListSet) { beginDate = priceList.getApplicationBeginDate() != null ? priceList.getApplicationBeginDate() : LocalDate.MIN; if (beginDate.compareTo(previousEndDate) < 0) { throw new AxelorException( TraceBackRepository.CATEGORY_INCONSISTENCY, String.format( I18n.get(IExceptionMessage.PARTNER_PRICE_LIST_DATE_INCONSISTENT), previousTitle.replace("%", "%%"), priceList.getTitle().replace("%", "%%")), partnerPriceList); } previousEndDate = priceList.getApplicationEndDate() != null ? priceList.getApplicationEndDate() : LocalDate.MAX; previousTitle = priceList.getTitle(); } } @Override public PriceList getDefaultPriceList(Partner partner, int priceListTypeSelect) { if (partner == null) { return null; } partner = Beans.get(PartnerRepository.class).find(partner.getId()); PartnerPriceList partnerPriceList = getPartnerPriceList(partner, priceListTypeSelect); if (partnerPriceList == null) { return null; } Set<PriceList> priceListSet = partnerPriceList.getPriceListSet(); if (priceListSet == null) { return null; } List<PriceList> priceLists = priceListSet.stream() .filter( priceList -> (priceList.getApplicationBeginDate() == null || priceList .getApplicationBeginDate() .compareTo(appBaseService.getTodayDate()) <= 0) && (priceList.getApplicationEndDate() == null || priceList .getApplicationEndDate() .compareTo(appBaseService.getTodayDate()) >= 0)) .collect(Collectors.toList()); if (priceLists.size() == 1) { return priceLists.get(0); } else { return null; } } public String getPriceListDomain(Partner partner, int priceListTypeSelect) { if (partner == null) { return "self.id IN (0)"; } // get all non exclusive partner price lists List<PartnerPriceList> partnerPriceLists = Beans.get(PartnerPriceListRepository.class) .all() .filter("self.typeSelect = :_priceListTypeSelect " + "AND self.isExclusive = false") .bind("_priceListTypeSelect", priceListTypeSelect) .fetch(); // get (maybe exclusive) list for the partner PartnerPriceList partnerPriceList = getPartnerPriceList(partner, priceListTypeSelect); if (partnerPriceList != null && partnerPriceList.getIsExclusive()) { partnerPriceLists.add(partnerPriceList); } if (partnerPriceLists.isEmpty()) { return "self.id IN (0)"; } List<PriceList> priceLists = partnerPriceLists.stream() .flatMap(partnerPriceList1 -> partnerPriceList1.getPriceListSet().stream()) .filter( priceList -> priceList.getIsActive() && (priceList.getApplicationBeginDate() == null || priceList .getApplicationBeginDate() .compareTo(appBaseService.getTodayDate()) <= 0) && (priceList.getApplicationEndDate() == null || priceList .getApplicationEndDate() .compareTo(appBaseService.getTodayDate()) >= 0)) .collect(Collectors.toList()); return "self.id IN (" + StringTool.getIdListString(priceLists) + ")"; } public PartnerPriceList getPartnerPriceList(Partner partner, int priceListTypeSelect) { if (priceListTypeSelect == PriceListRepository.TYPE_SALE) { return partner.getSalePartnerPriceList(); } else if (priceListTypeSelect == PriceListRepository.TYPE_PURCHASE) { return partner.getPurchasePartnerPriceList(); } return null; } }
{ "pile_set_name": "Github" }
<?php /* * Copyright 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ class Google_Service_YouTube_EndscreenElement extends Google_Model { public $etag; public $id; public $kind; protected $snippetType = 'Google_Service_YouTube_EndscreenElementSnippet'; protected $snippetDataType = ''; public function setEtag($etag) { $this->etag = $etag; } public function getEtag() { return $this->etag; } public function setId($id) { $this->id = $id; } public function getId() { return $this->id; } public function setKind($kind) { $this->kind = $kind; } public function getKind() { return $this->kind; } /** * @param Google_Service_YouTube_EndscreenElementSnippet */ public function setSnippet(Google_Service_YouTube_EndscreenElementSnippet $snippet) { $this->snippet = $snippet; } /** * @return Google_Service_YouTube_EndscreenElementSnippet */ public function getSnippet() { return $this->snippet; } }
{ "pile_set_name": "Github" }
The head of America's most popular cable television service said on Tuesday that Latin American television will continue booming into the 21st century and that pan-regional advertising would shoot up to $1 billion within a decade. Kay Koplovitz, chief executive of U.S.A. Networks, told an industry conference that cross-boarder advertising on Latin American cable television and Direct-to-Home (DTH) was about $50 million to $75 million in 1996 but was poised for spectacular growth as new DTH services penetrate Latin America's 80 million television households. "I really believe it will reach $1 billion in the next decade," Koplovitz said. Audiences for cable and DTH in Latin American were affluent and younger than those in North America, characteristics that should appeal to advertisers. "This audience is younger and vibrant for consumer goods," she said. Some industry analysts and executives have questioned the appeal of pan-regional programming and advertising in Latin America saying Argentine and Mexican and other national audiences have varying taste and a much more pronounced hunger for local programming. Koplovitz likened the state of multiple-channel television in Latin America to the early days of U.S. cable television in the 1970s, when advertisers shunned the new medium because audience measurements were crude or nonexistent. "We need a reliable, standardized amd pan-regional measuring system," she told an audience of entertainment industry executives at a conference sponsored by the Variety trade newspaper. She also predicted that the governmental restrictions on DTH in some countries would melt away before the force of illegal satellite-dish sales and as taxing authorities realized that growing revenues streams were going untapped. According to Kagan Associates, a consulting group, cable television and DTH revenues in Latin America will grow to $8.1 billion by 2001. Industry revenues were about $2.5 billion last year in Latin America. Kagan has also estimated that only a bit more than 13 percent of Latin America's television homes subscribe to some form of multiple-channel television. By contrast, multiple-channel television penetration in the United States is more than 60 percent. "Latin America is one of the fastest growing and underdeveloped TV markets in the world," Koplovitz said. The expansion of DTH services by big international media ventures will be key in expanding pan-regional advertising, she said. One Latin American DTH service, called Galaxy is owned by GM Hughes of the United States, Cisneros Group of Venezuela, Multivision of Mexico and TVA Abril of Brazil. Its main competitor is Sky Entertainment, owned by multinational News Corp Ltd, Tele-Communications Inc of the United States, Mexico's Televisa and TV Globo of Brazil. "This is a market destine to grow, and grow it will," Koplovitz said. -- Miami Newsroom, 305-374-5013.
{ "pile_set_name": "Github" }
using ExtendedXmlSerializer.ContentModel.Content; using ExtendedXmlSerializer.ContentModel.Format; namespace ExtendedXmlSerializer.ExtensionModel.Xml { sealed class DefaultXmlContentsActivator : IXmlContentsActivator { public static IXmlContentsActivator Default { get; } = new DefaultXmlContentsActivator(); DefaultXmlContentsActivator() {} public IInnerContent Create(IFormatReader reader, object instance, XmlContent content) => new XmlInnerContent(reader, instance, content); } }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: MIT OR Apache-2.0 // // Copyright (c) 2018-2020 Andre Richter <[email protected]> //! Top-level BSP file for the Raspberry Pi 3 and 4. pub mod console; pub mod cpu; pub mod driver; pub mod exception; pub mod memory; //-------------------------------------------------------------------------------------------------- // Global instances //-------------------------------------------------------------------------------------------------- use super::device_driver; static GPIO: device_driver::GPIO = unsafe { device_driver::GPIO::new(memory::map::mmio::GPIO_BASE) }; static PL011_UART: device_driver::PL011Uart = unsafe { device_driver::PL011Uart::new( memory::map::mmio::PL011_UART_BASE, exception::asynchronous::irq_map::PL011_UART, ) }; #[cfg(feature = "bsp_rpi3")] static INTERRUPT_CONTROLLER: device_driver::InterruptController = unsafe { device_driver::InterruptController::new( memory::map::mmio::LOCAL_INTERRUPT_CONTROLLER_BASE, memory::map::mmio::PERIPHERAL_INTERRUPT_CONTROLLER_BASE, ) }; #[cfg(feature = "bsp_rpi4")] static INTERRUPT_CONTROLLER: device_driver::GICv2 = unsafe { device_driver::GICv2::new(memory::map::mmio::GICD_BASE, memory::map::mmio::GICC_BASE) }; //-------------------------------------------------------------------------------------------------- // Public Code //-------------------------------------------------------------------------------------------------- /// Board identification. pub fn board_name() -> &'static str { #[cfg(feature = "bsp_rpi3")] { "Raspberry Pi 3" } #[cfg(feature = "bsp_rpi4")] { "Raspberry Pi 4" } }
{ "pile_set_name": "Github" }