text
stringlengths 2
99k
| meta
dict |
---|---|
server:
port: 8040
spring:
application:
name: microservice-gateway-zuul
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
instance:
prefer-ip-address: true
zuul:
routes:
route-name:
path: /path-a/**
url: forward:/path-b
management:
security:
enabled: false | {
"pile_set_name": "Github"
} |
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <[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 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.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$PKG_CONFIG"; then
if test -n "$$1"; then
pkg_cv_[]$1="$$1"
else
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
fi
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
ifelse([$4], , [AC_MSG_ERROR(dnl
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT
])],
[AC_MSG_RESULT([no])
$4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES
| {
"pile_set_name": "Github"
} |
'use strict';
exports.mochaHooks = {
beforeAll: [
function() {
console.log('beforeAll array 1');
},
function() {
console.log('beforeAll array 2');
}
],
beforeEach: [
function() {
console.log('beforeEach array 1');
},
function() {
console.log('beforeEach array 2');
}
],
afterAll: [
function() {
console.log('afterAll array 1');
},
function() {
console.log('afterAll array 2');
}
],
afterEach: [
function() {
console.log('afterEach array 1');
},
function() {
console.log('afterEach array 2');
}
]
};
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
#include "am3517.dtsi"
#include "am3517-som.dtsi"
#include "am3517-evm-ui.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "TI AM3517 EVM (AM3517/05 TMDSEVM3517)";
compatible = "ti,am3517-evm", "ti,am3517", "ti,omap3";
aliases {
display0 = &lcd0;
};
chosen {
stdout-path = &uart3;
};
memory@80000000 {
device_type = "memory";
reg = <0x80000000 0x10000000>; /* 256 MB */
};
vmmc_fixed: vmmc {
compatible = "regulator-fixed";
regulator-name = "vmmc_fixed";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
gpio-keys {
compatible = "gpio-keys-polled";
poll-interval = <100>;
user_pb {
label = "User Push Button";
linux,code = <BTN_0>;
gpios = <&tca6416 5 GPIO_ACTIVE_LOW>;
};
user_sw_1 {
label = "User Switch 1";
linux,code = <BTN_1>;
gpios = <&tca6416 8 GPIO_ACTIVE_LOW>;
};
user_sw_2 {
label = "User Switch 2";
linux,code = <BTN_2>;
gpios = <&tca6416 9 GPIO_ACTIVE_LOW>;
};
user_sw_3 {
label = "User Switch 3";
linux,code = <BTN_3>;
gpios = <&tca6416 10 GPIO_ACTIVE_LOW>;
};
user_sw_4 {
label = "User Switch 4";
linux,code = <BTN_4>;
gpios = <&tca6416 11 GPIO_ACTIVE_LOW>;
};
user_sw_5 {
label = "User Switch 5";
linux,code = <BTN_5>;
gpios = <&tca6416 12 GPIO_ACTIVE_LOW>;
};
user_sw_6 {
label = "User Switch 6";
linux,code = <BTN_6>;
gpios = <&tca6416 13 GPIO_ACTIVE_LOW>;
};
user_sw_7 {
label = "User Switch 7";
linux,code = <BTN_7>;
gpios = <&tca6416 14 GPIO_ACTIVE_LOW>;
};
user_sw_8 {
label = "User Switch 8";
linux,code = <BTN_8>;
gpios = <&tca6416 15 GPIO_ACTIVE_LOW>;
};
};
gpio-leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&leds_pins>;
user_led_1 {
label = "am3517evm:green:user_led_1";
gpios = <&tca6416 7 GPIO_ACTIVE_LOW>;
default-state = "on";
};
user_led_2 {
label = "am3517evm:green:user_led_2";
gpios = <&tca6416 6 GPIO_ACTIVE_LOW>;
default-state = "on";
};
user_led_3 {
label = "am3517evm:green:user_led_3";
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "mmc0"; /* SD/MMC card activity */
};
user_led_4 {
label = "am3517evm:green:user_led_4";
gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
};
};
lcd0: display@0 {
compatible = "panel-dpi";
label = "15";
status = "okay";
pinctrl-names = "default";
enable-gpios = <&gpio6 16 GPIO_ACTIVE_HIGH>; /* gpio176, lcd INI */
vcc-supply = <&vdd_io_reg>;
port {
lcd_in: endpoint {
remote-endpoint = <&dpi_out>;
};
};
panel-timing {
clock-frequency = <9000000>;
hactive = <480>;
vactive = <272>;
hfront-porch = <3>;
hback-porch = <2>;
hsync-len = <42>;
vback-porch = <3>;
vfront-porch = <4>;
vsync-len = <11>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <1>;
};
};
bl: backlight {
compatible = "pwm-backlight";
pinctrl-names = "default";
power-supply = <&vdd_io_reg>;
pinctrl-0 = <&backlight_pins>;
pwms = <&pwm11 0 5000000 0>;
brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
default-brightness-level = <7>;
enable-gpios = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* gpio_182 */
};
pwm11: dmtimer-pwm@11 {
compatible = "ti,omap-dmtimer-pwm";
pinctrl-names = "default";
pinctrl-0 = <&pwm_pins>;
ti,timers = <&timer11>;
#pwm-cells = <3>;
};
/* HS USB Host PHY on PORT 1 */
hsusb1_phy: hsusb1_phy {
compatible = "usb-nop-xceiv";
reset-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; /* gpio_57 */
#phy-cells = <0>;
};
};
&davinci_emac {
status = "okay";
};
&davinci_mdio {
status = "okay";
};
&dss {
status = "ok";
pinctrl-names = "default";
pinctrl-0 = <&dss_dpi_pins>;
vdds_dsi-supply = <&vdd_io_reg>;
vdda_video-supply = <&vdd_io_reg>;
port {
dpi_out: endpoint {
remote-endpoint = <&lcd_in>;
data-lines = <16>;
};
};
};
&i2c2 {
clock-frequency = <400000>;
/* User DIP swithes [1:8] / User LEDS [1:2] */
tca6416: gpio@21 {
compatible = "ti,tca6416";
reg = <0x21>;
gpio-controller;
#gpio-cells = <2>;
vcc-supply = <&vdd_io_reg>;
};
};
&i2c3 {
clock-frequency = <400000>;
};
&mmc1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pins>;
vmmc-supply = <&vmmc_fixed>;
bus-width = <4>;
wp-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>; /* gpio_126 */
cd-gpios = <&gpio4 31 GPIO_ACTIVE_LOW>; /* gpio_127 */
};
&mmc3 {
status = "disabled";
};
&usbhshost {
port1-mode = "ehci-phy";
};
&usbhsehci {
phys = <&hsusb1_phy>;
};
&omap3_pmx_core {
pinctrl-names = "default";
pinctrl-0 = <&hsusb1_rst_pins>;
leds_pins: pinmux_leds_pins {
pinctrl-single,pins = <
OMAP3_WKUP_IOPAD(0x2a24, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu0.gpio_11 */
OMAP3_WKUP_IOPAD(0x2a26, PIN_OUTPUT_PULLUP | MUX_MODE4) /* jtag_emu1.gpio_31 */
>;
};
mmc1_pins: pinmux_mmc1_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */
OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */
OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
OMAP3_CORE1_IOPAD(0x2150, PIN_INPUT_PULLUP | MUX_MODE4) /* sdmmc1_dat4.gpio_126 */
OMAP3_CORE1_IOPAD(0x2152, PIN_INPUT_PULLUP | MUX_MODE4) /* sdmmc1_dat5.gpio_127 */
>;
};
pwm_pins: pinmux_pwm_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x21dc, PIN_OUTPUT | MUX_MODE1) /* mcspi2_cs0.gpt11_pwm */
>;
};
backlight_pins: pinmux_backlight_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x21de, PIN_OUTPUT | MUX_MODE4) /* mcspi2_cs1.gpio_182 */
>;
};
dss_dpi_pins: pinmux_dss_dpi_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x21d2, PIN_OUTPUT | MUX_MODE4) /* mcspi1_cs2.gpio_176 */
OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */
OMAP3_CORE1_IOPAD(0x20dc, PIN_OUTPUT | MUX_MODE0) /* dss_data0.dss_data0 */
OMAP3_CORE1_IOPAD(0x20de, PIN_OUTPUT | MUX_MODE0) /* dss_data1.dss_data1 */
OMAP3_CORE1_IOPAD(0x20e0, PIN_OUTPUT | MUX_MODE0) /* dss_data2.dss_data2 */
OMAP3_CORE1_IOPAD(0x20e2, PIN_OUTPUT | MUX_MODE0) /* dss_data3.dss_data3 */
OMAP3_CORE1_IOPAD(0x20e4, PIN_OUTPUT | MUX_MODE0) /* dss_data4.dss_data4 */
OMAP3_CORE1_IOPAD(0x20e6, PIN_OUTPUT | MUX_MODE0) /* dss_data5.dss_data5 */
OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
OMAP3_CORE1_IOPAD(0x20fa, PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
>;
};
hsusb1_rst_pins: pinmux_hsusb1_rst_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x20ba, PIN_OUTPUT | MUX_MODE4) /* gpmc_ncs6.gpio_57 */
>;
};
};
&omap3_pmx_core2 {
pinctrl-names = "default";
pinctrl-0 = <&hsusb1_pins>;
hsusb1_pins: pinmux_hsusb1_pins {
pinctrl-single,pins = <
OMAP3430_CORE2_IOPAD(0x25d8, PIN_OUTPUT | MUX_MODE3) /* etk_clk.hsusb1_stp */
OMAP3430_CORE2_IOPAD(0x25da, PIN_OUTPUT | MUX_MODE3) /* etk_ctl.hsusb1_clk */
OMAP3430_CORE2_IOPAD(0x25ec, PIN_INPUT | MUX_MODE3) /* etk_d8.hsusb1_dir */
OMAP3430_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE3) /* etk_d9.hsusb1_nxt */
OMAP3430_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE3) /* etk_d0.hsusb1_data0 */
OMAP3430_CORE2_IOPAD(0x25de, PIN_INPUT | MUX_MODE3) /* etk_d1.hsusb1_data1 */
OMAP3430_CORE2_IOPAD(0x25e0, PIN_INPUT | MUX_MODE3) /* etk_d2.hsusb1_data2 */
OMAP3430_CORE2_IOPAD(0x25ea, PIN_INPUT | MUX_MODE3) /* etk_d7.hsusb1_data3 */
OMAP3430_CORE2_IOPAD(0x25e4, PIN_INPUT | MUX_MODE3) /* etk_d4.hsusb1_data4 */
OMAP3430_CORE2_IOPAD(0x25e6, PIN_INPUT | MUX_MODE3) /* etk_d5.hsusb1_data5 */
OMAP3430_CORE2_IOPAD(0x25e8, PIN_INPUT | MUX_MODE3) /* etk_d6.hsusb1_data6 */
OMAP3430_CORE2_IOPAD(0x25e2, PIN_INPUT | MUX_MODE3) /* etk_d3.hsusb1_data7 */
>;
};
};
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tests.helpers import create_ctfd, destroy_ctfd, gen_user
def test_ctfd_setup_redirect():
"""Test that a fresh CTFd instance redirects to /setup"""
app = create_ctfd(setup=False)
with app.app_context():
with app.test_client() as client:
r = client.get("/users")
assert r.status_code == 302
assert r.location == "http://localhost/setup"
# Files in /themes load properly
r = client.get("/themes/core/static/css/main.dev.css")
r = client.get("/themes/core/static/css/main.min.css")
assert r.status_code == 200
destroy_ctfd(app)
def test_ctfd_setup_verification():
app = create_ctfd(setup=False)
with app.app_context():
with app.test_client() as client:
r = client.get("/setup")
assert r.status_code == 200
with client.session_transaction() as sess:
data = {
"ctf_name": "CTFd",
"ctf_description": "CTF description",
"name": "test",
"email": "[email protected]",
"password": "",
"user_mode": "users",
"nonce": sess.get("nonce"),
}
r = client.post("/setup", data=data)
assert "longer password" in r.get_data(as_text=True)
gen_user(app.db, name="test", email="[email protected]")
data["password"] = "password"
r = client.post("/setup", data=data)
resp = r.get_data(as_text=True)
assert "email has already been used" in resp
assert "name is already taken" in resp
data["name"] = "admin"
data["email"] = "[email protected]"
r = client.post("/setup", data=data)
assert r.status_code == 302
assert r.location == "http://localhost/"
destroy_ctfd(app)
| {
"pile_set_name": "Github"
} |
<?php
/**
* PHPExcel
*
* Copyright (c) 2006 - 2014 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Shared_ZipArchive
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
if (!defined('PCLZIP_TEMPORARY_DIR')) {
define('PCLZIP_TEMPORARY_DIR', PHPExcel_Shared_File::sys_get_temp_dir() . DIRECTORY_SEPARATOR);
}
require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php';
/**
* PHPExcel_Shared_ZipArchive
*
* @category PHPExcel
* @package PHPExcel_Shared_ZipArchive
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Shared_ZipArchive
{
/** constants */
const OVERWRITE = 'OVERWRITE';
const CREATE = 'CREATE';
/**
* Temporary storage directory
*
* @var string
*/
private $_tempDir;
/**
* Zip Archive Stream Handle
*
* @var string
*/
private $_zip;
/**
* Open a new zip archive
*
* @param string $fileName Filename for the zip archive
* @return boolean
*/
public function open($fileName)
{
$this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir();
$this->_zip = new PclZip($fileName);
return true;
}
/**
* Close this zip archive
*
*/
public function close()
{
}
/**
* Add a new file to the zip archive from a string of raw data.
*
* @param string $localname Directory/Name of the file to add to the zip archive
* @param string $contents String of data to add to the zip archive
*/
public function addFromString($localname, $contents)
{
$filenameParts = pathinfo($localname);
$handle = fopen($this->_tempDir.'/'.$filenameParts["basename"], "wb");
fwrite($handle, $contents);
fclose($handle);
$res = $this->_zip->add($this->_tempDir.'/'.$filenameParts["basename"],
PCLZIP_OPT_REMOVE_PATH, $this->_tempDir,
PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]
);
if ($res == 0) {
throw new PHPExcel_Writer_Exception("Error zipping files : " . $this->_zip->errorInfo(true));
}
unlink($this->_tempDir.'/'.$filenameParts["basename"]);
}
/**
* Find if given fileName exist in archive (Emulate ZipArchive locateName())
*
* @param string $fileName Filename for the file in zip archive
* @return boolean
*/
public function locateName($fileName)
{
$list = $this->_zip->listContent();
$listCount = count($list);
$list_index = -1;
for ($i = 0; $i < $listCount; ++$i) {
if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
$list_index = $i;
break;
}
}
return ($list_index > -1);
}
/**
* Extract file from archive by given fileName (Emulate ZipArchive getFromName())
*
* @param string $fileName Filename for the file in zip archive
* @return string $contents File string contents
*/
public function getFromName($fileName)
{
$list = $this->_zip->listContent();
$listCount = count($list);
$list_index = -1;
for ($i = 0; $i < $listCount; ++$i) {
if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
$list_index = $i;
break;
}
}
$extracted = "";
if ($list_index != -1) {
$extracted = $this->_zip->extractByIndex($list_index, PCLZIP_OPT_EXTRACT_AS_STRING);
} else {
$filename = substr($fileName, 1);
$list_index = -1;
for ($i = 0; $i < $listCount; ++$i) {
if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
$list_index = $i;
break;
}
}
$extracted = $this->_zip->extractByIndex($list_index, PCLZIP_OPT_EXTRACT_AS_STRING);
}
if ((is_array($extracted)) && ($extracted != 0)) {
$contents = $extracted[0]["content"];
}
return $contents;
}
}
| {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("filetools","ko",{loadError:"파일을 읽는 중 오류가 발생했습니다.",networkError:"파일 업로드 중 네트워크 오류가 발생했습니다.",httpError404:"파일 업로드중 HTTP 오류가 발생했습니다 (404: 파일 찾을수 없음).",httpError403:"파일 업로드중 HTTP 오류가 발생했습니다 (403: 권한 없음).",httpError:"파일 업로드중 HTTP 오류가 발생했습니다 (오류 코드 %1).",noUrlError:"업로드 주소가 정의되어 있지 않습니다.",responseError:"잘못된 서버 응답."}); | {
"pile_set_name": "Github"
} |
/*
* Copyright 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.dev.cfg.testdata.separate.libraryone.client;
/**
* Test class for module loading.
*/
public class LibraryOne {
// For testing.
}
| {
"pile_set_name": "Github"
} |
-module(rts_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start(_StartType, _StartArgs) ->
case rts_sup:start_link() of
{ok, Pid} ->
ok = riak_core:register_vnode_module(rts_vnode),
ok = riak_core_node_watcher:service_up(rts, self()),
ok = riak_core:register_vnode_module(rts_entry_vnode),
ok = riak_core_node_watcher:service_up(rts_entry, self()),
ok = riak_core:register_vnode_module(rts_stat_vnode),
ok = riak_core_node_watcher:service_up(rts_stat, self()),
EntryRoute = {["rts", "entry", client], rts_wm_entry, []},
webmachine_router:add_route(EntryRoute),
{ok, Pid};
{error, Reason} ->
{error, Reason}
end.
stop(_State) ->
ok.
| {
"pile_set_name": "Github"
} |
[
{
"title": "Associate Site Reliability Engineer",
"source": "Freedom of the Press Foundation",
"sourceUrl": "https://freedom.press/jobs/job-opening-associate-site-reliability-engineer/",
"city": "Multiple",
"state": "Multiple",
"country": "United States",
"description": "In this role, you will empower the whole FPF team by participating in the development of a robust continuous deployment pipeline, by performing routine maintenance tasks, and by automating operations work, e.g., by using cluster and configuration management tools. Open to remote work in time zones within the Americas. Deadline to apply: 4 November. It's open to recent college or university graduates, and to early-career and mid-career technologists whether or not they have a relevant degree. It is also open to candidates from non-technology career backgrounds with substantial applicable volunteer experience.",
"status": "active",
"remote": true,
"tags": [
"Unix CLI",
"Python",
"Ruby"
]
},
{
"title": "Software Engineer",
"source": "MasterControl",
"sourceUrl": "https://mastercontrol.applicantpro.com/jobs/908219.html",
"city": "Cottonwood Heights",
"state": "Utah",
"country": "United States",
"description": "Software Engineer will be responsible for the design, development, implementation, and analysis of the company's technical products and systems. Performs engineering design evaluations and may develop a range of products. Uses professional concepts and company policies to solve a wide range of difficult problems in imaginative and practical ways. Works on problems of diverse scope where analysis of data requires evaluation of identifiable factors. Exercises judgment within generally defined practices and policies in selecting methods and techniques for obtaining solutions. Normally receives no instruction on routine work, general instructions on new assignments. May lead and direct the work of others. Considered highly skilled and proficient in discipline. Works under minimal supervision with wide latitude for independent judgment.",
"status": "active",
"remote": false,
"tags": [
"Java",
".Net",
"Oracle",
"Angular",
"Ruby",
"JavaScript"
]
},
{
"title": "Software Quality Assurance Engineer",
"source": "MasterControl",
"sourceUrl": "https://mastercontrol.applicantpro.com/jobs/908219.html",
"city": "Cottonwood Heights",
"state": "Utah",
"country": "United States",
"description": "MasterControl is looking for creative, energetic automation test engineers to join our software quality team. Team members will use innovative test tools and methods, working closely with product managers and developers in an agile environment, to proactively ensure delivery of the best software possible.",
"status": "active",
"remote": false,
"tags": [
"Quality Assurance",
"QA",
"SQL",
"Oracle",
"Angular",
"Ruby",
"JavaScript"
]
},
{
"title": "Software Engineer",
"source": "Lockheed Martin",
"sourceUrl": "https://www.lockheedmartinjobs.com/job/boulder/software-engineer/694/8061488",
"city": "Boulder",
"state": "Colorado",
"country": "United States",
"description": "We are seeking a Software Engineer to join our dynamic and growing team! The selected candidate will design, develop, and test software solutions across our contracted efforts, supporting multiple baselines in defect resolution as well as enhancements, special projects, new business initiatives, and modernization efforts. The successful candidate will be a passionate coder, someone who loves a challenge and always rises to the occasion to ensure success. They embrace modern development practices and insist that others do as well. Only a Secret Clearance is required to start, and there are multiple openings for each position.",
"status": "active",
"remote": false,
"tags": [
"Java",
"C++"
]
}
] | {
"pile_set_name": "Github"
} |
import React from 'react';
import AddTodo from './AddTodo';
import TodoList from './TodoList';
export default class App extends React.Component {
render() {
return (
<div>
<h1>Todos</h1>
<TodoList/>
<AddTodo/>
</div>
);
}
}
| {
"pile_set_name": "Github"
} |
/*
File: SFNTLayoutTypes.h
Contains: SFNT file layout structures and constants.
Version: QuickTime 7.3
Copyright: (c) 2007 (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __SFNTLAYOUTTYPES__
#define __SFNTLAYOUTTYPES__
#ifndef __MACTYPES__
#include <MacTypes.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
/* ----------------------------------------------------------------------------------------- */
/* CONSTANTS */
/*
The following values can be used to set run feature values. Note that unless the
feature is defaulted differently in different fonts, the zero value for the
selectors represents the default value. Check the following URL site for further info:
"http://fonts.apple.com/Registry"
*/
/*
* Summary:
* Feature types
*/
enum {
kAllTypographicFeaturesType = 0,
kLigaturesType = 1,
kCursiveConnectionType = 2,
kLetterCaseType = 3,
kVerticalSubstitutionType = 4,
kLinguisticRearrangementType = 5,
kNumberSpacingType = 6,
kSmartSwashType = 8,
kDiacriticsType = 9,
kVerticalPositionType = 10,
kFractionsType = 11,
kOverlappingCharactersType = 13,
kTypographicExtrasType = 14,
kMathematicalExtrasType = 15,
kOrnamentSetsType = 16,
kCharacterAlternativesType = 17,
kDesignComplexityType = 18,
kStyleOptionsType = 19,
kCharacterShapeType = 20,
kNumberCaseType = 21,
kTextSpacingType = 22,
kTransliterationType = 23,
kAnnotationType = 24,
kKanaSpacingType = 25,
kIdeographicSpacingType = 26,
kUnicodeDecompositionType = 27,
kRubyKanaType = 28,
kCJKSymbolAlternativesType = 29,
kIdeographicAlternativesType = 30,
kCJKVerticalRomanPlacementType = 31,
kItalicCJKRomanType = 32,
kCJKRomanSpacingType = 103,
kLastFeatureType = -1
};
/*
* Summary:
* Selectors for feature type kAllTypographicFeaturesType
*/
enum {
kAllTypeFeaturesOnSelector = 0,
kAllTypeFeaturesOffSelector = 1
};
/*
* Summary:
* Selectors for feature type kLigaturesType
*/
enum {
kRequiredLigaturesOnSelector = 0,
kRequiredLigaturesOffSelector = 1,
kCommonLigaturesOnSelector = 2,
kCommonLigaturesOffSelector = 3,
kRareLigaturesOnSelector = 4,
kRareLigaturesOffSelector = 5,
kLogosOnSelector = 6,
kLogosOffSelector = 7,
kRebusPicturesOnSelector = 8,
kRebusPicturesOffSelector = 9,
kDiphthongLigaturesOnSelector = 10,
kDiphthongLigaturesOffSelector = 11,
kSquaredLigaturesOnSelector = 12,
kSquaredLigaturesOffSelector = 13,
kAbbrevSquaredLigaturesOnSelector = 14,
kAbbrevSquaredLigaturesOffSelector = 15,
kSymbolLigaturesOnSelector = 16,
kSymbolLigaturesOffSelector = 17
};
/*
* Summary:
* Selectors for feature type kCursiveConnectionType
*/
enum {
kUnconnectedSelector = 0,
kPartiallyConnectedSelector = 1,
kCursiveSelector = 2
};
/*
* Summary:
* Selectors for feature type kLetterCaseType
*/
enum {
kUpperAndLowerCaseSelector = 0,
kAllCapsSelector = 1,
kAllLowerCaseSelector = 2,
kSmallCapsSelector = 3,
kInitialCapsSelector = 4,
kInitialCapsAndSmallCapsSelector = 5
};
/*
* Summary:
* Selectors for feature type kVerticalSubstitutionType
*/
enum {
kSubstituteVerticalFormsOnSelector = 0,
kSubstituteVerticalFormsOffSelector = 1
};
/*
* Summary:
* Selectors for feature type kLinguisticRearrangementType
*/
enum {
kLinguisticRearrangementOnSelector = 0,
kLinguisticRearrangementOffSelector = 1
};
/*
* Summary:
* Selectors for feature type kNumberSpacingType
*/
enum {
kMonospacedNumbersSelector = 0,
kProportionalNumbersSelector = 1,
kThirdWidthNumbersSelector = 2,
kQuarterWidthNumbersSelector = 3
};
/*
* Summary:
* Selectors for feature type kSmartSwashType
*/
enum {
kWordInitialSwashesOnSelector = 0,
kWordInitialSwashesOffSelector = 1,
kWordFinalSwashesOnSelector = 2,
kWordFinalSwashesOffSelector = 3,
kLineInitialSwashesOnSelector = 4,
kLineInitialSwashesOffSelector = 5,
kLineFinalSwashesOnSelector = 6,
kLineFinalSwashesOffSelector = 7,
kNonFinalSwashesOnSelector = 8,
kNonFinalSwashesOffSelector = 9
};
/*
* Summary:
* Selectors for feature type kDiacriticsType
*/
enum {
kShowDiacriticsSelector = 0,
kHideDiacriticsSelector = 1,
kDecomposeDiacriticsSelector = 2
};
/*
* Summary:
* Selectors for feature type kVerticalPositionType
*/
enum {
kNormalPositionSelector = 0,
kSuperiorsSelector = 1,
kInferiorsSelector = 2,
kOrdinalsSelector = 3
};
/*
* Summary:
* Selectors for feature type kFractionsType
*/
enum {
kNoFractionsSelector = 0,
kVerticalFractionsSelector = 1,
kDiagonalFractionsSelector = 2
};
/*
* Summary:
* Selectors for feature type kOverlappingCharactersType
*/
enum {
kPreventOverlapOnSelector = 0,
kPreventOverlapOffSelector = 1
};
/*
* Summary:
* Selectors for feature type kTypographicExtrasType
*/
enum {
kHyphensToEmDashOnSelector = 0,
kHyphensToEmDashOffSelector = 1,
kHyphenToEnDashOnSelector = 2,
kHyphenToEnDashOffSelector = 3,
kSlashedZeroOnSelector = 4,
kSlashedZeroOffSelector = 5,
kFormInterrobangOnSelector = 6,
kFormInterrobangOffSelector = 7,
kSmartQuotesOnSelector = 8,
kSmartQuotesOffSelector = 9,
kPeriodsToEllipsisOnSelector = 10,
kPeriodsToEllipsisOffSelector = 11
};
/*
* Summary:
* Selectors for feature type kMathematicalExtrasType
*/
enum {
kHyphenToMinusOnSelector = 0,
kHyphenToMinusOffSelector = 1,
kAsteriskToMultiplyOnSelector = 2,
kAsteriskToMultiplyOffSelector = 3,
kSlashToDivideOnSelector = 4,
kSlashToDivideOffSelector = 5,
kInequalityLigaturesOnSelector = 6,
kInequalityLigaturesOffSelector = 7,
kExponentsOnSelector = 8,
kExponentsOffSelector = 9
};
/*
* Summary:
* Selectors for feature type kOrnamentSetsType
*/
enum {
kNoOrnamentsSelector = 0,
kDingbatsSelector = 1,
kPiCharactersSelector = 2,
kFleuronsSelector = 3,
kDecorativeBordersSelector = 4,
kInternationalSymbolsSelector = 5,
kMathSymbolsSelector = 6
};
/*
* Summary:
* Selectors for feature type kCharacterAlternativesType
*/
enum {
kNoAlternatesSelector = 0
};
/*
* Summary:
* Selectors for feature type kDesignComplexityType
*/
enum {
kDesignLevel1Selector = 0,
kDesignLevel2Selector = 1,
kDesignLevel3Selector = 2,
kDesignLevel4Selector = 3,
kDesignLevel5Selector = 4
};
/*
* Summary:
* Selectors for feature type kStyleOptionsType
*/
enum {
kNoStyleOptionsSelector = 0,
kDisplayTextSelector = 1,
kEngravedTextSelector = 2,
kIlluminatedCapsSelector = 3,
kTitlingCapsSelector = 4,
kTallCapsSelector = 5
};
/*
* Summary:
* Selectors for feature type kCharacterShapeType
*/
enum {
kTraditionalCharactersSelector = 0,
kSimplifiedCharactersSelector = 1,
kJIS1978CharactersSelector = 2,
kJIS1983CharactersSelector = 3,
kJIS1990CharactersSelector = 4,
kTraditionalAltOneSelector = 5,
kTraditionalAltTwoSelector = 6,
kTraditionalAltThreeSelector = 7,
kTraditionalAltFourSelector = 8,
kTraditionalAltFiveSelector = 9,
kExpertCharactersSelector = 10
};
/*
* Summary:
* Selectors for feature type kNumberCaseType
*/
enum {
kLowerCaseNumbersSelector = 0,
kUpperCaseNumbersSelector = 1
};
/*
* Summary:
* Selectors for feature type kTextSpacingType
*/
enum {
kProportionalTextSelector = 0,
kMonospacedTextSelector = 1,
kHalfWidthTextSelector = 2
};
/*
* Summary:
* Selectors for feature type kTransliterationType
*/
enum {
kNoTransliterationSelector = 0,
kHanjaToHangulSelector = 1,
kHiraganaToKatakanaSelector = 2,
kKatakanaToHiraganaSelector = 3,
kKanaToRomanizationSelector = 4,
kRomanizationToHiraganaSelector = 5,
kRomanizationToKatakanaSelector = 6,
kHanjaToHangulAltOneSelector = 7,
kHanjaToHangulAltTwoSelector = 8,
kHanjaToHangulAltThreeSelector = 9
};
/*
* Summary:
* Selectors for feature type kAnnotationType
*/
enum {
kNoAnnotationSelector = 0,
kBoxAnnotationSelector = 1,
kRoundedBoxAnnotationSelector = 2,
kCircleAnnotationSelector = 3,
kInvertedCircleAnnotationSelector = 4,
kParenthesisAnnotationSelector = 5,
kPeriodAnnotationSelector = 6,
kRomanNumeralAnnotationSelector = 7,
kDiamondAnnotationSelector = 8,
kInvertedBoxAnnotationSelector = 9,
kInvertedRoundedBoxAnnotationSelector = 10
};
/*
* Summary:
* Selectors for feature type kKanaSpacingType
*/
enum {
kFullWidthKanaSelector = 0,
kProportionalKanaSelector = 1
};
/*
* Summary:
* Selectors for feature type kIdeographicSpacingType
*/
enum {
kFullWidthIdeographsSelector = 0,
kProportionalIdeographsSelector = 1,
kHalfWidthIdeographsSelector = 2
};
/*
* Summary:
* Selectors for feature type kUnicodeDecompositionType
*/
enum {
kCanonicalCompositionOnSelector = 0,
kCanonicalCompositionOffSelector = 1,
kCompatibilityCompositionOnSelector = 2,
kCompatibilityCompositionOffSelector = 3,
kTranscodingCompositionOnSelector = 4,
kTranscodingCompositionOffSelector = 5
};
/*
* Summary:
* Selectors for feature type kRubyKanaType
*/
enum {
kNoRubyKanaSelector = 0,
kRubyKanaSelector = 1
};
/*
* Summary:
* Selectors for feature type kCJKSymbolAlternativesType
*/
enum {
kNoCJKSymbolAlternativesSelector = 0,
kCJKSymbolAltOneSelector = 1,
kCJKSymbolAltTwoSelector = 2,
kCJKSymbolAltThreeSelector = 3,
kCJKSymbolAltFourSelector = 4,
kCJKSymbolAltFiveSelector = 5
};
/*
* Summary:
* Selectors for feature type kIdeographicAlternativesType
*/
enum {
kNoIdeographicAlternativesSelector = 0,
kIdeographicAltOneSelector = 1,
kIdeographicAltTwoSelector = 2,
kIdeographicAltThreeSelector = 3,
kIdeographicAltFourSelector = 4,
kIdeographicAltFiveSelector = 5
};
/*
* Summary:
* Selectors for feature type kCJKVerticalRomanPlacementType
*/
enum {
kCJKVerticalRomanCenteredSelector = 0,
kCJKVerticalRomanHBaselineSelector = 1
};
/*
* Summary:
* Selectors for feature type kItalicCJKRomanType
*/
enum {
kNoCJKItalicRomanSelector = 0,
kCJKItalicRomanSelector = 1
};
/*
* Summary:
* Selectors for feature type kCJKRomanSpacingType
*/
enum {
kHalfWidthCJKRomanSelector = 0,
kProportionalCJKRomanSelector = 1,
kDefaultCJKRomanSelector = 2,
kFullWidthCJKRomanSelector = 3
};
/* --------------------------------------------------------------------------- */
/* ---------------- Table Specific Typedefs and Constants -------------------- */
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: lookup tables - used within various other tables */
enum {
kSFNTLookupSimpleArray = 0, /* a simple array indexed by glyph code */
kSFNTLookupSegmentSingle = 2, /* segment mapping to single value */
kSFNTLookupSegmentArray = 4, /* segment mapping to lookup array */
kSFNTLookupSingleTable = 6, /* sorted list of glyph, value pairs */
kSFNTLookupTrimmedArray = 8 /* a simple trimmed array indexed by glyph code */
};
typedef UInt16 SFNTLookupTableFormat;
typedef UInt16 SFNTLookupValue;
typedef UInt16 SFNTLookupOffset;
typedef UInt32 SFNTLookupKind;
/*
A BinarySearchHeader defines the five standard fields needed to perform quick
lookups in a lookup table (note that using UInt16s, and not ItemCounts or
similar types, is important here, since these tables are in fonts, and the
documented font formats specify 16-bit quantities).
*/
struct SFNTLookupBinarySearchHeader {
UInt16 unitSize; /* size of a unit in bytes */
UInt16 nUnits; /* number of units in table */
UInt16 searchRange; /* (largest power of two <= nUnits) * unitSize */
UInt16 entrySelector; /* log2 (largest power of two <= nUnits) */
UInt16 rangeShift; /* (nUnits - largest power of two <= nUnits) * unitSize */
};
typedef struct SFNTLookupBinarySearchHeader SFNTLookupBinarySearchHeader;
/* A format 0 lookup table maps all glyphs in the font to lookup values */
struct SFNTLookupArrayHeader {
SFNTLookupValue lookupValues[1];
};
typedef struct SFNTLookupArrayHeader SFNTLookupArrayHeader;
/* A format 8 lookup table maps some range of glyphs in the font to lookup values */
struct SFNTLookupTrimmedArrayHeader {
UInt16 firstGlyph;
UInt16 count;
SFNTLookupValue valueArray[1];
};
typedef struct SFNTLookupTrimmedArrayHeader SFNTLookupTrimmedArrayHeader;
/*
Format 2 and format 4 lookup tables map ranges of glyphs to either single lookup
values (format 2), or per-glyph lookup values (format 4). Since both formats
use the same kind of data, only one unified set of segment-related structures
is defined.
*/
struct SFNTLookupSegment {
UInt16 lastGlyph;
UInt16 firstGlyph;
UInt16 value[1];
};
typedef struct SFNTLookupSegment SFNTLookupSegment;
struct SFNTLookupSegmentHeader {
SFNTLookupBinarySearchHeader binSearch;
SFNTLookupSegment segments[1];
};
typedef struct SFNTLookupSegmentHeader SFNTLookupSegmentHeader;
/* A format 6 lookup table maps single glyphs to lookup values. */
struct SFNTLookupSingle {
UInt16 glyph;
UInt16 value[1];
};
typedef struct SFNTLookupSingle SFNTLookupSingle;
struct SFNTLookupSingleHeader {
SFNTLookupBinarySearchHeader binSearch;
SFNTLookupSingle entries[1];
};
typedef struct SFNTLookupSingleHeader SFNTLookupSingleHeader;
/* The format-specific part of the subtable header */
union SFNTLookupFormatSpecificHeader {
SFNTLookupArrayHeader theArray;
SFNTLookupSegmentHeader segment;
SFNTLookupSingleHeader single;
SFNTLookupTrimmedArrayHeader trimmedArray;
};
typedef union SFNTLookupFormatSpecificHeader SFNTLookupFormatSpecificHeader;
/* The overall subtable header */
struct SFNTLookupTable {
SFNTLookupTableFormat format; /* table format */
SFNTLookupFormatSpecificHeader fsHeader; /* format specific header */
};
typedef struct SFNTLookupTable SFNTLookupTable;
typedef SFNTLookupTable * SFNTLookupTablePtr;
typedef SFNTLookupTablePtr * SFNTLookupTableHandle;
/* --------------------------------------------------------------------------- */
/* GENERAL FORMATS FOR STATE TABLES -- prefix "ST" */
enum {
kSTClassEndOfText = 0,
kSTClassOutOfBounds = 1,
kSTClassDeletedGlyph = 2,
kSTClassEndOfLine = 3,
kSTSetMark = 0x8000,
kSTNoAdvance = 0x4000,
kSTMarkEnd = 0x2000,
kSTLigActionMask = 0x3FFF,
kSTRearrVerbMask = 0x000F
};
typedef UInt8 STClass;
typedef UInt8 STEntryIndex;
struct STHeader {
UInt8 filler;
STClass nClasses;
UInt16 classTableOffset;
UInt16 stateArrayOffset;
UInt16 entryTableOffset;
};
typedef struct STHeader STHeader;
struct STClassTable {
UInt16 firstGlyph;
UInt16 nGlyphs;
STClass classes[1];
};
typedef struct STClassTable STClassTable;
struct STEntryZero {
UInt16 newState;
UInt16 flags;
};
typedef struct STEntryZero STEntryZero;
struct STEntryOne {
UInt16 newState;
UInt16 flags;
UInt16 offset1;
};
typedef struct STEntryOne STEntryOne;
struct STEntryTwo {
UInt16 newState;
UInt16 flags;
UInt16 offset1;
UInt16 offset2;
};
typedef struct STEntryTwo STEntryTwo;
/* --------------------------------------------------------------------------- */
/* GENERAL FORMATS FOR STATE TABLES to be used with 'morx' tables -- prefix "STX" */
enum {
kSTXHasLigAction = 0x2000
};
typedef UInt16 STXClass;
typedef UInt16 STXStateIndex;
typedef UInt16 STXEntryIndex;
struct STXHeader {
UInt32 nClasses;
UInt32 classTableOffset;
UInt32 stateArrayOffset;
UInt32 entryTableOffset;
};
typedef struct STXHeader STXHeader;
typedef SFNTLookupTable STXClassTable;
struct STXEntryZero {
STXStateIndex newState;
UInt16 flags;
};
typedef struct STXEntryZero STXEntryZero;
struct STXEntryOne {
STXStateIndex newState;
UInt16 flags;
UInt16 index1;
};
typedef struct STXEntryOne STXEntryOne;
struct STXEntryTwo {
STXStateIndex newState;
UInt16 flags;
UInt16 index1;
UInt16 index2;
};
typedef struct STXEntryTwo STXEntryTwo;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'lcar' */
/* CONSTANTS */
enum {
kLCARTag = 0x6C636172, /* 'lcar' */
kLCARCurrentVersion = 0x00010000, /* current version number for 'lcar' table */
kLCARLinearFormat = 0,
kLCARCtlPointFormat = 1
};
/* TYPES */
struct LcarCaretClassEntry {
UInt16 count;
UInt16 partials[1]; /* these are either FUnits or control-point numbers */
};
typedef struct LcarCaretClassEntry LcarCaretClassEntry;
struct LcarCaretTable {
Fixed version;
UInt16 format;
SFNTLookupTable lookup;
};
typedef struct LcarCaretTable LcarCaretTable;
typedef LcarCaretTable * LcarCaretTablePtr;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'just' */
/* CONSTANTS */
enum {
kJUSTTag = 0x6A757374, /* 'just' */
kJUSTCurrentVersion = 0x00010000,
kJUSTStandardFormat = 0,
kJUSTnoGlyphcode = 0xFFFF, /* used in a pcConditionalAddAction */
kJUSTpcDecompositionAction = 0,
kJUSTpcUnconditionalAddAction = 1,
kJUSTpcConditionalAddAction = 2,
kJUSTpcGlyphStretchAction = 3,
kJUSTpcDuctilityAction = 4,
kJUSTpcGlyphRepeatAddAction = 5
};
/* Justification priority levels */
enum {
kJUSTKashidaPriority = 0,
kJUSTSpacePriority = 1,
kJUSTLetterPriority = 2,
kJUSTNullPriority = 3,
kJUSTPriorityCount = 4
};
/* Justification flags */
enum {
kJUSTOverridePriority = 0x8000,
kJUSTOverrideLimits = 0x4000,
kJUSTOverrideUnlimited = 0x2000,
kJUSTUnlimited = 0x1000,
kJUSTPriorityMask = 0x0003
};
/* TYPES */
typedef UInt16 JustPCActionType;
typedef UInt16 JustificationFlags;
/* A JustPCDecompositionAction defines a ligature decomposition action. */
struct JustPCDecompositionAction {
Fixed lowerLimit;
Fixed upperLimit;
UInt16 order;
UInt16 count;
UInt16 glyphs[1];
};
typedef struct JustPCDecompositionAction JustPCDecompositionAction;
/* A JUSTPCUnconditionalAddAction defines an unconditional glyph add action. */
typedef UInt16 JustPCUnconditionalAddAction;
/*
A JUSTPCConditionalAddAction defines a glyph substitution and add action. If the addGlyph
is equal to kJUSTnoGlyphcode, then no glyph will be added, and the justification for
the line will be redone.
*/
struct JustPCConditionalAddAction {
Fixed substThreshhold; /* threshhold of growth factor at which subst occurs */
UInt16 addGlyph;
UInt16 substGlyph;
};
typedef struct JustPCConditionalAddAction JustPCConditionalAddAction;
/* A PCDuctilityAction defines a ductile axis along which the glyph will be varied. */
struct JustPCDuctilityAction {
UInt32 ductilityAxis;
Fixed minimumLimit;
Fixed noStretchValue;
Fixed maximumLimit;
};
typedef struct JustPCDuctilityAction JustPCDuctilityAction;
/*
A PCGlyphRepetitionAction defines a glyph which will not be stretched or otherwise
transformed, but rather which will be emplaced however many times are needed to fill
the needed gap.
*/
struct JustPCGlyphRepeatAddAction {
UInt16 flags;
UInt16 glyph;
};
typedef struct JustPCGlyphRepeatAddAction JustPCGlyphRepeatAddAction;
/* PCActionSubrecords contain the actual postcompensation actions. */
struct JustPCActionSubrecord {
UInt16 theClass; /* justification class value associated with this rec */
JustPCActionType theType;
UInt32 length;
UInt32 data; /* not really a UInt32; cast as ptr to appropriate action */
};
typedef struct JustPCActionSubrecord JustPCActionSubrecord;
/* The set of postcompensation records is defined in a PCAction struct. */
struct JustPCAction {
UInt32 actionCount; /* long for alignment purposes */
JustPCActionSubrecord actions[1];
};
typedef struct JustPCAction JustPCAction;
/*
JustWidthDeltaEntry is the justification table entry structure. The justClass value (which is
actually limited to 7 bits by the state table structure) is defined as a long for PPC alignment reasons.
*/
struct JustWidthDeltaEntry {
UInt32 justClass;
Fixed beforeGrowLimit; /* ems AW can grow by at most on LT */
Fixed beforeShrinkLimit; /* ems AW can shrink by at most on LT */
Fixed afterGrowLimit; /* ems AW can grow by at most on RB */
Fixed afterShrinkLimit; /* ems AW can shrink by at most on RB */
JustificationFlags growFlags; /* flags controlling grow case */
JustificationFlags shrinkFlags; /* flags controlling shrink case */
};
typedef struct JustWidthDeltaEntry JustWidthDeltaEntry;
struct JustWidthDeltaGroup {
UInt32 count;
JustWidthDeltaEntry entries[1];
};
typedef struct JustWidthDeltaGroup JustWidthDeltaGroup;
/* Overall structure of a postcompensation table is defined in PostcompTable. */
struct JustPostcompTable {
SFNTLookupTable lookupTable;
/* action records here */
};
typedef struct JustPostcompTable JustPostcompTable;
struct JustDirectionTable {
UInt16 justClass; /* offset to state table (0=none) */
UInt16 widthDeltaClusters; /* offset to clusters */
UInt16 postcomp; /* offset to postcomp table (0=none) */
SFNTLookupTable lookup;
};
typedef struct JustDirectionTable JustDirectionTable;
struct JustTable {
Fixed version;
UInt16 format;
UInt16 horizHeaderOffset;
UInt16 vertHeaderOffset;
};
typedef struct JustTable JustTable;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'opbd' */
/* CONSTANTS */
enum {
kOPBDTag = 0x6F706264, /* 'opbd' */
kOPBDCurrentVersion = 0x00010000,
kOPBDDistanceFormat = 0,
kOPBDControlPointFormat = 1
};
/* TYPES */
typedef UInt16 OpbdTableFormat;
/*
The OpbdSideValues struct is the lookup result from the FindSingle call for the
optical tables. It contains the 4 FUnit values that are relevant to the specified
glyph, or the 4 control gxPoint values.
*/
struct OpbdSideValues {
SInt16 leftSideShift;
SInt16 topSideShift;
SInt16 rightSideShift;
SInt16 bottomSideShift;
};
typedef struct OpbdSideValues OpbdSideValues;
struct OpbdTable {
Fixed version;
OpbdTableFormat format;
SFNTLookupTable lookupTable;
};
typedef struct OpbdTable OpbdTable;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'mort' */
/* CONSTANTS */
enum {
kMORTTag = 0x6D6F7274, /* 'mort' */
kMORTCurrentVersion = 0x00010000, /* current version number for 'mort' table */
/* Coverage masks */
kMORTCoverVertical = 0x8000,
kMORTCoverDescending = 0x4000,
kMORTCoverIgnoreVertical = 0x2000,
kMORTCoverTypeMask = 0x000F, /* Subtable types */
kMORTRearrangementType = 0,
kMORTContextualType = 1,
kMORTLigatureType = 2,
kMORTSwashType = 4,
kMORTInsertionType = 5, /* Ligature subtable constants */
kMORTLigLastAction = (long)0x80000000,
kMORTLigStoreLigature = 0x40000000,
kMORTLigFormOffsetMask = 0x3FFFFFFF,
kMORTLigFormOffsetShift = 2, /* Rearrangement subtable actions */
kMORTraNoAction = 0, /* no action */
kMORTraxA = 1, /* Ax => xA */
kMORTraDx = 2, /* xD => Dx */
kMORTraDxA = 3, /* AxD => DxA */
kMORTraxAB = 4, /* ABx => xAB */
kMORTraxBA = 5, /* ABx => xBA */
kMORTraCDx = 6, /* xCD => CDx */
kMORTraDCx = 7, /* xCD => DCx */
kMORTraCDxA = 8, /* AxCD => CDxA */
kMORTraDCxA = 9, /* AxCD => DCxA */
kMORTraDxAB = 10, /* ABxD => DxAB */
kMORTraDxBA = 11, /* ABxD => DxBA */
kMORTraCDxAB = 12, /* ABxCD => CDxAB */
kMORTraCDxBA = 13, /* ABxCD => CDxBA */
kMORTraDCxAB = 14, /* ABxCD => DCxAB */
kMORTraDCxBA = 15, /* ABxCD => DCxBA */
/* Insertion subtable constants */
kMORTDoInsertionsBefore = 0x80,
kMORTIsSplitVowelPiece = 0x40,
kMORTInsertionsCountMask = 0x3F,
kMORTCurrInsertKashidaLike = 0x2000,
kMORTMarkInsertKashidaLike = 0x1000,
kMORTCurrInsertBefore = 0x0800,
kMORTMarkInsertBefore = 0x0400,
kMORTMarkJustTableCountMask = 0x3F80,
kMORTMarkJustTableCountShift = 7, /* JustTableIndex for marked character */
kMORTCurrJustTableCountMask = 0x007F,
kMORTCurrJustTableCountShift = 0, /* JustTableIndex for current character */
kMORTCurrInsertCountMask = 0x03E0,
kMORTCurrInsertCountShift = 5, /* count to insert after current glyphRec */
kMORTMarkInsertCountMask = 0x001F,
kMORTMarkInsertCountShift = 0 /* count to insert after marked glyphRec */
};
/* TYPES */
typedef UInt32 MortSubtableMaskFlags;
typedef UInt32 MortLigatureActionEntry;
struct MortRearrangementSubtable {
STHeader header;
};
typedef struct MortRearrangementSubtable MortRearrangementSubtable;
struct MortContextualSubtable {
STHeader header;
UInt16 substitutionTableOffset;
};
typedef struct MortContextualSubtable MortContextualSubtable;
struct MortLigatureSubtable {
STHeader header;
UInt16 ligatureActionTableOffset;
UInt16 componentTableOffset;
UInt16 ligatureTableOffset;
};
typedef struct MortLigatureSubtable MortLigatureSubtable;
struct MortSwashSubtable {
SFNTLookupTable lookup;
};
typedef struct MortSwashSubtable MortSwashSubtable;
struct MortInsertionSubtable {
STHeader header;
};
typedef struct MortInsertionSubtable MortInsertionSubtable;
union MortSpecificSubtable {
MortRearrangementSubtable rearrangement;
MortContextualSubtable contextual;
MortLigatureSubtable ligature;
MortSwashSubtable swash;
MortInsertionSubtable insertion;
};
typedef union MortSpecificSubtable MortSpecificSubtable;
struct MortSubtable {
UInt16 length;
UInt16 coverage;
MortSubtableMaskFlags flags;
MortSpecificSubtable u;
};
typedef struct MortSubtable MortSubtable;
struct MortFeatureEntry {
UInt16 featureType;
UInt16 featureSelector;
MortSubtableMaskFlags enableFlags;
MortSubtableMaskFlags disableFlags;
};
typedef struct MortFeatureEntry MortFeatureEntry;
struct MortChain {
MortSubtableMaskFlags defaultFlags; /* default flags for this chain */
UInt32 length; /* byte length of this chain */
UInt16 nFeatures; /* number of feature entries */
UInt16 nSubtables; /* number of subtables */
MortFeatureEntry featureEntries[1];
/* the subtables follow */
};
typedef struct MortChain MortChain;
struct MortTable {
Fixed version;
UInt32 nChains;
MortChain chains[1];
};
typedef struct MortTable MortTable;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'morx' (version 2 and beyond metamorphosis tables) */
/* CONSTANTS */
enum {
kMORXTag = 0x6D6F7278, /* 'morx' */
kMORXCurrentVersion = 0x00020000, /* version number for current 'morx' table */
/* Coverage masks */
kMORXCoverVertical = (long)0x80000000,
kMORXCoverDescending = 0x40000000,
kMORXCoverIgnoreVertical = 0x20000000,
kMORXCoverTypeMask = 0x000000FF
};
/* TYPES */
struct MorxRearrangementSubtable {
STXHeader header;
};
typedef struct MorxRearrangementSubtable MorxRearrangementSubtable;
struct MorxContextualSubtable {
STXHeader header;
UInt32 substitutionTableOffset;
};
typedef struct MorxContextualSubtable MorxContextualSubtable;
struct MorxLigatureSubtable {
STXHeader header;
UInt32 ligatureActionTableOffset;
UInt32 componentTableOffset;
UInt32 ligatureTableOffset;
};
typedef struct MorxLigatureSubtable MorxLigatureSubtable;
struct MorxInsertionSubtable {
STXHeader header;
UInt32 insertionGlyphTableOffset;
};
typedef struct MorxInsertionSubtable MorxInsertionSubtable;
union MorxSpecificSubtable {
MorxRearrangementSubtable rearrangement;
MorxContextualSubtable contextual;
MorxLigatureSubtable ligature;
MortSwashSubtable swash;
MorxInsertionSubtable insertion;
};
typedef union MorxSpecificSubtable MorxSpecificSubtable;
struct MorxSubtable {
UInt32 length;
UInt32 coverage;
MortSubtableMaskFlags flags;
MorxSpecificSubtable u;
};
typedef struct MorxSubtable MorxSubtable;
struct MorxChain {
MortSubtableMaskFlags defaultFlags; /* default flags for this chain */
UInt32 length; /* byte length of this chain */
UInt32 nFeatures; /* number of feature entries */
UInt32 nSubtables; /* number of subtables */
MortFeatureEntry featureEntries[1];
/* the subtables follow */
};
typedef struct MorxChain MorxChain;
struct MorxTable {
Fixed version;
UInt32 nChains;
MorxChain chains[1];
};
typedef struct MorxTable MorxTable;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'prop' */
/* CONSTANTS */
enum {
kPROPTag = 0x70726F70, /* 'prop' */
kPROPCurrentVersion = 0x00030000, /* current version number for 'prop' table */
kPROPPairOffsetShift = 8,
kPROPPairOffsetSign = 7,
kPROPIsFloaterMask = 0x8000, /* glyph is floater */
kPROPCanHangLTMask = 0x4000, /* glyph can hang left/top */
kPROPCanHangRBMask = 0x2000, /* glyph can hang right/bottom */
kPROPUseRLPairMask = 0x1000, /* if glyph lands in RL streak, use paired glyph */
kPROPPairOffsetMask = 0x0F00, /* 4-bit signed offset to other pair member */
kPROPRightConnectMask = 0x0080, /* glyph connects to glyph on right */
kPROPZeroReserved = 0x0060, /* must be zero */
kPROPDirectionMask = 0x001F /* direction bits */
};
/* These are the Unicode direction classes (plus the Special European Number class). */
enum {
kPROPLDirectionClass = 0, /* Left-to-Right */
kPROPRDirectionClass = 1, /* Right-to-Left */
kPROPALDirectionClass = 2, /* Right-to-Left Arabic Letter */
kPROPENDirectionClass = 3, /* European Number */
kPROPESDirectionClass = 4, /* European Number Seperator */
kPROPETDirectionClass = 5, /* European Number Terminator */
kPROPANDirectionClass = 6, /* Arabic Number */
kPROPCSDirectionClass = 7, /* Common Number Seperator */
kPROPPSDirectionClass = 8, /* Paragraph Seperator (also referred to as Block Separator) */
kPROPSDirectionClass = 9, /* Segment Seperator */
kPROPWSDirectionClass = 10, /* Whitespace */
kPROPONDirectionClass = 11, /* Other Neutral */
kPROPSENDirectionClass = 12, /* Special European Number (not a Unicode class) */
kPROPLREDirectionClass = 13, /* Left-to-Right Embeding */
kPROPLRODirectionClass = 14, /* Left-to-Right Override */
kPROPRLEDirectionClass = 15, /* Right-to-Left Embeding */
kPROPRLODirectionClass = 16, /* Right-to-Left Override */
kPROPPDFDirectionClass = 17, /* Pop Directional Format */
kPROPNSMDirectionClass = 18, /* Non-Spacing Mark */
kPROPBNDirectionClass = 19, /* Boundary Neutral */
kPROPNumDirectionClasses = 20 /* Number of Unicode directional types + Special European Number */
};
/* TYPES */
typedef UInt16 PropCharProperties;
struct PropTable {
Fixed version;
UInt16 format;
PropCharProperties defaultProps;
SFNTLookupTable lookup;
};
typedef struct PropTable PropTable;
struct PropLookupSegment {
UInt16 lastGlyph;
UInt16 firstGlyph;
UInt16 value;
};
typedef struct PropLookupSegment PropLookupSegment;
struct PropLookupSingle {
UInt16 glyph;
PropCharProperties props;
};
typedef struct PropLookupSingle PropLookupSingle;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'trak' */
/* CONSTANTS */
enum {
kTRAKTag = 0x7472616B, /* 'trak' */
kTRAKCurrentVersion = 0x00010000, /* current version number for 'trak' table */
kTRAKUniformFormat = 0 /* kTRAKPerGlyphFormat = 2*/
};
/* TYPES */
typedef SInt16 TrakValue;
struct TrakTableEntry {
Fixed track;
UInt16 nameTableIndex;
UInt16 sizesOffset; /* offset to array of TrackingValues */
};
typedef struct TrakTableEntry TrakTableEntry;
struct TrakTableData {
UInt16 nTracks;
UInt16 nSizes;
UInt32 sizeTableOffset;
TrakTableEntry trakTable[1];
};
typedef struct TrakTableData TrakTableData;
struct TrakTable {
Fixed version;
UInt16 format;
UInt16 horizOffset;
UInt16 vertOffset;
};
typedef struct TrakTable TrakTable;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'kern' */
/* CONSTANTS */
enum {
kKERNTag = 0x6B65726E, /* 'kern' */
kKERNCurrentVersion = 0x00010000,
kKERNVertical = 0x8000, /* set if this table has vertical kerning information */
kKERNResetCrossStream = 0x8000, /* this value in a cross-stream table means reset to zero */
kKERNCrossStream = 0x4000, /* set if this table contains cross-stream kerning values */
kKERNVariation = 0x2000, /* set if this table contains variation kerning values */
kKERNUnusedBits = 0x1F00, /* UNUSED, MUST BE ZERO */
kKERNFormatMask = 0x00FF /* format of this subtable */
};
enum {
kKERNOrderedList = 0, /* ordered list of kerning pairs */
kKERNStateTable = 1, /* state table for n-way contextual kerning */
kKERNSimpleArray = 2, /* simple n X m array of kerning values */
kKERNIndexArray = 3 /* modifed version of SimpleArray */
};
/* Message Type Flags */
enum {
kKERNLineStart = 0x00000001, /* Array of glyphs starts a line */
kKERNLineEndKerning = 0x00000002, /* Array of glyphs ends a line */
kKERNNoCrossKerning = 0x00000004, /* Prohibit cross kerning */
kKERNNotesRequested = 0x00000008, /* Caller wants kerning notes */
kKERNNoStakeNote = 1, /* Indicates a glyph was involved in a kerning pair/group */
kKERNCrossStreamResetNote = 2, /* Indicates a return-to-baseline in cross-stream kerning */
kKERNNotApplied = 0x00000001 /* All kerning values were zero, kerning call had no effect */
};
/* TYPES */
typedef UInt8 KernTableFormat;
typedef UInt16 KernSubtableInfo;
typedef SInt16 KernKerningValue;
typedef UInt16 KernArrayOffset;
/* header for version 0 kerning table */
struct KernVersion0Header {
UInt16 version; /* font version number (will be 0!) */
UInt16 nTables; /* number of subtables present */
UInt16 firstSubtable[1]; /* first subtable starts here */
};
typedef struct KernVersion0Header KernVersion0Header;
/* Header for a kerning table */
struct KernTableHeader {
Fixed version; /* font version number (currently 1.0) */
SInt32 nTables; /* number of subtables present */
UInt16 firstSubtable[1]; /* first subtable starts here */
};
typedef struct KernTableHeader KernTableHeader;
typedef KernTableHeader * KernTableHeaderPtr;
typedef KernTableHeaderPtr * KernTableHeaderHandle;
/*
F O R M A T S P E C I F I C D E F I N I T I O N S
kernOrderedList:
The table is a sorted list of [left glyph, right glyph, value] triples.
There's enough information in the header so that the list can be
efficiently binary searched.
*/
/* defines a single kerning pair of Glyphcodes */
struct KernKerningPair {
UInt16 left;
UInt16 right;
};
typedef struct KernKerningPair KernKerningPair;
/* a single list entry */
struct KernOrderedListEntry {
KernKerningPair pair; /* the kerning pair */
KernKerningValue value; /* the kerning value for the above pair */
};
typedef struct KernOrderedListEntry KernOrderedListEntry;
typedef KernOrderedListEntry * KernOrderedListEntryPtr;
/* the header information for binary searching the list */
struct KernOrderedListHeader {
UInt16 nPairs; /* number of kerning pairs in table */
UInt16 searchRange; /* (largest power of two <= nPairs) * entry size */
UInt16 entrySelector; /* log2 (largest power of two <= nPairs) */
UInt16 rangeShift; /* (nPairs - largest power of two <= nPairs) * entry size */
UInt16 table[1]; /* entries are first glyph, second glyph, and value */
};
typedef struct KernOrderedListHeader KernOrderedListHeader;
/* KernStateTable: like the the generic state tables */
struct KernStateHeader {
STHeader header; /* state table header */
UInt16 valueTable; /* offset to kerning value table */
UInt8 firstTable[1]; /* first table starts here */
};
typedef struct KernStateHeader KernStateHeader;
struct KernStateEntry {
UInt16 newState;
UInt16 flags; /* flags per above enum */
};
typedef struct KernStateEntry KernStateEntry;
/*
Kern offset table header.
The offset table is a trimmed array from firstGlyph to limitGlyph.
Glyphs outside of this range should get zero for right-hand glyphs
and the offset of the beginning of the kerning array for left-hand glyphs.
*/
struct KernOffsetTable {
UInt16 firstGlyph; /* first glyph in class range */
UInt16 nGlyphs; /* number of glyphs in class range */
KernArrayOffset offsetTable[1]; /* offset table starts here */
};
typedef struct KernOffsetTable KernOffsetTable;
typedef KernOffsetTable * KernOffsetTablePtr;
/* Header information for accessing offset tables and kerning array */
/*
KernSimpleArray:
The array is an nXm array of kenring values. Each row in the array
represents one left-hand glyph, and each column one right-hand glyph.
The zeroth row and column always represent glyphs that are out of bounds
and will always contain zero.
A pair is looked up by indexing the left-hand glyph through the left
offset table, the right-hand glyph through the right offset table,
adding both offsets to the starting address of the kerning array,
and fetching the kerning value pointed to.
*/
/* Kern offset table header. */
/* The offset table is a trimmed array from firstGlyph to limitGlyph. */
/* Glyphs outside of this range should get zero for right-hand glyphs */
/* and the offset of the beginning of the kerning array for left- */
/* hand glyphs. */
struct KernSimpleArrayHeader {
UInt16 rowWidth; /* width, in bytes, of a row in the table */
UInt16 leftOffsetTable; /* offset to left-hand offset table */
UInt16 rightOffsetTable; /* offset to right-hand offset table */
KernArrayOffset theArray; /* offset to start of kerning array */
UInt16 firstTable[1]; /* first offset table starts here... */
};
typedef struct KernSimpleArrayHeader KernSimpleArrayHeader;
/* Index Array */
struct KernIndexArrayHeader {
UInt16 glyphCount;
UInt8 kernValueCount;
UInt8 leftClassCount;
UInt8 rightClassCount;
UInt8 flags; /* set to 0 for now */
SInt16 kernValue[1]; /* actual kerning values reference by index in kernIndex */
UInt8 leftClass[1]; /* maps left glyph to offset into kern index */
UInt8 rightClass[1]; /* maps right glyph to offset into kern index */
UInt8 kernIndex[1]; /* contains indicies into kernValue */
};
typedef struct KernIndexArrayHeader KernIndexArrayHeader;
/* format specific part of subtable header */
union KernFormatSpecificHeader {
KernOrderedListHeader orderedList;
KernStateHeader stateTable;
KernSimpleArrayHeader simpleArray;
KernIndexArrayHeader indexArray;
};
typedef union KernFormatSpecificHeader KernFormatSpecificHeader;
/* version 0 subtable header */
struct KernVersion0SubtableHeader {
UInt16 version; /* kerning table version number */
UInt16 length; /* length in bytes (including this header) */
KernSubtableInfo stInfo; /* sub-table info */
KernFormatSpecificHeader fsHeader; /* format specific sub-header */
};
typedef struct KernVersion0SubtableHeader KernVersion0SubtableHeader;
/* Overall Subtable header format */
struct KernSubtableHeader {
SInt32 length; /* length in bytes (including this header) */
KernSubtableInfo stInfo; /* subtable info */
SInt16 tupleIndex; /* tuple index for variation subtables */
KernFormatSpecificHeader fsHeader; /* format specific sub-header */
};
typedef struct KernSubtableHeader KernSubtableHeader;
typedef KernSubtableHeader * KernSubtableHeaderPtr;
/* --------------------------------------------------------------------------- */
/* FORMATS FOR TABLE: 'bsln' */
/* CONSTANTS */
enum {
kBSLNTag = 0x62736C6E, /* 'bsln' */
kBSLNCurrentVersion = 0x00010000, /* current version number for 'bsln' table */
kBSLNDistanceFormatNoMap = 0,
kBSLNDistanceFormatWithMap = 1,
kBSLNControlPointFormatNoMap = 2,
kBSLNControlPointFormatWithMap = 3
};
/* Baseline classes and constants */
enum {
kBSLNRomanBaseline = 0,
kBSLNIdeographicCenterBaseline = 1,
kBSLNIdeographicLowBaseline = 2,
kBSLNHangingBaseline = 3,
kBSLNMathBaseline = 4,
kBSLNLastBaseline = 31,
kBSLNNumBaselineClasses = kBSLNLastBaseline + 1,
kBSLNNoBaselineOverride = 255
};
/* TYPES */
typedef UInt32 BslnBaselineClass;
/* The BslnBaselineRecord array defines the baseline deltas for the line. */
typedef Fixed BslnBaselineRecord[32];
/*
BslnFormat0Part is the format-specific data for a distance table with no mapping (i.e.
all the glyphs belong to the defaultBaseline).
*/
struct BslnFormat0Part {
SInt16 deltas[32];
};
typedef struct BslnFormat0Part BslnFormat0Part;
/* BslnFormat1Part is the format-specific data for a distance table with a gxMapping. */
struct BslnFormat1Part {
SInt16 deltas[32];
SFNTLookupTable mappingData;
};
typedef struct BslnFormat1Part BslnFormat1Part;
/*
BslnFormat2Part is the format-specific data for a control-point table with no
mapping (i.e. all the glyphs belong to the defaultBaseline). It specifies a single
glyph to use and the set of control points in that glyph that designate each of
the baselines.
*/
struct BslnFormat2Part {
UInt16 stdGlyph;
SInt16 ctlPoints[32];
};
typedef struct BslnFormat2Part BslnFormat2Part;
/*
BslnFormat3Part is the format-specific data for a distance table with a mapping. Like
format 2, it contains a single glyph and its set of control-point values for each
of the baselines.
*/
struct BslnFormat3Part {
UInt16 stdGlyph;
SInt16 ctlPoints[32];
SFNTLookupTable mappingData;
};
typedef struct BslnFormat3Part BslnFormat3Part;
/* The BslnFormatUnion is a union containing the format-specific parts of the baseline table. */
union BslnFormatUnion {
BslnFormat0Part fmt0Part;
BslnFormat1Part fmt1Part;
BslnFormat2Part fmt2Part;
BslnFormat3Part fmt3Part;
};
typedef union BslnFormatUnion BslnFormatUnion;
/* The table format used in BaselineTable */
typedef UInt16 BslnTableFormat;
/* BaselineTable defines the top-level format of the baseline table in the font. */
struct BslnTable {
Fixed version;
BslnTableFormat format;
UInt16 defaultBaseline;
BslnFormatUnion parts;
};
typedef struct BslnTable BslnTable;
typedef BslnTable * BslnTablePtr;
/* --------------------------------------------------------------------------- */
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#endif /* __SFNTLAYOUTTYPES__ */
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>VSTGUI: CFileExtension Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxydocu.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>CFileExtension Class Reference</h1><!-- doxytag: class="CFileExtension" --><!-- doxytag: inherits="CBaseObject" -->
<p>file extension description
<a href="#_details">More...</a></p>
<p><code>#include <cfileselector.h></code></p>
<p><a href="class_c_file_extension-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a82ad1d2467b3cada2ad3e60760201d08">CFileExtension</a> (const char *<a class="el" href="class_c_file_extension.html#a8444d6e0dfe2bbab0b5e7b24308f1559">description</a>, const char *<a class="el" href="class_c_file_extension.html#a84bf1fb20854625843d173ca370a6f91">extension</a>, const char *<a class="el" href="class_c_file_extension.html#a601a3f862806cfe363e774594ef28bfe">mimeType</a>=0, int <a class="el" href="class_c_file_extension.html#ae420482072c5abe9844a5552886e7107">macType</a>=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a7060e6cf2650cf7cca4151b8eb0fa884">CFileExtension</a> (const <a class="el" href="class_c_file_extension.html">CFileExtension</a> &ext)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a9786a248d13d8f466332b3397db4a20d">~CFileExtension</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a75a561fea2eb253bec2f2d45a53e6bf2">getDescription</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#ad1f9205ddf7a7da6aa5f653cd11b86cb">getExtension</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a9e4b12ddfc9afd9b82b1dbce916ea665">getMimeType</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#aab0974b698118961536a3dc03e1055b8">getMacType</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a3e7a70079acd9cc71ef1795a211b28cb">operator==</a> (const <a class="el" href="class_c_file_extension.html">CFileExtension</a> &ext) const </td></tr>
<tr><td colspan="2"><div class="groupHeader">Reference Counting Methods</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpedfd2603e45787e0f5180f3f75cb23db"></a> </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_base_object.html#ad63e28fbe95a3458c97c60bfacd47ab8">forget</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">decrease refcount and delete object if refcount == 0 <a href="#ad63e28fbe95a3458c97c60bfacd47ab8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_base_object.html#ada0719d1daaca4af1795018001769311">remember</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">increase refcount <a href="#ada0719d1daaca4af1795018001769311"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_base_object.html#a7baf9c801f9691fb887f3e4473b89761">getNbReference</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">get refcount <a href="#a7baf9c801f9691fb887f3e4473b89761"></a><br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">Message Methods</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrp84a4b7ed6226b9142fbae63958a627a5"></a> </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="vstgui_8h.html#a2c1cd94c80c1fa6feeb2d29e8116caa7">CMessageResult</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_base_object.html#af6f09a19ef1db7b019690590747b34e8">notify</a> (<a class="el" href="class_c_base_object.html">CBaseObject</a> *sender, const char *message)</td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a466e95a851ee99905e3a2887437da571">init</a> (const char *<a class="el" href="class_c_file_extension.html#a8444d6e0dfe2bbab0b5e7b24308f1559">description</a>, const char *<a class="el" href="class_c_file_extension.html#a84bf1fb20854625843d173ca370a6f91">extension</a>, const char *<a class="el" href="class_c_file_extension.html#a601a3f862806cfe363e774594ef28bfe">mimeType</a>)</td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a8444d6e0dfe2bbab0b5e7b24308f1559">description</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a84bf1fb20854625843d173ca370a6f91">extension</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#a601a3f862806cfe363e774594ef28bfe">mimeType</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_file_extension.html#ae420482072c5abe9844a5552886e7107">macType</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>file extension description </p>
<hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="a82ad1d2467b3cada2ad3e60760201d08"></a><!-- doxytag: member="CFileExtension::CFileExtension" ref="a82ad1d2467b3cada2ad3e60760201d08" args="(const char *description, const char *extension, const char *mimeType=0, int macType=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_c_file_extension.html">CFileExtension</a> </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>description</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>extension</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>mimeType</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>macType</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a7060e6cf2650cf7cca4151b8eb0fa884"></a><!-- doxytag: member="CFileExtension::CFileExtension" ref="a7060e6cf2650cf7cca4151b8eb0fa884" args="(const CFileExtension &ext)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_c_file_extension.html">CFileExtension</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_c_file_extension.html">CFileExtension</a> & </td>
<td class="paramname"> <em>ext</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a9786a248d13d8f466332b3397db4a20d"></a><!-- doxytag: member="CFileExtension::~CFileExtension" ref="a9786a248d13d8f466332b3397db4a20d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">~<a class="el" href="class_c_file_extension.html">CFileExtension</a> </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a75a561fea2eb253bec2f2d45a53e6bf2"></a><!-- doxytag: member="CFileExtension::getDescription" ref="a75a561fea2eb253bec2f2d45a53e6bf2" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* getDescription </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ad1f9205ddf7a7da6aa5f653cd11b86cb"></a><!-- doxytag: member="CFileExtension::getExtension" ref="ad1f9205ddf7a7da6aa5f653cd11b86cb" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* getExtension </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a9e4b12ddfc9afd9b82b1dbce916ea665"></a><!-- doxytag: member="CFileExtension::getMimeType" ref="a9e4b12ddfc9afd9b82b1dbce916ea665" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* getMimeType </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="aab0974b698118961536a3dc03e1055b8"></a><!-- doxytag: member="CFileExtension::getMacType" ref="aab0974b698118961536a3dc03e1055b8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int getMacType </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a3e7a70079acd9cc71ef1795a211b28cb"></a><!-- doxytag: member="CFileExtension::operator==" ref="a3e7a70079acd9cc71ef1795a211b28cb" args="(const CFileExtension &ext) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool operator== </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_c_file_extension.html">CFileExtension</a> & </td>
<td class="paramname"> <em>ext</em></td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a466e95a851ee99905e3a2887437da571"></a><!-- doxytag: member="CFileExtension::init" ref="a466e95a851ee99905e3a2887437da571" args="(const char *description, const char *extension, const char *mimeType)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void init </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>description</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>extension</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>mimeType</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ad63e28fbe95a3458c97c60bfacd47ab8"></a><!-- doxytag: member="CFileExtension::forget" ref="ad63e28fbe95a3458c97c60bfacd47ab8" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void forget </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [inline, virtual, inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>decrease refcount and delete object if refcount == 0 </p>
<p>Reimplemented in <a class="el" href="class_c_draw_context.html#aa78336379db86549f01190aa3dae09a1">CDrawContext</a>.</p>
</div>
</div>
<a class="anchor" id="ada0719d1daaca4af1795018001769311"></a><!-- doxytag: member="CFileExtension::remember" ref="ada0719d1daaca4af1795018001769311" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void remember </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td><code> [inline, virtual, inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>increase refcount </p>
</div>
</div>
<a class="anchor" id="a7baf9c801f9691fb887f3e4473b89761"></a><!-- doxytag: member="CFileExtension::getNbReference" ref="a7baf9c801f9691fb887f3e4473b89761" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long getNbReference </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td> const<code> [inline, inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>get refcount </p>
</div>
</div>
<a class="anchor" id="af6f09a19ef1db7b019690590747b34e8"></a><!-- doxytag: member="CFileExtension::notify" ref="af6f09a19ef1db7b019690590747b34e8" args="(CBaseObject *sender, const char *message)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="vstgui_8h.html#a2c1cd94c80c1fa6feeb2d29e8116caa7">CMessageResult</a> notify </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_c_base_object.html">CBaseObject</a> * </td>
<td class="paramname"> <em>sender</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>message</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline, virtual, inherited]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reimplemented in <a class="el" href="class_c_data_browser.html#a995cf6e41cb91dff28a59638c9814ae1">CDataBrowser</a>, <a class="el" href="class_c_scrollbar.html#a995cf6e41cb91dff28a59638c9814ae1">CScrollbar</a>, <a class="el" href="class_c_tooltip_support.html#af3f8320730913edf80f42a4b67c79b6c">CTooltipSupport</a>, <a class="el" href="class_c_view.html#a995cf6e41cb91dff28a59638c9814ae1">CView</a>, and <a class="el" href="class_c_view_container.html#a995cf6e41cb91dff28a59638c9814ae1">CViewContainer</a>.</p>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a8444d6e0dfe2bbab0b5e7b24308f1559"></a><!-- doxytag: member="CFileExtension::description" ref="a8444d6e0dfe2bbab0b5e7b24308f1559" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="class_c_file_extension.html#a8444d6e0dfe2bbab0b5e7b24308f1559">description</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a84bf1fb20854625843d173ca370a6f91"></a><!-- doxytag: member="CFileExtension::extension" ref="a84bf1fb20854625843d173ca370a6f91" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="class_c_file_extension.html#a84bf1fb20854625843d173ca370a6f91">extension</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a601a3f862806cfe363e774594ef28bfe"></a><!-- doxytag: member="CFileExtension::mimeType" ref="a601a3f862806cfe363e774594ef28bfe" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="class_c_file_extension.html#a601a3f862806cfe363e774594ef28bfe">mimeType</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ae420482072c5abe9844a5552886e7107"></a><!-- doxytag: member="CFileExtension::macType" ref="ae420482072c5abe9844a5552886e7107" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="class_c_file_extension.html#ae420482072c5abe9844a5552886e7107">macType</a><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="cfileselector_8h.html">cfileselector.h</a></li>
<li><a class="el" href="cfileselector_8cpp.html">cfileselector.cpp</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Apr 9 10:19:32 2010 for VSTGUI by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
| {
"pile_set_name": "Github"
} |
Imports Access = NetOffice.AccessApi
Imports NetOffice.AccessApi.Enums
Imports NetOffice.AccessApi.Constants
Imports DAO = NetOffice.DAOApi
Imports NetOffice.DAOApi.Enums
Imports NetOffice.DAOApi.Constants
Public Class Example04
Implements IExample
Dim _hostApplication As ExampleBase.IHost
#Region "IExample Member"
Public Sub RunExample() Implements ExampleBase.IExample.RunExample
' its an example with an own visual control
' checkout ShowDatabaseInfo
End Sub
Public ReadOnly Property Caption As String Implements ExampleBase.IExample.Caption
Get
Return "Example04"
End Get
End Property
Public ReadOnly Property Description As String Implements ExampleBase.IExample.Description
Get
Return "Database informations"
End Get
End Property
Public Sub Connect(ByVal hostApplication As ExampleBase.IHost) Implements ExampleBase.IExample.Connect
_hostApplication = hostApplication
End Sub
Public ReadOnly Property Panel As System.Windows.Forms.UserControl Implements ExampleBase.IExample.Panel
Get
Return Nothing
End Get
End Property
#End Region
#Region "UI Trigger"
Private Sub buttonSelectDatabase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonSelectDatabase.Click
Dim ofd As New OpenFileDialog()
ofd.Filter = "(*.mdb)|*.mdb|(*.accdb)|.accdb"
If (DialogResult.OK = ofd.ShowDialog(Me)) Then
textBoxFilePath.Text = ofd.FileName
treeViewInfo.Nodes.Clear()
ShowDatabaseInfo(textBoxFilePath.Text)
End If
End Sub
#End Region
#Region "Methods"
Private Sub ShowDatabaseInfo(ByVal filePath As String)
' start access
Dim accessApplication As New Access.Application()
'open database
Dim database As DAO.Database = accessApplication.DBEngine.Workspaces(0).OpenDatabase(filePath)
Dim tnTableDefs As TreeNode = treeViewInfo.Nodes.Add("Tables")
For Each item As DAO.TableDef In database.TableDefs
tnTableDefs.Nodes.Add(item.Name)
Next item
Dim tnQueryDefs As TreeNode = treeViewInfo.Nodes.Add("Queries")
For Each item As DAO.QueryDef In database.QueryDefs
tnQueryDefs.Nodes.Add(item.Name)
Next item
Dim tnRelations As TreeNode = treeViewInfo.Nodes.Add("Relations")
For Each item As DAO.Relation In database.Relations
tnRelations.Nodes.Add(item.Name)
Next item
Dim tnContainers As TreeNode = treeViewInfo.Nodes.Add("Containers")
For Each item As DAO.Container In database.Containers
tnContainers.Nodes.Add(item.Name)
Next item
End Sub
#End Region
End Class
| {
"pile_set_name": "Github"
} |
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* If the argument len is not a Number, then the length property of
* the newly constructed object is set to 1 and the 0 property of
* the newly constructed object is set to len
*
* @path ch15/15.4/15.4.2/15.4.2.2/S15.4.2.2_A2.3_T4.js
* @description Checking for Number object
*/
var obj = new Number(0);
var x = new Array(obj);
//CHECK#1
if (x.length !== 1) {
$ERROR('#1: var obj = new Number(0); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#2
if (x[0] !== obj) {
$ERROR('#2: var obj = new Number(0); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}
var obj = new Number(1);
var x = new Array(obj);
//CHECK#3
if (x.length !== 1) {
$ERROR('#3: var obj = new Number(1); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#4
if (x[0] !== obj) {
$ERROR('#4: var obj = new Number(1); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}
var obj = new Number(4294967295);
var x = new Array(obj);
//CHECK#5
if (x.length !== 1) {
$ERROR('#5: var obj = new Number(4294967295); var x = new Array(obj); x.length === 1. Actual: ' + (x.length));
}
//CHECK#6
if (x[0] !== obj) {
$ERROR('#6: var obj = new Number(4294967295); var x = new Array(obj); x[0] === obj. Actual: ' + (x[0]));
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>runDestinationsByUUID</key>
<dict>
<key>19271D85-6C2A-4AB7-B0C5-AD1C09375278</key>
<dict>
<key>localComputer</key>
<dict>
<key>busSpeedInMHz</key>
<integer>100</integer>
<key>cpuCount</key>
<integer>1</integer>
<key>cpuKind</key>
<string>Intel Core i7</string>
<key>cpuSpeedInMHz</key>
<integer>2800</integer>
<key>logicalCPUCoresPerPackage</key>
<integer>8</integer>
<key>modelCode</key>
<string>MacBookPro11,3</string>
<key>physicalCPUCoresPerPackage</key>
<integer>4</integer>
<key>platformIdentifier</key>
<string>com.apple.platform.macosx</string>
</dict>
<key>targetArchitecture</key>
<string>x86_64</string>
<key>targetDevice</key>
<dict>
<key>modelCode</key>
<string>iPhone7,2</string>
<key>platformIdentifier</key>
<string>com.apple.platform.iphonesimulator</string>
</dict>
</dict>
</dict>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
/*
* arch/arm/mach-tegra/localtimer.c
*
* Copyright (C) 2002 ARM Ltd.
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/clockchips.h>
#include <asm/irq.h>
#include <asm/smp_twd.h>
#include <asm/localtimer.h>
/*
* Setup the local clock events for a CPU.
*/
void __cpuinit local_timer_setup(struct clock_event_device *evt)
{
evt->irq = IRQ_LOCALTIMER;
twd_timer_setup(evt);
}
| {
"pile_set_name": "Github"
} |
package logging
// The IRC client will log things using these methods
type Logger interface {
// Debug logging of raw socket comms to/from server.
Debug(format string, args ...interface{})
// Informational logging about client behaviour.
Info(format string, args ...interface{})
// Warnings of inconsistent or unexpected data, mostly
// related to state tracking of IRC nicks/chans.
Warn(format string, args ...interface{})
// Errors, mostly to do with network communication.
Error(format string, args ...interface{})
}
// By default we do no logging. Logging is enabled or disabled
// at the package level, since I'm lazy and re-re-reorganising
// my code to pass a per-client-struct Logger around to all the
// state objects is a pain in the arse.
var logger Logger = nullLogger{}
// SetLogger sets the internal goirc Logger to l. If l is nil,
// a dummy logger that does nothing is installed instead.
func SetLogger(l Logger) {
if l == nil {
logger = nullLogger{}
} else {
logger = l
}
}
// A nullLogger does nothing while fulfilling Logger.
type nullLogger struct{}
func (nl nullLogger) Debug(f string, a ...interface{}) {}
func (nl nullLogger) Info(f string, a ...interface{}) {}
func (nl nullLogger) Warn(f string, a ...interface{}) {}
func (nl nullLogger) Error(f string, a ...interface{}) {}
// Shim functions so that the package can be used directly
func Debug(f string, a ...interface{}) { logger.Debug(f, a...) }
func Info(f string, a ...interface{}) { logger.Info(f, a...) }
func Warn(f string, a ...interface{}) { logger.Warn(f, a...) }
func Error(f string, a ...interface{}) { logger.Error(f, a...) }
| {
"pile_set_name": "Github"
} |
/**********************************************************************
* LeechCraft - modular cross-platform feature rich internet client.
* Copyright (C) 2006-2014 Georg Rudoy
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
**********************************************************************/
#include "entitygeneratingpage.h"
#include <interfaces/core/icoreproxy.h>
#include <interfaces/core/ientitymanager.h>
#include <interfaces/structures.h>
namespace LC
{
namespace NewLife
{
EntityGeneratingPage::EntityGeneratingPage (const ICoreProxy_ptr& proxy, QWidget *parent)
: QWizardPage { parent }
, Proxy_ { proxy }
{
}
void EntityGeneratingPage::SendEntity (const Entity& entity) const
{
Proxy_->GetEntityManager ()->HandleEntity (entity);
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:redirect="http://xml.apache.org/xalan/redirect" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.1" exclude-result-prefixes="doc" extension-element-prefixes="saxon redirect lxslt">
<!-- ********************************************************************
$Id: oldchunker.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- This stylesheet works with Saxon and Xalan; for XT use xtchunker.xsl -->
<!-- ==================================================================== -->
<xsl:param name="default.encoding" select="'ISO-8859-1'" doc:type="string"/>
<doc:param xmlns="" name="default.encoding">
<refpurpose xmlns="http://www.w3.org/1999/xhtml">Encoding used in generated HTML pages</refpurpose>
<refdescription xmlns="http://www.w3.org/1999/xhtml">
<para>This encoding is used in files generated by chunking stylesheet. Currently
only Saxon is able to change output encoding.
</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="saxon.character.representation" select="'entity;decimal'" doc:type="string"/>
<doc:param xmlns="" name="saxon.character.representation">
<refpurpose xmlns="http://www.w3.org/1999/xhtml">Saxon character representation used in generated HTML pages</refpurpose>
<refdescription xmlns="http://www.w3.org/1999/xhtml">
<para>This character representation is used in files generated by chunking stylesheet. If
you want to suppress entity references for characters with direct representation
in default.encoding, set this parameter to value <literal>native</literal>.
</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:template name="make-relative-filename">
<xsl:param name="base.dir" select="'./'"/>
<xsl:param name="base.name" select="''"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:choose>
<xsl:when test="contains($vendor, 'SAXON')">
<!-- Saxon doesn't make the chunks relative -->
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>
<xsl:when test="contains($vendor, 'Apache')">
<!-- Xalan doesn't make the chunks relative -->
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Chunking isn't supported with </xsl:text>
<xsl:value-of select="$vendor"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk">
<xsl:param name="filename" select="''"/>
<xsl:param name="method" select="'html'"/>
<xsl:param name="encoding" select="$default.encoding"/>
<xsl:param name="indent" select="'no'"/>
<xsl:param name="content" select="''"/>
<xsl:message>
<xsl:text>Writing </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:if test="name(.) != ''">
<xsl:text> for </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:if test="@id">
<xsl:text>(</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:if>
</xsl:message>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:choose>
<xsl:when test="contains($vendor, 'SAXON 6.2')">
<!-- Saxon 6.2.x uses xsl:document -->
<xsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</xsl:document>
</xsl:when>
<xsl:when test="contains($vendor, 'SAXON')">
<!-- Saxon uses saxon:output -->
<saxon:output file="{$filename}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="contains($vendor, 'Apache')">
<!-- Xalan uses redirect -->
<redirect:write file="{$filename}">
<xsl:copy-of select="$content"/>
</redirect:write>
</xsl:when>
<xsl:otherwise>
<!-- it doesn't matter since we won't be making chunks... -->
<xsl:message terminate="yes">
<xsl:text>Can't make chunks with </xsl:text>
<xsl:value-of select="$vendor"/>
<xsl:text>'s processor.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk.with.doctype">
<xsl:param name="filename" select="''"/>
<xsl:param name="method" select="'html'"/>
<xsl:param name="encoding" select="$default.encoding"/>
<xsl:param name="indent" select="'no'"/>
<xsl:param name="doctype-public" select="''"/>
<xsl:param name="doctype-system" select="''"/>
<xsl:param name="content" select="''"/>
<xsl:message>
<xsl:text>Writing </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:if test="name(.) != ''">
<xsl:text> for </xsl:text>
<xsl:value-of select="name(.)"/>
</xsl:if>
</xsl:message>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:choose>
<xsl:when test="contains($vendor, 'SAXON 6.2')">
<!-- Saxon 6.2.x uses xsl:document -->
<xsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</xsl:document>
</xsl:when>
<xsl:when test="contains($vendor, 'SAXON')">
<!-- Saxon uses saxon:output -->
<saxon:output file="{$filename}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="contains($vendor, 'Apache')">
<!-- Xalan uses redirect -->
<redirect:write file="{$filename}">
<xsl:copy-of select="$content"/>
</redirect:write>
</xsl:when>
<xsl:otherwise>
<!-- it doesn't matter since we won't be making chunks... -->
<xsl:message terminate="yes">
<xsl:text>Can't make chunks with </xsl:text>
<xsl:value-of select="$vendor"/>
<xsl:text>'s processor.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
| {
"pile_set_name": "Github"
} |
/// Copyright (c) 2012 Ecma International. All rights reserved.
/**
* @path ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-i-16.js
* @description Array.prototype.reduceRight - element to be retrieved is inherited accessor property on an Array
*/
function testcase() {
var testResult = false;
function callbackfn(prevVal, curVal, idx, obj) {
if (idx === 1) {
testResult = (curVal === 1);
}
}
try {
Object.defineProperty(Array.prototype, "1", {
get: function () {
return 1;
},
configurable: true
});
var arr = [0, , 2];
arr.reduceRight(callbackfn, "initialValue");
return testResult;
} finally {
delete Array.prototype[1];
}
}
runTestCase(testcase);
| {
"pile_set_name": "Github"
} |
/*
* Copyright © 2016 Cask Data, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import DeleteAction from 'components/FastAction/DeleteAction';
import TruncateAction from 'components/FastAction/TruncateAction';
import StartStopAction from 'components/FastAction/StartStopAction';
import ExploreAction from 'components/FastAction/ExploreAction';
import SetPreferenceAction from 'components/FastAction/SetPreferenceAction';
import LogAction from 'components/FastAction/LogAction';
import { objectQuery } from 'services/helpers';
export default class FastAction extends Component {
constructor(props) {
super(props);
}
// This function is using switch statement because just using const mapping,
// react already creating virtual DOM element for it, so it was failing the
// Props validation.
renderFastAction(type) {
switch (type) {
case 'delete':
return (
<DeleteAction
entity={this.props.entity}
onSuccess={this.props.onSuccess}
argsToAction={objectQuery(this.props.argsToAction)}
/>
);
case 'truncate':
return (
<TruncateAction
entity={this.props.entity}
onSuccess={this.props.onSuccess}
argsToAction={objectQuery(this.props.argsToAction)}
/>
);
case 'startStop':
return (
<StartStopAction
entity={this.props.entity}
onSuccess={this.props.onSuccess}
argsToAction={objectQuery(this.props.argsToAction)}
/>
);
case 'explore':
return (
<ExploreAction
entity={this.props.entity}
opened={this.props.opened}
argsToAction={objectQuery(this.props.argsToAction)}
/>
);
case 'setPreferences':
return (
<SetPreferenceAction
entity={this.props.entity}
onSuccess={this.props.onSuccess}
argsToAction={objectQuery(this.props.argsToAction)}
/>
);
case 'log':
return (
<LogAction
entity={this.props.entity}
argsToAction={objectQuery(this.props.argsToAction)}
/>
);
default:
return null;
}
}
render() {
return this.renderFastAction(this.props.type);
}
}
FastAction.propTypes = {
type: PropTypes.oneOf(['delete', 'truncate', 'startStop', 'explore', 'setPreferences', 'log']),
entity: PropTypes.object,
onSuccess: PropTypes.func,
opened: PropTypes.bool,
argsToAction: PropTypes.object,
};
| {
"pile_set_name": "Github"
} |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.EntityFrameworkCore.Internal
{
/// <summary>
/// <para>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </para>
/// <para>
/// The service lifetime is <see cref="ServiceLifetime.Singleton" />. This means a single instance
/// is used by many <see cref="DbContext" /> instances. The implementation must be thread-safe.
/// This service cannot depend on services registered as <see cref="ServiceLifetime.Scoped" />.
/// </para>
/// </summary>
public interface ISingletonOptionsInitializer
{
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
void EnsureInitialized(
[NotNull] IServiceProvider serviceProvider,
[NotNull] IDbContextOptions options);
}
}
| {
"pile_set_name": "Github"
} |
/**
* \file
*
* \brief Peripheral I/O description for SAM4LS4B
*
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
*
* \asf_license_start
*
* \page License
*
* Subject to your compliance with these terms, you may use Microchip
* software and any derivatives exclusively with Microchip products.
* It is your responsibility to comply with third party license terms applicable
* to your use of third party software (including open source software) that
* may accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
*/
#ifndef _SAM4LS4B_PIO_
#define _SAM4LS4B_PIO_
#define PIN_PA00 0 /**< \brief Pin Number for PA00 */
#define GPIO_PA00 (1u << 0) /**< \brief GPIO Mask for PA00 */
#define PIN_PA01 1 /**< \brief Pin Number for PA01 */
#define GPIO_PA01 (1u << 1) /**< \brief GPIO Mask for PA01 */
#define PIN_PA02 2 /**< \brief Pin Number for PA02 */
#define GPIO_PA02 (1u << 2) /**< \brief GPIO Mask for PA02 */
#define PIN_PA03 3 /**< \brief Pin Number for PA03 */
#define GPIO_PA03 (1u << 3) /**< \brief GPIO Mask for PA03 */
#define PIN_PA04 4 /**< \brief Pin Number for PA04 */
#define GPIO_PA04 (1u << 4) /**< \brief GPIO Mask for PA04 */
#define PIN_PA05 5 /**< \brief Pin Number for PA05 */
#define GPIO_PA05 (1u << 5) /**< \brief GPIO Mask for PA05 */
#define PIN_PA06 6 /**< \brief Pin Number for PA06 */
#define GPIO_PA06 (1u << 6) /**< \brief GPIO Mask for PA06 */
#define PIN_PA07 7 /**< \brief Pin Number for PA07 */
#define GPIO_PA07 (1u << 7) /**< \brief GPIO Mask for PA07 */
#define PIN_PA08 8 /**< \brief Pin Number for PA08 */
#define GPIO_PA08 (1u << 8) /**< \brief GPIO Mask for PA08 */
#define PIN_PA09 9 /**< \brief Pin Number for PA09 */
#define GPIO_PA09 (1u << 9) /**< \brief GPIO Mask for PA09 */
#define PIN_PA10 10 /**< \brief Pin Number for PA10 */
#define GPIO_PA10 (1u << 10) /**< \brief GPIO Mask for PA10 */
#define PIN_PA11 11 /**< \brief Pin Number for PA11 */
#define GPIO_PA11 (1u << 11) /**< \brief GPIO Mask for PA11 */
#define PIN_PA12 12 /**< \brief Pin Number for PA12 */
#define GPIO_PA12 (1u << 12) /**< \brief GPIO Mask for PA12 */
#define PIN_PA13 13 /**< \brief Pin Number for PA13 */
#define GPIO_PA13 (1u << 13) /**< \brief GPIO Mask for PA13 */
#define PIN_PA14 14 /**< \brief Pin Number for PA14 */
#define GPIO_PA14 (1u << 14) /**< \brief GPIO Mask for PA14 */
#define PIN_PA15 15 /**< \brief Pin Number for PA15 */
#define GPIO_PA15 (1u << 15) /**< \brief GPIO Mask for PA15 */
#define PIN_PA16 16 /**< \brief Pin Number for PA16 */
#define GPIO_PA16 (1u << 16) /**< \brief GPIO Mask for PA16 */
#define PIN_PA17 17 /**< \brief Pin Number for PA17 */
#define GPIO_PA17 (1u << 17) /**< \brief GPIO Mask for PA17 */
#define PIN_PA18 18 /**< \brief Pin Number for PA18 */
#define GPIO_PA18 (1u << 18) /**< \brief GPIO Mask for PA18 */
#define PIN_PA19 19 /**< \brief Pin Number for PA19 */
#define GPIO_PA19 (1u << 19) /**< \brief GPIO Mask for PA19 */
#define PIN_PA20 20 /**< \brief Pin Number for PA20 */
#define GPIO_PA20 (1u << 20) /**< \brief GPIO Mask for PA20 */
#define PIN_PA21 21 /**< \brief Pin Number for PA21 */
#define GPIO_PA21 (1u << 21) /**< \brief GPIO Mask for PA21 */
#define PIN_PA22 22 /**< \brief Pin Number for PA22 */
#define GPIO_PA22 (1u << 22) /**< \brief GPIO Mask for PA22 */
#define PIN_PA23 23 /**< \brief Pin Number for PA23 */
#define GPIO_PA23 (1u << 23) /**< \brief GPIO Mask for PA23 */
#define PIN_PA24 24 /**< \brief Pin Number for PA24 */
#define GPIO_PA24 (1u << 24) /**< \brief GPIO Mask for PA24 */
#define PIN_PA25 25 /**< \brief Pin Number for PA25 */
#define GPIO_PA25 (1u << 25) /**< \brief GPIO Mask for PA25 */
#define PIN_PA26 26 /**< \brief Pin Number for PA26 */
#define GPIO_PA26 (1u << 26) /**< \brief GPIO Mask for PA26 */
#define PIN_PA27 27 /**< \brief Pin Number for PA27 */
#define GPIO_PA27 (1u << 27) /**< \brief GPIO Mask for PA27 */
#define PIN_PA28 28 /**< \brief Pin Number for PA28 */
#define GPIO_PA28 (1u << 28) /**< \brief GPIO Mask for PA28 */
#define PIN_PA29 29 /**< \brief Pin Number for PA29 */
#define GPIO_PA29 (1u << 29) /**< \brief GPIO Mask for PA29 */
#define PIN_PA30 30 /**< \brief Pin Number for PA30 */
#define GPIO_PA30 (1u << 30) /**< \brief GPIO Mask for PA30 */
#define PIN_PA31 31 /**< \brief Pin Number for PA31 */
#define GPIO_PA31 (1u << 31) /**< \brief GPIO Mask for PA31 */
#define PIN_PB00 32 /**< \brief Pin Number for PB00 */
#define GPIO_PB00 (1u << 0) /**< \brief GPIO Mask for PB00 */
#define PIN_PB01 33 /**< \brief Pin Number for PB01 */
#define GPIO_PB01 (1u << 1) /**< \brief GPIO Mask for PB01 */
#define PIN_PB02 34 /**< \brief Pin Number for PB02 */
#define GPIO_PB02 (1u << 2) /**< \brief GPIO Mask for PB02 */
#define PIN_PB03 35 /**< \brief Pin Number for PB03 */
#define GPIO_PB03 (1u << 3) /**< \brief GPIO Mask for PB03 */
#define PIN_PB04 36 /**< \brief Pin Number for PB04 */
#define GPIO_PB04 (1u << 4) /**< \brief GPIO Mask for PB04 */
#define PIN_PB05 37 /**< \brief Pin Number for PB05 */
#define GPIO_PB05 (1u << 5) /**< \brief GPIO Mask for PB05 */
#define PIN_PB06 38 /**< \brief Pin Number for PB06 */
#define GPIO_PB06 (1u << 6) /**< \brief GPIO Mask for PB06 */
#define PIN_PB07 39 /**< \brief Pin Number for PB07 */
#define GPIO_PB07 (1u << 7) /**< \brief GPIO Mask for PB07 */
#define PIN_PB08 40 /**< \brief Pin Number for PB08 */
#define GPIO_PB08 (1u << 8) /**< \brief GPIO Mask for PB08 */
#define PIN_PB09 41 /**< \brief Pin Number for PB09 */
#define GPIO_PB09 (1u << 9) /**< \brief GPIO Mask for PB09 */
#define PIN_PB10 42 /**< \brief Pin Number for PB10 */
#define GPIO_PB10 (1u << 10) /**< \brief GPIO Mask for PB10 */
#define PIN_PB11 43 /**< \brief Pin Number for PB11 */
#define GPIO_PB11 (1u << 11) /**< \brief GPIO Mask for PB11 */
#define PIN_PB12 44 /**< \brief Pin Number for PB12 */
#define GPIO_PB12 (1u << 12) /**< \brief GPIO Mask for PB12 */
#define PIN_PB13 45 /**< \brief Pin Number for PB13 */
#define GPIO_PB13 (1u << 13) /**< \brief GPIO Mask for PB13 */
#define PIN_PB14 46 /**< \brief Pin Number for PB14 */
#define GPIO_PB14 (1u << 14) /**< \brief GPIO Mask for PB14 */
#define PIN_PB15 47 /**< \brief Pin Number for PB15 */
#define GPIO_PB15 (1u << 15) /**< \brief GPIO Mask for PB15 */
/* ========== GPIO definition for TWIMS0 peripheral ========== */
#define PIN_PA24B_TWIMS0_TWCK 24 /**< \brief TWIMS0 signal: TWCK on PA24 mux B */
#define MUX_PA24B_TWIMS0_TWCK 1
#define PINMUX_PA24B_TWIMS0_TWCK ((PIN_PA24B_TWIMS0_TWCK << 16) | MUX_PA24B_TWIMS0_TWCK)
#define GPIO_PA24B_TWIMS0_TWCK (1u << 24)
#define PIN_PA23B_TWIMS0_TWD 23 /**< \brief TWIMS0 signal: TWD on PA23 mux B */
#define MUX_PA23B_TWIMS0_TWD 1
#define PINMUX_PA23B_TWIMS0_TWD ((PIN_PA23B_TWIMS0_TWD << 16) | MUX_PA23B_TWIMS0_TWD)
#define GPIO_PA23B_TWIMS0_TWD (1u << 23)
/* ========== GPIO definition for TWIMS1 peripheral ========== */
#define PIN_PB01A_TWIMS1_TWCK 33 /**< \brief TWIMS1 signal: TWCK on PB01 mux A */
#define MUX_PB01A_TWIMS1_TWCK 0
#define PINMUX_PB01A_TWIMS1_TWCK ((PIN_PB01A_TWIMS1_TWCK << 16) | MUX_PB01A_TWIMS1_TWCK)
#define GPIO_PB01A_TWIMS1_TWCK (1u << 1)
#define PIN_PB00A_TWIMS1_TWD 32 /**< \brief TWIMS1 signal: TWD on PB00 mux A */
#define MUX_PB00A_TWIMS1_TWD 0
#define PINMUX_PB00A_TWIMS1_TWD ((PIN_PB00A_TWIMS1_TWD << 16) | MUX_PB00A_TWIMS1_TWD)
#define GPIO_PB00A_TWIMS1_TWD (1u << 0)
/* ========== GPIO definition for TWIMS2 peripheral ========== */
#define PIN_PA22E_TWIMS2_TWCK 22 /**< \brief TWIMS2 signal: TWCK on PA22 mux E */
#define MUX_PA22E_TWIMS2_TWCK 4
#define PINMUX_PA22E_TWIMS2_TWCK ((PIN_PA22E_TWIMS2_TWCK << 16) | MUX_PA22E_TWIMS2_TWCK)
#define GPIO_PA22E_TWIMS2_TWCK (1u << 22)
#define PIN_PA21E_TWIMS2_TWD 21 /**< \brief TWIMS2 signal: TWD on PA21 mux E */
#define MUX_PA21E_TWIMS2_TWD 4
#define PINMUX_PA21E_TWIMS2_TWD ((PIN_PA21E_TWIMS2_TWD << 16) | MUX_PA21E_TWIMS2_TWD)
#define GPIO_PA21E_TWIMS2_TWD (1u << 21)
/* ========== GPIO definition for TWIMS3 peripheral ========== */
#define PIN_PB15C_TWIMS3_TWCK 47 /**< \brief TWIMS3 signal: TWCK on PB15 mux C */
#define MUX_PB15C_TWIMS3_TWCK 2
#define PINMUX_PB15C_TWIMS3_TWCK ((PIN_PB15C_TWIMS3_TWCK << 16) | MUX_PB15C_TWIMS3_TWCK)
#define GPIO_PB15C_TWIMS3_TWCK (1u << 15)
#define PIN_PB14C_TWIMS3_TWD 46 /**< \brief TWIMS3 signal: TWD on PB14 mux C */
#define MUX_PB14C_TWIMS3_TWD 2
#define PINMUX_PB14C_TWIMS3_TWD ((PIN_PB14C_TWIMS3_TWD << 16) | MUX_PB14C_TWIMS3_TWD)
#define GPIO_PB14C_TWIMS3_TWD (1u << 14)
/* ========== GPIO definition for IISC peripheral ========== */
#define PIN_PB05D_IISC_IMCK 37 /**< \brief IISC signal: IMCK on PB05 mux D */
#define MUX_PB05D_IISC_IMCK 3
#define PINMUX_PB05D_IISC_IMCK ((PIN_PB05D_IISC_IMCK << 16) | MUX_PB05D_IISC_IMCK)
#define GPIO_PB05D_IISC_IMCK (1u << 5)
#define PIN_PA31B_IISC_IMCK 31 /**< \brief IISC signal: IMCK on PA31 mux B */
#define MUX_PA31B_IISC_IMCK 1
#define PINMUX_PA31B_IISC_IMCK ((PIN_PA31B_IISC_IMCK << 16) | MUX_PA31B_IISC_IMCK)
#define GPIO_PA31B_IISC_IMCK (1u << 31)
#define PIN_PB02D_IISC_ISCK 34 /**< \brief IISC signal: ISCK on PB02 mux D */
#define MUX_PB02D_IISC_ISCK 3
#define PINMUX_PB02D_IISC_ISCK ((PIN_PB02D_IISC_ISCK << 16) | MUX_PB02D_IISC_ISCK)
#define GPIO_PB02D_IISC_ISCK (1u << 2)
#define PIN_PA27B_IISC_ISCK 27 /**< \brief IISC signal: ISCK on PA27 mux B */
#define MUX_PA27B_IISC_ISCK 1
#define PINMUX_PA27B_IISC_ISCK ((PIN_PA27B_IISC_ISCK << 16) | MUX_PA27B_IISC_ISCK)
#define GPIO_PA27B_IISC_ISCK (1u << 27)
#define PIN_PB03D_IISC_ISDI 35 /**< \brief IISC signal: ISDI on PB03 mux D */
#define MUX_PB03D_IISC_ISDI 3
#define PINMUX_PB03D_IISC_ISDI ((PIN_PB03D_IISC_ISDI << 16) | MUX_PB03D_IISC_ISDI)
#define GPIO_PB03D_IISC_ISDI (1u << 3)
#define PIN_PA28B_IISC_ISDI 28 /**< \brief IISC signal: ISDI on PA28 mux B */
#define MUX_PA28B_IISC_ISDI 1
#define PINMUX_PA28B_IISC_ISDI ((PIN_PA28B_IISC_ISDI << 16) | MUX_PA28B_IISC_ISDI)
#define GPIO_PA28B_IISC_ISDI (1u << 28)
#define PIN_PB04D_IISC_ISDO 36 /**< \brief IISC signal: ISDO on PB04 mux D */
#define MUX_PB04D_IISC_ISDO 3
#define PINMUX_PB04D_IISC_ISDO ((PIN_PB04D_IISC_ISDO << 16) | MUX_PB04D_IISC_ISDO)
#define GPIO_PB04D_IISC_ISDO (1u << 4)
#define PIN_PA30B_IISC_ISDO 30 /**< \brief IISC signal: ISDO on PA30 mux B */
#define MUX_PA30B_IISC_ISDO 1
#define PINMUX_PA30B_IISC_ISDO ((PIN_PA30B_IISC_ISDO << 16) | MUX_PA30B_IISC_ISDO)
#define GPIO_PA30B_IISC_ISDO (1u << 30)
#define PIN_PB06D_IISC_IWS 38 /**< \brief IISC signal: IWS on PB06 mux D */
#define MUX_PB06D_IISC_IWS 3
#define PINMUX_PB06D_IISC_IWS ((PIN_PB06D_IISC_IWS << 16) | MUX_PB06D_IISC_IWS)
#define GPIO_PB06D_IISC_IWS (1u << 6)
#define PIN_PA29B_IISC_IWS 29 /**< \brief IISC signal: IWS on PA29 mux B */
#define MUX_PA29B_IISC_IWS 1
#define PINMUX_PA29B_IISC_IWS ((PIN_PA29B_IISC_IWS << 16) | MUX_PA29B_IISC_IWS)
#define GPIO_PA29B_IISC_IWS (1u << 29)
/* ========== GPIO definition for SPI peripheral ========== */
#define PIN_PA03B_SPI_MISO 3 /**< \brief SPI signal: MISO on PA03 mux B */
#define MUX_PA03B_SPI_MISO 1
#define PINMUX_PA03B_SPI_MISO ((PIN_PA03B_SPI_MISO << 16) | MUX_PA03B_SPI_MISO)
#define GPIO_PA03B_SPI_MISO (1u << 3)
#define PIN_PB14B_SPI_MISO 46 /**< \brief SPI signal: MISO on PB14 mux B */
#define MUX_PB14B_SPI_MISO 1
#define PINMUX_PB14B_SPI_MISO ((PIN_PB14B_SPI_MISO << 16) | MUX_PB14B_SPI_MISO)
#define GPIO_PB14B_SPI_MISO (1u << 14)
#define PIN_PA21A_SPI_MISO 21 /**< \brief SPI signal: MISO on PA21 mux A */
#define MUX_PA21A_SPI_MISO 0
#define PINMUX_PA21A_SPI_MISO ((PIN_PA21A_SPI_MISO << 16) | MUX_PA21A_SPI_MISO)
#define GPIO_PA21A_SPI_MISO (1u << 21)
#define PIN_PA27A_SPI_MISO 27 /**< \brief SPI signal: MISO on PA27 mux A */
#define MUX_PA27A_SPI_MISO 0
#define PINMUX_PA27A_SPI_MISO ((PIN_PA27A_SPI_MISO << 16) | MUX_PA27A_SPI_MISO)
#define GPIO_PA27A_SPI_MISO (1u << 27)
#define PIN_PB15B_SPI_MOSI 47 /**< \brief SPI signal: MOSI on PB15 mux B */
#define MUX_PB15B_SPI_MOSI 1
#define PINMUX_PB15B_SPI_MOSI ((PIN_PB15B_SPI_MOSI << 16) | MUX_PB15B_SPI_MOSI)
#define GPIO_PB15B_SPI_MOSI (1u << 15)
#define PIN_PA22A_SPI_MOSI 22 /**< \brief SPI signal: MOSI on PA22 mux A */
#define MUX_PA22A_SPI_MOSI 0
#define PINMUX_PA22A_SPI_MOSI ((PIN_PA22A_SPI_MOSI << 16) | MUX_PA22A_SPI_MOSI)
#define GPIO_PA22A_SPI_MOSI (1u << 22)
#define PIN_PA28A_SPI_MOSI 28 /**< \brief SPI signal: MOSI on PA28 mux A */
#define MUX_PA28A_SPI_MOSI 0
#define PINMUX_PA28A_SPI_MOSI ((PIN_PA28A_SPI_MOSI << 16) | MUX_PA28A_SPI_MOSI)
#define GPIO_PA28A_SPI_MOSI (1u << 28)
#define PIN_PA02B_SPI_NPCS0 2 /**< \brief SPI signal: NPCS0 on PA02 mux B */
#define MUX_PA02B_SPI_NPCS0 1
#define PINMUX_PA02B_SPI_NPCS0 ((PIN_PA02B_SPI_NPCS0 << 16) | MUX_PA02B_SPI_NPCS0)
#define GPIO_PA02B_SPI_NPCS0 (1u << 2)
#define PIN_PA24A_SPI_NPCS0 24 /**< \brief SPI signal: NPCS0 on PA24 mux A */
#define MUX_PA24A_SPI_NPCS0 0
#define PINMUX_PA24A_SPI_NPCS0 ((PIN_PA24A_SPI_NPCS0 << 16) | MUX_PA24A_SPI_NPCS0)
#define GPIO_PA24A_SPI_NPCS0 (1u << 24)
#define PIN_PA30A_SPI_NPCS0 30 /**< \brief SPI signal: NPCS0 on PA30 mux A */
#define MUX_PA30A_SPI_NPCS0 0
#define PINMUX_PA30A_SPI_NPCS0 ((PIN_PA30A_SPI_NPCS0 << 16) | MUX_PA30A_SPI_NPCS0)
#define GPIO_PA30A_SPI_NPCS0 (1u << 30)
#define PIN_PA13C_SPI_NPCS1 13 /**< \brief SPI signal: NPCS1 on PA13 mux C */
#define MUX_PA13C_SPI_NPCS1 2
#define PINMUX_PA13C_SPI_NPCS1 ((PIN_PA13C_SPI_NPCS1 << 16) | MUX_PA13C_SPI_NPCS1)
#define GPIO_PA13C_SPI_NPCS1 (1u << 13)
#define PIN_PB13B_SPI_NPCS1 45 /**< \brief SPI signal: NPCS1 on PB13 mux B */
#define MUX_PB13B_SPI_NPCS1 1
#define PINMUX_PB13B_SPI_NPCS1 ((PIN_PB13B_SPI_NPCS1 << 16) | MUX_PB13B_SPI_NPCS1)
#define GPIO_PB13B_SPI_NPCS1 (1u << 13)
#define PIN_PA31A_SPI_NPCS1 31 /**< \brief SPI signal: NPCS1 on PA31 mux A */
#define MUX_PA31A_SPI_NPCS1 0
#define PINMUX_PA31A_SPI_NPCS1 ((PIN_PA31A_SPI_NPCS1 << 16) | MUX_PA31A_SPI_NPCS1)
#define GPIO_PA31A_SPI_NPCS1 (1u << 31)
#define PIN_PA14C_SPI_NPCS2 14 /**< \brief SPI signal: NPCS2 on PA14 mux C */
#define MUX_PA14C_SPI_NPCS2 2
#define PINMUX_PA14C_SPI_NPCS2 ((PIN_PA14C_SPI_NPCS2 << 16) | MUX_PA14C_SPI_NPCS2)
#define GPIO_PA14C_SPI_NPCS2 (1u << 14)
#define PIN_PB11B_SPI_NPCS2 43 /**< \brief SPI signal: NPCS2 on PB11 mux B */
#define MUX_PB11B_SPI_NPCS2 1
#define PINMUX_PB11B_SPI_NPCS2 ((PIN_PB11B_SPI_NPCS2 << 16) | MUX_PB11B_SPI_NPCS2)
#define GPIO_PB11B_SPI_NPCS2 (1u << 11)
#define PIN_PA15C_SPI_NPCS3 15 /**< \brief SPI signal: NPCS3 on PA15 mux C */
#define MUX_PA15C_SPI_NPCS3 2
#define PINMUX_PA15C_SPI_NPCS3 ((PIN_PA15C_SPI_NPCS3 << 16) | MUX_PA15C_SPI_NPCS3)
#define GPIO_PA15C_SPI_NPCS3 (1u << 15)
#define PIN_PB12B_SPI_NPCS3 44 /**< \brief SPI signal: NPCS3 on PB12 mux B */
#define MUX_PB12B_SPI_NPCS3 1
#define PINMUX_PB12B_SPI_NPCS3 ((PIN_PB12B_SPI_NPCS3 << 16) | MUX_PB12B_SPI_NPCS3)
#define GPIO_PB12B_SPI_NPCS3 (1u << 12)
#define PIN_PA23A_SPI_SCK 23 /**< \brief SPI signal: SCK on PA23 mux A */
#define MUX_PA23A_SPI_SCK 0
#define PINMUX_PA23A_SPI_SCK ((PIN_PA23A_SPI_SCK << 16) | MUX_PA23A_SPI_SCK)
#define GPIO_PA23A_SPI_SCK (1u << 23)
#define PIN_PA29A_SPI_SCK 29 /**< \brief SPI signal: SCK on PA29 mux A */
#define MUX_PA29A_SPI_SCK 0
#define PINMUX_PA29A_SPI_SCK ((PIN_PA29A_SPI_SCK << 16) | MUX_PA29A_SPI_SCK)
#define GPIO_PA29A_SPI_SCK (1u << 29)
/* ========== GPIO definition for TC0 peripheral ========== */
#define PIN_PB07D_TC0_A0 39 /**< \brief TC0 signal: A0 on PB07 mux D */
#define MUX_PB07D_TC0_A0 3
#define PINMUX_PB07D_TC0_A0 ((PIN_PB07D_TC0_A0 << 16) | MUX_PB07D_TC0_A0)
#define GPIO_PB07D_TC0_A0 (1u << 7)
#define PIN_PA08B_TC0_A0 8 /**< \brief TC0 signal: A0 on PA08 mux B */
#define MUX_PA08B_TC0_A0 1
#define PINMUX_PA08B_TC0_A0 ((PIN_PA08B_TC0_A0 << 16) | MUX_PA08B_TC0_A0)
#define GPIO_PA08B_TC0_A0 (1u << 8)
#define PIN_PB09D_TC0_A1 41 /**< \brief TC0 signal: A1 on PB09 mux D */
#define MUX_PB09D_TC0_A1 3
#define PINMUX_PB09D_TC0_A1 ((PIN_PB09D_TC0_A1 << 16) | MUX_PB09D_TC0_A1)
#define GPIO_PB09D_TC0_A1 (1u << 9)
#define PIN_PA10B_TC0_A1 10 /**< \brief TC0 signal: A1 on PA10 mux B */
#define MUX_PA10B_TC0_A1 1
#define PINMUX_PA10B_TC0_A1 ((PIN_PA10B_TC0_A1 << 16) | MUX_PA10B_TC0_A1)
#define GPIO_PA10B_TC0_A1 (1u << 10)
#define PIN_PB11D_TC0_A2 43 /**< \brief TC0 signal: A2 on PB11 mux D */
#define MUX_PB11D_TC0_A2 3
#define PINMUX_PB11D_TC0_A2 ((PIN_PB11D_TC0_A2 << 16) | MUX_PB11D_TC0_A2)
#define GPIO_PB11D_TC0_A2 (1u << 11)
#define PIN_PA12B_TC0_A2 12 /**< \brief TC0 signal: A2 on PA12 mux B */
#define MUX_PA12B_TC0_A2 1
#define PINMUX_PA12B_TC0_A2 ((PIN_PA12B_TC0_A2 << 16) | MUX_PA12B_TC0_A2)
#define GPIO_PA12B_TC0_A2 (1u << 12)
#define PIN_PB08D_TC0_B0 40 /**< \brief TC0 signal: B0 on PB08 mux D */
#define MUX_PB08D_TC0_B0 3
#define PINMUX_PB08D_TC0_B0 ((PIN_PB08D_TC0_B0 << 16) | MUX_PB08D_TC0_B0)
#define GPIO_PB08D_TC0_B0 (1u << 8)
#define PIN_PA09B_TC0_B0 9 /**< \brief TC0 signal: B0 on PA09 mux B */
#define MUX_PA09B_TC0_B0 1
#define PINMUX_PA09B_TC0_B0 ((PIN_PA09B_TC0_B0 << 16) | MUX_PA09B_TC0_B0)
#define GPIO_PA09B_TC0_B0 (1u << 9)
#define PIN_PB10D_TC0_B1 42 /**< \brief TC0 signal: B1 on PB10 mux D */
#define MUX_PB10D_TC0_B1 3
#define PINMUX_PB10D_TC0_B1 ((PIN_PB10D_TC0_B1 << 16) | MUX_PB10D_TC0_B1)
#define GPIO_PB10D_TC0_B1 (1u << 10)
#define PIN_PA11B_TC0_B1 11 /**< \brief TC0 signal: B1 on PA11 mux B */
#define MUX_PA11B_TC0_B1 1
#define PINMUX_PA11B_TC0_B1 ((PIN_PA11B_TC0_B1 << 16) | MUX_PA11B_TC0_B1)
#define GPIO_PA11B_TC0_B1 (1u << 11)
#define PIN_PB12D_TC0_B2 44 /**< \brief TC0 signal: B2 on PB12 mux D */
#define MUX_PB12D_TC0_B2 3
#define PINMUX_PB12D_TC0_B2 ((PIN_PB12D_TC0_B2 << 16) | MUX_PB12D_TC0_B2)
#define GPIO_PB12D_TC0_B2 (1u << 12)
#define PIN_PA13B_TC0_B2 13 /**< \brief TC0 signal: B2 on PA13 mux B */
#define MUX_PA13B_TC0_B2 1
#define PINMUX_PA13B_TC0_B2 ((PIN_PA13B_TC0_B2 << 16) | MUX_PA13B_TC0_B2)
#define GPIO_PA13B_TC0_B2 (1u << 13)
#define PIN_PB13D_TC0_CLK0 45 /**< \brief TC0 signal: CLK0 on PB13 mux D */
#define MUX_PB13D_TC0_CLK0 3
#define PINMUX_PB13D_TC0_CLK0 ((PIN_PB13D_TC0_CLK0 << 16) | MUX_PB13D_TC0_CLK0)
#define GPIO_PB13D_TC0_CLK0 (1u << 13)
#define PIN_PA14B_TC0_CLK0 14 /**< \brief TC0 signal: CLK0 on PA14 mux B */
#define MUX_PA14B_TC0_CLK0 1
#define PINMUX_PA14B_TC0_CLK0 ((PIN_PA14B_TC0_CLK0 << 16) | MUX_PA14B_TC0_CLK0)
#define GPIO_PA14B_TC0_CLK0 (1u << 14)
#define PIN_PB14D_TC0_CLK1 46 /**< \brief TC0 signal: CLK1 on PB14 mux D */
#define MUX_PB14D_TC0_CLK1 3
#define PINMUX_PB14D_TC0_CLK1 ((PIN_PB14D_TC0_CLK1 << 16) | MUX_PB14D_TC0_CLK1)
#define GPIO_PB14D_TC0_CLK1 (1u << 14)
#define PIN_PA15B_TC0_CLK1 15 /**< \brief TC0 signal: CLK1 on PA15 mux B */
#define MUX_PA15B_TC0_CLK1 1
#define PINMUX_PA15B_TC0_CLK1 ((PIN_PA15B_TC0_CLK1 << 16) | MUX_PA15B_TC0_CLK1)
#define GPIO_PA15B_TC0_CLK1 (1u << 15)
#define PIN_PB15D_TC0_CLK2 47 /**< \brief TC0 signal: CLK2 on PB15 mux D */
#define MUX_PB15D_TC0_CLK2 3
#define PINMUX_PB15D_TC0_CLK2 ((PIN_PB15D_TC0_CLK2 << 16) | MUX_PB15D_TC0_CLK2)
#define GPIO_PB15D_TC0_CLK2 (1u << 15)
#define PIN_PA16B_TC0_CLK2 16 /**< \brief TC0 signal: CLK2 on PA16 mux B */
#define MUX_PA16B_TC0_CLK2 1
#define PINMUX_PA16B_TC0_CLK2 ((PIN_PA16B_TC0_CLK2 << 16) | MUX_PA16B_TC0_CLK2)
#define GPIO_PA16B_TC0_CLK2 (1u << 16)
/* ========== GPIO definition for USART0 peripheral ========== */
#define PIN_PA04B_USART0_CLK 4 /**< \brief USART0 signal: CLK on PA04 mux B */
#define MUX_PA04B_USART0_CLK 1
#define PINMUX_PA04B_USART0_CLK ((PIN_PA04B_USART0_CLK << 16) | MUX_PA04B_USART0_CLK)
#define GPIO_PA04B_USART0_CLK (1u << 4)
#define PIN_PA10A_USART0_CLK 10 /**< \brief USART0 signal: CLK on PA10 mux A */
#define MUX_PA10A_USART0_CLK 0
#define PINMUX_PA10A_USART0_CLK ((PIN_PA10A_USART0_CLK << 16) | MUX_PA10A_USART0_CLK)
#define GPIO_PA10A_USART0_CLK (1u << 10)
#define PIN_PB13A_USART0_CLK 45 /**< \brief USART0 signal: CLK on PB13 mux A */
#define MUX_PB13A_USART0_CLK 0
#define PINMUX_PB13A_USART0_CLK ((PIN_PB13A_USART0_CLK << 16) | MUX_PB13A_USART0_CLK)
#define GPIO_PB13A_USART0_CLK (1u << 13)
#define PIN_PA09A_USART0_CTS 9 /**< \brief USART0 signal: CTS on PA09 mux A */
#define MUX_PA09A_USART0_CTS 0
#define PINMUX_PA09A_USART0_CTS ((PIN_PA09A_USART0_CTS << 16) | MUX_PA09A_USART0_CTS)
#define GPIO_PA09A_USART0_CTS (1u << 9)
#define PIN_PB11A_USART0_CTS 43 /**< \brief USART0 signal: CTS on PB11 mux A */
#define MUX_PB11A_USART0_CTS 0
#define PINMUX_PB11A_USART0_CTS ((PIN_PB11A_USART0_CTS << 16) | MUX_PB11A_USART0_CTS)
#define GPIO_PB11A_USART0_CTS (1u << 11)
#define PIN_PA06B_USART0_RTS 6 /**< \brief USART0 signal: RTS on PA06 mux B */
#define MUX_PA06B_USART0_RTS 1
#define PINMUX_PA06B_USART0_RTS ((PIN_PA06B_USART0_RTS << 16) | MUX_PA06B_USART0_RTS)
#define GPIO_PA06B_USART0_RTS (1u << 6)
#define PIN_PA08A_USART0_RTS 8 /**< \brief USART0 signal: RTS on PA08 mux A */
#define MUX_PA08A_USART0_RTS 0
#define PINMUX_PA08A_USART0_RTS ((PIN_PA08A_USART0_RTS << 16) | MUX_PA08A_USART0_RTS)
#define GPIO_PA08A_USART0_RTS (1u << 8)
#define PIN_PB12A_USART0_RTS 44 /**< \brief USART0 signal: RTS on PB12 mux A */
#define MUX_PB12A_USART0_RTS 0
#define PINMUX_PB12A_USART0_RTS ((PIN_PB12A_USART0_RTS << 16) | MUX_PB12A_USART0_RTS)
#define GPIO_PB12A_USART0_RTS (1u << 12)
#define PIN_PA05B_USART0_RXD 5 /**< \brief USART0 signal: RXD on PA05 mux B */
#define MUX_PA05B_USART0_RXD 1
#define PINMUX_PA05B_USART0_RXD ((PIN_PA05B_USART0_RXD << 16) | MUX_PA05B_USART0_RXD)
#define GPIO_PA05B_USART0_RXD (1u << 5)
#define PIN_PB00B_USART0_RXD 32 /**< \brief USART0 signal: RXD on PB00 mux B */
#define MUX_PB00B_USART0_RXD 1
#define PINMUX_PB00B_USART0_RXD ((PIN_PB00B_USART0_RXD << 16) | MUX_PB00B_USART0_RXD)
#define GPIO_PB00B_USART0_RXD (1u << 0)
#define PIN_PA11A_USART0_RXD 11 /**< \brief USART0 signal: RXD on PA11 mux A */
#define MUX_PA11A_USART0_RXD 0
#define PINMUX_PA11A_USART0_RXD ((PIN_PA11A_USART0_RXD << 16) | MUX_PA11A_USART0_RXD)
#define GPIO_PA11A_USART0_RXD (1u << 11)
#define PIN_PB14A_USART0_RXD 46 /**< \brief USART0 signal: RXD on PB14 mux A */
#define MUX_PB14A_USART0_RXD 0
#define PINMUX_PB14A_USART0_RXD ((PIN_PB14A_USART0_RXD << 16) | MUX_PB14A_USART0_RXD)
#define GPIO_PB14A_USART0_RXD (1u << 14)
#define PIN_PA07B_USART0_TXD 7 /**< \brief USART0 signal: TXD on PA07 mux B */
#define MUX_PA07B_USART0_TXD 1
#define PINMUX_PA07B_USART0_TXD ((PIN_PA07B_USART0_TXD << 16) | MUX_PA07B_USART0_TXD)
#define GPIO_PA07B_USART0_TXD (1u << 7)
#define PIN_PB01B_USART0_TXD 33 /**< \brief USART0 signal: TXD on PB01 mux B */
#define MUX_PB01B_USART0_TXD 1
#define PINMUX_PB01B_USART0_TXD ((PIN_PB01B_USART0_TXD << 16) | MUX_PB01B_USART0_TXD)
#define GPIO_PB01B_USART0_TXD (1u << 1)
#define PIN_PA12A_USART0_TXD 12 /**< \brief USART0 signal: TXD on PA12 mux A */
#define MUX_PA12A_USART0_TXD 0
#define PINMUX_PA12A_USART0_TXD ((PIN_PA12A_USART0_TXD << 16) | MUX_PA12A_USART0_TXD)
#define GPIO_PA12A_USART0_TXD (1u << 12)
#define PIN_PB15A_USART0_TXD 47 /**< \brief USART0 signal: TXD on PB15 mux A */
#define MUX_PB15A_USART0_TXD 0
#define PINMUX_PB15A_USART0_TXD ((PIN_PB15A_USART0_TXD << 16) | MUX_PB15A_USART0_TXD)
#define GPIO_PB15A_USART0_TXD (1u << 15)
/* ========== GPIO definition for USART1 peripheral ========== */
#define PIN_PB03B_USART1_CLK 35 /**< \brief USART1 signal: CLK on PB03 mux B */
#define MUX_PB03B_USART1_CLK 1
#define PINMUX_PB03B_USART1_CLK ((PIN_PB03B_USART1_CLK << 16) | MUX_PB03B_USART1_CLK)
#define GPIO_PB03B_USART1_CLK (1u << 3)
#define PIN_PA14A_USART1_CLK 14 /**< \brief USART1 signal: CLK on PA14 mux A */
#define MUX_PA14A_USART1_CLK 0
#define PINMUX_PA14A_USART1_CLK ((PIN_PA14A_USART1_CLK << 16) | MUX_PA14A_USART1_CLK)
#define GPIO_PA14A_USART1_CLK (1u << 14)
#define PIN_PA21B_USART1_CTS 21 /**< \brief USART1 signal: CTS on PA21 mux B */
#define MUX_PA21B_USART1_CTS 1
#define PINMUX_PA21B_USART1_CTS ((PIN_PA21B_USART1_CTS << 16) | MUX_PA21B_USART1_CTS)
#define GPIO_PA21B_USART1_CTS (1u << 21)
#define PIN_PB02B_USART1_RTS 34 /**< \brief USART1 signal: RTS on PB02 mux B */
#define MUX_PB02B_USART1_RTS 1
#define PINMUX_PB02B_USART1_RTS ((PIN_PB02B_USART1_RTS << 16) | MUX_PB02B_USART1_RTS)
#define GPIO_PB02B_USART1_RTS (1u << 2)
#define PIN_PA13A_USART1_RTS 13 /**< \brief USART1 signal: RTS on PA13 mux A */
#define MUX_PA13A_USART1_RTS 0
#define PINMUX_PA13A_USART1_RTS ((PIN_PA13A_USART1_RTS << 16) | MUX_PA13A_USART1_RTS)
#define GPIO_PA13A_USART1_RTS (1u << 13)
#define PIN_PB04B_USART1_RXD 36 /**< \brief USART1 signal: RXD on PB04 mux B */
#define MUX_PB04B_USART1_RXD 1
#define PINMUX_PB04B_USART1_RXD ((PIN_PB04B_USART1_RXD << 16) | MUX_PB04B_USART1_RXD)
#define GPIO_PB04B_USART1_RXD (1u << 4)
#define PIN_PA15A_USART1_RXD 15 /**< \brief USART1 signal: RXD on PA15 mux A */
#define MUX_PA15A_USART1_RXD 0
#define PINMUX_PA15A_USART1_RXD ((PIN_PA15A_USART1_RXD << 16) | MUX_PA15A_USART1_RXD)
#define GPIO_PA15A_USART1_RXD (1u << 15)
#define PIN_PB05B_USART1_TXD 37 /**< \brief USART1 signal: TXD on PB05 mux B */
#define MUX_PB05B_USART1_TXD 1
#define PINMUX_PB05B_USART1_TXD ((PIN_PB05B_USART1_TXD << 16) | MUX_PB05B_USART1_TXD)
#define GPIO_PB05B_USART1_TXD (1u << 5)
#define PIN_PA16A_USART1_TXD 16 /**< \brief USART1 signal: TXD on PA16 mux A */
#define MUX_PA16A_USART1_TXD 0
#define PINMUX_PA16A_USART1_TXD ((PIN_PA16A_USART1_TXD << 16) | MUX_PA16A_USART1_TXD)
#define GPIO_PA16A_USART1_TXD (1u << 16)
/* ========== GPIO definition for USART2 peripheral ========== */
#define PIN_PA18A_USART2_CLK 18 /**< \brief USART2 signal: CLK on PA18 mux A */
#define MUX_PA18A_USART2_CLK 0
#define PINMUX_PA18A_USART2_CLK ((PIN_PA18A_USART2_CLK << 16) | MUX_PA18A_USART2_CLK)
#define GPIO_PA18A_USART2_CLK (1u << 18)
#define PIN_PA22B_USART2_CTS 22 /**< \brief USART2 signal: CTS on PA22 mux B */
#define MUX_PA22B_USART2_CTS 1
#define PINMUX_PA22B_USART2_CTS ((PIN_PA22B_USART2_CTS << 16) | MUX_PA22B_USART2_CTS)
#define GPIO_PA22B_USART2_CTS (1u << 22)
#define PIN_PA17A_USART2_RTS 17 /**< \brief USART2 signal: RTS on PA17 mux A */
#define MUX_PA17A_USART2_RTS 0
#define PINMUX_PA17A_USART2_RTS ((PIN_PA17A_USART2_RTS << 16) | MUX_PA17A_USART2_RTS)
#define GPIO_PA17A_USART2_RTS (1u << 17)
#define PIN_PA25B_USART2_RXD 25 /**< \brief USART2 signal: RXD on PA25 mux B */
#define MUX_PA25B_USART2_RXD 1
#define PINMUX_PA25B_USART2_RXD ((PIN_PA25B_USART2_RXD << 16) | MUX_PA25B_USART2_RXD)
#define GPIO_PA25B_USART2_RXD (1u << 25)
#define PIN_PA19A_USART2_RXD 19 /**< \brief USART2 signal: RXD on PA19 mux A */
#define MUX_PA19A_USART2_RXD 0
#define PINMUX_PA19A_USART2_RXD ((PIN_PA19A_USART2_RXD << 16) | MUX_PA19A_USART2_RXD)
#define GPIO_PA19A_USART2_RXD (1u << 19)
#define PIN_PA26B_USART2_TXD 26 /**< \brief USART2 signal: TXD on PA26 mux B */
#define MUX_PA26B_USART2_TXD 1
#define PINMUX_PA26B_USART2_TXD ((PIN_PA26B_USART2_TXD << 16) | MUX_PA26B_USART2_TXD)
#define GPIO_PA26B_USART2_TXD (1u << 26)
#define PIN_PA20A_USART2_TXD 20 /**< \brief USART2 signal: TXD on PA20 mux A */
#define MUX_PA20A_USART2_TXD 0
#define PINMUX_PA20A_USART2_TXD ((PIN_PA20A_USART2_TXD << 16) | MUX_PA20A_USART2_TXD)
#define GPIO_PA20A_USART2_TXD (1u << 20)
/* ========== GPIO definition for USART3 peripheral ========== */
#define PIN_PA29E_USART3_CLK 29 /**< \brief USART3 signal: CLK on PA29 mux E */
#define MUX_PA29E_USART3_CLK 4
#define PINMUX_PA29E_USART3_CLK ((PIN_PA29E_USART3_CLK << 16) | MUX_PA29E_USART3_CLK)
#define GPIO_PA29E_USART3_CLK (1u << 29)
#define PIN_PB08A_USART3_CLK 40 /**< \brief USART3 signal: CLK on PB08 mux A */
#define MUX_PB08A_USART3_CLK 0
#define PINMUX_PB08A_USART3_CLK ((PIN_PB08A_USART3_CLK << 16) | MUX_PB08A_USART3_CLK)
#define GPIO_PB08A_USART3_CLK (1u << 8)
#define PIN_PA28E_USART3_CTS 28 /**< \brief USART3 signal: CTS on PA28 mux E */
#define MUX_PA28E_USART3_CTS 4
#define PINMUX_PA28E_USART3_CTS ((PIN_PA28E_USART3_CTS << 16) | MUX_PA28E_USART3_CTS)
#define GPIO_PA28E_USART3_CTS (1u << 28)
#define PIN_PB07A_USART3_CTS 39 /**< \brief USART3 signal: CTS on PB07 mux A */
#define MUX_PB07A_USART3_CTS 0
#define PINMUX_PB07A_USART3_CTS ((PIN_PB07A_USART3_CTS << 16) | MUX_PB07A_USART3_CTS)
#define GPIO_PB07A_USART3_CTS (1u << 7)
#define PIN_PA27E_USART3_RTS 27 /**< \brief USART3 signal: RTS on PA27 mux E */
#define MUX_PA27E_USART3_RTS 4
#define PINMUX_PA27E_USART3_RTS ((PIN_PA27E_USART3_RTS << 16) | MUX_PA27E_USART3_RTS)
#define GPIO_PA27E_USART3_RTS (1u << 27)
#define PIN_PB06A_USART3_RTS 38 /**< \brief USART3 signal: RTS on PB06 mux A */
#define MUX_PB06A_USART3_RTS 0
#define PINMUX_PB06A_USART3_RTS ((PIN_PB06A_USART3_RTS << 16) | MUX_PB06A_USART3_RTS)
#define GPIO_PB06A_USART3_RTS (1u << 6)
#define PIN_PA30E_USART3_RXD 30 /**< \brief USART3 signal: RXD on PA30 mux E */
#define MUX_PA30E_USART3_RXD 4
#define PINMUX_PA30E_USART3_RXD ((PIN_PA30E_USART3_RXD << 16) | MUX_PA30E_USART3_RXD)
#define GPIO_PA30E_USART3_RXD (1u << 30)
#define PIN_PB09A_USART3_RXD 41 /**< \brief USART3 signal: RXD on PB09 mux A */
#define MUX_PB09A_USART3_RXD 0
#define PINMUX_PB09A_USART3_RXD ((PIN_PB09A_USART3_RXD << 16) | MUX_PB09A_USART3_RXD)
#define GPIO_PB09A_USART3_RXD (1u << 9)
#define PIN_PA31E_USART3_TXD 31 /**< \brief USART3 signal: TXD on PA31 mux E */
#define MUX_PA31E_USART3_TXD 4
#define PINMUX_PA31E_USART3_TXD ((PIN_PA31E_USART3_TXD << 16) | MUX_PA31E_USART3_TXD)
#define GPIO_PA31E_USART3_TXD (1u << 31)
#define PIN_PB10A_USART3_TXD 42 /**< \brief USART3 signal: TXD on PB10 mux A */
#define MUX_PB10A_USART3_TXD 0
#define PINMUX_PB10A_USART3_TXD ((PIN_PB10A_USART3_TXD << 16) | MUX_PB10A_USART3_TXD)
#define GPIO_PB10A_USART3_TXD (1u << 10)
/* ========== GPIO definition for ADCIFE peripheral ========== */
#define PIN_PA04A_ADCIFE_AD0 4 /**< \brief ADCIFE signal: AD0 on PA04 mux A */
#define MUX_PA04A_ADCIFE_AD0 0
#define PINMUX_PA04A_ADCIFE_AD0 ((PIN_PA04A_ADCIFE_AD0 << 16) | MUX_PA04A_ADCIFE_AD0)
#define GPIO_PA04A_ADCIFE_AD0 (1u << 4)
#define PIN_PA05A_ADCIFE_AD1 5 /**< \brief ADCIFE signal: AD1 on PA05 mux A */
#define MUX_PA05A_ADCIFE_AD1 0
#define PINMUX_PA05A_ADCIFE_AD1 ((PIN_PA05A_ADCIFE_AD1 << 16) | MUX_PA05A_ADCIFE_AD1)
#define GPIO_PA05A_ADCIFE_AD1 (1u << 5)
#define PIN_PA07A_ADCIFE_AD2 7 /**< \brief ADCIFE signal: AD2 on PA07 mux A */
#define MUX_PA07A_ADCIFE_AD2 0
#define PINMUX_PA07A_ADCIFE_AD2 ((PIN_PA07A_ADCIFE_AD2 << 16) | MUX_PA07A_ADCIFE_AD2)
#define GPIO_PA07A_ADCIFE_AD2 (1u << 7)
#define PIN_PB02A_ADCIFE_AD3 34 /**< \brief ADCIFE signal: AD3 on PB02 mux A */
#define MUX_PB02A_ADCIFE_AD3 0
#define PINMUX_PB02A_ADCIFE_AD3 ((PIN_PB02A_ADCIFE_AD3 << 16) | MUX_PB02A_ADCIFE_AD3)
#define GPIO_PB02A_ADCIFE_AD3 (1u << 2)
#define PIN_PB03A_ADCIFE_AD4 35 /**< \brief ADCIFE signal: AD4 on PB03 mux A */
#define MUX_PB03A_ADCIFE_AD4 0
#define PINMUX_PB03A_ADCIFE_AD4 ((PIN_PB03A_ADCIFE_AD4 << 16) | MUX_PB03A_ADCIFE_AD4)
#define GPIO_PB03A_ADCIFE_AD4 (1u << 3)
#define PIN_PB04A_ADCIFE_AD5 36 /**< \brief ADCIFE signal: AD5 on PB04 mux A */
#define MUX_PB04A_ADCIFE_AD5 0
#define PINMUX_PB04A_ADCIFE_AD5 ((PIN_PB04A_ADCIFE_AD5 << 16) | MUX_PB04A_ADCIFE_AD5)
#define GPIO_PB04A_ADCIFE_AD5 (1u << 4)
#define PIN_PB05A_ADCIFE_AD6 37 /**< \brief ADCIFE signal: AD6 on PB05 mux A */
#define MUX_PB05A_ADCIFE_AD6 0
#define PINMUX_PB05A_ADCIFE_AD6 ((PIN_PB05A_ADCIFE_AD6 << 16) | MUX_PB05A_ADCIFE_AD6)
#define GPIO_PB05A_ADCIFE_AD6 (1u << 5)
#define PIN_PA05E_ADCIFE_TRIGGER 5 /**< \brief ADCIFE signal: TRIGGER on PA05 mux E */
#define MUX_PA05E_ADCIFE_TRIGGER 4
#define PINMUX_PA05E_ADCIFE_TRIGGER ((PIN_PA05E_ADCIFE_TRIGGER << 16) | MUX_PA05E_ADCIFE_TRIGGER)
#define GPIO_PA05E_ADCIFE_TRIGGER (1u << 5)
/* ========== GPIO definition for DACC peripheral ========== */
#define PIN_PB04E_DACC_EXT_TRIG0 36 /**< \brief DACC signal: EXT_TRIG0 on PB04 mux E */
#define MUX_PB04E_DACC_EXT_TRIG0 4
#define PINMUX_PB04E_DACC_EXT_TRIG0 ((PIN_PB04E_DACC_EXT_TRIG0 << 16) | MUX_PB04E_DACC_EXT_TRIG0)
#define GPIO_PB04E_DACC_EXT_TRIG0 (1u << 4)
#define PIN_PA06A_DACC_VOUT 6 /**< \brief DACC signal: VOUT on PA06 mux A */
#define MUX_PA06A_DACC_VOUT 0
#define PINMUX_PA06A_DACC_VOUT ((PIN_PA06A_DACC_VOUT << 16) | MUX_PA06A_DACC_VOUT)
#define GPIO_PA06A_DACC_VOUT (1u << 6)
/* ========== GPIO definition for ACIFC peripheral ========== */
#define PIN_PA06E_ACIFC_ACAN0 6 /**< \brief ACIFC signal: ACAN0 on PA06 mux E */
#define MUX_PA06E_ACIFC_ACAN0 4
#define PINMUX_PA06E_ACIFC_ACAN0 ((PIN_PA06E_ACIFC_ACAN0 << 16) | MUX_PA06E_ACIFC_ACAN0)
#define GPIO_PA06E_ACIFC_ACAN0 (1u << 6)
#define PIN_PA07E_ACIFC_ACAP0 7 /**< \brief ACIFC signal: ACAP0 on PA07 mux E */
#define MUX_PA07E_ACIFC_ACAP0 4
#define PINMUX_PA07E_ACIFC_ACAP0 ((PIN_PA07E_ACIFC_ACAP0 << 16) | MUX_PA07E_ACIFC_ACAP0)
#define GPIO_PA07E_ACIFC_ACAP0 (1u << 7)
#define PIN_PB02E_ACIFC_ACBN0 34 /**< \brief ACIFC signal: ACBN0 on PB02 mux E */
#define MUX_PB02E_ACIFC_ACBN0 4
#define PINMUX_PB02E_ACIFC_ACBN0 ((PIN_PB02E_ACIFC_ACBN0 << 16) | MUX_PB02E_ACIFC_ACBN0)
#define GPIO_PB02E_ACIFC_ACBN0 (1u << 2)
#define PIN_PB03E_ACIFC_ACBP0 35 /**< \brief ACIFC signal: ACBP0 on PB03 mux E */
#define MUX_PB03E_ACIFC_ACBP0 4
#define PINMUX_PB03E_ACIFC_ACBP0 ((PIN_PB03E_ACIFC_ACBP0 << 16) | MUX_PB03E_ACIFC_ACBP0)
#define GPIO_PB03E_ACIFC_ACBP0 (1u << 3)
/* ========== GPIO definition for GLOC peripheral ========== */
#define PIN_PA06D_GLOC_IN0 6 /**< \brief GLOC signal: IN0 on PA06 mux D */
#define MUX_PA06D_GLOC_IN0 3
#define PINMUX_PA06D_GLOC_IN0 ((PIN_PA06D_GLOC_IN0 << 16) | MUX_PA06D_GLOC_IN0)
#define GPIO_PA06D_GLOC_IN0 (1u << 6)
#define PIN_PA20D_GLOC_IN0 20 /**< \brief GLOC signal: IN0 on PA20 mux D */
#define MUX_PA20D_GLOC_IN0 3
#define PINMUX_PA20D_GLOC_IN0 ((PIN_PA20D_GLOC_IN0 << 16) | MUX_PA20D_GLOC_IN0)
#define GPIO_PA20D_GLOC_IN0 (1u << 20)
#define PIN_PA04D_GLOC_IN1 4 /**< \brief GLOC signal: IN1 on PA04 mux D */
#define MUX_PA04D_GLOC_IN1 3
#define PINMUX_PA04D_GLOC_IN1 ((PIN_PA04D_GLOC_IN1 << 16) | MUX_PA04D_GLOC_IN1)
#define GPIO_PA04D_GLOC_IN1 (1u << 4)
#define PIN_PA21D_GLOC_IN1 21 /**< \brief GLOC signal: IN1 on PA21 mux D */
#define MUX_PA21D_GLOC_IN1 3
#define PINMUX_PA21D_GLOC_IN1 ((PIN_PA21D_GLOC_IN1 << 16) | MUX_PA21D_GLOC_IN1)
#define GPIO_PA21D_GLOC_IN1 (1u << 21)
#define PIN_PA05D_GLOC_IN2 5 /**< \brief GLOC signal: IN2 on PA05 mux D */
#define MUX_PA05D_GLOC_IN2 3
#define PINMUX_PA05D_GLOC_IN2 ((PIN_PA05D_GLOC_IN2 << 16) | MUX_PA05D_GLOC_IN2)
#define GPIO_PA05D_GLOC_IN2 (1u << 5)
#define PIN_PA22D_GLOC_IN2 22 /**< \brief GLOC signal: IN2 on PA22 mux D */
#define MUX_PA22D_GLOC_IN2 3
#define PINMUX_PA22D_GLOC_IN2 ((PIN_PA22D_GLOC_IN2 << 16) | MUX_PA22D_GLOC_IN2)
#define GPIO_PA22D_GLOC_IN2 (1u << 22)
#define PIN_PA07D_GLOC_IN3 7 /**< \brief GLOC signal: IN3 on PA07 mux D */
#define MUX_PA07D_GLOC_IN3 3
#define PINMUX_PA07D_GLOC_IN3 ((PIN_PA07D_GLOC_IN3 << 16) | MUX_PA07D_GLOC_IN3)
#define GPIO_PA07D_GLOC_IN3 (1u << 7)
#define PIN_PA23D_GLOC_IN3 23 /**< \brief GLOC signal: IN3 on PA23 mux D */
#define MUX_PA23D_GLOC_IN3 3
#define PINMUX_PA23D_GLOC_IN3 ((PIN_PA23D_GLOC_IN3 << 16) | MUX_PA23D_GLOC_IN3)
#define GPIO_PA23D_GLOC_IN3 (1u << 23)
#define PIN_PA27D_GLOC_IN4 27 /**< \brief GLOC signal: IN4 on PA27 mux D */
#define MUX_PA27D_GLOC_IN4 3
#define PINMUX_PA27D_GLOC_IN4 ((PIN_PA27D_GLOC_IN4 << 16) | MUX_PA27D_GLOC_IN4)
#define GPIO_PA27D_GLOC_IN4 (1u << 27)
#define PIN_PB06C_GLOC_IN4 38 /**< \brief GLOC signal: IN4 on PB06 mux C */
#define MUX_PB06C_GLOC_IN4 2
#define PINMUX_PB06C_GLOC_IN4 ((PIN_PB06C_GLOC_IN4 << 16) | MUX_PB06C_GLOC_IN4)
#define GPIO_PB06C_GLOC_IN4 (1u << 6)
#define PIN_PA28D_GLOC_IN5 28 /**< \brief GLOC signal: IN5 on PA28 mux D */
#define MUX_PA28D_GLOC_IN5 3
#define PINMUX_PA28D_GLOC_IN5 ((PIN_PA28D_GLOC_IN5 << 16) | MUX_PA28D_GLOC_IN5)
#define GPIO_PA28D_GLOC_IN5 (1u << 28)
#define PIN_PB07C_GLOC_IN5 39 /**< \brief GLOC signal: IN5 on PB07 mux C */
#define MUX_PB07C_GLOC_IN5 2
#define PINMUX_PB07C_GLOC_IN5 ((PIN_PB07C_GLOC_IN5 << 16) | MUX_PB07C_GLOC_IN5)
#define GPIO_PB07C_GLOC_IN5 (1u << 7)
#define PIN_PA29D_GLOC_IN6 29 /**< \brief GLOC signal: IN6 on PA29 mux D */
#define MUX_PA29D_GLOC_IN6 3
#define PINMUX_PA29D_GLOC_IN6 ((PIN_PA29D_GLOC_IN6 << 16) | MUX_PA29D_GLOC_IN6)
#define GPIO_PA29D_GLOC_IN6 (1u << 29)
#define PIN_PB08C_GLOC_IN6 40 /**< \brief GLOC signal: IN6 on PB08 mux C */
#define MUX_PB08C_GLOC_IN6 2
#define PINMUX_PB08C_GLOC_IN6 ((PIN_PB08C_GLOC_IN6 << 16) | MUX_PB08C_GLOC_IN6)
#define GPIO_PB08C_GLOC_IN6 (1u << 8)
#define PIN_PA30D_GLOC_IN7 30 /**< \brief GLOC signal: IN7 on PA30 mux D */
#define MUX_PA30D_GLOC_IN7 3
#define PINMUX_PA30D_GLOC_IN7 ((PIN_PA30D_GLOC_IN7 << 16) | MUX_PA30D_GLOC_IN7)
#define GPIO_PA30D_GLOC_IN7 (1u << 30)
#define PIN_PB09C_GLOC_IN7 41 /**< \brief GLOC signal: IN7 on PB09 mux C */
#define MUX_PB09C_GLOC_IN7 2
#define PINMUX_PB09C_GLOC_IN7 ((PIN_PB09C_GLOC_IN7 << 16) | MUX_PB09C_GLOC_IN7)
#define GPIO_PB09C_GLOC_IN7 (1u << 9)
#define PIN_PA08D_GLOC_OUT0 8 /**< \brief GLOC signal: OUT0 on PA08 mux D */
#define MUX_PA08D_GLOC_OUT0 3
#define PINMUX_PA08D_GLOC_OUT0 ((PIN_PA08D_GLOC_OUT0 << 16) | MUX_PA08D_GLOC_OUT0)
#define GPIO_PA08D_GLOC_OUT0 (1u << 8)
#define PIN_PA24D_GLOC_OUT0 24 /**< \brief GLOC signal: OUT0 on PA24 mux D */
#define MUX_PA24D_GLOC_OUT0 3
#define PINMUX_PA24D_GLOC_OUT0 ((PIN_PA24D_GLOC_OUT0 << 16) | MUX_PA24D_GLOC_OUT0)
#define GPIO_PA24D_GLOC_OUT0 (1u << 24)
#define PIN_PA31D_GLOC_OUT1 31 /**< \brief GLOC signal: OUT1 on PA31 mux D */
#define MUX_PA31D_GLOC_OUT1 3
#define PINMUX_PA31D_GLOC_OUT1 ((PIN_PA31D_GLOC_OUT1 << 16) | MUX_PA31D_GLOC_OUT1)
#define GPIO_PA31D_GLOC_OUT1 (1u << 31)
#define PIN_PB10C_GLOC_OUT1 42 /**< \brief GLOC signal: OUT1 on PB10 mux C */
#define MUX_PB10C_GLOC_OUT1 2
#define PINMUX_PB10C_GLOC_OUT1 ((PIN_PB10C_GLOC_OUT1 << 16) | MUX_PB10C_GLOC_OUT1)
#define GPIO_PB10C_GLOC_OUT1 (1u << 10)
/* ========== GPIO definition for ABDACB peripheral ========== */
#define PIN_PA31C_ABDACB_CLK 31 /**< \brief ABDACB signal: CLK on PA31 mux C */
#define MUX_PA31C_ABDACB_CLK 2
#define PINMUX_PA31C_ABDACB_CLK ((PIN_PA31C_ABDACB_CLK << 16) | MUX_PA31C_ABDACB_CLK)
#define GPIO_PA31C_ABDACB_CLK (1u << 31)
#define PIN_PA27C_ABDACB_DAC0 27 /**< \brief ABDACB signal: DAC0 on PA27 mux C */
#define MUX_PA27C_ABDACB_DAC0 2
#define PINMUX_PA27C_ABDACB_DAC0 ((PIN_PA27C_ABDACB_DAC0 << 16) | MUX_PA27C_ABDACB_DAC0)
#define GPIO_PA27C_ABDACB_DAC0 (1u << 27)
#define PIN_PB02C_ABDACB_DAC0 34 /**< \brief ABDACB signal: DAC0 on PB02 mux C */
#define MUX_PB02C_ABDACB_DAC0 2
#define PINMUX_PB02C_ABDACB_DAC0 ((PIN_PB02C_ABDACB_DAC0 << 16) | MUX_PB02C_ABDACB_DAC0)
#define GPIO_PB02C_ABDACB_DAC0 (1u << 2)
#define PIN_PA17B_ABDACB_DAC0 17 /**< \brief ABDACB signal: DAC0 on PA17 mux B */
#define MUX_PA17B_ABDACB_DAC0 1
#define PINMUX_PA17B_ABDACB_DAC0 ((PIN_PA17B_ABDACB_DAC0 << 16) | MUX_PA17B_ABDACB_DAC0)
#define GPIO_PA17B_ABDACB_DAC0 (1u << 17)
#define PIN_PA29C_ABDACB_DAC1 29 /**< \brief ABDACB signal: DAC1 on PA29 mux C */
#define MUX_PA29C_ABDACB_DAC1 2
#define PINMUX_PA29C_ABDACB_DAC1 ((PIN_PA29C_ABDACB_DAC1 << 16) | MUX_PA29C_ABDACB_DAC1)
#define GPIO_PA29C_ABDACB_DAC1 (1u << 29)
#define PIN_PB04C_ABDACB_DAC1 36 /**< \brief ABDACB signal: DAC1 on PB04 mux C */
#define MUX_PB04C_ABDACB_DAC1 2
#define PINMUX_PB04C_ABDACB_DAC1 ((PIN_PB04C_ABDACB_DAC1 << 16) | MUX_PB04C_ABDACB_DAC1)
#define GPIO_PB04C_ABDACB_DAC1 (1u << 4)
#define PIN_PA19B_ABDACB_DAC1 19 /**< \brief ABDACB signal: DAC1 on PA19 mux B */
#define MUX_PA19B_ABDACB_DAC1 1
#define PINMUX_PA19B_ABDACB_DAC1 ((PIN_PA19B_ABDACB_DAC1 << 16) | MUX_PA19B_ABDACB_DAC1)
#define GPIO_PA19B_ABDACB_DAC1 (1u << 19)
#define PIN_PA28C_ABDACB_DACN0 28 /**< \brief ABDACB signal: DACN0 on PA28 mux C */
#define MUX_PA28C_ABDACB_DACN0 2
#define PINMUX_PA28C_ABDACB_DACN0 ((PIN_PA28C_ABDACB_DACN0 << 16) | MUX_PA28C_ABDACB_DACN0)
#define GPIO_PA28C_ABDACB_DACN0 (1u << 28)
#define PIN_PB03C_ABDACB_DACN0 35 /**< \brief ABDACB signal: DACN0 on PB03 mux C */
#define MUX_PB03C_ABDACB_DACN0 2
#define PINMUX_PB03C_ABDACB_DACN0 ((PIN_PB03C_ABDACB_DACN0 << 16) | MUX_PB03C_ABDACB_DACN0)
#define GPIO_PB03C_ABDACB_DACN0 (1u << 3)
#define PIN_PA18B_ABDACB_DACN0 18 /**< \brief ABDACB signal: DACN0 on PA18 mux B */
#define MUX_PA18B_ABDACB_DACN0 1
#define PINMUX_PA18B_ABDACB_DACN0 ((PIN_PA18B_ABDACB_DACN0 << 16) | MUX_PA18B_ABDACB_DACN0)
#define GPIO_PA18B_ABDACB_DACN0 (1u << 18)
#define PIN_PA30C_ABDACB_DACN1 30 /**< \brief ABDACB signal: DACN1 on PA30 mux C */
#define MUX_PA30C_ABDACB_DACN1 2
#define PINMUX_PA30C_ABDACB_DACN1 ((PIN_PA30C_ABDACB_DACN1 << 16) | MUX_PA30C_ABDACB_DACN1)
#define GPIO_PA30C_ABDACB_DACN1 (1u << 30)
#define PIN_PB05C_ABDACB_DACN1 37 /**< \brief ABDACB signal: DACN1 on PB05 mux C */
#define MUX_PB05C_ABDACB_DACN1 2
#define PINMUX_PB05C_ABDACB_DACN1 ((PIN_PB05C_ABDACB_DACN1 << 16) | MUX_PB05C_ABDACB_DACN1)
#define GPIO_PB05C_ABDACB_DACN1 (1u << 5)
#define PIN_PA20B_ABDACB_DACN1 20 /**< \brief ABDACB signal: DACN1 on PA20 mux B */
#define MUX_PA20B_ABDACB_DACN1 1
#define PINMUX_PA20B_ABDACB_DACN1 ((PIN_PA20B_ABDACB_DACN1 << 16) | MUX_PA20B_ABDACB_DACN1)
#define GPIO_PA20B_ABDACB_DACN1 (1u << 20)
/* ========== GPIO definition for PARC peripheral ========== */
#define PIN_PA17D_PARC_PCCK 17 /**< \brief PARC signal: PCCK on PA17 mux D */
#define MUX_PA17D_PARC_PCCK 3
#define PINMUX_PA17D_PARC_PCCK ((PIN_PA17D_PARC_PCCK << 16) | MUX_PA17D_PARC_PCCK)
#define GPIO_PA17D_PARC_PCCK (1u << 17)
#define PIN_PA09D_PARC_PCDATA0 9 /**< \brief PARC signal: PCDATA0 on PA09 mux D */
#define MUX_PA09D_PARC_PCDATA0 3
#define PINMUX_PA09D_PARC_PCDATA0 ((PIN_PA09D_PARC_PCDATA0 << 16) | MUX_PA09D_PARC_PCDATA0)
#define GPIO_PA09D_PARC_PCDATA0 (1u << 9)
#define PIN_PA10D_PARC_PCDATA1 10 /**< \brief PARC signal: PCDATA1 on PA10 mux D */
#define MUX_PA10D_PARC_PCDATA1 3
#define PINMUX_PA10D_PARC_PCDATA1 ((PIN_PA10D_PARC_PCDATA1 << 16) | MUX_PA10D_PARC_PCDATA1)
#define GPIO_PA10D_PARC_PCDATA1 (1u << 10)
#define PIN_PA11D_PARC_PCDATA2 11 /**< \brief PARC signal: PCDATA2 on PA11 mux D */
#define MUX_PA11D_PARC_PCDATA2 3
#define PINMUX_PA11D_PARC_PCDATA2 ((PIN_PA11D_PARC_PCDATA2 << 16) | MUX_PA11D_PARC_PCDATA2)
#define GPIO_PA11D_PARC_PCDATA2 (1u << 11)
#define PIN_PA12D_PARC_PCDATA3 12 /**< \brief PARC signal: PCDATA3 on PA12 mux D */
#define MUX_PA12D_PARC_PCDATA3 3
#define PINMUX_PA12D_PARC_PCDATA3 ((PIN_PA12D_PARC_PCDATA3 << 16) | MUX_PA12D_PARC_PCDATA3)
#define GPIO_PA12D_PARC_PCDATA3 (1u << 12)
#define PIN_PA13D_PARC_PCDATA4 13 /**< \brief PARC signal: PCDATA4 on PA13 mux D */
#define MUX_PA13D_PARC_PCDATA4 3
#define PINMUX_PA13D_PARC_PCDATA4 ((PIN_PA13D_PARC_PCDATA4 << 16) | MUX_PA13D_PARC_PCDATA4)
#define GPIO_PA13D_PARC_PCDATA4 (1u << 13)
#define PIN_PA14D_PARC_PCDATA5 14 /**< \brief PARC signal: PCDATA5 on PA14 mux D */
#define MUX_PA14D_PARC_PCDATA5 3
#define PINMUX_PA14D_PARC_PCDATA5 ((PIN_PA14D_PARC_PCDATA5 << 16) | MUX_PA14D_PARC_PCDATA5)
#define GPIO_PA14D_PARC_PCDATA5 (1u << 14)
#define PIN_PA15D_PARC_PCDATA6 15 /**< \brief PARC signal: PCDATA6 on PA15 mux D */
#define MUX_PA15D_PARC_PCDATA6 3
#define PINMUX_PA15D_PARC_PCDATA6 ((PIN_PA15D_PARC_PCDATA6 << 16) | MUX_PA15D_PARC_PCDATA6)
#define GPIO_PA15D_PARC_PCDATA6 (1u << 15)
#define PIN_PA16D_PARC_PCDATA7 16 /**< \brief PARC signal: PCDATA7 on PA16 mux D */
#define MUX_PA16D_PARC_PCDATA7 3
#define PINMUX_PA16D_PARC_PCDATA7 ((PIN_PA16D_PARC_PCDATA7 << 16) | MUX_PA16D_PARC_PCDATA7)
#define GPIO_PA16D_PARC_PCDATA7 (1u << 16)
#define PIN_PA18D_PARC_PCEN1 18 /**< \brief PARC signal: PCEN1 on PA18 mux D */
#define MUX_PA18D_PARC_PCEN1 3
#define PINMUX_PA18D_PARC_PCEN1 ((PIN_PA18D_PARC_PCEN1 << 16) | MUX_PA18D_PARC_PCEN1)
#define GPIO_PA18D_PARC_PCEN1 (1u << 18)
#define PIN_PA19D_PARC_PCEN2 19 /**< \brief PARC signal: PCEN2 on PA19 mux D */
#define MUX_PA19D_PARC_PCEN2 3
#define PINMUX_PA19D_PARC_PCEN2 ((PIN_PA19D_PARC_PCEN2 << 16) | MUX_PA19D_PARC_PCEN2)
#define GPIO_PA19D_PARC_PCEN2 (1u << 19)
/* ========== GPIO definition for CATB peripheral ========== */
#define PIN_PA02G_CATB_DIS 2 /**< \brief CATB signal: DIS on PA02 mux G */
#define MUX_PA02G_CATB_DIS 6
#define PINMUX_PA02G_CATB_DIS ((PIN_PA02G_CATB_DIS << 16) | MUX_PA02G_CATB_DIS)
#define GPIO_PA02G_CATB_DIS (1u << 2)
#define PIN_PA12G_CATB_DIS 12 /**< \brief CATB signal: DIS on PA12 mux G */
#define MUX_PA12G_CATB_DIS 6
#define PINMUX_PA12G_CATB_DIS ((PIN_PA12G_CATB_DIS << 16) | MUX_PA12G_CATB_DIS)
#define GPIO_PA12G_CATB_DIS (1u << 12)
#define PIN_PA23G_CATB_DIS 23 /**< \brief CATB signal: DIS on PA23 mux G */
#define MUX_PA23G_CATB_DIS 6
#define PINMUX_PA23G_CATB_DIS ((PIN_PA23G_CATB_DIS << 16) | MUX_PA23G_CATB_DIS)
#define GPIO_PA23G_CATB_DIS (1u << 23)
#define PIN_PA31G_CATB_DIS 31 /**< \brief CATB signal: DIS on PA31 mux G */
#define MUX_PA31G_CATB_DIS 6
#define PINMUX_PA31G_CATB_DIS ((PIN_PA31G_CATB_DIS << 16) | MUX_PA31G_CATB_DIS)
#define GPIO_PA31G_CATB_DIS (1u << 31)
#define PIN_PB03G_CATB_DIS 35 /**< \brief CATB signal: DIS on PB03 mux G */
#define MUX_PB03G_CATB_DIS 6
#define PINMUX_PB03G_CATB_DIS ((PIN_PB03G_CATB_DIS << 16) | MUX_PB03G_CATB_DIS)
#define GPIO_PB03G_CATB_DIS (1u << 3)
#define PIN_PB12G_CATB_DIS 44 /**< \brief CATB signal: DIS on PB12 mux G */
#define MUX_PB12G_CATB_DIS 6
#define PINMUX_PB12G_CATB_DIS ((PIN_PB12G_CATB_DIS << 16) | MUX_PB12G_CATB_DIS)
#define GPIO_PB12G_CATB_DIS (1u << 12)
#define PIN_PA04G_CATB_SENSE0 4 /**< \brief CATB signal: SENSE0 on PA04 mux G */
#define MUX_PA04G_CATB_SENSE0 6
#define PINMUX_PA04G_CATB_SENSE0 ((PIN_PA04G_CATB_SENSE0 << 16) | MUX_PA04G_CATB_SENSE0)
#define GPIO_PA04G_CATB_SENSE0 (1u << 4)
#define PIN_PA27G_CATB_SENSE0 27 /**< \brief CATB signal: SENSE0 on PA27 mux G */
#define MUX_PA27G_CATB_SENSE0 6
#define PINMUX_PA27G_CATB_SENSE0 ((PIN_PA27G_CATB_SENSE0 << 16) | MUX_PA27G_CATB_SENSE0)
#define GPIO_PA27G_CATB_SENSE0 (1u << 27)
#define PIN_PB13G_CATB_SENSE0 45 /**< \brief CATB signal: SENSE0 on PB13 mux G */
#define MUX_PB13G_CATB_SENSE0 6
#define PINMUX_PB13G_CATB_SENSE0 ((PIN_PB13G_CATB_SENSE0 << 16) | MUX_PB13G_CATB_SENSE0)
#define GPIO_PB13G_CATB_SENSE0 (1u << 13)
#define PIN_PA05G_CATB_SENSE1 5 /**< \brief CATB signal: SENSE1 on PA05 mux G */
#define MUX_PA05G_CATB_SENSE1 6
#define PINMUX_PA05G_CATB_SENSE1 ((PIN_PA05G_CATB_SENSE1 << 16) | MUX_PA05G_CATB_SENSE1)
#define GPIO_PA05G_CATB_SENSE1 (1u << 5)
#define PIN_PA28G_CATB_SENSE1 28 /**< \brief CATB signal: SENSE1 on PA28 mux G */
#define MUX_PA28G_CATB_SENSE1 6
#define PINMUX_PA28G_CATB_SENSE1 ((PIN_PA28G_CATB_SENSE1 << 16) | MUX_PA28G_CATB_SENSE1)
#define GPIO_PA28G_CATB_SENSE1 (1u << 28)
#define PIN_PB14G_CATB_SENSE1 46 /**< \brief CATB signal: SENSE1 on PB14 mux G */
#define MUX_PB14G_CATB_SENSE1 6
#define PINMUX_PB14G_CATB_SENSE1 ((PIN_PB14G_CATB_SENSE1 << 16) | MUX_PB14G_CATB_SENSE1)
#define GPIO_PB14G_CATB_SENSE1 (1u << 14)
#define PIN_PA06G_CATB_SENSE2 6 /**< \brief CATB signal: SENSE2 on PA06 mux G */
#define MUX_PA06G_CATB_SENSE2 6
#define PINMUX_PA06G_CATB_SENSE2 ((PIN_PA06G_CATB_SENSE2 << 16) | MUX_PA06G_CATB_SENSE2)
#define GPIO_PA06G_CATB_SENSE2 (1u << 6)
#define PIN_PA29G_CATB_SENSE2 29 /**< \brief CATB signal: SENSE2 on PA29 mux G */
#define MUX_PA29G_CATB_SENSE2 6
#define PINMUX_PA29G_CATB_SENSE2 ((PIN_PA29G_CATB_SENSE2 << 16) | MUX_PA29G_CATB_SENSE2)
#define GPIO_PA29G_CATB_SENSE2 (1u << 29)
#define PIN_PB15G_CATB_SENSE2 47 /**< \brief CATB signal: SENSE2 on PB15 mux G */
#define MUX_PB15G_CATB_SENSE2 6
#define PINMUX_PB15G_CATB_SENSE2 ((PIN_PB15G_CATB_SENSE2 << 16) | MUX_PB15G_CATB_SENSE2)
#define GPIO_PB15G_CATB_SENSE2 (1u << 15)
#define PIN_PA07G_CATB_SENSE3 7 /**< \brief CATB signal: SENSE3 on PA07 mux G */
#define MUX_PA07G_CATB_SENSE3 6
#define PINMUX_PA07G_CATB_SENSE3 ((PIN_PA07G_CATB_SENSE3 << 16) | MUX_PA07G_CATB_SENSE3)
#define GPIO_PA07G_CATB_SENSE3 (1u << 7)
#define PIN_PA30G_CATB_SENSE3 30 /**< \brief CATB signal: SENSE3 on PA30 mux G */
#define MUX_PA30G_CATB_SENSE3 6
#define PINMUX_PA30G_CATB_SENSE3 ((PIN_PA30G_CATB_SENSE3 << 16) | MUX_PA30G_CATB_SENSE3)
#define GPIO_PA30G_CATB_SENSE3 (1u << 30)
#define PIN_PA08G_CATB_SENSE4 8 /**< \brief CATB signal: SENSE4 on PA08 mux G */
#define MUX_PA08G_CATB_SENSE4 6
#define PINMUX_PA08G_CATB_SENSE4 ((PIN_PA08G_CATB_SENSE4 << 16) | MUX_PA08G_CATB_SENSE4)
#define GPIO_PA08G_CATB_SENSE4 (1u << 8)
#define PIN_PA09G_CATB_SENSE5 9 /**< \brief CATB signal: SENSE5 on PA09 mux G */
#define MUX_PA09G_CATB_SENSE5 6
#define PINMUX_PA09G_CATB_SENSE5 ((PIN_PA09G_CATB_SENSE5 << 16) | MUX_PA09G_CATB_SENSE5)
#define GPIO_PA09G_CATB_SENSE5 (1u << 9)
#define PIN_PA10G_CATB_SENSE6 10 /**< \brief CATB signal: SENSE6 on PA10 mux G */
#define MUX_PA10G_CATB_SENSE6 6
#define PINMUX_PA10G_CATB_SENSE6 ((PIN_PA10G_CATB_SENSE6 << 16) | MUX_PA10G_CATB_SENSE6)
#define GPIO_PA10G_CATB_SENSE6 (1u << 10)
#define PIN_PA11G_CATB_SENSE7 11 /**< \brief CATB signal: SENSE7 on PA11 mux G */
#define MUX_PA11G_CATB_SENSE7 6
#define PINMUX_PA11G_CATB_SENSE7 ((PIN_PA11G_CATB_SENSE7 << 16) | MUX_PA11G_CATB_SENSE7)
#define GPIO_PA11G_CATB_SENSE7 (1u << 11)
#define PIN_PA13G_CATB_SENSE8 13 /**< \brief CATB signal: SENSE8 on PA13 mux G */
#define MUX_PA13G_CATB_SENSE8 6
#define PINMUX_PA13G_CATB_SENSE8 ((PIN_PA13G_CATB_SENSE8 << 16) | MUX_PA13G_CATB_SENSE8)
#define GPIO_PA13G_CATB_SENSE8 (1u << 13)
#define PIN_PA14G_CATB_SENSE9 14 /**< \brief CATB signal: SENSE9 on PA14 mux G */
#define MUX_PA14G_CATB_SENSE9 6
#define PINMUX_PA14G_CATB_SENSE9 ((PIN_PA14G_CATB_SENSE9 << 16) | MUX_PA14G_CATB_SENSE9)
#define GPIO_PA14G_CATB_SENSE9 (1u << 14)
#define PIN_PA15G_CATB_SENSE10 15 /**< \brief CATB signal: SENSE10 on PA15 mux G */
#define MUX_PA15G_CATB_SENSE10 6
#define PINMUX_PA15G_CATB_SENSE10 ((PIN_PA15G_CATB_SENSE10 << 16) | MUX_PA15G_CATB_SENSE10)
#define GPIO_PA15G_CATB_SENSE10 (1u << 15)
#define PIN_PA16G_CATB_SENSE11 16 /**< \brief CATB signal: SENSE11 on PA16 mux G */
#define MUX_PA16G_CATB_SENSE11 6
#define PINMUX_PA16G_CATB_SENSE11 ((PIN_PA16G_CATB_SENSE11 << 16) | MUX_PA16G_CATB_SENSE11)
#define GPIO_PA16G_CATB_SENSE11 (1u << 16)
#define PIN_PA17G_CATB_SENSE12 17 /**< \brief CATB signal: SENSE12 on PA17 mux G */
#define MUX_PA17G_CATB_SENSE12 6
#define PINMUX_PA17G_CATB_SENSE12 ((PIN_PA17G_CATB_SENSE12 << 16) | MUX_PA17G_CATB_SENSE12)
#define GPIO_PA17G_CATB_SENSE12 (1u << 17)
#define PIN_PA18G_CATB_SENSE13 18 /**< \brief CATB signal: SENSE13 on PA18 mux G */
#define MUX_PA18G_CATB_SENSE13 6
#define PINMUX_PA18G_CATB_SENSE13 ((PIN_PA18G_CATB_SENSE13 << 16) | MUX_PA18G_CATB_SENSE13)
#define GPIO_PA18G_CATB_SENSE13 (1u << 18)
#define PIN_PA19G_CATB_SENSE14 19 /**< \brief CATB signal: SENSE14 on PA19 mux G */
#define MUX_PA19G_CATB_SENSE14 6
#define PINMUX_PA19G_CATB_SENSE14 ((PIN_PA19G_CATB_SENSE14 << 16) | MUX_PA19G_CATB_SENSE14)
#define GPIO_PA19G_CATB_SENSE14 (1u << 19)
#define PIN_PA20G_CATB_SENSE15 20 /**< \brief CATB signal: SENSE15 on PA20 mux G */
#define MUX_PA20G_CATB_SENSE15 6
#define PINMUX_PA20G_CATB_SENSE15 ((PIN_PA20G_CATB_SENSE15 << 16) | MUX_PA20G_CATB_SENSE15)
#define GPIO_PA20G_CATB_SENSE15 (1u << 20)
#define PIN_PA21G_CATB_SENSE16 21 /**< \brief CATB signal: SENSE16 on PA21 mux G */
#define MUX_PA21G_CATB_SENSE16 6
#define PINMUX_PA21G_CATB_SENSE16 ((PIN_PA21G_CATB_SENSE16 << 16) | MUX_PA21G_CATB_SENSE16)
#define GPIO_PA21G_CATB_SENSE16 (1u << 21)
#define PIN_PA22G_CATB_SENSE17 22 /**< \brief CATB signal: SENSE17 on PA22 mux G */
#define MUX_PA22G_CATB_SENSE17 6
#define PINMUX_PA22G_CATB_SENSE17 ((PIN_PA22G_CATB_SENSE17 << 16) | MUX_PA22G_CATB_SENSE17)
#define GPIO_PA22G_CATB_SENSE17 (1u << 22)
#define PIN_PA24G_CATB_SENSE18 24 /**< \brief CATB signal: SENSE18 on PA24 mux G */
#define MUX_PA24G_CATB_SENSE18 6
#define PINMUX_PA24G_CATB_SENSE18 ((PIN_PA24G_CATB_SENSE18 << 16) | MUX_PA24G_CATB_SENSE18)
#define GPIO_PA24G_CATB_SENSE18 (1u << 24)
#define PIN_PA25G_CATB_SENSE19 25 /**< \brief CATB signal: SENSE19 on PA25 mux G */
#define MUX_PA25G_CATB_SENSE19 6
#define PINMUX_PA25G_CATB_SENSE19 ((PIN_PA25G_CATB_SENSE19 << 16) | MUX_PA25G_CATB_SENSE19)
#define GPIO_PA25G_CATB_SENSE19 (1u << 25)
#define PIN_PA26G_CATB_SENSE20 26 /**< \brief CATB signal: SENSE20 on PA26 mux G */
#define MUX_PA26G_CATB_SENSE20 6
#define PINMUX_PA26G_CATB_SENSE20 ((PIN_PA26G_CATB_SENSE20 << 16) | MUX_PA26G_CATB_SENSE20)
#define GPIO_PA26G_CATB_SENSE20 (1u << 26)
#define PIN_PB00G_CATB_SENSE21 32 /**< \brief CATB signal: SENSE21 on PB00 mux G */
#define MUX_PB00G_CATB_SENSE21 6
#define PINMUX_PB00G_CATB_SENSE21 ((PIN_PB00G_CATB_SENSE21 << 16) | MUX_PB00G_CATB_SENSE21)
#define GPIO_PB00G_CATB_SENSE21 (1u << 0)
#define PIN_PB01G_CATB_SENSE22 33 /**< \brief CATB signal: SENSE22 on PB01 mux G */
#define MUX_PB01G_CATB_SENSE22 6
#define PINMUX_PB01G_CATB_SENSE22 ((PIN_PB01G_CATB_SENSE22 << 16) | MUX_PB01G_CATB_SENSE22)
#define GPIO_PB01G_CATB_SENSE22 (1u << 1)
#define PIN_PB02G_CATB_SENSE23 34 /**< \brief CATB signal: SENSE23 on PB02 mux G */
#define MUX_PB02G_CATB_SENSE23 6
#define PINMUX_PB02G_CATB_SENSE23 ((PIN_PB02G_CATB_SENSE23 << 16) | MUX_PB02G_CATB_SENSE23)
#define GPIO_PB02G_CATB_SENSE23 (1u << 2)
#define PIN_PB04G_CATB_SENSE24 36 /**< \brief CATB signal: SENSE24 on PB04 mux G */
#define MUX_PB04G_CATB_SENSE24 6
#define PINMUX_PB04G_CATB_SENSE24 ((PIN_PB04G_CATB_SENSE24 << 16) | MUX_PB04G_CATB_SENSE24)
#define GPIO_PB04G_CATB_SENSE24 (1u << 4)
#define PIN_PB05G_CATB_SENSE25 37 /**< \brief CATB signal: SENSE25 on PB05 mux G */
#define MUX_PB05G_CATB_SENSE25 6
#define PINMUX_PB05G_CATB_SENSE25 ((PIN_PB05G_CATB_SENSE25 << 16) | MUX_PB05G_CATB_SENSE25)
#define GPIO_PB05G_CATB_SENSE25 (1u << 5)
#define PIN_PB06G_CATB_SENSE26 38 /**< \brief CATB signal: SENSE26 on PB06 mux G */
#define MUX_PB06G_CATB_SENSE26 6
#define PINMUX_PB06G_CATB_SENSE26 ((PIN_PB06G_CATB_SENSE26 << 16) | MUX_PB06G_CATB_SENSE26)
#define GPIO_PB06G_CATB_SENSE26 (1u << 6)
#define PIN_PB07G_CATB_SENSE27 39 /**< \brief CATB signal: SENSE27 on PB07 mux G */
#define MUX_PB07G_CATB_SENSE27 6
#define PINMUX_PB07G_CATB_SENSE27 ((PIN_PB07G_CATB_SENSE27 << 16) | MUX_PB07G_CATB_SENSE27)
#define GPIO_PB07G_CATB_SENSE27 (1u << 7)
#define PIN_PB08G_CATB_SENSE28 40 /**< \brief CATB signal: SENSE28 on PB08 mux G */
#define MUX_PB08G_CATB_SENSE28 6
#define PINMUX_PB08G_CATB_SENSE28 ((PIN_PB08G_CATB_SENSE28 << 16) | MUX_PB08G_CATB_SENSE28)
#define GPIO_PB08G_CATB_SENSE28 (1u << 8)
#define PIN_PB09G_CATB_SENSE29 41 /**< \brief CATB signal: SENSE29 on PB09 mux G */
#define MUX_PB09G_CATB_SENSE29 6
#define PINMUX_PB09G_CATB_SENSE29 ((PIN_PB09G_CATB_SENSE29 << 16) | MUX_PB09G_CATB_SENSE29)
#define GPIO_PB09G_CATB_SENSE29 (1u << 9)
#define PIN_PB10G_CATB_SENSE30 42 /**< \brief CATB signal: SENSE30 on PB10 mux G */
#define MUX_PB10G_CATB_SENSE30 6
#define PINMUX_PB10G_CATB_SENSE30 ((PIN_PB10G_CATB_SENSE30 << 16) | MUX_PB10G_CATB_SENSE30)
#define GPIO_PB10G_CATB_SENSE30 (1u << 10)
#define PIN_PB11G_CATB_SENSE31 43 /**< \brief CATB signal: SENSE31 on PB11 mux G */
#define MUX_PB11G_CATB_SENSE31 6
#define PINMUX_PB11G_CATB_SENSE31 ((PIN_PB11G_CATB_SENSE31 << 16) | MUX_PB11G_CATB_SENSE31)
#define GPIO_PB11G_CATB_SENSE31 (1u << 11)
/* ========== GPIO definition for USBC peripheral ========== */
#define PIN_PA25A_USBC_DM 25 /**< \brief USBC signal: DM on PA25 mux A */
#define MUX_PA25A_USBC_DM 0
#define PINMUX_PA25A_USBC_DM ((PIN_PA25A_USBC_DM << 16) | MUX_PA25A_USBC_DM)
#define GPIO_PA25A_USBC_DM (1u << 25)
#define PIN_PA26A_USBC_DP 26 /**< \brief USBC signal: DP on PA26 mux A */
#define MUX_PA26A_USBC_DP 0
#define PINMUX_PA26A_USBC_DP ((PIN_PA26A_USBC_DP << 16) | MUX_PA26A_USBC_DP)
#define GPIO_PA26A_USBC_DP (1u << 26)
/* ========== GPIO definition for PEVC peripheral ========== */
#define PIN_PA08C_PEVC_PAD_EVT0 8 /**< \brief PEVC signal: PAD_EVT0 on PA08 mux C */
#define MUX_PA08C_PEVC_PAD_EVT0 2
#define PINMUX_PA08C_PEVC_PAD_EVT0 ((PIN_PA08C_PEVC_PAD_EVT0 << 16) | MUX_PA08C_PEVC_PAD_EVT0)
#define GPIO_PA08C_PEVC_PAD_EVT0 (1u << 8)
#define PIN_PB12C_PEVC_PAD_EVT0 44 /**< \brief PEVC signal: PAD_EVT0 on PB12 mux C */
#define MUX_PB12C_PEVC_PAD_EVT0 2
#define PINMUX_PB12C_PEVC_PAD_EVT0 ((PIN_PB12C_PEVC_PAD_EVT0 << 16) | MUX_PB12C_PEVC_PAD_EVT0)
#define GPIO_PB12C_PEVC_PAD_EVT0 (1u << 12)
#define PIN_PA09C_PEVC_PAD_EVT1 9 /**< \brief PEVC signal: PAD_EVT1 on PA09 mux C */
#define MUX_PA09C_PEVC_PAD_EVT1 2
#define PINMUX_PA09C_PEVC_PAD_EVT1 ((PIN_PA09C_PEVC_PAD_EVT1 << 16) | MUX_PA09C_PEVC_PAD_EVT1)
#define GPIO_PA09C_PEVC_PAD_EVT1 (1u << 9)
#define PIN_PB13C_PEVC_PAD_EVT1 45 /**< \brief PEVC signal: PAD_EVT1 on PB13 mux C */
#define MUX_PB13C_PEVC_PAD_EVT1 2
#define PINMUX_PB13C_PEVC_PAD_EVT1 ((PIN_PB13C_PEVC_PAD_EVT1 << 16) | MUX_PB13C_PEVC_PAD_EVT1)
#define GPIO_PB13C_PEVC_PAD_EVT1 (1u << 13)
#define PIN_PA10C_PEVC_PAD_EVT2 10 /**< \brief PEVC signal: PAD_EVT2 on PA10 mux C */
#define MUX_PA10C_PEVC_PAD_EVT2 2
#define PINMUX_PA10C_PEVC_PAD_EVT2 ((PIN_PA10C_PEVC_PAD_EVT2 << 16) | MUX_PA10C_PEVC_PAD_EVT2)
#define GPIO_PA10C_PEVC_PAD_EVT2 (1u << 10)
#define PIN_PB09B_PEVC_PAD_EVT2 41 /**< \brief PEVC signal: PAD_EVT2 on PB09 mux B */
#define MUX_PB09B_PEVC_PAD_EVT2 1
#define PINMUX_PB09B_PEVC_PAD_EVT2 ((PIN_PB09B_PEVC_PAD_EVT2 << 16) | MUX_PB09B_PEVC_PAD_EVT2)
#define GPIO_PB09B_PEVC_PAD_EVT2 (1u << 9)
#define PIN_PA11C_PEVC_PAD_EVT3 11 /**< \brief PEVC signal: PAD_EVT3 on PA11 mux C */
#define MUX_PA11C_PEVC_PAD_EVT3 2
#define PINMUX_PA11C_PEVC_PAD_EVT3 ((PIN_PA11C_PEVC_PAD_EVT3 << 16) | MUX_PA11C_PEVC_PAD_EVT3)
#define GPIO_PA11C_PEVC_PAD_EVT3 (1u << 11)
#define PIN_PB10B_PEVC_PAD_EVT3 42 /**< \brief PEVC signal: PAD_EVT3 on PB10 mux B */
#define MUX_PB10B_PEVC_PAD_EVT3 1
#define PINMUX_PB10B_PEVC_PAD_EVT3 ((PIN_PB10B_PEVC_PAD_EVT3 << 16) | MUX_PB10B_PEVC_PAD_EVT3)
#define GPIO_PB10B_PEVC_PAD_EVT3 (1u << 10)
/* ========== GPIO definition for SCIF peripheral ========== */
#define PIN_PA19E_SCIF_GCLK0 19 /**< \brief SCIF signal: GCLK0 on PA19 mux E */
#define MUX_PA19E_SCIF_GCLK0 4
#define PINMUX_PA19E_SCIF_GCLK0 ((PIN_PA19E_SCIF_GCLK0 << 16) | MUX_PA19E_SCIF_GCLK0)
#define GPIO_PA19E_SCIF_GCLK0 (1u << 19)
#define PIN_PB10E_SCIF_GCLK0 42 /**< \brief SCIF signal: GCLK0 on PB10 mux E */
#define MUX_PB10E_SCIF_GCLK0 4
#define PINMUX_PB10E_SCIF_GCLK0 ((PIN_PB10E_SCIF_GCLK0 << 16) | MUX_PB10E_SCIF_GCLK0)
#define GPIO_PB10E_SCIF_GCLK0 (1u << 10)
#define PIN_PA02A_SCIF_GCLK0 2 /**< \brief SCIF signal: GCLK0 on PA02 mux A */
#define MUX_PA02A_SCIF_GCLK0 0
#define PINMUX_PA02A_SCIF_GCLK0 ((PIN_PA02A_SCIF_GCLK0 << 16) | MUX_PA02A_SCIF_GCLK0)
#define GPIO_PA02A_SCIF_GCLK0 (1u << 2)
#define PIN_PA20E_SCIF_GCLK1 20 /**< \brief SCIF signal: GCLK1 on PA20 mux E */
#define MUX_PA20E_SCIF_GCLK1 4
#define PINMUX_PA20E_SCIF_GCLK1 ((PIN_PA20E_SCIF_GCLK1 << 16) | MUX_PA20E_SCIF_GCLK1)
#define GPIO_PA20E_SCIF_GCLK1 (1u << 20)
#define PIN_PB11E_SCIF_GCLK1 43 /**< \brief SCIF signal: GCLK1 on PB11 mux E */
#define MUX_PB11E_SCIF_GCLK1 4
#define PINMUX_PB11E_SCIF_GCLK1 ((PIN_PB11E_SCIF_GCLK1 << 16) | MUX_PB11E_SCIF_GCLK1)
#define GPIO_PB11E_SCIF_GCLK1 (1u << 11)
#define PIN_PB12E_SCIF_GCLK2 44 /**< \brief SCIF signal: GCLK2 on PB12 mux E */
#define MUX_PB12E_SCIF_GCLK2 4
#define PINMUX_PB12E_SCIF_GCLK2 ((PIN_PB12E_SCIF_GCLK2 << 16) | MUX_PB12E_SCIF_GCLK2)
#define GPIO_PB12E_SCIF_GCLK2 (1u << 12)
#define PIN_PB13E_SCIF_GCLK3 45 /**< \brief SCIF signal: GCLK3 on PB13 mux E */
#define MUX_PB13E_SCIF_GCLK3 4
#define PINMUX_PB13E_SCIF_GCLK3 ((PIN_PB13E_SCIF_GCLK3 << 16) | MUX_PB13E_SCIF_GCLK3)
#define GPIO_PB13E_SCIF_GCLK3 (1u << 13)
#define PIN_PA23E_SCIF_GCLK_IN0 23 /**< \brief SCIF signal: GCLK_IN0 on PA23 mux E */
#define MUX_PA23E_SCIF_GCLK_IN0 4
#define PINMUX_PA23E_SCIF_GCLK_IN0 ((PIN_PA23E_SCIF_GCLK_IN0 << 16) | MUX_PA23E_SCIF_GCLK_IN0)
#define GPIO_PA23E_SCIF_GCLK_IN0 (1u << 23)
#define PIN_PB14E_SCIF_GCLK_IN0 46 /**< \brief SCIF signal: GCLK_IN0 on PB14 mux E */
#define MUX_PB14E_SCIF_GCLK_IN0 4
#define PINMUX_PB14E_SCIF_GCLK_IN0 ((PIN_PB14E_SCIF_GCLK_IN0 << 16) | MUX_PB14E_SCIF_GCLK_IN0)
#define GPIO_PB14E_SCIF_GCLK_IN0 (1u << 14)
#define PIN_PA24E_SCIF_GCLK_IN1 24 /**< \brief SCIF signal: GCLK_IN1 on PA24 mux E */
#define MUX_PA24E_SCIF_GCLK_IN1 4
#define PINMUX_PA24E_SCIF_GCLK_IN1 ((PIN_PA24E_SCIF_GCLK_IN1 << 16) | MUX_PA24E_SCIF_GCLK_IN1)
#define GPIO_PA24E_SCIF_GCLK_IN1 (1u << 24)
#define PIN_PB15E_SCIF_GCLK_IN1 47 /**< \brief SCIF signal: GCLK_IN1 on PB15 mux E */
#define MUX_PB15E_SCIF_GCLK_IN1 4
#define PINMUX_PB15E_SCIF_GCLK_IN1 ((PIN_PB15E_SCIF_GCLK_IN1 << 16) | MUX_PB15E_SCIF_GCLK_IN1)
#define GPIO_PB15E_SCIF_GCLK_IN1 (1u << 15)
/* ========== GPIO definition for EIC peripheral ========== */
#define PIN_PB01C_EIC_EXTINT0 33 /**< \brief EIC signal: EXTINT0 on PB01 mux C */
#define MUX_PB01C_EIC_EXTINT0 2
#define PINMUX_PB01C_EIC_EXTINT0 ((PIN_PB01C_EIC_EXTINT0 << 16) | MUX_PB01C_EIC_EXTINT0)
#define GPIO_PB01C_EIC_EXTINT0 (1u << 1)
#define PIN_PA06C_EIC_EXTINT1 6 /**< \brief EIC signal: EXTINT1 on PA06 mux C */
#define MUX_PA06C_EIC_EXTINT1 2
#define PINMUX_PA06C_EIC_EXTINT1 ((PIN_PA06C_EIC_EXTINT1 << 16) | MUX_PA06C_EIC_EXTINT1)
#define GPIO_PA06C_EIC_EXTINT1 (1u << 6)
#define PIN_PA16C_EIC_EXTINT1 16 /**< \brief EIC signal: EXTINT1 on PA16 mux C */
#define MUX_PA16C_EIC_EXTINT1 2
#define PINMUX_PA16C_EIC_EXTINT1 ((PIN_PA16C_EIC_EXTINT1 << 16) | MUX_PA16C_EIC_EXTINT1)
#define GPIO_PA16C_EIC_EXTINT1 (1u << 16)
#define PIN_PA04C_EIC_EXTINT2 4 /**< \brief EIC signal: EXTINT2 on PA04 mux C */
#define MUX_PA04C_EIC_EXTINT2 2
#define PINMUX_PA04C_EIC_EXTINT2 ((PIN_PA04C_EIC_EXTINT2 << 16) | MUX_PA04C_EIC_EXTINT2)
#define GPIO_PA04C_EIC_EXTINT2 (1u << 4)
#define PIN_PA17C_EIC_EXTINT2 17 /**< \brief EIC signal: EXTINT2 on PA17 mux C */
#define MUX_PA17C_EIC_EXTINT2 2
#define PINMUX_PA17C_EIC_EXTINT2 ((PIN_PA17C_EIC_EXTINT2 << 16) | MUX_PA17C_EIC_EXTINT2)
#define GPIO_PA17C_EIC_EXTINT2 (1u << 17)
#define PIN_PA05C_EIC_EXTINT3 5 /**< \brief EIC signal: EXTINT3 on PA05 mux C */
#define MUX_PA05C_EIC_EXTINT3 2
#define PINMUX_PA05C_EIC_EXTINT3 ((PIN_PA05C_EIC_EXTINT3 << 16) | MUX_PA05C_EIC_EXTINT3)
#define GPIO_PA05C_EIC_EXTINT3 (1u << 5)
#define PIN_PA18C_EIC_EXTINT3 18 /**< \brief EIC signal: EXTINT3 on PA18 mux C */
#define MUX_PA18C_EIC_EXTINT3 2
#define PINMUX_PA18C_EIC_EXTINT3 ((PIN_PA18C_EIC_EXTINT3 << 16) | MUX_PA18C_EIC_EXTINT3)
#define GPIO_PA18C_EIC_EXTINT3 (1u << 18)
#define PIN_PA07C_EIC_EXTINT4 7 /**< \brief EIC signal: EXTINT4 on PA07 mux C */
#define MUX_PA07C_EIC_EXTINT4 2
#define PINMUX_PA07C_EIC_EXTINT4 ((PIN_PA07C_EIC_EXTINT4 << 16) | MUX_PA07C_EIC_EXTINT4)
#define GPIO_PA07C_EIC_EXTINT4 (1u << 7)
#define PIN_PA19C_EIC_EXTINT4 19 /**< \brief EIC signal: EXTINT4 on PA19 mux C */
#define MUX_PA19C_EIC_EXTINT4 2
#define PINMUX_PA19C_EIC_EXTINT4 ((PIN_PA19C_EIC_EXTINT4 << 16) | MUX_PA19C_EIC_EXTINT4)
#define GPIO_PA19C_EIC_EXTINT4 (1u << 19)
#define PIN_PA20C_EIC_EXTINT5 20 /**< \brief EIC signal: EXTINT5 on PA20 mux C */
#define MUX_PA20C_EIC_EXTINT5 2
#define PINMUX_PA20C_EIC_EXTINT5 ((PIN_PA20C_EIC_EXTINT5 << 16) | MUX_PA20C_EIC_EXTINT5)
#define GPIO_PA20C_EIC_EXTINT5 (1u << 20)
#define PIN_PA21C_EIC_EXTINT6 21 /**< \brief EIC signal: EXTINT6 on PA21 mux C */
#define MUX_PA21C_EIC_EXTINT6 2
#define PINMUX_PA21C_EIC_EXTINT6 ((PIN_PA21C_EIC_EXTINT6 << 16) | MUX_PA21C_EIC_EXTINT6)
#define GPIO_PA21C_EIC_EXTINT6 (1u << 21)
#define PIN_PA22C_EIC_EXTINT7 22 /**< \brief EIC signal: EXTINT7 on PA22 mux C */
#define MUX_PA22C_EIC_EXTINT7 2
#define PINMUX_PA22C_EIC_EXTINT7 ((PIN_PA22C_EIC_EXTINT7 << 16) | MUX_PA22C_EIC_EXTINT7)
#define GPIO_PA22C_EIC_EXTINT7 (1u << 22)
#define PIN_PA23C_EIC_EXTINT8 23 /**< \brief EIC signal: EXTINT8 on PA23 mux C */
#define MUX_PA23C_EIC_EXTINT8 2
#define PINMUX_PA23C_EIC_EXTINT8 ((PIN_PA23C_EIC_EXTINT8 << 16) | MUX_PA23C_EIC_EXTINT8)
#define GPIO_PA23C_EIC_EXTINT8 (1u << 23)
#endif /* _SAM4LS4B_PIO_ */
| {
"pile_set_name": "Github"
} |
/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
* @path ch08/8.7/8.7.2/8.7.2-3-s.js
* @description Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-writable data property
* @onlyStrict
*/
function testcase() {
"use strict";
var _8_7_2_3 = {};
Object.defineProperty(_8_7_2_3, "b", {
writable: false
});
try {
_8_7_2_3.b = 11;
return false;
} catch (e) {
return e instanceof TypeError;
}
}
runTestCase(testcase);
| {
"pile_set_name": "Github"
} |
const help = (): void => {
console.log(`
bottender line <command> <action> [options]
`);
};
export default help;
| {
"pile_set_name": "Github"
} |
{
"type": "bundle",
"id": "bundle--4ec75f30-2415-4ef5-81d0-c7443b8c9f9d",
"spec_version": "2.0",
"objects": [
{
"id": "relationship--6d102ef8-c831-413d-b2cb-392517638b0b",
"created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5",
"description": "[Zebrocy](https://attack.mitre.org/software/S0251) uses HTTP for C2.(Citation: Palo Alto Sofacy 06-2018)(Citation: Unit42 Cannon Nov 2018)(Citation: ESET Zebrocy Nov 2018)(Citation: Unit42 Sofacy Dec 2018)(Citation: ESET Zebrocy May 2019)(Citation: Accenture SNAKEMACKEREL Nov 2018)",
"object_marking_refs": [
"marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168"
],
"external_references": [
{
"url": "https://researchcenter.paloaltonetworks.com/2018/06/unit42-sofacy-groups-parallel-attacks/",
"description": "Lee, B., Falcone, R. (2018, June 06). Sofacy Group\u2019s Parallel Attacks. Retrieved June 18, 2018.",
"source_name": "Palo Alto Sofacy 06-2018"
},
{
"source_name": "Unit42 Cannon Nov 2018",
"url": "https://researchcenter.paloaltonetworks.com/2018/11/unit42-sofacy-continues-global-attacks-wheels-new-cannon-trojan/",
"description": "Falcone, R., Lee, B. (2018, November 20). Sofacy Continues Global Attacks and Wheels Out New \u2018Cannon\u2019 Trojan. Retrieved November 26, 2018."
},
{
"source_name": "ESET Zebrocy Nov 2018",
"url": "https://www.welivesecurity.com/2018/11/20/sednit-whats-going-zebrocy/",
"description": "ESET. (2018, November 20). Sednit: What\u2019s going on with Zebrocy?. Retrieved February 12, 2019."
},
{
"description": "Lee, B., Falcone, R. (2018, December 12). Dear Joohn: The Sofacy Group\u2019s Global Campaign. Retrieved April 19, 2019.",
"url": "https://unit42.paloaltonetworks.com/dear-joohn-sofacy-groups-global-campaign/",
"source_name": "Unit42 Sofacy Dec 2018"
},
{
"source_name": "ESET Zebrocy May 2019",
"url": "https://www.welivesecurity.com/2019/05/22/journey-zebrocy-land/",
"description": "ESET Research. (2019, May 22). A journey to Zebrocy land. Retrieved June 20, 2019."
},
{
"description": "Accenture Security. (2018, November 29). SNAKEMACKEREL. Retrieved April 15, 2019.",
"url": "https://www.accenture.com/t20181129T203820Z__w__/us-en/_acnmedia/PDF-90/Accenture-snakemackerel-delivers-zekapab-malware.pdf#zoom=50",
"source_name": "Accenture SNAKEMACKEREL Nov 2018"
}
],
"source_ref": "malware--a4f57468-fbd5-49e4-8476-52088220b92d",
"relationship_type": "uses",
"target_ref": "attack-pattern--df8b2a25-8bdf-4856-953c-a04372b1c161",
"type": "relationship",
"modified": "2020-03-17T02:54:27.611Z",
"created": "2018-10-17T00:14:20.652Z"
}
]
} | {
"pile_set_name": "Github"
} |
package cn.neural.common;
import lombok.Getter;
import java.util.concurrent.*;
/**
* A specialized <em>semaphore</em> implementation that provides a number of permits in a given time frame.
* <p>
* TimedSemaphore sem = new TimedSemaphore(1, TimeUnit.SECOND, 10);
*
* @author lry
*/
@Getter
public class TimedSemaphore {
/**
* Constant for a value representing no limit.
* If the limit is set to a value less or equal this constant,
* the {@code TimedSemaphore} will be effectively switched off.
*/
public static final int NO_LIMIT = 0;
/**
* Constant for the thread pool size for the executor.
*/
private static final int THREAD_POOL_SIZE = 1;
/**
* The executor service for managing the timer thread.
*/
private final ScheduledExecutorService executorService;
/**
* Stores the period for this timed semaphore.
*/
private final long period;
private final TimeUnit unit;
/**
* A flag whether the executor service was created by this object.
*/
private final boolean ownExecutor;
/**
* A future object representing the timer task.
*/
private ScheduledFuture<?> task;
/**
* Stores the total number of invocations of the acquire() method.
*/
private long totalAcquireCount;
/**
* The counter for the periods. This counter is increased every time a period ends.
*/
private long periodCount;
private int limit;
/**
* The current counter.
*/
private int acquireCount;
/**
* The number of invocations of acquire() in the last period.
*/
private int lastCallsPerPeriod;
/**
* A flag whether shutdown() was called.
*/
private boolean shutdown;
public TimedSemaphore(long timePeriod, TimeUnit timeUnit, int limit) {
this(null, timePeriod, timeUnit, limit);
}
public TimedSemaphore(ScheduledExecutorService service, long timePeriod, TimeUnit timeUnit, int limit) {
if (timePeriod < 1) {
throw new IllegalArgumentException("Time period must be greater than 0!");
}
this.period = timePeriod;
this.unit = timeUnit;
if (service != null) {
this.executorService = service;
this.ownExecutor = false;
} else {
ScheduledThreadPoolExecutor timerExecutor = new ScheduledThreadPoolExecutor(THREAD_POOL_SIZE, r -> {
Thread t = new Thread(r);
t.setDaemon(true);
t.setName("MANAGING_TIMER_THREAD");
return t;
});
timerExecutor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
timerExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
this.executorService = timerExecutor;
this.ownExecutor = true;
}
setLimit(limit);
}
/**
* Returns the limit enforced by this semaphore. The limit determines how
* many invocations of {@link #acquire()} are allowed within the monitored period.
*
* @return the limit
*/
public final synchronized int getLimit() {
return limit;
}
/**
* Sets the limit. This is the number of times the {@link #acquire()} method
* can be called within the time period specified. If this limit is reached,
* further invocations of {@link #acquire()} will block. Setting the limit
* to a value <= {@link #NO_LIMIT} will cause the limit to be disabled,
* i.e. an arbitrary number of{@link #acquire()} invocations is allowed in the time period.
*
* @param limit the limit
*/
public final synchronized void setLimit(final int limit) {
this.limit = limit;
}
/**
* Initializes a shutdown. After that the object cannot be used any more.
* This method can be invoked an arbitrary number of times. All invocations
* after the first one do not have any effect.
*/
public synchronized void shutdown() {
if (!shutdown) {
if (ownExecutor) {
// if the executor was created by this instance, it has to be shutdown
getExecutorService().shutdownNow();
}
if (task != null) {
task.cancel(false);
}
shutdown = true;
}
}
/**
* Tests whether the {@link #shutdown()} method has been called on this object.
* <p>
* If this method returns <b>true</b>, this instance cannot be used any longer.
*
* @return a flag whether a shutdown has been performed
*/
public synchronized boolean isShutdown() {
return shutdown;
}
/**
* Acquires a permit from this semaphore. This method will block if
* the limit for the current period has already been reached. If
* {@link #shutdown()} has already been invoked, calling this method will
* cause an exception. The very first call of this method starts the timer
* task which monitors the time period set for this {@code TimedSemaphore}.
* From now on the semaphore is active.
*
* @throws InterruptedException if the thread gets interrupted
* @throws IllegalStateException if this semaphore is already shut down
*/
public synchronized void acquire() throws InterruptedException {
prepareAcquire();
boolean canPass;
do {
canPass = acquirePermit();
if (!canPass) {
wait();
}
} while (!canPass);
}
/**
* Tries to acquire a permit from this semaphore. If the limit of this semaphore has
* not yet been reached, a permit is acquired, and this method returns
* <strong>true</strong>. Otherwise, this method returns immediately with the result
* <strong>false</strong>.
*
* @return <strong>true</strong> if a permit could be acquired; <strong>false</strong> otherwise
* @throws IllegalStateException if this semaphore is already shut down
*/
public synchronized boolean tryAcquire() {
prepareAcquire();
return acquirePermit();
}
/**
* Returns the number of (successful) acquire invocations during the last
* period. This is the number of times the {@link #acquire()} method was
* called without blocking. This can be useful for testing or debugging
* purposes or to determine a meaningful threshold value. If a limit is set,
* the value returned by this method won't be greater than this limit.
*
* @return the number of non-blocking invocations of the {@link #acquire()} method
*/
public synchronized int getLastAcquiresPerPeriod() {
return lastCallsPerPeriod;
}
/**
* Returns the number of invocations of the {@link #acquire()} method for
* the current period. This may be useful for testing or debugging purposes.
*
* @return the current number of {@link #acquire()} invocations
*/
public synchronized int getAcquireCount() {
return acquireCount;
}
/**
* Returns the number of calls to the {@link #acquire()} method that can
* still be performed in the current period without blocking. This method
* can give an indication whether it is safe to call the {@link #acquire()}
* method without risking to be suspended. However, there is no guarantee
* that a subsequent call to {@link #acquire()} actually is not-blocking
* because in the mean time other threads may have invoked the semaphore.
*
* @return the current number of available {@link #acquire()} calls in the
* current period
*/
public synchronized int getAvailablePermits() {
return getLimit() - getAcquireCount();
}
/**
* Returns the average number of successful (i.e. non-blocking)
* {@link #acquire()} invocations for the entire life-time of this {@code
* TimedSemaphore}. This method can be used for instance for statistical
* calculations.
*
* @return the average number of {@link #acquire()} invocations per time
* unit
*/
public synchronized double getAverageCallsPerPeriod() {
return periodCount == 0 ? 0 : (double) totalAcquireCount / (double) periodCount;
}
/**
* Starts the timer. This method is called when {@link #acquire()} is called
* for the first time. It schedules a task to be executed at fixed rate to
* monitor the time period specified.
*
* @return a future object representing the task scheduled
*/
protected ScheduledFuture<?> startTimer() {
return getExecutorService().scheduleAtFixedRate(this::endOfPeriod, getPeriod(), getPeriod(), getUnit());
}
/**
* The current time period is finished. This method is called by the timer
* used internally to monitor the time period. It resets the counter and
* releases the threads waiting for this barrier.
*/
private synchronized void endOfPeriod() {
lastCallsPerPeriod = acquireCount;
totalAcquireCount += acquireCount;
periodCount++;
acquireCount = 0;
notifyAll();
}
/**
* Prepares an acquire operation.
* <p>
* Checks for the current state and starts the internal timer if necessary.
*/
private void prepareAcquire() {
if (isShutdown()) {
throw new IllegalStateException("TimedSemaphore is shut down!");
}
if (task == null) {
task = startTimer();
}
}
/**
* Internal helper method for acquiring a permit.
*
* @return a flag whether a permit could be acquired
*/
private boolean acquirePermit() {
if (getLimit() <= NO_LIMIT || acquireCount < getLimit()) {
acquireCount++;
return true;
}
return false;
}
}
| {
"pile_set_name": "Github"
} |
//===- llvm/TableGen/Error.h - tblgen error handling helpers ----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains error handling helper routines to pretty-print diagnostic
// messages from tblgen.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TABLEGEN_ERROR_H
#define LLVM_TABLEGEN_ERROR_H
#include "llvm/Support/SourceMgr.h"
namespace llvm {
void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
void PrintWarning(const char *Loc, const Twine &Msg);
void PrintWarning(const Twine &Msg);
void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
void PrintError(const char *Loc, const Twine &Msg);
void PrintError(const Twine &Msg);
LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg);
LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef<SMLoc> ErrorLoc,
const Twine &Msg);
extern SourceMgr SrcMgr;
extern unsigned ErrorsPrinted;
} // end namespace "llvm"
#endif
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>CMSIS DSP Software Library: High Precision Q31 Biquad Cascade Filter</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>High Precision Q31 Biquad Cascade Filter<br/>
<small>
[<a class="el" href="group__group_filters.html">Filtering Functions</a>]</small>
</h1> </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___biquad_cascade_d_f1__32x64.html#ga44900cecb8083afcaabf905ffcd656bb">arm_biquad_cas_df1_32x64_init_q31</a> (<a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html">arm_biquad_cas_df1_32x64_ins_q31</a> *S, uint8_t numStages, <a class="el" href="arm__math_8h.html#adc89a3547f5324b7b3b95adec3806bc0">q31_t</a> *pCoeffs, <a class="el" href="arm__math_8h.html#a5aea1cb12fc02d9d44c8abf217eaa5c6">q63_t</a> *pState, uint8_t postShift)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___biquad_cascade_d_f1__32x64.html#ga953a83e69685de6575cff37feb358a93">arm_biquad_cas_df1_32x64_q31</a> (const <a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html">arm_biquad_cas_df1_32x64_ins_q31</a> *S, <a class="el" href="arm__math_8h.html#adc89a3547f5324b7b3b95adec3806bc0">q31_t</a> *pSrc, <a class="el" href="arm__math_8h.html#adc89a3547f5324b7b3b95adec3806bc0">q31_t</a> *pDst, uint32_t <a class="el" href="arm__variance__example__f32_8c.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This function implements a high precision Biquad cascade filter which operates on Q31 data values. The filter coefficients are in 1.31 format and the state variables are in 1.63 format. The double precision state variables reduce quantization noise in the filter and provide a cleaner output. These filters are particularly useful when implementing filters in which the singularities are close to the unit circle. This is common for low pass or high pass filters with very low cutoff frequencies.</p>
<p>The function operates on blocks of input and output data and each call to the function processes <code>blockSize</code> samples through the filter. <code>pSrc</code> and <code>pDst</code> points to input and output arrays containing <code>blockSize</code> Q31 values.</p>
<dl class="user"><dt><b>Algorithm </b></dt><dd>Each Biquad stage implements a second order filter using the difference equation: <pre>
y[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] + a1 * y[n-1] + a2 * y[n-2]
</pre> A Direct Form I algorithm is used with 5 coefficients and 4 state variables per stage. <div align="center">
<img src="Biquad.gif" alt="Biquad.gif"/>
<p><strong>Single Biquad filter stage</strong></p></div>
Coefficients <code>b0, b1, and b2 </code> multiply the input signal <code>x[n]</code> and are referred to as the feedforward coefficients. Coefficients <code>a1</code> and <code>a2</code> multiply the output signal <code>y[n]</code> and are referred to as the feedback coefficients. Pay careful attention to the sign of the feedback coefficients. Some design tools use the difference equation <pre>
y[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] - a1 * y[n-1] - a2 * y[n-2]
</pre> In this case the feedback coefficients <code>a1</code> and <code>a2</code> must be negated when used with the CMSIS DSP Library.</dd></dl>
<dl class="user"><dt><b></b></dt><dd>Higher order filters are realized as a cascade of second order sections. <code>numStages</code> refers to the number of second order stages used. For example, an 8th order filter would be realized with <code>numStages=4</code> second order stages. <div align="center">
<img src="BiquadCascade.gif" alt="BiquadCascade.gif"/>
<p><strong>8th order filter using a cascade of Biquad stages</strong></p></div>
A 9th order filter would be realized with <code>numStages=5</code> second order stages with the coefficients for one of the stages configured as a first order filter (<code>b2=0</code> and <code>a2=0</code>).</dd></dl>
<dl class="user"><dt><b></b></dt><dd>The <code>pState</code> points to state variables array . Each Biquad stage has 4 state variables <code>x[n-1], x[n-2], y[n-1],</code> and <code>y[n-2]</code> and each state variable in 1.63 format to improve precision. The state variables are arranged in the array as: <pre>
{x[n-1], x[n-2], y[n-1], y[n-2]}
</pre></dd></dl>
<dl class="user"><dt><b></b></dt><dd>The 4 state variables for stage 1 are first, then the 4 state variables for stage 2, and so on. The state array has a total length of <code>4*numStages</code> values of data in 1.63 format. The state variables are updated after each block of data is processed; the coefficients are untouched.</dd></dl>
<dl class="user"><dt><b>Instance Structure </b></dt><dd>The coefficients and state variables for a filter are stored together in an instance data structure. A separate instance structure must be defined for each filter. Coefficient arrays may be shared among several instances while state variable arrays cannot be shared.</dd></dl>
<dl class="user"><dt><b>Init Function </b></dt><dd>There is also an associated initialization function which performs the following operations:<ul>
<li>Sets the values of the internal structure fields.</li>
<li>Zeros out the values in the state buffer. </li>
</ul>
</dd></dl>
<dl class="user"><dt><b></b></dt><dd>Use of the initialization function is optional. However, if the initialization function is used, then the instance structure cannot be placed into a const data section. To place an instance structure into a const data section, the instance structure must be manually initialized. Set the values in the state buffer to zeros before static initialization. For example, to statically initialize the filter instance structure use <pre>
<a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html" title="Instance structure for the high precision Q31 Biquad cascade filter.">arm_biquad_cas_df1_32x64_ins_q31</a> S1 = {numStages, pState, pCoeffs, postShift};
</pre> where <code>numStages</code> is the number of Biquad stages in the filter; <code>pState</code> is the address of the state buffer; <code>pCoeffs</code> is the address of the coefficient buffer; <code>postShift</code> shift to be applied which is described in detail below. </dd></dl>
<dl class="user"><dt><b>Fixed-Point Behavior </b></dt><dd>Care must be taken while using Biquad Cascade 32x64 filter function. Following issues must be considered:<ul>
<li>Scaling of coefficients</li>
<li>Filter gain</li>
<li>Overflow and saturation</li>
</ul>
</dd></dl>
<dl class="user"><dt><b></b></dt><dd>Filter coefficients are represented as fractional values and restricted to lie in the range <code>[-1 +1)</code>. The processing function has an additional scaling parameter <code>postShift</code> which allows the filter coefficients to exceed the range <code>[+1 -1)</code>. At the output of the filter's accumulator is a shift register which shifts the result by <code>postShift</code> bits. <div align="center">
<img src="BiquadPostshift.gif" alt="BiquadPostshift.gif"/>
<p><strong>Fixed-point Biquad with shift by postShift bits after accumulator</strong></p></div>
This essentially scales the filter coefficients by <code>2^postShift</code>. For example, to realize the coefficients <pre>
{1.5, -0.8, 1.2, 1.6, -0.9}
</pre> set the Coefficient array to: <pre>
{0.75, -0.4, 0.6, 0.8, -0.45}
</pre> and set <code>postShift=1</code></dd></dl>
<dl class="user"><dt><b></b></dt><dd>The second thing to keep in mind is the gain through the filter. The frequency response of a Biquad filter is a function of its coefficients. It is possible for the gain through the filter to exceed 1.0 meaning that the filter increases the amplitude of certain frequencies. This means that an input signal with amplitude < 1.0 may result in an output > 1.0 and these are saturated or overflowed based on the implementation of the filter. To avoid this behavior the filter needs to be scaled down such that its peak gain < 1.0 or the input signal must be scaled down so that the combination of input and filter are never overflowed.</dd></dl>
<dl class="user"><dt><b></b></dt><dd>The third item to consider is the overflow and saturation behavior of the fixed-point Q31 version. This is described in the function specific documentation below. </dd></dl>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga44900cecb8083afcaabf905ffcd656bb"></a><!-- doxytag: member="arm_biquad_cascade_df1_32x64_init_q31.c::arm_biquad_cas_df1_32x64_init_q31" ref="ga44900cecb8083afcaabf905ffcd656bb" args="(arm_biquad_cas_df1_32x64_ins_q31 *S, uint8_t numStages, q31_t *pCoeffs, q63_t *pState, uint8_t postShift)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void arm_biquad_cas_df1_32x64_init_q31 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html">arm_biquad_cas_df1_32x64_ins_q31</a> * </td>
<td class="paramname"> <em>S</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t </td>
<td class="paramname"> <em>numStages</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="arm__math_8h.html#adc89a3547f5324b7b3b95adec3806bc0">q31_t</a> * </td>
<td class="paramname"> <em>pCoeffs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="arm__math_8h.html#a5aea1cb12fc02d9d44c8abf217eaa5c6">q63_t</a> * </td>
<td class="paramname"> <em>pState</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t </td>
<td class="paramname"> <em>postShift</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">*S</td><td>points to an instance of the high precision Q31 Biquad cascade filter structure. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">numStages</td><td>number of 2nd order stages in the filter. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">*pCoeffs</td><td>points to the filter coefficients. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">*pState</td><td>points to the state buffer. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">postShift</td><td>Shift to be applied after the accumulator. Varies according to the coefficients format. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>none</dd></dl>
<p><b>Coefficient and State Ordering:</b></p>
<dl class="user"><dt><b></b></dt><dd>The coefficients are stored in the array <code>pCoeffs</code> in the following order: <pre>
{b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
</pre> where <code>b1x</code> and <code>a1x</code> are the coefficients for the first stage, <code>b2x</code> and <code>a2x</code> are the coefficients for the second stage, and so on. The <code>pCoeffs</code> array contains a total of <code>5*numStages</code> values.</dd></dl>
<dl class="user"><dt><b></b></dt><dd>The <code>pState</code> points to state variables array and size of each state variable is 1.63 format. Each Biquad stage has 4 state variables <code>x[n-1], x[n-2], y[n-1],</code> and <code>y[n-2]</code>. The state variables are arranged in the state array as: <pre>
{x[n-1], x[n-2], y[n-1], y[n-2]}
</pre> The 4 state variables for stage 1 are first, then the 4 state variables for stage 2, and so on. The state array has a total length of <code>4*numStages</code> values. The state variables are updated after each block of data is processed; the coefficients are untouched. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="arm_graphic_equalizer_example_q31_8c-example.html#a19">arm_graphic_equalizer_example_q31.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="arm__biquad__cascade__df1__32x64__init__q31_8c_source.html#l00077">77</a> of file <a class="el" href="arm__biquad__cascade__df1__32x64__init__q31_8c_source.html">arm_biquad_cascade_df1_32x64_init_q31.c</a>.</p>
</div>
</div>
<a class="anchor" id="ga953a83e69685de6575cff37feb358a93"></a><!-- doxytag: member="arm_biquad_cascade_df1_32x64_q31.c::arm_biquad_cas_df1_32x64_q31" ref="ga953a83e69685de6575cff37feb358a93" args="(const arm_biquad_cas_df1_32x64_ins_q31 *S, q31_t *pSrc, q31_t *pDst, uint32_t blockSize)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void arm_biquad_cas_df1_32x64_q31 </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html">arm_biquad_cas_df1_32x64_ins_q31</a> * </td>
<td class="paramname"> <em>S</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="arm__math_8h.html#adc89a3547f5324b7b3b95adec3806bc0">q31_t</a> * </td>
<td class="paramname"> <em>pSrc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="arm__math_8h.html#adc89a3547f5324b7b3b95adec3806bc0">q31_t</a> * </td>
<td class="paramname"> <em>pDst</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t </td>
<td class="paramname"> <em>blockSize</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">*S</td><td>points to an instance of the high precision Q31 Biquad cascade filter. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">*pSrc</td><td>points to the block of input data. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">*pDst</td><td>points to the block of output data. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">blockSize</td><td>number of samples to process. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>none.</dd></dl>
<dl class="user"><dt><b></b></dt><dd>The function is implemented using an internal 64-bit accumulator. The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. Thus, if the accumulator result overflows it wraps around rather than clip. In order to avoid overflows completely the input signal must be scaled down by 2 bits and lie in the range [-0.25 +0.25). After all 5 multiply-accumulates are performed, the 2.62 accumulator is shifted by <code>postShift</code> bits and the result truncated to 1.31 format by discarding the low 32 bits.</dd></dl>
<dl class="user"><dt><b></b></dt><dd>Two related functions are provided in the CMSIS DSP library. <code><a class="el" href="group___biquad_cascade_d_f1.html#ga27b0c54da702713976e5202d20b4473f" title="Processing function for the Q31 Biquad cascade filter.">arm_biquad_cascade_df1_q31()</a></code> implements a Biquad cascade with 32-bit coefficients and state variables with a Q63 accumulator. <code><a class="el" href="group___biquad_cascade_d_f1.html#ga456390f5e448afad3a38bed7d6e380e3" title="Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-...">arm_biquad_cascade_df1_fast_q31()</a></code> implements a Biquad cascade with 32-bit coefficients and state variables with a Q31 accumulator. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="arm_graphic_equalizer_example_q31_8c-example.html#a25">arm_graphic_equalizer_example_q31.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="arm__biquad__cascade__df1__32x64__q31_8c_source.html#l00176">176</a> of file <a class="el" href="arm__biquad__cascade__df1__32x64__q31_8c_source.html">arm_biquad_cascade_df1_32x64_q31.c</a>.</p>
</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jul 15 2011 13:16:20 for CMSIS DSP Software Library by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
| {
"pile_set_name": "Github"
} |
namespace LiveSplit.View
{
partial class EditHistoryDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditHistoryDialog));
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.historyListBox = new System.Windows.Forms.ListBox();
this.btnRemove = new System.Windows.Forms.Button();
this.tableLayoutPanel3.SuspendLayout();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnOK.Location = new System.Drawing.Point(200, 192);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 16;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(281, 192);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 17;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 2;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 81F));
this.tableLayoutPanel3.Controls.Add(this.btnCancel, 1, 2);
this.tableLayoutPanel3.Controls.Add(this.btnOK, 0, 2);
this.tableLayoutPanel3.Controls.Add(this.historyListBox, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.btnRemove, 0, 1);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(7, 7);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 3;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(359, 218);
this.tableLayoutPanel3.TabIndex = 41;
//
// historyListBox
//
this.tableLayoutPanel3.SetColumnSpan(this.historyListBox, 2);
this.historyListBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.historyListBox.FormattingEnabled = true;
this.historyListBox.Location = new System.Drawing.Point(3, 3);
this.historyListBox.Name = "historyListBox";
this.historyListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.historyListBox.Size = new System.Drawing.Size(353, 150);
this.historyListBox.TabIndex = 18;
//
// btnRemove
//
this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel3.SetColumnSpan(this.btnRemove, 2);
this.btnRemove.Location = new System.Drawing.Point(236, 159);
this.btnRemove.Name = "btnRemove";
this.btnRemove.Size = new System.Drawing.Size(120, 23);
this.btnRemove.TabIndex = 19;
this.btnRemove.Text = "Remove Selected";
this.btnRemove.UseVisualStyleBackColor = true;
this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
//
// EditHistoryDialog
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(373, 232);
this.Controls.Add(this.tableLayoutPanel3);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximumSize = new System.Drawing.Size(600, 10000);
this.MinimumSize = new System.Drawing.Size(300, 258);
this.Name = "EditHistoryDialog";
this.Padding = new System.Windows.Forms.Padding(7);
this.Text = "Edit History";
this.tableLayoutPanel3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.ListBox historyListBox;
private System.Windows.Forms.Button btnRemove;
}
} | {
"pile_set_name": "Github"
} |
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Diagnostics;
namespace ICSharpCode.AvalonEdit.Document
{
/// <summary>
/// Describes a change to a TextDocument.
/// </summary>
sealed class DocumentChangeOperation : IUndoableOperationWithContext
{
TextDocument document;
DocumentChangeEventArgs change;
public DocumentChangeOperation(TextDocument document, DocumentChangeEventArgs change)
{
this.document = document;
this.change = change;
}
public void Undo(UndoStack stack)
{
Debug.Assert(stack.state == UndoStack.StatePlayback);
stack.RegisterAffectedDocument(document);
stack.state = UndoStack.StatePlaybackModifyDocument;
this.Undo();
stack.state = UndoStack.StatePlayback;
}
public void Redo(UndoStack stack)
{
Debug.Assert(stack.state == UndoStack.StatePlayback);
stack.RegisterAffectedDocument(document);
stack.state = UndoStack.StatePlaybackModifyDocument;
this.Redo();
stack.state = UndoStack.StatePlayback;
}
public void Undo()
{
OffsetChangeMap map = change.OffsetChangeMapOrNull;
document.Replace(change.Offset, change.InsertionLength, change.RemovedText, map != null ? map.Invert() : null);
}
public void Redo()
{
document.Replace(change.Offset, change.RemovalLength, change.InsertedText, change.OffsetChangeMapOrNull);
}
}
}
| {
"pile_set_name": "Github"
} |
\name{Lcross}
\alias{Lcross}
\title{Multitype L-function (cross-type)}
\description{
Calculates an estimate of the cross-type L-function
for a multitype point pattern.
}
\usage{
Lcross(X, i, j, ..., from, to, correction)
}
\arguments{
\item{X}{The observed point pattern,
from which an estimate of the cross-type \eqn{L} function
\eqn{L_{ij}(r)}{Lij(r)} will be computed.
It must be a multitype point pattern (a marked point pattern
whose marks are a factor). See under Details.
}
\item{i}{The type (mark value)
of the points in \code{X} from which distances are measured.
A character string (or something that will be converted to a
character string).
Defaults to the first level of \code{marks(X)}.
}
\item{j}{The type (mark value)
of the points in \code{X} to which distances are measured.
A character string (or something that will be
converted to a character string).
Defaults to the second level of \code{marks(X)}.
}
\item{correction,\dots}{
Arguments passed to \code{\link{Kcross}}.
}
\item{from,to}{
An alternative way to specify \code{i} and \code{j} respectively.
}
}
\details{
The cross-type L-function is a transformation of the cross-type K-function,
\deqn{L_{ij}(r) = \sqrt{\frac{K_{ij}(r)}{\pi}}}{Lij(r) = sqrt(Kij(r)/pi)}
where \eqn{K_{ij}(r)}{Kij(r)} is the cross-type K-function
from type \code{i} to type \code{j}.
See \code{\link{Kcross}} for information
about the cross-type K-function.
The command \code{Lcross} first calls
\code{\link{Kcross}} to compute the estimate of the cross-type K-function,
and then applies the square root transformation.
For a marked point pattern in which the points of type \code{i}
are independent of the points of type \code{j},
the theoretical value of the L-function is
\eqn{L_{ij}(r) = r}{Lij(r) = r}.
The square root also has the effect of stabilising
the variance of the estimator, so that \eqn{L_{ij}}{Lij} is more appropriate
for use in simulation envelopes and hypothesis tests.
}
\value{
An object of class \code{"fv"}, see \code{\link{fv.object}},
which can be plotted directly using \code{\link{plot.fv}}.
Essentially a data frame containing columns
\item{r}{the vector of values of the argument \eqn{r}
at which the function \eqn{L_{ij}}{Lij} has been estimated
}
\item{theo}{the theoretical value \eqn{L_{ij}(r) = r}{Lij(r) = r}
for a stationary Poisson process
}
together with columns named
\code{"border"}, \code{"bord.modif"},
\code{"iso"} and/or \code{"trans"},
according to the selected edge corrections. These columns contain
estimates of the function \eqn{L_{ij}}{Lij} obtained by the edge corrections
named.
}
\seealso{
\code{\link{Kcross}},
\code{\link{Ldot}},
\code{\link{Lest}}
}
\examples{
data(amacrine)
L <- Lcross(amacrine, "off", "on")
plot(L)
}
\author{\adrian
and \rolf
}
\keyword{spatial}
\keyword{nonparametric}
| {
"pile_set_name": "Github"
} |
/**
* ***************************************************************************
* Copyright (c) 2010 Qcadoo Limited
* Project: Qcadoo MES
* Version: 1.4
*
* This file is part of Qcadoo.
*
* Qcadoo is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation; 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 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, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ***************************************************************************
*/
package com.qcadoo.mes.technologies.tree.builder.api;
import com.qcadoo.mes.technologies.tree.builder.TechnologyTreeBuilder;
/**
* Abstraction for technology tree's operation node
*
* @author Marcin Kubala
* @since 1.2.1
*/
public interface TechnologyOperationComponent extends EntityWrapper {
/**
* Set custom field value. You should not set basic tree fields such as parent, children, in/out product components, operation
* or entityType. The {@link TechnologyTreeBuilder} will deal with them for you.
*
* @param name
* @param value
*/
void setField(final String name, final Object value);
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated on Wed Mar 11 22:23:18 2020 by Eclipse SUMO Version v1_5_0+0662-a598ecae47
This data file and the accompanying materials
are made available under the terms of the Eclipse Public License v2.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="net.net.xml"/>
<route-files value="input_routes.rou.xml"/>
</input>
<output>
<write-license value="true"/>
<stop-output value="stopinfos.xml"/>
</output>
<processing>
<default.carfollowmodel value="BKerner"/>
<default.speeddev value="0"/>
</processing>
<report>
<xml-validation value="never"/>
<no-step-log value="true"/>
</report>
</configuration>
-->
<stops xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/stopinfo_file.xsd">
<stopinfo id="0" type="default" lane="gneE0_0" pos="220.00" parking="0" started="37.00" ended="47.00" delay="-1.00" initialPersons="0" loadedPersons="0" unloadedPersons="0" initialContainers="0" loadedContainers="0" unloadedContainers="0"/>
</stops>
| {
"pile_set_name": "Github"
} |
#ifndef CAFFE_SOFTMAX_LAYER_HPP_
#define CAFFE_SOFTMAX_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
/**
* @brief Computes the softmax function.
*
* TODO(dox): thorough documentation for Forward, Backward, and proto params.
*/
template <typename Dtype>
class SoftmaxLayer : public Layer<Dtype> {
public:
explicit SoftmaxLayer(const LayerParameter& param)
: Layer<Dtype>(param) {}
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual inline const char* type() const { return "Softmax"; }
virtual inline int ExactNumBottomBlobs() const { return 1; }
virtual inline int ExactNumTopBlobs() const { return 1; }
protected:
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
int outer_num_;
int inner_num_;
int softmax_axis_;
/// sum_multiplier is used to carry out sum using BLAS
Blob<Dtype> sum_multiplier_;
/// scale is an intermediate Blob to hold temporary results.
Blob<Dtype> scale_;
};
} // namespace caffe
#endif // CAFFE_SOFTMAX_LAYER_HPP_
| {
"pile_set_name": "Github"
} |
/**
* Copyright (C) 2010-2018 Gordon Fraser, Andrea Arcuri and EvoSuite
* contributors
*
* This file is part of EvoSuite.
*
* EvoSuite is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* EvoSuite is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with EvoSuite. If not, see <http://www.gnu.org/licenses/>.
*/
package org.evosuite.javaagent;
import org.evosuite.Properties;
import org.evosuite.TestUtil;
import org.evosuite.classpath.ClassPathHandler;
import org.evosuite.instrumentation.InstrumentingClassLoader;
import org.evosuite.instrumentation.testability.TestabilityTransformationClassLoader;
import org.evosuite.testcase.execution.ExecutionTrace;
import org.evosuite.testcase.execution.ExecutionTracer;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
public class InstrumentingClassLoaderTest {
@BeforeClass
public static void initClass() {
ClassPathHandler.getInstance().changeTargetCPtoTheSameAsEvoSuite();
}
@Test
public void testClassWithStaticInitializationCallingGetPackage()
throws ClassNotFoundException {
InstrumentingClassLoader instrumentingClassLoader = new InstrumentingClassLoader();
Class<?> stat = Class.forName("com.examples.with.different.packagename.StatInitIssue",
true, instrumentingClassLoader);
}
/*
* Tests the child-first/parent-last property of the classloader.
*/
@Ignore
@Test
public void testDependingInstrumentation() throws Exception {
Class<?> originalClass = DependentClassLoaderTestSubject.class;
Properties.TARGET_CLASS = originalClass.getName();
Properties.PROJECT_PREFIX = originalClass.getPackage().getName();
Properties.TARGET_CLASS_PREFIX = Properties.PROJECT_PREFIX;
TestabilityTransformationClassLoader instrumentingClassLoader = new TestabilityTransformationClassLoader();
Class<?> changedClass = instrumentingClassLoader.loadClass(ClassLoaderTestSubject.class.getName());
Assert.assertEquals(instrumentingClassLoader, changedClass.getClassLoader());
Object changed = changedClass.getConstructor().newInstance();
ExecutionTracer.enable();
ExecutionTracer.getExecutionTracer().clear();
TestUtil.invokeMethod(changed, "trySomethingElse");
ExecutionTrace execTrace = ExecutionTracer.getExecutionTracer().getTrace();
execTrace = ExecutionTracer.getExecutionTracer().getTrace();
Assert.assertFalse(execTrace.getTrueDistances().isEmpty());
Assert.assertFalse(execTrace.getFalseDistances().isEmpty());
ExecutionTracer.getExecutionTracer().clear();
}
@Ignore
@Test
public void testDirectInstrumentation() throws Exception {
Class<?> originalClass = ClassLoaderTestSubject.class;
Properties.TARGET_CLASS = originalClass.getName();
Properties.PROJECT_PREFIX = originalClass.getPackage().getName();
ClassLoaderTestSubject original = new ClassLoaderTestSubject();
ExecutionTracer.enable();
ExecutionTracer.getExecutionTracer().clear();
original.assess(6);
ExecutionTrace execTrace = ExecutionTracer.getExecutionTracer().getTrace();
Assert.assertTrue(execTrace.getTrueDistances().isEmpty());
Assert.assertTrue(execTrace.getFalseDistances().isEmpty());
TestabilityTransformationClassLoader instrumentingClassLoader = new TestabilityTransformationClassLoader();
Class<?> changedClass = instrumentingClassLoader.loadClass(ClassLoaderTestSubject.class.getName());
Assert.assertEquals(instrumentingClassLoader, changedClass.getClassLoader());
Assert.assertTrue(changedClass.hashCode() != originalClass.hashCode());
Assert.assertFalse(changedClass.equals(originalClass));
Object changed = changedClass.getConstructor().newInstance();
try {
@SuppressWarnings("unused")
ClassLoaderTestSubject casted = (ClassLoaderTestSubject) changed;
Assert.fail();
} catch (ClassCastException exc) {
// expected
}
ExecutionTracer.getExecutionTracer().clear();
TestUtil.invokeMethod(changed, "assess", Integer.valueOf(6));
execTrace = ExecutionTracer.getExecutionTracer().getTrace();
Assert.assertFalse(execTrace.getTrueDistances().isEmpty());
Assert.assertFalse(execTrace.getFalseDistances().isEmpty());
ExecutionTracer.getExecutionTracer().clear();
}
@Ignore
@Test
public void testInnerClasses() throws Exception {
Class<? extends InnerClassesTestSubject> originalClass = InnerClassesTestSubject.class;
Properties.TARGET_CLASS = originalClass.getName();
Properties.PROJECT_PREFIX = originalClass.getPackage().getName();
TestabilityTransformationClassLoader instrumentingClassLoader = new TestabilityTransformationClassLoader();
Class<?> changedClass = instrumentingClassLoader.loadClass(InnerClassesTestSubject.class.getName());
Assert.assertEquals(instrumentingClassLoader, changedClass.getClassLoader());
Assert.assertTrue(changedClass.hashCode() != originalClass.hashCode());
InnerClassesTestSubject original = originalClass.newInstance();
Assert.assertEquals("abcd", original.toString());
Object modified = changedClass.newInstance();
Assert.assertEquals("abcd", modified.toString());
}
}
| {
"pile_set_name": "Github"
} |
"""
Definition of urls for DjangoWebProject1.
"""
from datetime import datetime
from django.conf.urls import patterns, include, url
from django.contrib import admin
from app.forms import BootstrapAuthenticationForm
admin.autodiscover()
urlpatterns = patterns('',
url(r'^', include('app.urls', namespace="app")),
url(r'^contact$', 'app.views.contact', name='contact'),
url(r'^about', 'app.views.about', name='about'),
url(r'^seed', 'app.views.seed', name='seed'),
url(r'^login/$',
'django.contrib.auth.views.login',
{
'template_name': 'app/login.html',
'authentication_form': BootstrapAuthenticationForm,
'extra_context':
{
'title':'Log in',
'year':datetime.now().year,
}
},
name='login'),
url(r'^logout$',
'django.contrib.auth.views.logout',
{
'next_page': '/',
},
name='logout'),
url(r'^admin/', include(admin.site.urls)),
)
| {
"pile_set_name": "Github"
} |
# gbRNAs.sql was originally generated by the autoSql program, which also
# generated gbRNAs.c and gbRNAs.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#Genbank RNA genes
CREATE TABLE gbRNAs (
bin int unsigned not null,
chrom varchar(255) not null, # chromosome
chromStart int unsigned not null, # Start position in chromosome
chromEnd int unsigned not null, # End position in chromosome
name varchar(255) not null, # gene name
score int unsigned not null, # Score from 900-1000. 1000 is best
strand char(1) not null, # Value should be + or -
product varchar(255) not null, # Description of RNA gene
intron varchar(255) not null, # Coordinates of intron in RNA gene
#Indices
PRIMARY KEY(name)
);
| {
"pile_set_name": "Github"
} |
package vpx
import "errors"
func Error(err CodecErr) error {
switch err {
case CodecOk:
return nil
case CodecError:
return ErrCodecUnknownError
case CodecMemError:
return ErrCodecMemError
case CodecABIMismatch:
return ErrCodecABIMismatch
case CodecIncapable:
return ErrCodecIncapable
case CodecUnsupBitstream:
return ErrCodecUnsupBitstream
case CodecUnsupFeature:
return ErrCodecUnsupFeature
case CodecCorruptFrame:
return ErrCodecCorruptFrame
case CodecInvalidParam:
return ErrCodecInvalidParam
default:
return ErrCodecUnknownError
}
}
var (
ErrCodecUnknownError = errors.New("vpx: unknown error")
ErrCodecMemError = errors.New("vpx: memory error")
ErrCodecABIMismatch = errors.New("vpx: ABI mismatch")
ErrCodecIncapable = errors.New("vpx: incapable")
ErrCodecUnsupBitstream = errors.New("vpx: unsupported bitstream")
ErrCodecUnsupFeature = errors.New("vpx: unsupported feature")
ErrCodecCorruptFrame = errors.New("vpx: corrupt frame")
ErrCodecInvalidParam = errors.New("vpx: invalid param")
)
| {
"pile_set_name": "Github"
} |
! Copyright (C) 2002-2013 Free Software Foundation, Inc.
! Contributed by Paul Brook <[email protected]>
!
!This file is part of the GNU Fortran 95 runtime library (libgfortran).
!
!GNU libgfortran 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.
!GNU libgfortran is distributed in the hope that it will be useful,
!but WITHOUT ANY WARRANTY; without even the implied warranty of
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!GNU General Public License for more details.
!
!Under Section 7 of GPL version 3, you are granted additional
!permissions described in the GCC Runtime Library Exception, version
!3.1, as published by the Free Software Foundation.
!
!You should have received a copy of the GNU General Public License and
!a copy of the GCC Runtime Library Exception along with this program;
!see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
!<http://www.gnu.org/licenses/>.
!
!This file is machine generated.
#include "config.h"
#include "kinds.inc"
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_10)
#ifdef HAVE_ASINHL
elemental function _gfortran_specific__asinh_r10 (parm)
real (kind=10), intent (in) :: parm
real (kind=10) :: _gfortran_specific__asinh_r10
_gfortran_specific__asinh_r10 = asinh (parm)
end function
#endif
#endif
| {
"pile_set_name": "Github"
} |
{
"version" : "5.5.0",
"timestamp" : 1581572105208,
"path" : "query-validation-tests/url.json",
"schemas" : {
"CSAS_OUTPUT_0.KsqlTopic.Source" : {
"schema" : "`ROWKEY` STRING KEY, `URL` STRING",
"serdeOptions" : [ ]
},
"CSAS_OUTPUT_0.OUTPUT" : {
"schema" : "`ROWKEY` STRING KEY, `PARAM_A` STRING, `PARAM_B` STRING",
"serdeOptions" : [ ]
}
},
"testCase" : {
"name" : "extract a parameter from a URL using URL_EXTRACT_PARAMETER - JSON",
"inputs" : [ {
"topic" : "test_topic",
"key" : "1",
"value" : {
"url" : "http://www.test.com/?one=a&two=b&three"
},
"timestamp" : 0
} ],
"outputs" : [ {
"topic" : "OUTPUT",
"key" : "1",
"value" : {
"PARAM_A" : "a",
"PARAM_B" : "b"
},
"timestamp" : 0
} ],
"topics" : [ {
"name" : "OUTPUT",
"replicas" : 1,
"numPartitions" : 4
}, {
"name" : "test_topic",
"replicas" : 1,
"numPartitions" : 4
} ],
"statements" : [ "CREATE STREAM TEST (URL STRING) WITH (KAFKA_TOPIC='test_topic', VALUE_FORMAT='JSON');", "CREATE STREAM OUTPUT AS SELECT\n URL_EXTRACT_PARAMETER(TEST.URL, 'one') PARAM_A,\n URL_EXTRACT_PARAMETER(TEST.URL, 'two') PARAM_B\nFROM TEST TEST\nEMIT CHANGES;" ],
"post" : {
"sources" : [ {
"name" : "OUTPUT",
"type" : "STREAM",
"schema" : "`ROWKEY` STRING KEY, `PARAM_A` STRING, `PARAM_B` STRING",
"keyFormat" : {
"format" : "KAFKA"
},
"serdeOptions" : [ ]
}, {
"name" : "TEST",
"type" : "STREAM",
"schema" : "`ROWKEY` STRING KEY, `URL` STRING",
"keyFormat" : {
"format" : "KAFKA"
},
"serdeOptions" : [ ]
} ],
"topics" : {
"topics" : [ {
"name" : "test_topic",
"keyFormat" : {
"formatInfo" : {
"format" : "KAFKA"
}
},
"valueFormat" : {
"format" : "JSON"
},
"partitions" : 4
}, {
"name" : "OUTPUT",
"keyFormat" : {
"formatInfo" : {
"format" : "KAFKA"
}
},
"valueFormat" : {
"format" : "JSON"
},
"partitions" : 4
} ]
}
}
}
} | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="iso-8859-1"?>
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<toolchain>
<name>ARM</name>
</toolchain>
<debug>1</debug>
<settings>
<name>C-SPY</name>
<archiveVersion>2</archiveVersion>
<data>
<version>21</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CInput</name>
<state>1</state>
</option>
<option>
<name>CEndian</name>
<state>1</state>
</option>
<option>
<name>CProcessor</name>
<state>1</state>
</option>
<option>
<name>OCVariant</name>
<state>0</state>
</option>
<option>
<name>MacOverride</name>
<state>0</state>
</option>
<option>
<name>MacFile</name>
<state></state>
</option>
<option>
<name>MemOverride</name>
<state>0</state>
</option>
<option>
<name>MemFile</name>
<state></state>
</option>
<option>
<name>RunToEnable</name>
<state>1</state>
</option>
<option>
<name>RunToName</name>
<state>main</state>
</option>
<option>
<name>CExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>CExtraOptions</name>
<state></state>
</option>
<option>
<name>CFpuProcessor</name>
<state>1</state>
</option>
<option>
<name>OCDDFArgumentProducer</name>
<state></state>
</option>
<option>
<name>OCDownloadSuppressDownload</name>
<state>0</state>
</option>
<option>
<name>OCDownloadVerifyAll</name>
<state>1</state>
</option>
<option>
<name>OCProductVersion</name>
<state>5.41.2.51798</state>
</option>
<option>
<name>OCDynDriverList</name>
<state>JLINK_ID</state>
</option>
<option>
<name>OCLastSavedByProductVersion</name>
<state>5.41.2.51798</state>
</option>
<option>
<name>OCDownloadAttachToProgram</name>
<state>0</state>
</option>
<option>
<name>UseFlashLoader</name>
<state>1</state>
</option>
<option>
<name>CLowLevel</name>
<state>1</state>
</option>
<option>
<name>OCBE8Slave</name>
<state>1</state>
</option>
<option>
<name>MacFile2</name>
<state></state>
</option>
<option>
<name>CDevice</name>
<state>1</state>
</option>
<option>
<name>FlashLoadersV3</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck1</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath1</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck2</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath2</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck3</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath3</name>
<state></state>
</option>
<option>
<name>OverrideDefFlashBoard</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ARMSIM_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OCSimDriverInfo</name>
<state>1</state>
</option>
<option>
<name>OCSimEnablePSP</name>
<state>0</state>
</option>
<option>
<name>OCSimPspOverrideConfig</name>
<state>0</state>
</option>
<option>
<name>OCSimPspConfigFile</name>
<state></state>
</option>
</data>
</settings>
<settings>
<name>ANGEL_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CCAngelHeartbeat</name>
<state>1</state>
</option>
<option>
<name>CAngelCommunication</name>
<state>1</state>
</option>
<option>
<name>CAngelCommBaud</name>
<version>0</version>
<state>3</state>
</option>
<option>
<name>CAngelCommPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>ANGELTCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>DoAngelLogfile</name>
<state>0</state>
</option>
<option>
<name>AngelLogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>GDBSERVER_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>TCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>DoLogfile</name>
<state>0</state>
</option>
<option>
<name>LogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCJTagBreakpointRadio</name>
<state>0</state>
</option>
<option>
<name>CCJTagDoUpdateBreakpoints</name>
<state>0</state>
</option>
<option>
<name>CCJTagUpdateBreakpoints</name>
<state>main</state>
</option>
</data>
</settings>
<settings>
<name>IARROM_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CRomLogFileCheck</name>
<state>0</state>
</option>
<option>
<name>CRomLogFileEditB</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CRomCommunication</name>
<state>0</state>
</option>
<option>
<name>CRomCommPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CRomCommBaud</name>
<version>0</version>
<state>7</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>JLINK_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>JLinkSpeed</name>
<state>32</state>
</option>
<option>
<name>CCJLinkDoLogfile</name>
<state>0</state>
</option>
<option>
<name>CCJLinkLogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCJLinkHWResetDelay</name>
<state>0</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>JLinkInitialSpeed</name>
<state>32</state>
</option>
<option>
<name>CCDoJlinkMultiTarget</name>
<state>0</state>
</option>
<option>
<name>CCScanChainNonARMDevices</name>
<state>0</state>
</option>
<option>
<name>CCJLinkMultiTarget</name>
<state>0</state>
</option>
<option>
<name>CCJLinkIRLength</name>
<state>0</state>
</option>
<option>
<name>CCJLinkCommRadio</name>
<state>0</state>
</option>
<option>
<name>CCJLinkTCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>CCJLinkSpeedRadioV2</name>
<state>0</state>
</option>
<option>
<name>CCUSBDevice</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCRDICatchReset</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchUndef</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchSWI</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchData</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchPrefetch</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchIRQ</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchFIQ</name>
<state>0</state>
</option>
<option>
<name>CCJLinkBreakpointRadio</name>
<state>0</state>
</option>
<option>
<name>CCJLinkDoUpdateBreakpoints</name>
<state>0</state>
</option>
<option>
<name>CCJLinkUpdateBreakpoints</name>
<state>main</state>
</option>
<option>
<name>CCJLinkInterfaceRadio</name>
<state>1</state>
</option>
<option>
<name>OCJLinkAttachSlave</name>
<state>1</state>
</option>
<option>
<name>CCJLinkResetList</name>
<version>2</version>
<state>7</state>
</option>
<option>
<name>CCJLinkInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>LMIFTDI_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>2</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>LmiftdiSpeed</name>
<state>500</state>
</option>
<option>
<name>CCLmiftdiDoLogfile</name>
<state>0</state>
</option>
<option>
<name>CCLmiftdiLogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCLmiFtdiInterfaceRadio</name>
<state>0</state>
</option>
<option>
<name>CCLmiFtdiInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>MACRAIGOR_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>3</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>jtag</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>EmuSpeed</name>
<state>1</state>
</option>
<option>
<name>TCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>DoLogfile</name>
<state>0</state>
</option>
<option>
<name>LogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>DoEmuMultiTarget</name>
<state>0</state>
</option>
<option>
<name>EmuMultiTarget</name>
<state>0@ARM7TDMI</state>
</option>
<option>
<name>EmuHWReset</name>
<state>0</state>
</option>
<option>
<name>CEmuCommBaud</name>
<version>0</version>
<state>4</state>
</option>
<option>
<name>CEmuCommPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>jtago</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>UnusedAddr</name>
<state>0x00800000</state>
</option>
<option>
<name>CCMacraigorHWResetDelay</name>
<state></state>
</option>
<option>
<name>CCJTagBreakpointRadio</name>
<state>0</state>
</option>
<option>
<name>CCJTagDoUpdateBreakpoints</name>
<state>0</state>
</option>
<option>
<name>CCJTagUpdateBreakpoints</name>
<state>main</state>
</option>
<option>
<name>CCMacraigorInterfaceRadio</name>
<state>0</state>
</option>
<option>
<name>CCMacraigorInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>RDI_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CRDIDriverDll</name>
<state>###Uninitialized###</state>
</option>
<option>
<name>CRDILogFileCheck</name>
<state>0</state>
</option>
<option>
<name>CRDILogFileEdit</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCRDIHWReset</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchReset</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchUndef</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchSWI</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchData</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchPrefetch</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchIRQ</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchFIQ</name>
<state>0</state>
</option>
<option>
<name>CCRDIUseETM</name>
<state>0</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>STLINK_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>CCSTLinkInterfaceRadio</name>
<state>0</state>
</option>
<option>
<name>CCSTLinkInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>THIRDPARTY_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CThirdPartyDriverDll</name>
<state>###Uninitialized###</state>
</option>
<option>
<name>CThirdPartyLogFileCheck</name>
<state>0</state>
</option>
<option>
<name>CThirdPartyLogFileEditB</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<debuggerPlugins>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB5_Plugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>
</configuration>
<configuration>
<name>Release</name>
<toolchain>
<name>ARM</name>
</toolchain>
<debug>0</debug>
<settings>
<name>C-SPY</name>
<archiveVersion>2</archiveVersion>
<data>
<version>21</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CInput</name>
<state>1</state>
</option>
<option>
<name>CEndian</name>
<state>1</state>
</option>
<option>
<name>CProcessor</name>
<state>1</state>
</option>
<option>
<name>OCVariant</name>
<state>0</state>
</option>
<option>
<name>MacOverride</name>
<state>0</state>
</option>
<option>
<name>MacFile</name>
<state></state>
</option>
<option>
<name>MemOverride</name>
<state>0</state>
</option>
<option>
<name>MemFile</name>
<state></state>
</option>
<option>
<name>RunToEnable</name>
<state>1</state>
</option>
<option>
<name>RunToName</name>
<state>main</state>
</option>
<option>
<name>CExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>CExtraOptions</name>
<state></state>
</option>
<option>
<name>CFpuProcessor</name>
<state>1</state>
</option>
<option>
<name>OCDDFArgumentProducer</name>
<state></state>
</option>
<option>
<name>OCDownloadSuppressDownload</name>
<state>0</state>
</option>
<option>
<name>OCDownloadVerifyAll</name>
<state>1</state>
</option>
<option>
<name>OCProductVersion</name>
<state>5.41.2.51798</state>
</option>
<option>
<name>OCDynDriverList</name>
<state>JLINK_ID</state>
</option>
<option>
<name>OCLastSavedByProductVersion</name>
<state>5.41.2.51798</state>
</option>
<option>
<name>OCDownloadAttachToProgram</name>
<state>0</state>
</option>
<option>
<name>UseFlashLoader</name>
<state>1</state>
</option>
<option>
<name>CLowLevel</name>
<state>1</state>
</option>
<option>
<name>OCBE8Slave</name>
<state>1</state>
</option>
<option>
<name>MacFile2</name>
<state></state>
</option>
<option>
<name>CDevice</name>
<state>1</state>
</option>
<option>
<name>FlashLoadersV3</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck1</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath1</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck2</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath2</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck3</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath3</name>
<state></state>
</option>
<option>
<name>OverrideDefFlashBoard</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ARMSIM_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>OCSimDriverInfo</name>
<state>1</state>
</option>
<option>
<name>OCSimEnablePSP</name>
<state>0</state>
</option>
<option>
<name>OCSimPspOverrideConfig</name>
<state>0</state>
</option>
<option>
<name>OCSimPspConfigFile</name>
<state></state>
</option>
</data>
</settings>
<settings>
<name>ANGEL_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CCAngelHeartbeat</name>
<state>1</state>
</option>
<option>
<name>CAngelCommunication</name>
<state>1</state>
</option>
<option>
<name>CAngelCommBaud</name>
<version>0</version>
<state>3</state>
</option>
<option>
<name>CAngelCommPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>ANGELTCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>DoAngelLogfile</name>
<state>0</state>
</option>
<option>
<name>AngelLogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>GDBSERVER_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>TCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>DoLogfile</name>
<state>0</state>
</option>
<option>
<name>LogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCJTagBreakpointRadio</name>
<state>0</state>
</option>
<option>
<name>CCJTagDoUpdateBreakpoints</name>
<state>0</state>
</option>
<option>
<name>CCJTagUpdateBreakpoints</name>
<state>main</state>
</option>
</data>
</settings>
<settings>
<name>IARROM_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CRomLogFileCheck</name>
<state>0</state>
</option>
<option>
<name>CRomLogFileEditB</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CRomCommunication</name>
<state>0</state>
</option>
<option>
<name>CRomCommPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CRomCommBaud</name>
<version>0</version>
<state>7</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>JLINK_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>10</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>JLinkSpeed</name>
<state>32</state>
</option>
<option>
<name>CCJLinkDoLogfile</name>
<state>0</state>
</option>
<option>
<name>CCJLinkLogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCJLinkHWResetDelay</name>
<state>0</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>JLinkInitialSpeed</name>
<state>32</state>
</option>
<option>
<name>CCDoJlinkMultiTarget</name>
<state>0</state>
</option>
<option>
<name>CCScanChainNonARMDevices</name>
<state>0</state>
</option>
<option>
<name>CCJLinkMultiTarget</name>
<state>0</state>
</option>
<option>
<name>CCJLinkIRLength</name>
<state>0</state>
</option>
<option>
<name>CCJLinkCommRadio</name>
<state>0</state>
</option>
<option>
<name>CCJLinkTCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>CCJLinkSpeedRadioV2</name>
<state>0</state>
</option>
<option>
<name>CCUSBDevice</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCRDICatchReset</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchUndef</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchSWI</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchData</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchPrefetch</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchIRQ</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchFIQ</name>
<state>0</state>
</option>
<option>
<name>CCJLinkBreakpointRadio</name>
<state>0</state>
</option>
<option>
<name>CCJLinkDoUpdateBreakpoints</name>
<state>0</state>
</option>
<option>
<name>CCJLinkUpdateBreakpoints</name>
<state>main</state>
</option>
<option>
<name>CCJLinkInterfaceRadio</name>
<state>1</state>
</option>
<option>
<name>OCJLinkAttachSlave</name>
<state>1</state>
</option>
<option>
<name>CCJLinkResetList</name>
<version>2</version>
<state>7</state>
</option>
<option>
<name>CCJLinkInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>LMIFTDI_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>2</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>LmiftdiSpeed</name>
<state>500</state>
</option>
<option>
<name>CCLmiftdiDoLogfile</name>
<state>0</state>
</option>
<option>
<name>CCLmiftdiLogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCLmiFtdiInterfaceRadio</name>
<state>0</state>
</option>
<option>
<name>CCLmiFtdiInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>MACRAIGOR_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>3</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>jtag</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>EmuSpeed</name>
<state>1</state>
</option>
<option>
<name>TCPIP</name>
<state>aaa.bbb.ccc.ddd</state>
</option>
<option>
<name>DoLogfile</name>
<state>0</state>
</option>
<option>
<name>LogFile</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>DoEmuMultiTarget</name>
<state>0</state>
</option>
<option>
<name>EmuMultiTarget</name>
<state>0@ARM7TDMI</state>
</option>
<option>
<name>EmuHWReset</name>
<state>0</state>
</option>
<option>
<name>CEmuCommBaud</name>
<version>0</version>
<state>4</state>
</option>
<option>
<name>CEmuCommPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>jtago</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>UnusedAddr</name>
<state>0x00800000</state>
</option>
<option>
<name>CCMacraigorHWResetDelay</name>
<state></state>
</option>
<option>
<name>CCJTagBreakpointRadio</name>
<state>0</state>
</option>
<option>
<name>CCJTagDoUpdateBreakpoints</name>
<state>0</state>
</option>
<option>
<name>CCJTagUpdateBreakpoints</name>
<state>main</state>
</option>
<option>
<name>CCMacraigorInterfaceRadio</name>
<state>0</state>
</option>
<option>
<name>CCMacraigorInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>RDI_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CRDIDriverDll</name>
<state>###Uninitialized###</state>
</option>
<option>
<name>CRDILogFileCheck</name>
<state>0</state>
</option>
<option>
<name>CRDILogFileEdit</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>CCRDIHWReset</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchReset</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchUndef</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchSWI</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchData</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchPrefetch</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchIRQ</name>
<state>0</state>
</option>
<option>
<name>CCRDICatchFIQ</name>
<state>0</state>
</option>
<option>
<name>CCRDIUseETM</name>
<state>0</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>STLINK_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
<option>
<name>CCSTLinkInterfaceRadio</name>
<state>0</state>
</option>
<option>
<name>CCSTLinkInterfaceCmdLine</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>THIRDPARTY_ID</name>
<archiveVersion>2</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CThirdPartyDriverDll</name>
<state>###Uninitialized###</state>
</option>
<option>
<name>CThirdPartyLogFileCheck</name>
<state>0</state>
</option>
<option>
<name>CThirdPartyLogFileEditB</name>
<state>$PROJ_DIR$\cspycomm.log</state>
</option>
<option>
<name>OCDriverInfo</name>
<state>1</state>
</option>
</data>
</settings>
<debuggerPlugins>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB5_Plugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>
</configuration>
</project>
| {
"pile_set_name": "Github"
} |
// Boost.Bimap
//
// Copyright (c) 2006-2007 Matias Capeletto
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/// \file relation/support/get_pair_functor.hpp
/// \brief get_pair_functor definition
#ifndef BOOST_BIMAP_RELATION_SUPPORT_GET_PAIR_FUNCTOR_HPP
#define BOOST_BIMAP_RELATION_SUPPORT_GET_PAIR_FUNCTOR_HPP
#if defined(_MSC_VER) && (_MSC_VER>=1200)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/bimap/relation/support/pair_by.hpp>
namespace boost {
namespace bimaps {
namespace relation {
namespace support {
/// \brief A Functor that takes a relation as a parameter an return the desired view.
/**
This functor is included to help users of the relation class when using
stl algorithms.
See also member_at, pair_by().
\ingroup relation_group
**/
template< class Tag, class Relation >
struct get_pair_functor
{
BOOST_DEDUCED_TYPENAME result_of::pair_by<Tag,Relation>::type
operator()( Relation & r ) const
{
return pair_by<Tag>(r);
}
BOOST_DEDUCED_TYPENAME result_of::pair_by<Tag,const Relation>::type
operator()( const Relation & r ) const
{
return pair_by<Tag>(r);
}
};
/// \brief A Functor that takes a relation as a parameter an return the above view.
/**
\ingroup relation_group
**/
template< class Relation >
struct get_above_view_functor
{
BOOST_DEDUCED_TYPENAME Relation::above_view &
operator()( Relation & r ) const
{
return r.get_view();
}
const BOOST_DEDUCED_TYPENAME Relation::above_view &
operator()( const Relation & r ) const
{
return r.get_view();
}
};
} // namespace support
} // namespace relation
} // namespace bimaps
} // namespace boost
#endif // BOOST_BIMAP_RELATION_SUPPORT_GET_PAIR_FUNCTOR_HPP
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2017 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "nv50.h"
#include "head.h"
#include "ior.h"
#include "rootnv50.h"
static const struct nv50_disp_func
mcp77_disp = {
.intr = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = &g94_disp_root_oclass,
.head.new = nv50_head_new,
.dac = { .nr = 3, .new = nv50_dac_new },
.sor = { .nr = 4, .new = mcp77_sor_new },
.pior = { .nr = 3, .new = nv50_pior_new },
};
int
mcp77_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp)
{
return nv50_disp_new_(&mcp77_disp, device, index, 2, pdisp);
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" />
<ItemGroup>
<ClCompile Include="src\account.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\browser\badconnect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\browser\mailbrowser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\debug.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\filterplugin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\mails\decode.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\mails\mails.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\mails\mime.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\protoplugin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\proto\netlib.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\proto\pop3\pop3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\proto\pop3\pop3comm.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\proto\pop3\pop3opt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\services.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\stdafx.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\synchro.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\yamn.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\browser\browser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\mails\decode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\proto\netclient.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\proto\netlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\proto\pop3\pop3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\proto\pop3\pop3comm.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\proto\pop3\pop3opt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\debug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\main.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\Version.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
<ResourceCompile Include="res\YAMN.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project> | {
"pile_set_name": "Github"
} |
#region Copyright Syncfusion Inc. 2001-2020.
// Copyright Syncfusion Inc. 2001-2020. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// [email protected]. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using Syncfusion.SfDataGrid;
using UIKit;
using System.Globalization;
using CoreGraphics;
using System.ComponentModel;
namespace SampleBrowser
{
[Foundation.Preserve(AllMembers = true)]
public class Sorting:SampleView
{
#region Fields
SfDataGrid SfGrid;
#endregion
static bool UserInterfaceIdiomIsPhone {
get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; }
}
public Sorting ()
{
this.SfGrid = new SfDataGrid ();
this.SfGrid.SelectionMode = SelectionMode.Single;
this.SfGrid.AllowSorting = true;
this.SfGrid.AllowTriStateSorting = true;
this.SfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;
this.SfGrid.ItemsSource = new SortViewModel ().Products;
this.SfGrid.ShowRowHeader = false;
this.SfGrid.HeaderRowHeight = 45;
this.SfGrid.RowHeight = 45;
if (Utility.IsIPad)
this.SfGrid.ColumnSizer = ColumnSizer.Star;
this.SfGrid.SortColumnDescriptions.Add (new SortColumnDescription (){ ColumnName ="ProductID",SortDirection = ListSortDirection.Descending });
this.AddSubview (SfGrid);
}
void GridAutoGenerateColumns (object sender, AutoGeneratingColumnEventArgs e)
{
if (e.Column.MappingName == "SupplierID") {
e.Column.HeaderText = "Supplier ID";
e.Column.TextAlignment = UITextAlignment.Center;
} else if (e.Column.MappingName == "ProductID") {
e.Column.HeaderText = "Product ID";
e.Column.TextAlignment = UITextAlignment.Center;
} else if (e.Column.MappingName == "ProductName") {
e.Column.HeaderText = "Product Name";
e.Column.TextMargin = 15;
e.Column.TextAlignment = UITextAlignment.Left;
} else if (e.Column.MappingName == "QuantityPerUnit") {
e.Column.HeaderText = "Quantity Per Unit";
e.Column.TextAlignment = UITextAlignment.Center;
} else if (e.Column.MappingName == "UnitPrice") {
e.Column.TextAlignment = UITextAlignment.Center;
e.Column.Format = "C";
e.Column.CultureInfo = new CultureInfo ("en-US");
e.Column.HeaderText = "Unit Price";
} else if (e.Column.MappingName == "UnitsInStock") {
e.Column.TextAlignment = UITextAlignment.Center;
e.Column.HeaderText = "Units In Stock";
}
}
public override void LayoutSubviews ()
{
this.SfGrid.Frame = new CGRect (0, 0, this.Frame.Width, this.Frame.Height);
base.LayoutSubviews ();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (SfGrid != null)
{
SfGrid.AutoGeneratingColumn -= GridAutoGenerateColumns;
SfGrid.Dispose();
SfGrid = null;
}
}
base.Dispose(disposing);
}
}
}
| {
"pile_set_name": "Github"
} |
package net.anotheria.moskito.core.tracer;
import net.anotheria.moskito.core.config.MoskitoConfigurationHolder;
import net.anotheria.moskito.core.config.tracing.TracingConfiguration;
import net.anotheria.moskito.core.journey.JourneyManager;
import net.anotheria.moskito.core.journey.JourneyManagerFactory;
import net.anotheria.util.sorter.StaticQuickSorter;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* TODO comment this class
*
* @author lrosenberg
* @since 04.05.15 17:40
*/
public class Tracer {
/**
* Associated producer for this tracer.
*/
private String producerId;
/**
* If true the tracer is currently enabled. Disabled tracer doesn't collect any futher traces.
*/
private boolean enabled;
/**
* Journey manager is used to add remove journey-steps.
*/
private static JourneyManager journeyManager = JourneyManagerFactory.getJourneyManager();
/**
* Sorttype for keep longest strategy.
*/
private TraceSortType sortTypeForKeepLongest = new TraceSortType(TraceSortType.SORT_BY_DURATION, TraceSortType.DESC);
/**
* Lock for deletion of traces in case we gather too many traces.
*/
private ReadWriteLock resizeLock = new ReentrantReadWriteLock();
private List<Trace> traces;
private int totalEntryCount;
public Tracer(String aProducerId){
producerId = aProducerId;
enabled = true;
traces = new CopyOnWriteArrayList<Trace>();
}
public String getProducerId(){
return producerId;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public int getEntryCount(){
return traces == null ? 0 : traces.size();
}
public void addTrace(Trace aTrace, int toleratedAmount, int maxAmount){
totalEntryCount++;
try {
resizeLock.writeLock().lock();
traces.add(aTrace);
if (traces.size() <= toleratedAmount)
return;
TracingConfiguration config = MoskitoConfigurationHolder.getConfiguration().getTracingConfig();
List<Trace> oldTraces;
switch (config.getShrinkingStrategy()) {
case KEEPLONGEST:
oldTraces = StaticQuickSorter.sort(traces, sortTypeForKeepLongest);
traces = new CopyOnWriteArrayList<Trace>();
for (int i = 0; i < oldTraces.size(); i++) {
if (i < maxAmount) {
traces.add(oldTraces.get(i));
} else {
journeyManager.getOrCreateJourney(Tracers.getJourneyNameForTracers(producerId)).removeStepByName(Tracers.getCallName(oldTraces.get(i)));
}
}
break;
case FIFO:
oldTraces = traces;
traces = new CopyOnWriteArrayList<Trace>();
int offset = toleratedAmount - maxAmount;
for (int i=0; i<oldTraces.size(); i++){
if (i>=(1+offset) && i<=(maxAmount+offset)){
traces.add(oldTraces.get(i));
}else{
journeyManager.getOrCreateJourney(Tracers.getJourneyNameForTracers(producerId)).removeStepByName(Tracers.getCallName(oldTraces.get(i)));
}
}
break;
default:
throw new IllegalArgumentException("Shrinking strategy " + config.getShrinkingStrategy() + " is not supported");
}
}finally{
resizeLock.writeLock().unlock();
}
}
public List<Trace> getTraces(){
try{
resizeLock.readLock().lock();
return traces;
}finally {
resizeLock.readLock().unlock();
}
}
public int getTotalEntryCount() {
return totalEntryCount;
}
public void setTotalEntryCount(int totalEntryCount) {
this.totalEntryCount = totalEntryCount;
}
}
| {
"pile_set_name": "Github"
} |
param(
[Parameter(Mandatory=$true)][string] $SourceRepo,
[Parameter(Mandatory=$true)][int] $ChannelId,
[Parameter(Mandatory=$true)][string] $MaestroApiAccessToken,
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com',
[Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2019-01-16'
)
try {
. $PSScriptRoot\post-build-utils.ps1
# Get all the $SourceRepo subscriptions
$normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '')
$subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId
if (!$subscriptions) {
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'"
ExitWithExitCode 0
}
$subscriptionsToTrigger = New-Object System.Collections.Generic.List[string]
$failedTriggeredSubscription = $false
# Get all enabled subscriptions that need dependency flow on 'everyBuild'
foreach ($subscription in $subscriptions) {
if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) {
Write-Host "Should trigger this subscription: ${$subscription.id}"
[void]$subscriptionsToTrigger.Add($subscription.id)
}
}
foreach ($subscriptionToTrigger in $subscriptionsToTrigger) {
try {
Write-Host "Triggering subscription '$subscriptionToTrigger'."
Trigger-Subscription -SubscriptionId $subscriptionToTrigger
Write-Host 'done.'
}
catch
{
Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'"
Write-Host $_
Write-Host $_.ScriptStackTrace
$failedTriggeredSubscription = $true
}
}
if ($subscriptionsToTrigger.Count -eq 0) {
Write-Host "No subscription matched source repo '$normalizedSourceRepo' and channel ID '$ChannelId'."
}
elseif ($failedTriggeredSubscription) {
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message 'At least one subscription failed to be triggered...'
ExitWithExitCode 1
}
else {
Write-Host 'All subscriptions were triggered successfully!'
}
}
catch {
Write-Host $_.ScriptStackTrace
Write-PipelineTelemetryError -Category 'TriggerSubscriptions' -Message $_
ExitWithExitCode 1
}
| {
"pile_set_name": "Github"
} |
/**
* @brief A solver factory that allows one to register solvers, similar to
* layer factory. During runtime, registered solvers could be called by passing
* a SolverParameter protobuffer to the CreateSolver function:
*
* SolverRegistry<Dtype>::CreateSolver(param);
*
* There are two ways to register a solver. Assuming that we have a solver like:
*
* template <typename Dtype>
* class MyAwesomeSolver : public Solver<Dtype> {
* // your implementations
* };
*
* and its type is its C++ class name, but without the "Solver" at the end
* ("MyAwesomeSolver" -> "MyAwesome").
*
* If the solver is going to be created simply by its constructor, in your c++
* file, add the following line:
*
* REGISTER_SOLVER_CLASS(MyAwesome);
*
* Or, if the solver is going to be created by another creator function, in the
* format of:
*
* template <typename Dtype>
* Solver<Dtype*> GetMyAwesomeSolver(const SolverParameter& param) {
* // your implementation
* }
*
* then you can register the creator function instead, like
*
* REGISTER_SOLVER_CREATOR(MyAwesome, GetMyAwesomeSolver)
*
* Note that each solver type should only be registered once.
*/
#ifndef CAFFE_SOLVER_FACTORY_H_
#define CAFFE_SOLVER_FACTORY_H_
#include <map>
#include <string>
#include <vector>
#include "caffe/common.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
template <typename Dtype>
class Solver;
template <typename Dtype>
class SolverRegistry {
public:
typedef Solver<Dtype>* (*Creator)(const SolverParameter&);
typedef std::map<string, Creator> CreatorRegistry;
static CreatorRegistry& Registry() {
static CreatorRegistry* g_registry_ = new CreatorRegistry();
return *g_registry_;
}
// Adds a creator.
static void AddCreator(const string& type, Creator creator) {
CreatorRegistry& registry = Registry();
CHECK_EQ(registry.count(type), 0)
<< "Solver type " << type << " already registered.";
registry[type] = creator;
}
// Get a solver using a SolverParameter.
static Solver<Dtype>* CreateSolver(const SolverParameter& param) {
const string& type = param.type();
CreatorRegistry& registry = Registry();
CHECK_EQ(registry.count(type), 1) << "Unknown solver type: " << type
<< " (known types: " << SolverTypeListString() << ")";
return registry[type](param);
}
static vector<string> SolverTypeList() {
CreatorRegistry& registry = Registry();
vector<string> solver_types;
for (typename CreatorRegistry::iterator iter = registry.begin();
iter != registry.end(); ++iter) {
solver_types.push_back(iter->first);
}
return solver_types;
}
private:
// Solver registry should never be instantiated - everything is done with its
// static variables.
SolverRegistry() {}
static string SolverTypeListString() {
vector<string> solver_types = SolverTypeList();
string solver_types_str;
for (vector<string>::iterator iter = solver_types.begin();
iter != solver_types.end(); ++iter) {
if (iter != solver_types.begin()) {
solver_types_str += ", ";
}
solver_types_str += *iter;
}
return solver_types_str;
}
};
template <typename Dtype>
class SolverRegisterer {
public:
SolverRegisterer(const string& type,
Solver<Dtype>* (*creator)(const SolverParameter&)) {
// LOG(INFO) << "Registering solver type: " << type;
SolverRegistry<Dtype>::AddCreator(type, creator);
}
};
#define REGISTER_SOLVER_CREATOR(type, creator) \
static SolverRegisterer<float> g_creator_f_##type(#type, creator<float>); \
static SolverRegisterer<double> g_creator_d_##type(#type, creator<double>) \
#define REGISTER_SOLVER_CLASS(type) \
template <typename Dtype> \
Solver<Dtype>* Creator_##type##Solver( \
const SolverParameter& param) \
{ \
return new type##Solver<Dtype>(param); \
} \
REGISTER_SOLVER_CREATOR(type, Creator_##type##Solver)
} // namespace caffe
#endif // CAFFE_SOLVER_FACTORY_H_
| {
"pile_set_name": "Github"
} |
FOO input.mak /^FOO ?= bar$/;" m
URL input.mak /^URL ?= \\$/;" m
| {
"pile_set_name": "Github"
} |
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* -*- linux-c -*- *
*
* ALSA driver for the digigram lx6464es interface
* adapted upstream headers
*
* Copyright (c) 2009 Tim Blechmann <[email protected]>
*/
#ifndef LX_DEFS_H
#define LX_DEFS_H
/* code adapted from ethersound.h */
#define XES_FREQ_COUNT8_MASK 0x00001FFF /* compteur 25MHz entre 8 ech. */
#define XES_FREQ_COUNT8_44_MIN 0x00001288 /* 25M /
* [ 44k - ( 44.1k + 48k ) / 2 ]
* * 8 */
#define XES_FREQ_COUNT8_44_MAX 0x000010F0 /* 25M / [ ( 44.1k + 48k ) / 2 ]
* * 8 */
#define XES_FREQ_COUNT8_48_MAX 0x00000F08 /* 25M /
* [ 48k + ( 44.1k + 48k ) / 2 ]
* * 8 */
/* code adapted from LXES_registers.h */
#define IOCR_OUTPUTS_OFFSET 0 /* (rw) offset for the number of OUTs in the
* ConfES register. */
#define IOCR_INPUTS_OFFSET 8 /* (rw) offset for the number of INs in the
* ConfES register. */
#define FREQ_RATIO_OFFSET 19 /* (rw) offset for frequency ratio in the
* ConfES register. */
#define FREQ_RATIO_SINGLE_MODE 0x01 /* value for single mode frequency ratio:
* sample rate = frequency rate. */
#define CONFES_READ_PART_MASK 0x00070000
#define CONFES_WRITE_PART_MASK 0x00F80000
/* code adapted from if_drv_mb.h */
#define MASK_SYS_STATUS_ERROR (1L << 31) /* events that lead to a PCI irq if
* not yet pending */
#define MASK_SYS_STATUS_URUN (1L << 30)
#define MASK_SYS_STATUS_ORUN (1L << 29)
#define MASK_SYS_STATUS_EOBO (1L << 28)
#define MASK_SYS_STATUS_EOBI (1L << 27)
#define MASK_SYS_STATUS_FREQ (1L << 26)
#define MASK_SYS_STATUS_ESA (1L << 25) /* reserved, this is set by the
* XES */
#define MASK_SYS_STATUS_TIMER (1L << 24)
#define MASK_SYS_ASYNC_EVENTS (MASK_SYS_STATUS_ERROR | \
MASK_SYS_STATUS_URUN | \
MASK_SYS_STATUS_ORUN | \
MASK_SYS_STATUS_EOBO | \
MASK_SYS_STATUS_EOBI | \
MASK_SYS_STATUS_FREQ | \
MASK_SYS_STATUS_ESA)
#define MASK_SYS_PCI_EVENTS (MASK_SYS_ASYNC_EVENTS | \
MASK_SYS_STATUS_TIMER)
#define MASK_SYS_TIMER_COUNT 0x0000FFFF
#define MASK_SYS_STATUS_EOT_PLX (1L << 22) /* event that remains
* internal: reserved fo end
* of plx dma */
#define MASK_SYS_STATUS_XES (1L << 21) /* event that remains
* internal: pending XES
* IRQ */
#define MASK_SYS_STATUS_CMD_DONE (1L << 20) /* alternate command
* management: notify driver
* instead of polling */
#define MAX_STREAM_BUFFER 5 /* max amount of stream buffers. */
#define MICROBLAZE_IBL_MIN 32
#define MICROBLAZE_IBL_DEFAULT 128
#define MICROBLAZE_IBL_MAX 512
/* #define MASK_GRANULARITY (2*MICROBLAZE_IBL_MAX-1) */
/* command opcodes, see reference for details */
/*
the capture bit position in the object_id field in driver commands
depends upon the number of managed channels. For now, 64 IN + 64 OUT are
supported. HOwever, the communication protocol forsees 1024 channels, hence
bit 10 indicates a capture (input) object).
*/
#define ID_IS_CAPTURE (1L << 10)
#define ID_OFFSET 13 /* object ID is at the 13th bit in the
* 1st command word.*/
#define ID_CH_MASK 0x3F
#define OPCODE_OFFSET 24 /* offset of the command opcode in the first
* command word.*/
enum cmd_mb_opcodes {
CMD_00_INFO_DEBUG = 0x00,
CMD_01_GET_SYS_CFG = 0x01,
CMD_02_SET_GRANULARITY = 0x02,
CMD_03_SET_TIMER_IRQ = 0x03,
CMD_04_GET_EVENT = 0x04,
CMD_05_GET_PIPES = 0x05,
CMD_06_ALLOCATE_PIPE = 0x06,
CMD_07_RELEASE_PIPE = 0x07,
CMD_08_ASK_BUFFERS = 0x08,
CMD_09_STOP_PIPE = 0x09,
CMD_0A_GET_PIPE_SPL_COUNT = 0x0a,
CMD_0B_TOGGLE_PIPE_STATE = 0x0b,
CMD_0C_DEF_STREAM = 0x0c,
CMD_0D_SET_MUTE = 0x0d,
CMD_0E_GET_STREAM_SPL_COUNT = 0x0e,
CMD_0F_UPDATE_BUFFER = 0x0f,
CMD_10_GET_BUFFER = 0x10,
CMD_11_CANCEL_BUFFER = 0x11,
CMD_12_GET_PEAK = 0x12,
CMD_13_SET_STREAM_STATE = 0x13,
CMD_14_INVALID = 0x14,
};
/* pipe states */
enum pipe_state_t {
PSTATE_IDLE = 0, /* the pipe is not processed in the XES_IRQ
* (free or stopped, or paused). */
PSTATE_RUN = 1, /* sustained play/record state. */
PSTATE_PURGE = 2, /* the ES channels are now off, render pipes do
* not DMA, record pipe do a last DMA. */
PSTATE_ACQUIRE = 3, /* the ES channels are now on, render pipes do
* not yet increase their sample count, record
* pipes do not DMA. */
PSTATE_CLOSING = 4, /* the pipe is releasing, and may not yet
* receive an "alloc" command. */
};
/* stream states */
enum stream_state_t {
SSTATE_STOP = 0x00, /* setting to stop resets the stream spl
* count.*/
SSTATE_RUN = (0x01 << 0), /* start DMA and spl count handling. */
SSTATE_PAUSE = (0x01 << 1), /* pause DMA and spl count handling. */
};
/* buffer flags */
enum buffer_flags {
BF_VALID = 0x80, /* set if the buffer is valid, clear if free.*/
BF_CURRENT = 0x40, /* set if this is the current buffer (there is
* always a current buffer).*/
BF_NOTIFY_EOB = 0x20, /* set if this buffer must cause a PCI event
* when finished.*/
BF_CIRCULAR = 0x10, /* set if buffer[1] must be copied to buffer[0]
* by the end of this buffer.*/
BF_64BITS_ADR = 0x08, /* set if the hi part of the address is valid.*/
BF_xx = 0x04, /* future extension.*/
BF_EOB = 0x02, /* set if finished, but not yet free.*/
BF_PAUSE = 0x01, /* pause stream at buffer end.*/
BF_ZERO = 0x00, /* no flags (init).*/
};
/*
* Stream Flags definitions
*/
enum stream_flags {
SF_ZERO = 0x00000000, /* no flags (stream invalid). */
SF_VALID = 0x10000000, /* the stream has a valid DMA_conf
* info (setstreamformat). */
SF_XRUN = 0x20000000, /* the stream is un x-run state. */
SF_START = 0x40000000, /* the DMA is running.*/
SF_ASIO = 0x80000000, /* ASIO.*/
};
#define MASK_SPL_COUNT_HI 0x00FFFFFF /* 4 MSBits are status bits */
#define PSTATE_OFFSET 28 /* 4 MSBits are status bits */
#define MASK_STREAM_HAS_MAPPING (1L << 12)
#define MASK_STREAM_IS_ASIO (1L << 9)
#define STREAM_FMT_OFFSET 10 /* the stream fmt bits start at the 10th
* bit in the command word. */
#define STREAM_FMT_16b 0x02
#define STREAM_FMT_intel 0x01
#define FREQ_FIELD_OFFSET 15 /* offset of the freq field in the response
* word */
#define BUFF_FLAGS_OFFSET 24 /* offset of the buffer flags in the
* response word. */
#define MASK_DATA_SIZE 0x00FFFFFF /* this must match the field size of
* datasize in the buffer_t structure. */
#define MASK_BUFFER_ID 0xFF /* the cancel command awaits a buffer ID,
* may be 0xFF for "current". */
/* code adapted from PcxErr_e.h */
/* Bits masks */
#define ERROR_MASK 0x8000
#define SOURCE_MASK 0x7800
#define E_SOURCE_BOARD 0x4000 /* 8 >> 1 */
#define E_SOURCE_DRV 0x2000 /* 4 >> 1 */
#define E_SOURCE_API 0x1000 /* 2 >> 1 */
/* Error tools */
#define E_SOURCE_TOOLS 0x0800 /* 1 >> 1 */
/* Error pcxaudio */
#define E_SOURCE_AUDIO 0x1800 /* 3 >> 1 */
/* Error virtual pcx */
#define E_SOURCE_VPCX 0x2800 /* 5 >> 1 */
/* Error dispatcher */
#define E_SOURCE_DISPATCHER 0x3000 /* 6 >> 1 */
/* Error from CobraNet firmware */
#define E_SOURCE_COBRANET 0x3800 /* 7 >> 1 */
#define E_SOURCE_USER 0x7800
#define CLASS_MASK 0x0700
#define CODE_MASK 0x00FF
/* Bits values */
/* Values for the error/warning bit */
#define ERROR_VALUE 0x8000
#define WARNING_VALUE 0x0000
/* Class values */
#define E_CLASS_GENERAL 0x0000
#define E_CLASS_INVALID_CMD 0x0100
#define E_CLASS_INVALID_STD_OBJECT 0x0200
#define E_CLASS_RSRC_IMPOSSIBLE 0x0300
#define E_CLASS_WRONG_CONTEXT 0x0400
#define E_CLASS_BAD_SPECIFIC_PARAMETER 0x0500
#define E_CLASS_REAL_TIME_ERROR 0x0600
#define E_CLASS_DIRECTSHOW 0x0700
#define E_CLASS_FREE 0x0700
/* Complete DRV error code for the general class */
#define ED_GN (ERROR_VALUE | E_SOURCE_DRV | E_CLASS_GENERAL)
#define ED_CONCURRENCY (ED_GN | 0x01)
#define ED_DSP_CRASHED (ED_GN | 0x02)
#define ED_UNKNOWN_BOARD (ED_GN | 0x03)
#define ED_NOT_INSTALLED (ED_GN | 0x04)
#define ED_CANNOT_OPEN_SVC_MANAGER (ED_GN | 0x05)
#define ED_CANNOT_READ_REGISTRY (ED_GN | 0x06)
#define ED_DSP_VERSION_MISMATCH (ED_GN | 0x07)
#define ED_UNAVAILABLE_FEATURE (ED_GN | 0x08)
#define ED_CANCELLED (ED_GN | 0x09)
#define ED_NO_RESPONSE_AT_IRQA (ED_GN | 0x10)
#define ED_INVALID_ADDRESS (ED_GN | 0x11)
#define ED_DSP_CORRUPTED (ED_GN | 0x12)
#define ED_PENDING_OPERATION (ED_GN | 0x13)
#define ED_NET_ALLOCATE_MEMORY_IMPOSSIBLE (ED_GN | 0x14)
#define ED_NET_REGISTER_ERROR (ED_GN | 0x15)
#define ED_NET_THREAD_ERROR (ED_GN | 0x16)
#define ED_NET_OPEN_ERROR (ED_GN | 0x17)
#define ED_NET_CLOSE_ERROR (ED_GN | 0x18)
#define ED_NET_NO_MORE_PACKET (ED_GN | 0x19)
#define ED_NET_NO_MORE_BUFFER (ED_GN | 0x1A)
#define ED_NET_SEND_ERROR (ED_GN | 0x1B)
#define ED_NET_RECEIVE_ERROR (ED_GN | 0x1C)
#define ED_NET_WRONG_MSG_SIZE (ED_GN | 0x1D)
#define ED_NET_WAIT_ERROR (ED_GN | 0x1E)
#define ED_NET_EEPROM_ERROR (ED_GN | 0x1F)
#define ED_INVALID_RS232_COM_NUMBER (ED_GN | 0x20)
#define ED_INVALID_RS232_INIT (ED_GN | 0x21)
#define ED_FILE_ERROR (ED_GN | 0x22)
#define ED_INVALID_GPIO_CMD (ED_GN | 0x23)
#define ED_RS232_ALREADY_OPENED (ED_GN | 0x24)
#define ED_RS232_NOT_OPENED (ED_GN | 0x25)
#define ED_GPIO_ALREADY_OPENED (ED_GN | 0x26)
#define ED_GPIO_NOT_OPENED (ED_GN | 0x27)
#define ED_REGISTRY_ERROR (ED_GN | 0x28) /* <- NCX */
#define ED_INVALID_SERVICE (ED_GN | 0x29) /* <- NCX */
#define ED_READ_FILE_ALREADY_OPENED (ED_GN | 0x2a) /* <- Decalage
* pour RCX
* (old 0x28)
* */
#define ED_READ_FILE_INVALID_COMMAND (ED_GN | 0x2b) /* ~ */
#define ED_READ_FILE_INVALID_PARAMETER (ED_GN | 0x2c) /* ~ */
#define ED_READ_FILE_ALREADY_CLOSED (ED_GN | 0x2d) /* ~ */
#define ED_READ_FILE_NO_INFORMATION (ED_GN | 0x2e) /* ~ */
#define ED_READ_FILE_INVALID_HANDLE (ED_GN | 0x2f) /* ~ */
#define ED_READ_FILE_END_OF_FILE (ED_GN | 0x30) /* ~ */
#define ED_READ_FILE_ERROR (ED_GN | 0x31) /* ~ */
#define ED_DSP_CRASHED_EXC_DSPSTACK_OVERFLOW (ED_GN | 0x32) /* <- Decalage pour
* PCX (old 0x14) */
#define ED_DSP_CRASHED_EXC_SYSSTACK_OVERFLOW (ED_GN | 0x33) /* ~ */
#define ED_DSP_CRASHED_EXC_ILLEGAL (ED_GN | 0x34) /* ~ */
#define ED_DSP_CRASHED_EXC_TIMER_REENTRY (ED_GN | 0x35) /* ~ */
#define ED_DSP_CRASHED_EXC_FATAL_ERROR (ED_GN | 0x36) /* ~ */
#define ED_FLASH_PCCARD_NOT_PRESENT (ED_GN | 0x37)
#define ED_NO_CURRENT_CLOCK (ED_GN | 0x38)
/* Complete DRV error code for real time class */
#define ED_RT (ERROR_VALUE | E_SOURCE_DRV | E_CLASS_REAL_TIME_ERROR)
#define ED_DSP_TIMED_OUT (ED_RT | 0x01)
#define ED_DSP_CHK_TIMED_OUT (ED_RT | 0x02)
#define ED_STREAM_OVERRUN (ED_RT | 0x03)
#define ED_DSP_BUSY (ED_RT | 0x04)
#define ED_DSP_SEMAPHORE_TIME_OUT (ED_RT | 0x05)
#define ED_BOARD_TIME_OUT (ED_RT | 0x06)
#define ED_XILINX_ERROR (ED_RT | 0x07)
#define ED_COBRANET_ITF_NOT_RESPONDING (ED_RT | 0x08)
/* Complete BOARD error code for the invaid standard object class */
#define EB_ISO (ERROR_VALUE | E_SOURCE_BOARD | \
E_CLASS_INVALID_STD_OBJECT)
#define EB_INVALID_EFFECT (EB_ISO | 0x00)
#define EB_INVALID_PIPE (EB_ISO | 0x40)
#define EB_INVALID_STREAM (EB_ISO | 0x80)
#define EB_INVALID_AUDIO (EB_ISO | 0xC0)
/* Complete BOARD error code for impossible resource allocation class */
#define EB_RI (ERROR_VALUE | E_SOURCE_BOARD | E_CLASS_RSRC_IMPOSSIBLE)
#define EB_ALLOCATE_ALL_STREAM_TRANSFERT_BUFFERS_IMPOSSIBLE (EB_RI | 0x01)
#define EB_ALLOCATE_PIPE_SAMPLE_BUFFER_IMPOSSIBLE (EB_RI | 0x02)
#define EB_ALLOCATE_MEM_STREAM_IMPOSSIBLE \
EB_ALLOCATE_ALL_STREAM_TRANSFERT_BUFFERS_IMPOSSIBLE
#define EB_ALLOCATE_MEM_PIPE_IMPOSSIBLE \
EB_ALLOCATE_PIPE_SAMPLE_BUFFER_IMPOSSIBLE
#define EB_ALLOCATE_DIFFERED_CMD_IMPOSSIBLE (EB_RI | 0x03)
#define EB_TOO_MANY_DIFFERED_CMD (EB_RI | 0x04)
#define EB_RBUFFERS_TABLE_OVERFLOW (EB_RI | 0x05)
#define EB_ALLOCATE_EFFECTS_IMPOSSIBLE (EB_RI | 0x08)
#define EB_ALLOCATE_EFFECT_POS_IMPOSSIBLE (EB_RI | 0x09)
#define EB_RBUFFER_NOT_AVAILABLE (EB_RI | 0x0A)
#define EB_ALLOCATE_CONTEXT_LIII_IMPOSSIBLE (EB_RI | 0x0B)
#define EB_STATUS_DIALOG_IMPOSSIBLE (EB_RI | 0x1D)
#define EB_CONTROL_CMD_IMPOSSIBLE (EB_RI | 0x1E)
#define EB_STATUS_SEND_IMPOSSIBLE (EB_RI | 0x1F)
#define EB_ALLOCATE_PIPE_IMPOSSIBLE (EB_RI | 0x40)
#define EB_ALLOCATE_STREAM_IMPOSSIBLE (EB_RI | 0x80)
#define EB_ALLOCATE_AUDIO_IMPOSSIBLE (EB_RI | 0xC0)
/* Complete BOARD error code for wrong call context class */
#define EB_WCC (ERROR_VALUE | E_SOURCE_BOARD | E_CLASS_WRONG_CONTEXT)
#define EB_CMD_REFUSED (EB_WCC | 0x00)
#define EB_START_STREAM_REFUSED (EB_WCC | 0xFC)
#define EB_SPC_REFUSED (EB_WCC | 0xFD)
#define EB_CSN_REFUSED (EB_WCC | 0xFE)
#define EB_CSE_REFUSED (EB_WCC | 0xFF)
#endif /* LX_DEFS_H */
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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.facebook.buck.swift;
import com.facebook.buck.core.build.buildable.context.BuildableContext;
import com.facebook.buck.core.build.context.BuildContext;
import com.facebook.buck.core.build.execution.context.ExecutionContext;
import com.facebook.buck.core.filesystems.AbsPath;
import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.model.Flavor;
import com.facebook.buck.core.model.impl.BuildTargetPaths;
import com.facebook.buck.core.rulekey.AddToRuleKey;
import com.facebook.buck.core.rules.ActionGraphBuilder;
import com.facebook.buck.core.rules.BuildRule;
import com.facebook.buck.core.rules.BuildRuleResolver;
import com.facebook.buck.core.rules.attr.SupportsInputBasedRuleKey;
import com.facebook.buck.core.rules.common.BuildableSupport;
import com.facebook.buck.core.rules.impl.AbstractBuildRule;
import com.facebook.buck.core.sourcepath.ExplicitBuildTargetSourcePath;
import com.facebook.buck.core.sourcepath.SourcePath;
import com.facebook.buck.core.sourcepath.resolver.SourcePathResolverAdapter;
import com.facebook.buck.core.toolchain.tool.Tool;
import com.facebook.buck.cxx.CxxDescriptionEnhancer;
import com.facebook.buck.cxx.PreprocessorFlags;
import com.facebook.buck.cxx.toolchain.HeaderVisibility;
import com.facebook.buck.rules.coercer.FrameworkPath;
import com.facebook.buck.cxx.toolchain.LinkerMapMode;
import com.facebook.buck.cxx.toolchain.PathShortener;
import com.facebook.buck.cxx.toolchain.Preprocessor;
import com.facebook.buck.io.BuildCellRelativePath;
import com.facebook.buck.io.file.MostFiles;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.rules.args.AddsToRuleKeyFunction;
import com.facebook.buck.rules.args.Arg;
import com.facebook.buck.rules.args.FileListableLinkerInputArg;
import com.facebook.buck.rules.args.SourcePathArg;
import com.facebook.buck.rules.args.StringArg;
import com.facebook.buck.step.Step;
import com.facebook.buck.step.StepExecutionResult;
import com.facebook.buck.step.StepExecutionResults;
import com.facebook.buck.step.fs.MkdirStep;
import com.facebook.buck.swift.toolchain.SwiftTargetTriple;
import com.facebook.buck.util.MoreIterables;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableList.Builder;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Streams;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Optional;
import java.util.SortedSet;
/** A build rule which compiles one or more Swift sources into a Swift module. */
public class SwiftCompile extends AbstractBuildRule implements SupportsInputBasedRuleKey {
private static final String INCLUDE_FLAG = "-I";
@AddToRuleKey private final Tool swiftCompiler;
@AddToRuleKey private final String moduleName;
@AddToRuleKey(stringify = true)
private final Path outputPath;
@AddToRuleKey(stringify = true)
private final Path objectFilePath;
@AddToRuleKey(stringify = true)
private final Path modulePath;
@AddToRuleKey(stringify = true)
private final Path moduleObjectPath;
@AddToRuleKey(stringify = true)
private final ImmutableList<Path> objectPaths;
private final Optional<AbsPath> swiftFileListPath;
@AddToRuleKey private final boolean shouldEmitSwiftdocs;
@AddToRuleKey private final boolean useModulewrap;
@AddToRuleKey private final boolean compileForceCache;
@AddToRuleKey(stringify = true)
private final Path swiftdocPath;
@AddToRuleKey private final ImmutableSortedSet<SourcePath> srcs;
@AddToRuleKey private final SwiftTargetTriple swiftTarget;
@AddToRuleKey private final Optional<String> version;
@AddToRuleKey private final ImmutableList<? extends Arg> compilerFlags;
@AddToRuleKey(stringify = true)
private final Path headerPath;
@AddToRuleKey private final ImmutableSet<FrameworkPath> frameworks;
@AddToRuleKey private final AddsToRuleKeyFunction<FrameworkPath, Path> frameworkPathToSearchPath;
@AddToRuleKey(stringify = true)
private final Flavor flavor;
@AddToRuleKey private final boolean enableObjcInterop;
@AddToRuleKey private final Optional<SourcePath> bridgingHeader;
@AddToRuleKey private final Preprocessor cPreprocessor;
@AddToRuleKey private final PreprocessorFlags cxxDeps;
@AddToRuleKey private final boolean importUnderlyingModule;
private BuildableSupport.DepsSupplier depsSupplier;
SwiftCompile(
SwiftBuckConfig swiftBuckConfig,
BuildTarget buildTarget,
SwiftTargetTriple swiftTarget,
ProjectFilesystem projectFilesystem,
ActionGraphBuilder graphBuilder,
Tool swiftCompiler,
ImmutableSet<FrameworkPath> frameworks,
AddsToRuleKeyFunction<FrameworkPath, Path> frameworkPathToSearchPath,
Flavor flavor,
String moduleName,
Path outputPath,
Iterable<SourcePath> srcs,
Optional<String> version,
ImmutableList<Arg> compilerFlags,
Optional<Boolean> enableObjcInterop,
Optional<SourcePath> bridgingHeader,
Preprocessor preprocessor,
PreprocessorFlags cxxDeps,
boolean importUnderlyingModule) {
super(buildTarget, projectFilesystem);
this.frameworks = frameworks;
this.frameworkPathToSearchPath = frameworkPathToSearchPath;
this.flavor = flavor;
this.swiftCompiler = swiftCompiler;
this.outputPath = outputPath;
this.importUnderlyingModule = importUnderlyingModule;
this.headerPath = outputPath.resolve(SwiftDescriptions.toSwiftHeaderName(moduleName) + ".h");
String escapedModuleName = CxxDescriptionEnhancer.normalizeModuleName(moduleName);
this.moduleName = escapedModuleName;
this.objectFilePath = outputPath.resolve(escapedModuleName + ".o");
this.modulePath = outputPath.resolve(escapedModuleName + ".swiftmodule");
this.moduleObjectPath = outputPath.resolve(escapedModuleName + ".swiftmodule.o");
this.objectPaths =
swiftBuckConfig.getUseModulewrap()
? ImmutableList.of(objectFilePath, moduleObjectPath)
: ImmutableList.of(objectFilePath);
this.swiftFileListPath =
swiftBuckConfig.getUseFileList()
? Optional.of(
getProjectFilesystem()
.getRootPath()
.resolve(
BuildTargetPaths.getScratchPath(
getProjectFilesystem(), getBuildTarget(), "%s__filelist.txt")))
: Optional.empty();
this.shouldEmitSwiftdocs = swiftBuckConfig.getEmitSwiftdocs();
this.useModulewrap = swiftBuckConfig.getUseModulewrap();
this.compileForceCache = swiftBuckConfig.getCompileForceCache();
this.swiftdocPath = outputPath.resolve(escapedModuleName + ".swiftdoc");
this.srcs = ImmutableSortedSet.copyOf(srcs);
this.swiftTarget = swiftTarget;
this.version = version;
this.compilerFlags =
new ImmutableList.Builder<Arg>()
.addAll(StringArg.from(swiftBuckConfig.getCompilerFlags().orElse(ImmutableSet.of())))
.addAll(compilerFlags)
.build();
this.enableObjcInterop = enableObjcInterop.orElse(true);
this.bridgingHeader = bridgingHeader;
this.cPreprocessor = preprocessor;
this.cxxDeps = cxxDeps;
this.depsSupplier = BuildableSupport.buildDepsSupplier(this, graphBuilder);
performChecks(buildTarget);
}
private void performChecks(BuildTarget buildTarget) {
Preconditions.checkArgument(
!LinkerMapMode.FLAVOR_DOMAIN.containsAnyOf(buildTarget.getFlavors().getSet()),
"SwiftCompile %s should not be created with LinkerMapMode flavor (%s)",
this,
LinkerMapMode.FLAVOR_DOMAIN);
Preconditions.checkArgument(
!buildTarget.getFlavors().contains(CxxDescriptionEnhancer.SHARED_FLAVOR));
}
private SwiftCompileStep makeCompileStep(SourcePathResolverAdapter resolver) {
ImmutableList.Builder<String> compilerCommand = ImmutableList.builder();
compilerCommand.addAll(swiftCompiler.getCommandPrefix(resolver));
compilerCommand.add("-target", swiftTarget.getTriple());
if (bridgingHeader.isPresent()) {
compilerCommand.add(
"-import-objc-header", resolver.getRelativePath(bridgingHeader.get()).toString());
}
if (importUnderlyingModule) {
compilerCommand.add("-import-underlying-module");
}
compilerCommand.addAll(
Streams.concat(frameworks.stream(), cxxDeps.getFrameworkPaths().stream())
.filter(x -> !x.isSDKROOTFrameworkPath())
.map(frameworkPathToSearchPath)
.flatMap(searchPath -> ImmutableSet.of("-F", searchPath.toString()).stream())
.iterator());
compilerCommand.addAll(
MoreIterables.zipAndConcat(Iterables.cycle("-Xcc"), getSwiftIncludeArgs(resolver)));
compilerCommand.addAll(
MoreIterables.zipAndConcat(
Iterables.cycle(INCLUDE_FLAG),
getBuildDeps().stream()
.filter(SwiftCompile.class::isInstance)
.map(BuildRule::getSourcePathToOutput)
.map(input -> resolver.getRelativePath(input).toString())
.collect(ImmutableSet.toImmutableSet())));
boolean hasMainEntry =
srcs.stream()
.map(input -> resolver.getAbsolutePath(input).getFileName().toString())
.anyMatch(SwiftDescriptions.SWIFT_MAIN_FILENAME::equalsIgnoreCase);
compilerCommand.add(
"-c",
enableObjcInterop ? "-enable-objc-interop" : "",
hasMainEntry ? "" : "-parse-as-library",
"-serialize-debugging-options",
"-module-name",
moduleName,
"-emit-module",
"-emit-module-path",
modulePath.toString(),
"-emit-objc-header-path",
headerPath.toString(),
"-o",
objectFilePath.toString());
if (shouldEmitSwiftdocs) {
compilerCommand.add("-emit-module-doc", "-emit-module-doc-path", swiftdocPath.toString());
}
version.ifPresent(
v -> {
compilerCommand.add("-swift-version", validVersionString(v));
});
compilerCommand.addAll(
Iterables.filter(Arg.stringify(compilerFlags, resolver), arg -> !arg.equals("-Xfrontend")));
if (swiftFileListPath.isPresent()) {
compilerCommand.add("-filelist", swiftFileListPath.get().toString());
} else {
for (SourcePath sourcePath : srcs) {
compilerCommand.add(resolver.getRelativePath(sourcePath).toString());
}
}
ProjectFilesystem projectFilesystem = getProjectFilesystem();
return new SwiftCompileStep(
projectFilesystem.getRootPath(), ImmutableMap.of(), compilerCommand.build());
}
@VisibleForTesting
static String validVersionString(String originalVersionString) {
// Swiftc officially only accepts the major version, but it respects the minor
// version if the version is 4.2.
String[] versions = originalVersionString.split("\\.");
if (versions.length > 2) {
versions = Arrays.copyOfRange(versions, 0, 2);
}
if (versions.length == 2) {
Integer majorVersion = Integer.parseInt(versions[0]);
Integer minorVersion = Integer.parseInt(versions[1]);
if (majorVersion > 4 || (majorVersion >= 4 && minorVersion >= 2)) {
return String.format("%d.%d", majorVersion, minorVersion);
} else {
return originalVersionString.length() > 1
? originalVersionString.substring(0, 1)
: originalVersionString;
}
} else {
return originalVersionString.length() > 1
? originalVersionString.substring(0, 1)
: originalVersionString;
}
}
private SwiftCompileStep makeModulewrapStep(SourcePathResolverAdapter resolver) {
ImmutableList.Builder<String> compilerCommand = ImmutableList.builder();
ImmutableList<String> commandPrefix = swiftCompiler.getCommandPrefix(resolver);
// The swift compiler path will be the first element of the command prefix
compilerCommand.add(commandPrefix.get(0));
compilerCommand.add("-modulewrap", modulePath.toString(), "-o", moduleObjectPath.toString());
compilerCommand.add("-target", swiftTarget.getTriple());
ProjectFilesystem projectFilesystem = getProjectFilesystem();
return new SwiftCompileStep(
projectFilesystem.getRootPath(), ImmutableMap.of(), compilerCommand.build());
}
@Override
public boolean isCacheable() {
// .swiftmodule artifacts are not cacheable because they can contain machine-specific
// headers. More specifically, all files included in a bridging header will be
// literally included in the .swiftmodule file. When the Swift compiler encounters
// `import Module`, it will include the headers from the .swiftmodule and those
// headers are referenced via an absolute path stored in the .swiftmodule. This
// means that Obj-C headers can be included multiple times if the machines which
// populated the cache and the machine which is building have placed the source
// repository at different paths (usually the case with CI and developer machines).
return !bridgingHeader.isPresent() || compileForceCache;
}
@Override
public SortedSet<BuildRule> getBuildDeps() {
return depsSupplier.get();
}
@Override
public void updateBuildRuleResolver(BuildRuleResolver ruleResolver) {
this.depsSupplier = BuildableSupport.buildDepsSupplier(this, ruleResolver);
}
@Override
public ImmutableList<Step> getBuildSteps(
BuildContext context, BuildableContext buildableContext) {
buildableContext.recordArtifact(outputPath);
Builder<Step> steps = ImmutableList.builder();
steps.add(
MkdirStep.of(
BuildCellRelativePath.fromCellRelativePath(
context.getBuildCellRootPath(), getProjectFilesystem(), outputPath)));
swiftFileListPath.map(
path -> steps.add(makeFileListStep(context.getSourcePathResolver(), path)));
steps.add(makeCompileStep(context.getSourcePathResolver()));
if (useModulewrap) {
steps.add(makeModulewrapStep(context.getSourcePathResolver()));
}
return steps.build();
}
private Step makeFileListStep(SourcePathResolverAdapter resolver, AbsPath swiftFileListPath) {
ImmutableList<String> relativePaths =
srcs.stream()
.map(sourcePath -> resolver.getRelativePath(sourcePath).toString())
.collect(ImmutableList.toImmutableList());
return new Step() {
@Override
public StepExecutionResult execute(ExecutionContext context) throws IOException {
if (Files.notExists(swiftFileListPath.getParent().getPath())) {
Files.createDirectories(swiftFileListPath.getParent().getPath());
}
MostFiles.writeLinesToFile(relativePaths, swiftFileListPath);
return StepExecutionResults.SUCCESS;
}
@Override
public String getShortName() {
return "swift-filelist";
}
@Override
public String getDescription(ExecutionContext context) {
return "swift-filelist";
}
};
}
@Override
public SourcePath getSourcePathToOutput() {
return ExplicitBuildTargetSourcePath.of(getBuildTarget(), outputPath);
}
/**
* @return the arguments to add to the preprocessor command line to include the given header packs
* in preprocessor search path.
* <p>We can't use CxxHeaders.getArgs() because 1. we don't need the system include roots. 2.
* swift doesn't like spaces after the "-I" flag.
*/
@VisibleForTesting
ImmutableList<String> getSwiftIncludeArgs(SourcePathResolverAdapter resolver) {
ImmutableList.Builder<String> args = ImmutableList.builder();
// Arg list can't simply be passed in since the current implementation of toToolFlags drops the
// dependency information.
Iterable<Arg> argsFromDeps =
cxxDeps
.toToolFlags(
resolver,
PathShortener.byRelativizingToWorkingDir(getProjectFilesystem().getRootPath()),
frameworkPathToSearchPath,
cPreprocessor,
Optional.empty())
.getAllFlags();
args.addAll(Arg.stringify(argsFromDeps, resolver));
if (bridgingHeader.isPresent()) {
for (HeaderVisibility headerVisibility : HeaderVisibility.values()) {
// We should probably pass in the correct symlink trees instead of guessing.
Path headerPath =
CxxDescriptionEnhancer.getHeaderSymlinkTreePath(
getProjectFilesystem(),
getBuildTarget().withFlavors(),
headerVisibility,
flavor);
args.add(INCLUDE_FLAG.concat(headerPath.toString()));
}
}
return args.build();
}
public ImmutableList<Arg> getAstLinkArgs() {
if (!useModulewrap) {
return ImmutableList.<Arg>builder()
.addAll(StringArg.from("-Xlinker", "-add_ast_path"))
.add(SourcePathArg.of(ExplicitBuildTargetSourcePath.of(getBuildTarget(), modulePath)))
.build();
} else {
return ImmutableList.<Arg>builder().build();
}
}
ImmutableList<Arg> getFileListLinkArg() {
return FileListableLinkerInputArg.from(
objectPaths.stream()
.map(
objectPath ->
SourcePathArg.of(
ExplicitBuildTargetSourcePath.of(getBuildTarget(), objectPath)))
.collect(ImmutableList.toImmutableList()));
}
/** @return The name of the Swift module. */
public String getModuleName() {
return moduleName;
}
/** @return List of {@link SourcePath} to the output object file(s) (i.e., .o file) */
public ImmutableList<SourcePath> getObjectPaths() {
// Ensures that users of the object path can depend on this build target
return objectPaths.stream()
.map(objectPath -> ExplicitBuildTargetSourcePath.of(getBuildTarget(), objectPath))
.collect(ImmutableList.toImmutableList());
}
/** @return File name of the Objective-C Generated Interface Header. */
public String getObjCGeneratedHeaderFileName() {
return headerPath.getFileName().toString();
}
/** @return {@link SourcePath} of the Objective-C Generated Interface Header. */
public SourcePath getObjCGeneratedHeaderPath() {
return ExplicitBuildTargetSourcePath.of(getBuildTarget(), headerPath);
}
/**
* @return {@link SourcePath} to the directory containing outputs from the compilation process
* (object files, Swift module metadata, etc).
*/
public SourcePath getOutputPath() {
return ExplicitBuildTargetSourcePath.of(getBuildTarget(), outputPath);
}
/**
* @return {@link SourcePath} to the .swiftmodule output from the compilation process. A
* swiftmodule file contains the public interface for a module, and is basically a binary file
* format equivalent to header files for a C framework or library.
*
* A swiftmodule file contains serialized ASTs (and possibly SIL), it conforms to
* Swift Binary Serialization Format, more details about this binary format can be found here:
* https://github.com/apple/swift/blob/7e6d62dae4bae4eb3737a6f76c0e51534c1bcca3/docs/Serialization.rst.
*/
public SourcePath getSwiftModuleOutputPath() {
return ExplicitBuildTargetSourcePath.of(getBuildTarget(), modulePath);
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env bb
(import (java.net ServerSocket))
(require '[clojure.java.io :as io]
'[clojure.string :as str])
(def debug? true)
(def user "admin")
(def password "admin")
(def base64 (-> (.getEncoder java.util.Base64)
(.encodeToString (.getBytes (str user ":" password)))))
(def notes-file (io/file (System/getProperty "user.home") ".notes" "notes.txt"))
(def file-lock (Object.))
(defn write-note! [note]
(locking file-lock
(io/make-parents notes-file)
(spit notes-file (str note "\n") :append true)))
;; hiccup-like
(defn html [v]
(cond (vector? v)
(let [tag (first v)
attrs (second v)
attrs (when (map? attrs) attrs)
elts (if attrs (nnext v) (next v))
tag-name (name tag)]
(format "<%s%s>%s</%s>\n" tag-name (html attrs) (html elts) tag-name))
(map? v)
(str/join ""
(map (fn [[k v]]
(format " %s=\"%s\"" (name k) v)) v))
(seq? v)
(str/join " " (map html v))
:else (str v)))
(defn write-response [out session-id status headers content]
(let [cookie-header (str "Set-Cookie: notes-id=" session-id)
headers (str/join "\r\n" (conj headers cookie-header))
response (str "HTTP/1.1 " status "\r\n"
(str headers "\r\n")
"Content-Length: " (if content (count content)
0)
"\r\n\r\n"
(when content
(str content)))]
(when debug? (println response))
(binding [*out* out]
(print response)
(flush))))
;; the home page
(defn home-response [out session-id]
(let [body (str
"<!DOCTYPE html>\n"
(html
[:html
[:head
[:title "Notes"]]
[:body
[:h1 "Notes"]
[:pre (when (.exists notes-file)
(slurp notes-file))]
[:form {:action "/" :method "post"}
[:input {:type "text" :name "note"}]
[:input {:type "submit" :value "Submit"}]]]]))]
(write-response out session-id "200 OK" nil body)))
(defn basic-auth-response [out session-id]
(write-response out session-id
"401 Unauthorized"
["WWW-Authenticate: Basic realm=\"notes\""]
nil))
(def known-sessions
(atom #{}))
(defn new-session! []
(let [uuid (str (java.util.UUID/randomUUID))]
(swap! known-sessions conj uuid)
uuid))
(defn get-session-id [headers]
(if-let [cookie-header (first (filter #(str/starts-with? % "Cookie: ") headers))]
(let [parts (str/split cookie-header #"; ")]
(if-let [notes-id (first (filter #(str/starts-with? % "notes-id") parts))]
(str/replace notes-id "notes-id=" "")
(new-session!)))
(new-session!)))
(defn basic-auth-header [headers]
(some #(str/starts-with? % "Basic-Auth: ") headers))
(def authenticated-sessions
(atom #{}))
(defn authenticate! [session-id headers]
(or (contains? @authenticated-sessions session-id)
(when (some #(= % (str "Authorization: Basic " base64)) headers)
(swap! authenticated-sessions conj session-id)
true)))
;; run the server
(with-open [server-socket (let [s (new ServerSocket 8080)]
(println "Server started on port 8080.")
s)]
(loop []
(let [client-socket (.accept server-socket)]
(future
(with-open [conn client-socket]
(try
(let [out (io/writer (.getOutputStream conn))
is (.getInputStream conn)
in (io/reader is)
[_req & headers :as response]
(loop [headers []]
(let [line (.readLine in)]
(if (str/blank? line)
headers
(recur (conj headers line)))))
session-id (get-session-id headers)
form-data (let [sb (StringBuilder.)]
(loop []
(when (.ready in)
(.append sb (char (.read in)))
(recur)))
(-> (str sb)
(java.net.URLDecoder/decode)))
_ (when debug? (println (str/join "\n" response)))
_ (when-not (str/blank? form-data)
(when debug? (println form-data))
(let [note (str/replace form-data "note=" "")]
(write-note! note)))
_ (when debug? (println))]
(cond
;; if we didn't see this session before, we want the user to re-authenticate
(not (contains? @known-sessions session-id))
(let [uuid (new-session!)]
(basic-auth-response out uuid))
(not (authenticate! session-id headers))
(basic-auth-response out session-id)
:else (home-response out session-id)))
(catch Throwable t
(binding [*err* *out*]
(println t)))))))
(recur)))
| {
"pile_set_name": "Github"
} |
# 算法_61_把字符串转化成整数
## Question
将一个字符串转换成一个整数,要求不能使用字符串转换整数的库函数。 数值为0或者字符串不是一个合法的数值则返回0
```
Solution1
class Solution1:
def StrToInt(self, s):
try:
return ____
except:
return 0
Solution2
class Solution2:
def StrToInt(self, s):
if not s:
return 0
num = []
numbers = {'1':1,'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9}
for i in s:
if i in numbers.keys():
num.append(numbers[i])
elif i == '+':
continue
elif i == '-':
continue
else:
return 0
ans = 0
for i in num:
ans = ans * 10 + i
if s[0] == '-':
ans = 0 - ans
return ____
```
%!A. int(s), ans!%
%!B. s, ans!%
%!C. int(s), 0!%
%!D. s, 0!%
------
## Answer
@!A!@
------
## Analysis
思路一: 使用int()
思路二:就是一些特殊处理,比如 +123,就不合理,123前面不需要+,但是-123就合理,因为这是个负数 | {
"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.tez.mapreduce.processor;
import java.io.IOException;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.tez.mapreduce.output.MROutput;
import org.apache.tez.runtime.api.LogicalOutput;
import org.apache.tez.runtime.api.Processor;
import org.apache.tez.runtime.api.ProcessorContext;
import org.apache.tez.runtime.library.processor.SimpleProcessor;
import com.google.common.collect.Lists;
/**
* A {@link SimpleProcessor} that provides Map Reduce specific post
* processing by calling commit (if needed) on all {@link MROutput}s
* connected to this {@link Processor}.
*/
@Public
@Evolving
public abstract class SimpleMRProcessor extends SimpleProcessor {
private static final Logger LOG = LoggerFactory.getLogger(SimpleMRProcessor.class);
public SimpleMRProcessor(ProcessorContext context) {
super(context);
}
@Override
protected void postOp() throws Exception {
if (getOutputs() == null) {
return; // No post op
}
List<MROutput> mrOuts = Lists.newLinkedList();
for (LogicalOutput output : getOutputs().values()) {
if (output instanceof MROutput) {
MROutput mrOutput = (MROutput) output;
mrOutput.flush();
if (mrOutput.isCommitRequired()) {
mrOuts.add((MROutput) output);
}
}
}
if (mrOuts.size() > 0) {
// This will loop till the AM asks for the task to be killed. As
// against, the AM sending a signal to the task to kill itself
// gracefully. The AM waits for the current committer to successfully
// complete and then kills us. Until then we wait in case the
// current committer fails and we get chosen to commit.
while (!getContext().canCommit()) {
Thread.sleep(100);
}
boolean willAbort = false;
Exception savedEx = null;
for (MROutput output : mrOuts) {
try {
output.commit();
} catch (IOException ioe) {
LOG.warn("Error in committing output", ioe);
willAbort = true;
savedEx = ioe;
break;
}
}
if (willAbort == true) {
for (MROutput output : mrOuts) {
try {
output.abort();
} catch (IOException ioe) {
LOG.warn("Error in aborting output", ioe);
}
}
throw savedEx;
}
}
}
}
| {
"pile_set_name": "Github"
} |
# Created by: Joerg Wunsch <[email protected]>
# $FreeBSD$
PORTNAME= libbfd
PORTVERSION= 2.19.1
PORTREVISION= 3
CATEGORIES= devel
MASTER_SITES= SOURCEWARE/binutils/releases
DISTNAME= binutils-${PORTVERSION}
MAINTAINER= [email protected]
COMMENT= Universal BFD library from GNU binutils
CONFLICTS= mingw-binutils-[0-9]* binutils-[0-9]*
WRKSRC= ${WRKDIR}/binutils-${PORTVERSION}/bfd
USES= libtool tar:bzip2
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-install-libbfd \
--disable-nls \
--enable-shared \
--enable-targets=all \
--disable-werror
CONFIGURE_TARGET=${ARCH:S/amd64/x86_64/}-portbld-${OPSYS:tl}${OSREL}
INFO= bfd
BROKEN_aarch64= Fails to configure: machine aarch64-portbld not recognized
BROKEN_armv6= Fails to configure: BFD does not support target armv6-portbld-freebsd12.0
BROKEN_armv7= Fails to configure: BFD does not support target armv7-portbld-freebsd12.0
BROKEN_mips64= Fails to configure: BFD does not support target mips64-portbld-freebsd12.0
pre-configure:
# Configure and build pic version of libiberty
(cd ${WRKSRC}/../libiberty && \
${SETENV} CC="${CC}" CFLAGS="${CFLAGS}" CPP="${CPP}" \
CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \
LIBS="${LIBS}" ${CONFIGURE_ENV} ./configure \
${CONFIGURE_ARGS} --build=${CONFIGURE_TARGET} && \
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
${MAKE_ARGS})
.include <bsd.port.mk>
| {
"pile_set_name": "Github"
} |
var createCompounder = require('./_createCompounder');
/**
* Converts `string` to
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the snake cased string.
* @example
*
* _.snakeCase('Foo Bar');
* // => 'foo_bar'
*
* _.snakeCase('fooBar');
* // => 'foo_bar'
*
* _.snakeCase('--FOO-BAR--');
* // => 'foo_bar'
*/
var snakeCase = createCompounder(function(result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase();
});
module.exports = snakeCase;
| {
"pile_set_name": "Github"
} |
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "qe3.h"
#include "Radiant.h"
#include "GLWidget.h"
#include "PropertyList.h"
#include "entitydlg.h"
#include "PreviewDlg.h"
#include "CurveDlg.h"
#include "../../renderer/model_local.h" // for idRenderModelPrt
void Select_Ungroup();
// CEntityDlg dialog
IMPLEMENT_DYNAMIC(CEntityDlg, CDialog)
CEntityDlg::CEntityDlg(CWnd* pParent /*=NULL*/)
: CDialog(CEntityDlg::IDD, pParent)
{
editEntity = NULL;
multipleEntities = false;
currentAnimation = NULL;
}
CEntityDlg::~CEntityDlg()
{
}
void CEntityDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST_KEYVAL, listKeyVal);
DDX_Control(pDX, IDC_COMBO_CLASS, comboClass);
DDX_Control(pDX, IDC_EDIT_KEY, editKey);
DDX_Control(pDX, IDC_EDIT_VAL, editVal);
DDX_Control(pDX, IDC_STATIC_TITLE, staticTitle);
DDX_Control(pDX, IDC_STATIC_KEY, staticKey);
DDX_Control(pDX, IDC_STATIC_VAL, staticVal);
DDX_Control(pDX, IDC_BUTTON_BROWSE, btnBrowse);
DDX_Control(pDX, IDC_E_135, btn135);
DDX_Control(pDX, IDC_E_90, btn90);
DDX_Control(pDX, IDC_E_45, btn45);
DDX_Control(pDX, IDC_E_180, btn180);
DDX_Control(pDX, IDC_E_0, btn360);
DDX_Control(pDX, IDC_E_225, btn225);
DDX_Control(pDX, IDC_E_270, btn270);
DDX_Control(pDX, IDC_E_315, btn315);
DDX_Control(pDX, IDC_E_UP, btnUp);
DDX_Control(pDX, IDC_E_DOWN, btnDown);
DDX_Control(pDX, IDC_BUTTON_MODEL, btnModel);
DDX_Control(pDX, IDC_BUTTON_SOUND, btnSound);
DDX_Control(pDX, IDC_BUTTON_GUI, btnGui);
DDX_Control(pDX, IDC_BUTTON_PARTICLE, btnParticle);
DDX_Control(pDX, IDC_BUTTON_SKIN, btnSkin);
DDX_Control(pDX, IDC_BUTTON_CURVE, btnCurve);
DDX_Control(pDX, IDC_BUTTON_CREATE, btnCreate);
DDX_Control(pDX, IDC_LIST_VARS, listVars);
DDX_Control(pDX, IDC_ENTITY_ANIMATIONS , cbAnimations);
DDX_Control(pDX, IDC_ANIMATION_SLIDER , slFrameSlider);
DDX_Control(pDX, IDC_ENTITY_CURRENT_ANIM , staticFrame);
DDX_Control(pDX, IDC_ENTITY_PLAY_ANIM , btnPlayAnim);
DDX_Control(pDX, IDC_ENTITY_STOP_ANIM , btnStopAnim);
}
BOOL CEntityDlg::OnInitDialog()
{
CDialog::OnInitDialog();
listKeyVal.SetUpdateInspectors(true);
listKeyVal.SetDivider(100);
listVars.SetDivider(100);
staticFrame.SetWindowText ( "0" );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
int CEntityDlg::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::OnToolHitTest(point, pTI);
}
void CEntityDlg::AddClassNames() {
comboClass.ResetContent();
for (eclass_t *pec = eclass; pec; pec = pec->next) {
comboClass.AddString(pec->name);
}
}
BEGIN_MESSAGE_MAP(CEntityDlg, CDialog)
ON_WM_SIZE()
ON_CBN_SELCHANGE(IDC_COMBO_CLASS, OnCbnSelchangeComboClass)
ON_LBN_SELCHANGE(IDC_LIST_KEYVAL, OnLbnSelchangeListkeyval)
ON_BN_CLICKED(IDC_E_135, OnBnClickedE135)
ON_BN_CLICKED(IDC_E_90, OnBnClickedE90)
ON_BN_CLICKED(IDC_E_45, OnBnClickedE45)
ON_BN_CLICKED(IDC_E_180, OnBnClickedE180)
ON_BN_CLICKED(IDC_E_0, OnBnClickedE0)
ON_BN_CLICKED(IDC_E_225, OnBnClickedE225)
ON_BN_CLICKED(IDC_E_270, OnBnClickedE270)
ON_BN_CLICKED(IDC_E_315, OnBnClickedE315)
ON_BN_CLICKED(IDC_E_UP, OnBnClickedEUp)
ON_BN_CLICKED(IDC_E_DOWN, OnBnClickedEDown)
ON_BN_CLICKED(IDC_BUTTON_MODEL, OnBnClickedButtonModel)
ON_BN_CLICKED(IDC_BUTTON_SOUND, OnBnClickedButtonSound)
ON_BN_CLICKED(IDC_BUTTON_GUI, OnBnClickedButtonGui)
ON_BN_CLICKED(IDC_BUTTON_BROWSE, OnBnClickedButtonBrowse)
ON_CBN_DBLCLK(IDC_COMBO_CLASS, OnCbnDblclkComboClass)
ON_BN_CLICKED(IDC_BUTTON_CREATE, OnBnClickedButtonCreate)
ON_LBN_DBLCLK(IDC_LIST_KEYVAL, OnLbnDblclkListkeyval)
ON_LBN_SELCHANGE(IDC_LIST_VARS, OnLbnSelchangeListVars)
ON_LBN_DBLCLK(IDC_LIST_VARS, OnLbnDblclkListVars)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_ANIMATION_SLIDER, OnNMReleasedcaptureSlider1)
ON_BN_CLICKED(IDC_BUTTON_PARTICLE, OnBnClickedButtonParticle)
ON_BN_CLICKED(IDC_BUTTON_SKIN, OnBnClickedButtonSkin)
ON_BN_CLICKED(IDC_BUTTON_CURVE, OnBnClickedButtonCurve)
ON_CBN_SELCHANGE(IDC_ENTITY_ANIMATIONS, OnCbnAnimationChange)
ON_BN_CLICKED(IDC_ENTITY_PLAY_ANIM , OnBnClickedStartAnimation)
ON_BN_CLICKED(IDC_ENTITY_STOP_ANIM , OnBnClickedStopAnimation)
ON_WM_TIMER()
ON_BN_CLICKED(IDOK, OnOK)
END_MESSAGE_MAP()
void CEntityDlg::OnSize(UINT nType, int cx, int cy)
{
if (staticTitle.GetSafeHwnd() == NULL) {
return;
}
CDialog::OnSize(nType, cx, cy);
CRect rect, crect, crect2;
GetClientRect(rect);
int bh = (float)rect.Height() * (rect.Height() - 210) / rect.Height() / 2;
staticTitle.GetWindowRect(crect);
staticTitle.SetWindowPos(NULL, 4, 4, rect.Width() -8, crect.Height(), SWP_SHOWWINDOW);
int top = 4 + crect.Height() + 4;
comboClass.GetWindowRect(crect);
btnCreate.GetWindowRect(crect2);
comboClass.SetWindowPos(NULL, 4, top, rect.Width() - 12 - crect2.Width(), crect.Height(), SWP_SHOWWINDOW);
btnCreate.SetWindowPos(NULL, rect.Width() - crect2.Width() - 4, top, crect2.Width(), crect.Height(), SWP_SHOWWINDOW);
top += crect.Height() + 4;
listVars.SetWindowPos(NULL, 4, top, rect.Width() - 8, bh, SWP_SHOWWINDOW);
top += bh + 4;
listKeyVal.SetWindowPos(NULL, 4, top, rect.Width() - 8, bh, SWP_SHOWWINDOW);
top += bh + 4;
staticKey.GetWindowRect(crect);
staticKey.SetWindowPos(NULL, 4, top + 2, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
int left = 4 + crect.Width() + 4;
int pad = crect.Width();
editKey.GetWindowRect(crect);
editKey.SetWindowPos(NULL, left, top, rect.Width() - 12 - pad, crect.Height(), SWP_SHOWWINDOW);
top += crect.Height() + 4;
staticVal.GetWindowRect(crect);
staticVal.SetWindowPos(NULL, 4, top + 2, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
editVal.GetWindowRect(crect);
bh = crect.Height();
editVal.SetWindowPos(NULL, left, top, rect.Width() - 16 - bh - pad, crect.Height(), SWP_SHOWWINDOW);
btnBrowse.SetWindowPos(NULL, rect.right - 4 - bh, top, bh, bh, SWP_SHOWWINDOW);
top += crect.Height() + 8;
btnModel.GetWindowRect(crect);
btnModel.SetWindowPos(NULL, rect.right - 4 - crect.Width(), top + 8, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
btnSound.SetWindowPos(NULL, rect.right - 4 - crect.Width(), top + 12 + crect.Height(), crect.Width(), crect.Height(), SWP_SHOWWINDOW);
btnGui.SetWindowPos(NULL, rect.right - 4 - crect.Width(), top + 16 + crect.Height() * 2, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
btnParticle.SetWindowPos(NULL, rect.right - 8 - (crect.Width() * 2), top + 16 + crect.Height() * 2, crect.Width(), crect.Height(), SWP_SHOWWINDOW);
btnSkin.SetWindowPos( NULL, rect.right - 8 - ( crect.Width() * 2 ), top + 12 + crect.Height(), crect.Width(), crect.Height(), SWP_SHOWWINDOW );
btnCurve.SetWindowPos( NULL, rect.right - 8 - ( crect.Width() * 2 ), top + 8, crect.Width(), crect.Height(), SWP_SHOWWINDOW );
//*************************************
//animation controls
//*************************************
int rightAnimAreaBorder = rect.right - 75 - crect.Width (); /*models, etc button width*/
btnStopAnim.GetWindowRect(crect);
btnStopAnim.SetWindowPos(NULL,rightAnimAreaBorder - crect.Width (),
top + 8 ,crect.Width(),crect.Height(),SWP_SHOWWINDOW);
left = rightAnimAreaBorder - crect.Width() - 4;
btnPlayAnim.GetWindowRect(crect);
btnPlayAnim.SetWindowPos(NULL,left-crect.Width () ,top + 8 , crect.Width(),crect.Height(),SWP_SHOWWINDOW);
left -= crect.Width() + 4;
cbAnimations.GetWindowRect(crect);
cbAnimations.SetWindowPos(NULL,left-crect.Width (),top + 8 ,crect.Width(),crect.Height(),SWP_SHOWWINDOW);
staticFrame.GetWindowRect(crect);
staticFrame.SetWindowPos(NULL,rightAnimAreaBorder - crect.Width (),
top + 34 ,crect.Width(),crect.Height(),SWP_SHOWWINDOW);
left = rightAnimAreaBorder - crect.Width () - 4;
slFrameSlider.GetWindowRect(crect);
slFrameSlider.SetWindowPos(NULL,left - crect.Width (),
top + 32 ,crect.Width(),crect.Height(),SWP_SHOWWINDOW);
//*************************************
//*************************************
btn135.GetWindowRect(crect);
bh = crect.Width();
btn135.SetWindowPos(NULL, 4, top, bh, bh, SWP_SHOWWINDOW);
btn90.SetWindowPos(NULL, 4 + 2 + bh, top, bh, bh, SWP_SHOWWINDOW);
btn45.SetWindowPos(NULL, 4 + 2 + 2 + bh * 2, top, bh, bh, SWP_SHOWWINDOW);
btnUp.SetWindowPos(NULL, 4 + 2 + 2 + 6 + bh * 3, top + bh / 2,bh,bh, SWP_SHOWWINDOW);
btnDown.SetWindowPos(NULL, 4 + 2 + 2 + 6 + bh *3, top + bh / 2 + bh + 2,bh,bh, SWP_SHOWWINDOW);
top += bh + 2;
btn180.SetWindowPos(NULL, 4, top, bh, bh, SWP_SHOWWINDOW);
btn360.SetWindowPos(NULL, 4 + 2 + 2 + bh * 2, top, bh, bh, SWP_SHOWWINDOW);
top += bh + 2;
btn225.SetWindowPos(NULL, 4, top, bh, bh, SWP_SHOWWINDOW);
btn270.SetWindowPos(NULL, 4 + 2 + bh, top, bh, bh, SWP_SHOWWINDOW);
btn315.SetWindowPos(NULL, 4 + 2 + 2 + bh * 2, top, bh, bh, SWP_SHOWWINDOW);
Invalidate();
}
void CEntityDlg::OnCbnSelchangeComboClass()
{
int index = comboClass.GetCurSel();
if (index != LB_ERR) {
CString str;
comboClass.GetLBText(index, str);
eclass_t *ent = Eclass_ForName (str, false);
if (ent) {
if (selected_brushes.next == &selected_brushes) {
editEntity = world_entity;
multipleEntities = false;
} else {
editEntity = selected_brushes.next->owner;
for (brush_t *b = selected_brushes.next->next; b != &selected_brushes; b = b->next) {
if (b->owner != editEntity) {
multipleEntities = true;
break;
}
}
}
listVars.ResetContent();
CPropertyItem *pi = new CPropertyItem("Usage:", ent->desc.c_str(), PIT_VAR, "");
listVars.AddPropItem(pi);
int c = ent->vars.Num();
for (int i = 0; i < c; i++) {
pi = new CPropertyItem(ent->vars[i].name.c_str(), ent->vars[i].desc.c_str(), PIT_VAR, "");
pi->SetData(ent->vars[i].type);
listVars.AddPropItem(pi);
}
listVars.Invalidate();
SetKeyValPairs();
}
}
}
const char *CEntityDlg::TranslateString(const char *buf) {
static char buf2[32768];
int i, l;
char *out;
l = strlen(buf);
out = buf2;
for (i = 0; i < l; i++) {
if (buf[i] == '\n') {
*out++ = '\r';
*out++ = '\n';
}
else {
*out++ = buf[i];
}
}
*out++ = 0;
return buf2;
}
void CEntityDlg::UpdateFromListBox() {
if (editEntity == NULL) {
return;
}
int c = listKeyVal.GetCount();
for (int i = 0 ; i < c; i++) {
CPropertyItem* pItem = (CPropertyItem*)listKeyVal.GetItemDataPtr(i);
if (pItem) {
editEntity->epairs.Set(pItem->m_propName, pItem->m_curValue);
}
}
SetKeyValPairs();
}
void CEntityDlg::SetKeyValPairs( bool updateAnims ) {
if (editEntity) {
listKeyVal.ResetContent();
int c = editEntity->epairs.GetNumKeyVals();
for (int i = 0; i < c; i++) {
const idKeyValue *kv = editEntity->epairs.GetKeyVal(i);
CPropertyItem *pi = new CPropertyItem(kv->GetKey().c_str(), kv->GetValue().c_str(), PIT_EDIT, "");
bool found = false;
int vc = editEntity->eclass->vars.Num();
for (int j = 0; j < vc; j++) {
if (editEntity->eclass->vars[j].name.Icmp(kv->GetKey()) == 0) {
switch (editEntity->eclass->vars[j].type) {
case EVAR_STRING :
case EVAR_INT :
case EVAR_FLOAT :
pi->m_nItemType = PIT_EDIT;
break;
case EVAR_BOOL :
pi->m_nItemType = PIT_EDIT;
//pi->m_cmbItems = "0|1";
break;
case EVAR_COLOR :
pi->m_nItemType = PIT_COLOR;
break;
case EVAR_MATERIAL :
pi->m_nItemType = PIT_MATERIAL;
break;
case EVAR_MODEL :
pi->m_nItemType = PIT_MODEL;
break;
case EVAR_GUI :
pi->m_nItemType = PIT_GUI;
break;
case EVAR_SOUND :
pi->m_nItemType = PIT_SOUND;
break;
}
found = true;
break;
}
}
if (!found) {
if (kv->GetKey().Icmp("model") == 0) {
pi->m_nItemType = PIT_MODEL;
}
if (kv->GetKey().Icmp("_color") == 0) {
pi->m_nItemType = PIT_COLOR;
}
if (kv->GetKey().Icmp("gui") == 0) {
pi->m_nItemType = PIT_GUI;
}
if (kv->GetKey().Icmp("gui2") == 0) {
pi->m_nItemType = PIT_GUI;
}
if (kv->GetKey().Icmp("gui3") == 0) {
pi->m_nItemType = PIT_GUI;
}
if (kv->GetKey().Icmp("s_shader") == 0) {
pi->m_nItemType = PIT_SOUND;
}
}
listKeyVal.AddPropItem(pi);
}
if ( updateAnims ) {
int i, num;
cbAnimations.ResetContent();
num = gameEdit->ANIM_GetNumAnimsFromEntityDef( &editEntity->eclass->defArgs );
for( i = 0; i < num; i++ ) {
cbAnimations.AddString( gameEdit->ANIM_GetAnimNameFromEntityDef( &editEntity->eclass->defArgs, i ) );
}
const idKeyValue* kv = editEntity->epairs.FindKey ( "anim" );
if ( kv ) {
int selIndex = cbAnimations.FindStringExact( 0 , kv->GetValue().c_str() );
if ( selIndex != -1 ) {
cbAnimations.SetCurSel( selIndex );
OnCbnAnimationChange ();
}
}
}
}
}
void CEntityDlg::UpdateEntitySel(eclass_t *ent) {
assert ( ent );
assert ( ent->name );
int index = comboClass.FindString(-1, ent->name);
if (index != LB_ERR) {
comboClass.SetCurSel(index);
OnCbnSelchangeComboClass();
}
}
void CEntityDlg::OnLbnSelchangeListkeyval()
{
int index = listKeyVal.GetCurSel();
if (index != LB_ERR) {
CString str;
listKeyVal.GetText(index, str);
int i;
for (i = 0; str[i] != '\t' && str[i] != '\0'; i++) {
}
idStr key = str.Left(i);
while (str[i] == '\t' && str[i] != '\0') {
i++;
}
idStr val = str.Right(str.GetLength() - i);
editKey.SetWindowText(key);
editVal.SetWindowText(val);
}
}
static int TabOrder[] = {
IDC_COMBO_CLASS,
IDC_BUTTON_CREATE,
//IDC_EDIT_INFO,
IDC_LIST_KEYVAL,
IDC_EDIT_KEY,
IDC_EDIT_VAL,
IDC_BUTTON_BROWSE,
IDC_E_135,
IDC_E_90,
IDC_E_45,
IDC_E_180,
IDC_E_0,
IDC_E_225,
IDC_E_270,
IDC_E_315,
IDC_E_UP,
IDC_E_DOWN,
IDC_BUTTON_MODEL,
IDC_BUTTON_SOUND,
IDC_BUTTON_GUI,
IDC_ENTITY_ANIMATIONS
};
int TabCount = sizeof(TabOrder) / sizeof(int);
void CEntityDlg::DelProp() {
CString key;
if (editEntity == NULL) {
return;
}
editKey.GetWindowText(key);
if (multipleEntities) {
for (brush_t *b = selected_brushes.next; b != &selected_brushes; b = b->next) {
DeleteKey(b->owner, key);
Entity_UpdateCurveData( b->owner );
}
} else {
DeleteKey(editEntity, key);
Entity_UpdateCurveData( editEntity );
}
// refresh the prop listbox
SetKeyValPairs();
Sys_UpdateWindows( W_ENTITY | W_XY | W_CAMERA );
}
BOOL CEntityDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->hwnd == editVal.GetSafeHwnd()) {
if (pMsg->message == WM_LBUTTONDOWN) {
editVal.SetFocus();
return TRUE;
}
}
if (pMsg->hwnd == editKey.GetSafeHwnd()) {
if (pMsg->message == WM_LBUTTONDOWN) {
editKey.SetFocus();
return TRUE;
}
}
if (GetFocus() == &editVal || GetFocus() == &editKey) {
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
AddProp();
return TRUE;
}
}
if (GetFocus() == listKeyVal.GetEditBox()) {
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
listKeyVal.OnChangeEditBox();
listKeyVal.OnSelchange();
listKeyVal.OnKillfocusEditBox();
AddProp();
SetKeyValPairs();
return TRUE;
}
}
if (GetFocus() == &listKeyVal) {
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_DELETE && editEntity) {
DelProp();
return TRUE;
}
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) {
if (pMsg->wParam == VK_ESCAPE) {
g_pParentWnd->GetCamera()->SetFocus();
Select_Deselect();
}
return TRUE;
}
if ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
// keeps ENTER from closing the dialog
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB) {
if (GetFocus()) {
int id = GetFocus()->GetDlgCtrlID();
for (int i = 0; i < TabCount; i++) {
if (TabOrder[i] == id) {
i++;
if (i >= TabCount) {
i = 0;
}
CWnd *next = GetDlgItem(TabOrder[i]);
if (next) {
next->SetFocus();
if (TabOrder[i] == IDC_EDIT_VAL) {
editVal.SetSel(0, -1);
}
return TRUE;
}
}
}
}
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RIGHT && pMsg->hwnd == slFrameSlider.GetSafeHwnd()) {
int pos = slFrameSlider.GetPos() + 1;
pos = (pos % slFrameSlider.GetRangeMax());
slFrameSlider.SetPos ( pos );
UpdateFromAnimationFrame ();
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_LEFT && pMsg->hwnd == slFrameSlider.GetSafeHwnd()) {
int pos = slFrameSlider.GetPos() - 1;
if ( pos < 1 ) {
pos = slFrameSlider.GetRangeMax();
}
slFrameSlider.SetPos ( pos );
UpdateFromAnimationFrame ();
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
/*
=======================================================================================================================
AddProp
=======================================================================================================================
*/
void CEntityDlg::AddProp() {
if (editEntity == NULL) {
return;
}
CString Key, Value;
editKey.GetWindowText(Key);
editVal.GetWindowText(Value);
bool isName = (stricmp(Key, "name") == 0);
bool isModel = static_cast<bool>((stricmp(Key, "model") == 0 && Value.GetLength() > 0));
bool isOrigin = ( idStr::Icmp( Key, "origin" ) == 0 );
if (multipleEntities) {
brush_t *b;
for (b = selected_brushes.next; b != &selected_brushes; b = b->next) {
if (isName) {
Entity_SetName(b->owner, Value);
} else {
if ( ! ( ( isModel || isOrigin ) && ( b->owner->eclass->nShowFlags & ECLASS_WORLDSPAWN ) ) ) {
SetKeyValue(b->owner, Key, Value);
}
}
}
}
else {
if (isName) {
Entity_SetName(editEntity, Value);
} else {
if ( ! ( ( isModel || isOrigin ) && ( editEntity->eclass->nShowFlags & ECLASS_WORLDSPAWN ) ) ) {
SetKeyValue(editEntity, Key, Value);
}
}
if ( isModel && !( editEntity->eclass->nShowFlags & ECLASS_WORLDSPAWN ) ) {
idBounds bo;
idVec3 mins, maxs;
selected_brushes.next->modelHandle = renderModelManager->FindModel( Value );
if ( dynamic_cast<idRenderModelPrt*>( selected_brushes.next->modelHandle ) || dynamic_cast<idRenderModelLiquid*>( selected_brushes.next->modelHandle ) ) {
bo.Zero();
bo.ExpandSelf( 12.0f );
} else {
bo = selected_brushes.next->modelHandle->Bounds( NULL );
}
VectorCopy(bo[0], mins);
VectorCopy(bo[1], maxs);
VectorAdd(mins, editEntity->origin, mins);
VectorAdd(maxs, editEntity->origin, maxs);
Brush_RebuildBrush(selected_brushes.next, mins, maxs, false);
Brush_Build ( selected_brushes.next , false, false , false, true );
}
}
// refresh the prop listbox
SetKeyValPairs();
Sys_UpdateWindows(W_ALL);
}
const char *CEntityDlg::AngleKey() {
if (editEntity == NULL) {
return "";
}
if (editEntity->eclass->nShowFlags & ECLASS_MOVER) {
return "movedir";
}
return "angle";
}
void CEntityDlg::OnBnClickedE135()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("135");
AddProp();
}
void CEntityDlg::OnBnClickedE90()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("90");
AddProp();
}
void CEntityDlg::OnBnClickedE45()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("45");
AddProp();
}
void CEntityDlg::OnBnClickedE180()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("180");
AddProp();
}
void CEntityDlg::OnBnClickedE0()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("0");
AddProp();
}
void CEntityDlg::OnBnClickedE225()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("225");
AddProp();
}
void CEntityDlg::OnBnClickedE270()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("270");
AddProp();
}
void CEntityDlg::OnBnClickedE315()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("315");
AddProp();
}
void CEntityDlg::OnBnClickedEUp()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("-1");
AddProp();
}
void CEntityDlg::OnBnClickedEDown()
{
if (editEntity == NULL) {
return;
}
editKey.SetWindowText(AngleKey());
editVal.SetWindowText("-2");
AddProp();
}
CPreviewDlg *CEntityDlg::ShowModelChooser() {
static CPreviewDlg modelDlg;
modelDlg.SetMode(CPreviewDlg::MODELS);
modelDlg.SetModal();
if (modelDlg.GetSafeHwnd() == NULL) {
modelDlg.Create(MAKEINTRESOURCE(IDD_DIALOG_PREVIEW));
}
modelDlg.ShowWindow( SW_SHOW );
modelDlg.BringWindowToTop();
while (modelDlg.Waiting()) {
}
return &modelDlg;
}
CPreviewDlg *CEntityDlg::ShowParticleChooser() {
static CPreviewDlg modelDlg;
modelDlg.SetMode(CPreviewDlg::PARTICLES);
modelDlg.SetModal();
if (modelDlg.GetSafeHwnd() == NULL) {
modelDlg.Create(MAKEINTRESOURCE(IDD_DIALOG_PREVIEW));
}
modelDlg.ShowWindow(SW_SHOW);
modelDlg.BringWindowToTop();
while (modelDlg.Waiting()) {
}
return &modelDlg;
}
CPreviewDlg *CEntityDlg::ShowSkinChooser(entity_t *ent) {
static CPreviewDlg modelDlg;
modelDlg.SetMode(CPreviewDlg::SKINS);
modelDlg.SetModal();
if (modelDlg.GetSafeHwnd() == NULL) {
modelDlg.Create(MAKEINTRESOURCE(IDD_DIALOG_PREVIEW));
}
modelDlg.RebuildTree( ( ent ) ? ent->epairs.GetString( "model" ) : "" );
modelDlg.ShowWindow(SW_SHOW);
modelDlg.BringWindowToTop();
while (modelDlg.Waiting()) {
}
return &modelDlg;
}
CPreviewDlg *CEntityDlg::ShowGuiChooser() {
static CPreviewDlg guiDlg;
guiDlg.SetMode(CPreviewDlg::GUIS);
guiDlg.SetModal();
if (guiDlg.GetSafeHwnd() == NULL) {
guiDlg.Create(MAKEINTRESOURCE(IDD_DIALOG_PREVIEW));
}
guiDlg.ShowWindow(SW_SHOW);
guiDlg.BringWindowToTop();
while (guiDlg.Waiting()) {
}
return &guiDlg;
}
CPreviewDlg *CEntityDlg::ShowSoundChooser() {
static CPreviewDlg soundDlg;
soundDlg.SetMode(CPreviewDlg::SOUNDS);
soundDlg.SetModal();
if (soundDlg.GetSafeHwnd() == NULL) {
soundDlg.Create(MAKEINTRESOURCE(IDD_DIALOG_PREVIEW));
}
soundDlg.ShowWindow(SW_SHOW);
while (soundDlg.Waiting()) {
}
return &soundDlg;
}
CPreviewDlg *CEntityDlg::ShowMaterialChooser() {
static CPreviewDlg matDlg;
matDlg.SetMode(CPreviewDlg::MATERIALS);
matDlg.SetModal();
if (matDlg.GetSafeHwnd() == NULL) {
matDlg.Create(MAKEINTRESOURCE(IDD_DIALOG_PREVIEW));
}
matDlg.ShowWindow(SW_SHOW);
matDlg.BringWindowToTop();
while (matDlg.Waiting()) {
}
return &matDlg;
}
void CEntityDlg::AssignModel ()
{
OnBnClickedButtonModel();
}
void CEntityDlg::OnBnClickedButtonModel() {
CPreviewDlg *dlg = ShowModelChooser();
if (dlg->returnCode == IDOK) {
editKey.SetWindowText("model");
editVal.SetWindowText(dlg->mediaName);
AddProp();
}
}
void CEntityDlg::OnBnClickedButtonSound() {
CPreviewDlg *dlg = ShowSoundChooser();
if (dlg->returnCode == IDOK) {
editKey.SetWindowText("s_shader");
editVal.SetWindowText(dlg->mediaName);
AddProp();
}
}
void CEntityDlg::OnBnClickedButtonGui() {
CPreviewDlg *dlg = ShowGuiChooser();
if (dlg->returnCode == IDOK) {
editKey.SetWindowText("gui");
editVal.SetWindowText(dlg->mediaName);
AddProp();
}
}
void CEntityDlg::OnBnClickedButtonParticle() {
CPreviewDlg *dlg = ShowParticleChooser();
if (dlg->returnCode == IDOK) {
editKey.SetWindowText("model");
editVal.SetWindowText(dlg->mediaName);
AddProp();
}
}
void CEntityDlg::OnBnClickedButtonSkin() {
CPreviewDlg *dlg = ShowSkinChooser( editEntity );
if (dlg->returnCode == IDOK) {
editKey.SetWindowText("skin");
editVal.SetWindowText(dlg->mediaName);
AddProp();
}
}
void CEntityDlg::OnBnClickedButtonCurve() {
CCurveDlg dlg;
if ( dlg.DoModal() == IDOK ) {
if ( editEntity ) {
idStr str = "curve_" + dlg.strCurveType;
editKey.SetWindowText( str );
idVec3 org = editEntity->origin;
str = "3 ( ";
str += org.ToString();
org.x += 64;
str += " ";
str += org.ToString();
org.y += 64;
str += " ";
str += org.ToString();
str += " )";
editVal.SetWindowText( str );
AddProp();
Entity_SetCurveData( editEntity );
}
}
}
void CEntityDlg::OnBnClickedButtonBrowse() {
DelProp();
}
void CEntityDlg::OnCbnDblclkComboClass()
{
// TODO: Add your control notification handler code here
}
//
// =======================================================================================================================
// CreateEntity Creates a new entity based on the currently selected brush and entity type.
// =======================================================================================================================
//
void CEntityDlg::CreateEntity() {
entity_t *petNew;
bool forceFixed = false;
// check to make sure we have a brush
CXYWnd *pWnd = g_pParentWnd->ActiveXY();
if (pWnd) {
CRect rctZ;
pWnd->GetClientRect(rctZ);
brush_t *pBrush;
if (selected_brushes.next == &selected_brushes) {
pBrush = CreateEntityBrush(g_nSmartX, rctZ.Height() - 1 - g_nSmartY, pWnd);
forceFixed = true;
}
}
else {
if (selected_brushes.next == &selected_brushes) {
MessageBox("You must have a selected brush to create an entity", "info", 0);
return;
}
}
int index = comboClass.GetCurSel();
if (index == LB_ERR) {
MessageBox("You must have a selected class to create an entity", "info", 0);
return;
}
CString str;
comboClass.GetLBText(index, str);
if (!stricmp(str, "worldspawn")) {
MessageBox("Can't create an entity with worldspawn.", "info", 0);
return;
}
eclass_t *pecNew = Eclass_ForName (str, false);
// create it
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000)) {
// MAJOR hack for xian
extern void Brush_CopyList(brush_t *pFrom, brush_t *pTo);
brush_t temp_brushes;
temp_brushes.next = &temp_brushes;
Brush_CopyList(&selected_brushes, &temp_brushes);
Select_Deselect();
brush_t *pBrush = temp_brushes.next;
while (pBrush != NULL && pBrush != &temp_brushes) {
brush_t *pNext = pBrush->next;
Brush_RemoveFromList(pBrush);
Brush_AddToList(pBrush, &selected_brushes);
pBrush = pNext;
petNew = Entity_Create(pecNew, forceFixed);
Select_Deselect();
}
} else if ((GetAsyncKeyState(VK_SHIFT) & 0x8000)) {
Select_Ungroup();
petNew = Entity_Create(pecNew, forceFixed);
} else {
petNew = Entity_Create(pecNew, forceFixed);
}
if (petNew == NULL) {
MessageBox("Failed to create entity.", "info", 0);
return;
}
if (selected_brushes.next == &selected_brushes) {
editEntity = world_entity;
}
else {
editEntity = selected_brushes.next->owner;
}
SetKeyValPairs();
Select_Deselect();
Select_Brush(editEntity->brushes.onext);
Sys_UpdateWindows(W_ALL);
}
void CEntityDlg::OnBnClickedButtonCreate()
{
CreateEntity();
}
void CEntityDlg::OnLbnDblclkListkeyval()
{
CString Key, Value;
idStr work;
editKey.GetWindowText( Key );
editVal.GetWindowText( Value );
if ( stricmp( Key, "script" ) == 0 ) {
Key = Value;
Value = "script/" + Key;
if ( fileSystem->ReadFile( Value, NULL, NULL ) == -1) {
sprintf( work, "// Script for %s\n// \n\nvoid main() {\n\n}\n\n", currentmap );
fileSystem->WriteFile( Value, work.c_str(), work.Length(), "fs_devpath" );
}
work = fileSystem->RelativePathToOSPath( Value );
WinExec( va( "notepad.exe %s", work.c_str() ), SW_SHOW );
}
}
void CEntityDlg::OnLbnSelchangeListVars() {
}
void CEntityDlg::OnLbnDblclkListVars() {
if (editEntity == NULL) {
return;
}
int sel = listVars.GetCurSel();
CPropertyItem *pi = (CPropertyItem*)listVars.GetItemDataPtr(sel);
if (pi) {
if (editEntity->epairs.FindKey(pi->m_propName) == NULL) {
editKey.SetWindowText(pi->m_propName);
editVal.SetWindowText("");
editVal.SetFocus();
}
}
}
void CEntityDlg::UpdateKeyVal(const char *key, const char *val) {
if (editEntity) {
editEntity->epairs.Set(key, val);
SetKeyValPairs();
g_pParentWnd->GetCamera()->BuildEntityRenderState(editEntity, true);
Entity_UpdateSoundEmitter(editEntity);
}
}
void CEntityDlg::OnNMReleasedcaptureSlider1(NMHDR *pNMHDR, LRESULT *pResult)
{
if ( !editEntity )
{
return;
}
UpdateFromAnimationFrame ();
*pResult = 0;
}
void CEntityDlg::UpdateFromAnimationFrame ( bool updateKeyValueDisplay )
{
int frame = slFrameSlider.GetPos ();
editEntity->epairs.SetInt( "frame" , frame );
SetDlgItemText ( IDC_ENTITY_CURRENT_ANIM , va ( "%i" , frame));
if ( updateKeyValueDisplay ) {
SetKeyValPairs();
}
g_pParentWnd->GetCamera ()->BuildEntityRenderState (editEntity , true );
Sys_UpdateWindows ( W_ALL );
}
void CEntityDlg::OnCbnAnimationChange ()
{
if ( !editEntity )
{
return;
}
int sel = cbAnimations.GetCurSel();
CString animName;
currentAnimation = NULL;
int currFrame = 0;
if ( sel != -1 ) {
cbAnimations.GetLBText( sel , animName );
if ( animName.GetLength() > 0 ) {
//preserve the existing frame number
currFrame = editEntity->epairs.GetInt ( "frame" , "1" );
editEntity->epairs.Set("anim" , animName.GetBuffer(0));
SetKeyValPairs(false/*don't update anims combo box :)*/ );
//update the slider
currentAnimation = gameEdit->ANIM_GetAnimFromEntityDef(editEntity->eclass->name , animName.GetBuffer(0));
currentAnimationFrame = 0;
if ( currentAnimation ) {
slFrameSlider.SetRange( 1 , gameEdit->ANIM_GetNumFrames( currentAnimation ), TRUE );
slFrameSlider.SetPos( currFrame );
currentAnimationFrame = currFrame;
}
Sys_UpdateWindows(W_ALL);
}
}
}
void CEntityDlg::OnBnClickedStartAnimation()
{
if (!editEntity) {
return;
}
SetTimer ( 0 , 1000/24 , NULL );
}
void CEntityDlg::OnBnClickedStopAnimation()
{
KillTimer ( 0 );
}
void CEntityDlg::OnTimer(UINT nIDEvent)
{
if ( !editEntity ) {
OnBnClickedStopAnimation ();
return;
}
if ( currentAnimation ) {
currentAnimationFrame = ( (currentAnimationFrame++) % gameEdit->ANIM_GetNumFrames( currentAnimation ) );
editEntity->epairs.SetInt ( "frame" , currentAnimationFrame );
slFrameSlider.SetPos ( currentAnimationFrame );
UpdateFromAnimationFrame (false/*don't update key/value display*/);
Sys_UpdateWindows ( W_CAMERA | W_XY );
}
}
void CEntityDlg::AddCurvePoints() {
if ( editEntity == NULL || editEntity->curve == NULL ) {
return;
}
// add one point 64 units from the direction of the two points int he curve
int c = editEntity->curve->GetNumValues();
idVec3 start;
idVec3 end;
if ( c > 1 ) {
start = editEntity->curve->GetValue( c - 2 );
end = editEntity->curve->GetValue( c - 1 );
idVec3 dir = end - start;
dir.Normalize();
start = end + 64 * dir;
} else if ( c > 0 ) {
start = editEntity->curve->GetValue( 0 );
start.x += 64;
start.y += 64;
} else {
start = editEntity->origin;
}
editEntity->curve->AddValue( editEntity->curve->GetNumValues() * 100, start );
if ( g_qeglobals.d_select_mode == sel_editpoint ) {
g_qeglobals.d_select_mode = sel_brush;
EditCurvePoints();
}
Sys_UpdateWindows( W_CAMERA | W_XY );
}
void CEntityDlg::EditCurvePoints() {
if ( editEntity == NULL || editEntity->curve == NULL ) {
return;
}
if ( g_qeglobals.d_select_mode == sel_editpoint ) {
g_qeglobals.d_select_mode = sel_brush;
return;
}
g_qeglobals.d_select_mode = sel_editpoint;
g_qeglobals.d_numpoints = 0;
g_qeglobals.d_num_move_points = 0;
int c = editEntity->curve->GetNumValues();
for ( int i = 0; i < c; i++ ) {
if ( g_qeglobals.d_numpoints < MAX_POINTS - 1 ) {
g_qeglobals.d_points[g_qeglobals.d_numpoints++] = editEntity->curve->GetValue( i );
}
}
Sys_UpdateWindows( W_XY | W_CAMERA );
}
void CEntityDlg::InsertCurvePoint() {
if ( editEntity == NULL || editEntity->curve == NULL ) {
return;
}
if ( g_qeglobals.d_select_mode != sel_editpoint ) {
return;
}
if ( g_qeglobals.d_num_move_points == 0 ) {
return;
}
for ( int i = 0; i < editEntity->curve->GetNumValues(); i++ ) {
if ( PointInMoveList( editEntity->curve->GetValueAddress( i ) ) >= 0 ) {
if ( i == editEntity->curve->GetNumValues() - 1 ) {
// just do an add
AddCurvePoints();
} else {
idCurve<idVec3> *newCurve = Entity_MakeCurve( editEntity );
if ( newCurve == NULL ) {
return;
}
for ( int j = 0; j < editEntity->curve->GetNumValues(); j++ ) {
if ( j == i ) {
idVec3 start;
idVec3 end;
if ( i > 0 ) {
start = editEntity->curve->GetValue( i - 1 );
end = editEntity->curve->GetValue( i );
start += end;
start *= 0.5f;
} else {
start = editEntity->curve->GetValue( 0 );
if ( editEntity->curve->GetNumValues() > 1 ) {
end = start;
start = editEntity->curve->GetValue ( 1 );
idVec3 dir = end - start;
dir.Normalize();
start = end + 64 * dir;
} else {
end = start;
end.x += 64;
end.y += 64;
}
}
newCurve->AddValue( newCurve->GetNumValues() * 100, start );
}
newCurve->AddValue( newCurve->GetNumValues() * 100, editEntity->curve->GetValue( j ) );
}
delete editEntity->curve;
editEntity->curve = newCurve;
}
g_qeglobals.d_num_move_points = 0;
break;
}
}
UpdateEntityCurve();
Sys_UpdateWindows( W_XY | W_CAMERA );
}
void CEntityDlg::DeleteCurvePoint() {
if ( editEntity == NULL || editEntity->curve == NULL ) {
return;
}
if ( g_qeglobals.d_select_mode != sel_editpoint ) {
return;
}
if ( g_qeglobals.d_num_move_points == 0 ) {
return;
}
for ( int i = 0; i < editEntity->curve->GetNumValues(); i++ ) {
if ( PointInMoveList( editEntity->curve->GetValueAddress( i ) ) >= 0 ) {
editEntity->curve->RemoveIndex( i );
g_qeglobals.d_num_move_points = 0;
break;
}
}
UpdateEntityCurve();
Sys_UpdateWindows( W_XY | W_CAMERA );
}
void CEntityDlg::UpdateEntityCurve() {
if ( editEntity == NULL ) {
return;
}
Entity_UpdateCurveData( editEntity );
if ( g_qeglobals.d_select_mode == sel_editpoint ) {
g_qeglobals.d_numpoints = 0;
int c = editEntity->curve->GetNumValues();
for ( int i = 0; i < c; i++ ) {
if ( g_qeglobals.d_numpoints < MAX_POINTS - 1 ) {
g_qeglobals.d_points[g_qeglobals.d_numpoints++] = editEntity->curve->GetValue( i );
}
}
}
Sys_UpdateWindows( W_ENTITY );
}
void CEntityDlg::SelectCurvePointByRay(const idVec3 &org, const idVec3 &dir, int buttons) {
int i, besti;
float d, bestd;
idVec3 temp;
if ( editEntity == NULL ) {
return;
}
// find the point closest to the ray
float scale = g_pParentWnd->ActiveXY()->Scale();
besti = -1;
bestd = 8 / scale / 2;
//bestd = 8;
for (i = 0; i < g_qeglobals.d_numpoints; i++) {
temp = g_qeglobals.d_points[i] - org;
d = temp * dir;
temp = org + d * dir;
temp = g_qeglobals.d_points[i] - temp;
d = temp.Length();
if ( d <= bestd ) {
bestd = d;
besti = i;
}
}
if (besti == -1) {
return;
}
g_qeglobals.d_num_move_points = 0;
assert ( besti < editEntity->curve->GetNumValues() );
g_qeglobals.d_move_points[ g_qeglobals.d_num_move_points++ ] = editEntity->curve->GetValueAddress( besti );
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright © 2014 - 2020 Leipzig University (Database Research Group)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradoop.flink.algorithms.gelly.functions;
import org.apache.flink.graph.Edge;
import org.gradoop.common.model.impl.id.GradoopId;
import org.gradoop.common.model.impl.pojo.EPGMEdge;
import org.gradoop.common.model.impl.properties.PropertyValue;
/**
* Maps EPGM edge to a Gelly edge consisting of EPGM source and target
* identifier and {@link Double} as edge value.
*/
public class EdgeToGellyEdgeWithDouble implements EdgeToGellyEdge<Double> {
/**
* Property key to get the value for.
*/
private final String propertyKey;
/**
* Reduce object instantiations.
*/
private final org.apache.flink.graph.Edge<GradoopId, Double> reuseEdge;
/**
* Constructor.
*
* @param propertyKey property key to get the property value.
*/
public EdgeToGellyEdgeWithDouble(String propertyKey) {
this.propertyKey = propertyKey;
this.reuseEdge = new org.apache.flink.graph.Edge<>();
}
@Override
public Edge<GradoopId, Double> map(EPGMEdge epgmEdge)
throws Exception {
reuseEdge.setSource(epgmEdge.getSourceId());
reuseEdge.setTarget(epgmEdge.getTargetId());
//cast incoming numeric value to double
PropertyValue value = epgmEdge.getPropertyValue(propertyKey);
if (value.isDouble()) {
reuseEdge.setValue(value.getDouble());
} else if (value.isFloat()) {
reuseEdge.setValue((double) value.getFloat());
} else if (value.isInt()) {
reuseEdge.setValue((double) value.getInt());
} else if (value.isLong()) {
reuseEdge.setValue((double) value.getLong());
}
return reuseEdge;
}
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Admin 1 – States, Provinces | Natural Earth</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="alternate" type="application/rss+xml" title="Natural Earth RSS Feed" href="http://www.naturalearthdata.com/feed/" />
<link rel="pingback" href="http://www.naturalearthdata.com/xmlrpc.php" />
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/themes/NEV/includes/js/suckerfish.js"></script>
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js" type="text/javascript"></script>
<script defer="defer" type="text/javascript" src="http://www.naturalearthdata.com/wp-content/themes/NEV/includes/js/pngfix.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://www.naturalearthdata.com/wp-content/themes/NEV/style.css" type="text/css" media="screen" />
<!-- All in One SEO Pack 2.3.2.3 by Michael Torbert of Semper Fi Web Designob_start_detected [-1,-1] -->
<meta name="description" content="Internal administrative boundaries. About NOTE: This theme is still in beta! Internal, first-order administrative" />
<link rel="canonical" href="http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/" />
<!-- /all in one seo pack -->
<link rel="alternate" type="application/rss+xml" title="Natural Earth » Admin 1 – States, Provinces Comments Feed" href="http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/feed/" />
<script type="text/javascript">
window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/www.naturalearthdata.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.4.11"}};
!function(a,b,c){function d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&f.getContext("2d"),h=String.fromCharCode;return g&&g.fillText?(g.textBaseline="top",g.font="600 32px Arial","flag"===a?(g.fillText(h(55356,56806,55356,56826),0,0),f.toDataURL().length>3e3):"diversity"===a?(g.fillText(h(55356,57221),0,0),c=g.getImageData(16,16,1,1).data,g.fillText(h(55356,57221,55356,57343),0,0),c=g.getImageData(16,16,1,1).data,e=c[0]+","+c[1]+","+c[2]+","+c[3],d!==e):("simple"===a?g.fillText(h(55357,56835),0,0):g.fillText(h(55356,57135),0,0),0!==g.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag"),unicode8:d("unicode8"),diversity:d("diversity")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag&&c.supports.unicode8&&c.supports.diversity||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<style type="text/css">
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<link rel='stylesheet' id='bbp-child-bbpress-css' href='http://www.naturalearthdata.com/wp-content/themes/NEV/css/bbpress.css?ver=2.5.8-5815' type='text/css' media='screen' />
<!-- This site uses the Google Analytics by Yoast plugin v5.4.6 - Universal enabled - https://yoast.com/wordpress/plugins/google-analytics/ -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker');
__gaTracker('create', 'UA-10168306-1', 'auto');
__gaTracker('set', 'forceSSL', true);
__gaTracker('send','pageview');
</script>
<!-- / Google Analytics by Yoast -->
<link rel='https://api.w.org/' href='http://www.naturalearthdata.com/wp-json/' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.naturalearthdata.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.naturalearthdata.com/wp-includes/wlwmanifest.xml" />
<link rel='prev' title='Populated Places' href='http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-populated-places/' />
<link rel='next' title='Admin 0 – Breakaway, Disputed Areas' href='http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-0-breakaway-disputed-areas/' />
<meta name="generator" content="WordPress 4.4.11" />
<link rel='shortlink' href='http://www.naturalearthdata.com/?p=480' />
<link rel="alternate" type="application/json+oembed" href="http://www.naturalearthdata.com/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fwww.naturalearthdata.com%2Fdownloads%2F10m-cultural-vectors%2F10m-admin-1-states-provinces%2F" />
<link rel="alternate" type="text/xml+oembed" href="http://www.naturalearthdata.com/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fwww.naturalearthdata.com%2Fdownloads%2F10m-cultural-vectors%2F10m-admin-1-states-provinces%2F&format=xml" />
<script type="text/javascript">
/* <![CDATA[ */
var ajaxurl = 'http://www.naturalearthdata.com/wp-admin/admin-ajax.php';
/* ]]> */
</script>
<!-- begin gallery scripts -->
<link rel="stylesheet" href="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/css/jd.gallery.css.php" type="text/css" media="screen" charset="utf-8"/>
<link rel="stylesheet" href="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/css/jd.gallery.css" type="text/css" media="screen" charset="utf-8"/>
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/scripts/mootools.v1.11.js"></script>
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/scripts/jd.gallery.js.php"></script>
<script type="text/javascript" src="http://www.naturalearthdata.com/wp-content/plugins/featured-content-gallery/scripts/jd.gallery.transitions.js"></script>
<!-- end gallery scripts -->
<script type="text/javascript">
window._se_plugin_version = '8.1.4';
</script>
<link href="http://www.naturalearthdata.com/wp-content/themes/NEV/css/default.css" rel="stylesheet" type="text/css" />
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
<style type="text/css">.broken_link, a.broken_link {
text-decoration: line-through;
}</style><!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="http://www.naturalearthdata.com/wp-content/themes/NEV/ie.css" />
<![endif]-->
<script src="http://www.naturalearthdata.com/wp-content/themes/NEV/js/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
<script>
jQuery.noConflict();
</script>
<script type="text/javascript" charset="utf-8">
$(function(){
var tabContainers = $('div#maintabdiv > div');
tabContainers.hide().filter('#comments').show();
$('div#maintabdiv ul#tabnav a').click(function () {
tabContainers.hide();
tabContainers.filter(this.hash).show();
$('div#maintabdiv ul#tabnav a').removeClass('current');
$(this).addClass('current');
return false;
}).filter('#comments').click();
});
</script>
<script type="text/javascript" language="javascript" src="http://www.naturalearthdata.com/dataTables/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#ne_table').dataTable();
} );
</script>
</head>
<body>
<div id="page">
<div id="header">
<div id="headerimg">
<h1><a href="http://www.naturalearthdata.com/"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/nev_logo.png" alt="Natural Earth title="Natural Earth" /></a></h1>
<div class="description">Free vector and raster map data at 1:10m, 1:50m, and 1:110m scales</div>
<div class="header_search"><form method="get" id="searchform" action="http://www.naturalearthdata.com/">
<label class="hidden" for="s">Search for:</label>
<div><input type="text" value="" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
</div>
<!--<div class="translate_panel" style="align:top; margin-left:650px; top:50px;">
<div id="google_translate_element" style="float:left;"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>-->
</div>
</div>
<div id="pagemenu" style="align:bottom;">
<ul id="page-list" class="clearfix"><li class="page_item page-item-4"><a href="http://www.naturalearthdata.com/">Home</a></li>
<li class="page_item page-item-10"><a href="http://www.naturalearthdata.com/features/">Features</a></li>
<li class="page_item page-item-12 page_item_has_children"><a href="http://www.naturalearthdata.com/downloads/">Downloads</a></li>
<li class="page_item page-item-6 current_page_parent"><a href="http://www.naturalearthdata.com/blog/">Blog</a></li>
<li class="page_item page-item-14"><a href="http://www.naturalearthdata.com/forums">Forums</a></li>
<li class="page_item page-item-366"><a href="http://www.naturalearthdata.com/corrections">Corrections</a></li>
<li class="page_item page-item-16 page_item_has_children"><a href="http://www.naturalearthdata.com/about/">About</a></li>
</ul>
</div>
<hr /> <div id="main">
<div id="content" class="narrowcolumn">
« <a href="http://www.naturalearthdata.com/downloads/10m-cultural-vectors/">1:10m Cultural Vectors</a>
« <a href="http://www.naturalearthdata.com/downloads/">Downloads</a>
<div class="post" id="post-480">
<h2>Admin 1 – States, Provinces</h2>
<div class="entry">
<div class="downloadPromoBlock">
<div style="float: left; width: 170px;"><img class="alignnone size-full wp-image-1914" title="states_thumb" src="http://www.naturalearthdata.com/wp-content/uploads/2009/09/states_thumb.png" alt="states_thumb" width="150" height="97" /></div>
<div style="float: left; width: 410px;"><em>Internal administrative boundaries.</em></p>
<div class="download-link-div">
<a href="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip" class="download-link" rel="nofollow" title="Downloaded 141418 times (Shapefile, geoDB, or TIFF format)" onclick="if (window.urchinTracker) urchinTracker ('http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip'); __gaTracker('send', 'event', 'download', 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces.zip');">Download states and provinces</a> <span class="download-link-span">(13.97 MB) version 4.0.0</span>
</div>
<div class="download-link-div">
<a href="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_scale_rank.zip" class="download-link" rel="nofollow" title="Downloaded 6673 times (Shapefile, geoDB, or TIFF format)" onclick="if (window.urchinTracker) urchinTracker ('http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_scale_rank.zip'); __gaTracker('send', 'event', 'download', 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_scale_rank.zip');">Download as scale ranks</a> <span class="download-link-span">(15.2 MB) version 4.0.0</span>
</div>
<div class="download-link-div">
<a href="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lakes.zip" class="download-link" rel="nofollow" title="Downloaded 18089 times (Shapefile, geoDB, or TIFF format)" onclick="if (window.urchinTracker) urchinTracker ('http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lakes.zip'); __gaTracker('send', 'event', 'download', 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lakes.zip');">Download without large lakes</a> <span class="download-link-span">(14.11 MB) version 4.0.0</span>
</div>
<div class="download-link-div">
<a href="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip" class="download-link" rel="nofollow" title="Downloaded 22381 times (Shapefile, geoDB, or TIFF format)" onclick="if (window.urchinTracker) urchinTracker ('http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip'); __gaTracker('send', 'event', 'download', 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip');">Download boundary lines</a> <span class="download-link-span">(5.67 MB) version 4.0.0</span>
</div>
<p><span id="more-480"></span></div>
</div>
<div class="downloadMainBlock">
<p><img class="alignnone size-full wp-image-1916" title="states_banner" src="http://www.naturalearthdata.com/wp-content/uploads/2009/09/states_banner.png" alt="states_banner" width="580" height="150" srcset="http://www.naturalearthdata.com/wp-content/uploads/2009/09/states_banner-300x77.png 300w, http://www.naturalearthdata.com/wp-content/uploads/2009/09/states_banner.png 580w" sizes="(max-width: 580px) 100vw, 580px" /></p>
<p><strong>About</strong></p>
<p><strong><span style="color: #ff0000;">NOTE: This theme is still in beta!</span></strong></p>
<p>Internal, first-order administrative boundaries and polygons for all but a few tiny countries. Includes name attributes (including diacritical marks), name variants, and some statistical codes (FIPS, ISO, HASC).</p>
<p>Looking for Cyrillic or Chinese characters? The <strong>GeoDB format</strong> preserves local scripts better than SHP format.</p>
<p><em>Admin-0 units that lack admin-1:</em></p>
<p>Antarctica, some disputed areas, tiny island nations, and principalities such as Monaco, Andorra, Liechtenstein, and San Marino.</p>
<p><strong>How-to</strong></p>
<p>Use the following selection statement to derive this theme from the 10m lakes:</p>
<p>“ScaleRank” <=2
Then punch those selected features through the admin-1 and save result as a new feature class.
<strong>Issues</strong></p>
<p>This is the toughest dataset to keep current. Unlike the United States, other countries constantly rearrange their admin-1 units, slicing and combining them on a regular basis.</p>
<p>We need help making sure our statistical codes are correct if they are present and about half the dataset needs them added, still.</p>
<p>Just a few admin-1 units lack a name. For names we are unsure about, those are flagged as an attribute.</p>
<p>A separate version should be created for “region” groupings of admin-1. Many countries, like France, include top level regions and departments, both as admin-1 ranking. If we only have their “region” admin-1, the department version needs to be digitized.</p>
<p><em>Boundaries should perfectly match the following NEV themes:</em></p>
<p>Coastline, lake shoreline, admin-0 country boundary, river and lake centerlines.</p>
<p>Some boundaries in Brazil, north Africa, and central Asia do not have enough data points on straight line segments. This is a concern when reprojecting the data. This is planned to be corrected in a 1.1 update.</p>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="http://www.unsalb.org/" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.unsalb.org/', 'UN SALB');" class="broken_link">UN SALB</a> (<a href="http://www.unsalb.org/index.php?option=com_content&view=article&id=95&Itemid=63" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.unsalb.org/index.php?option=com_content&view=article&id=95&Itemid=63', 'list');" class="broken_link">list</a> of National Mapping Agencies and their <a href="http://www.unsalb.org/index.php?option=com_content&view=article&id=47&Itemid=56" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.unsalb.org/index.php?option=com_content&view=article&id=47&Itemid=56', 'contacts');" class="broken_link">contacts</a>)</li>
<li><a href="http://www.gadm.org/" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.gadm.org/', 'Berkeley GADM');">Berkeley GADM</a></li>
<li><a href="http://www.eki.ee/knab/adm2.htm" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.eki.ee/knab/adm2.htm', 'Institute of the Estonian Language');">Institute of the Estonian Language</a> (<a href="http://www.eki.ee/knab/adm_w.htm" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.eki.ee/knab/adm_w.htm', 'alternate link');">alternate link</a>)<br />
Coordinating country for the UN GeoNames forums.</li>
<li><a href="http://www.statoids.com/" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.statoids.com/', 'Statoids');">Statoids</a><br />
Click on the ABCD images to find alphabetical listing of countries, then click into the country.</li>
<li>Wikipedia<br />
<a href="http://en.wikipedia.org/wiki/Table_of_administrative_divisions_by_country" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://en.wikipedia.org/wiki/Table_of_administrative_divisions_by_country', 'Table_of_administrative_divisions_by_country');" target="_blank">Table_of_administrative_divisions_by_country</a><br />
<a href="http://en.wikipedia.org/wiki/List_of_country_subdivisions" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://en.wikipedia.org/wiki/List_of_country_subdivisions', 'List_of_country_subdivisions');" target="_blank">List_of_country_subdivisions</a><br />
<a href="http://en.wikipedia.org/wiki/List_of_FIPS_region_codes_%28A-C%29" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://en.wikipedia.org/wiki/List_of_FIPS_region_codes_%28A-C%29', 'List_of_FIPS_region_codes');" target="_blank">List_of_FIPS_region_codes</a></li>
<li><a href="http://www.geonames.org/countries/" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.geonames.org/countries/', 'GeoNames.org');">GeoNames.org</a> (<a href="http://www.geonames.org/KG/administrative-division-kyrgyzstan.html" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.geonames.org/KG/administrative-division-kyrgyzstan.html', 'example');">example</a>)<br />
Collects official gazetteer information from all countries in the world.</li>
</ul>
<p><strong>Version History</strong></p>
<ul>
<li>
<a href="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip" onclick="__gaTracker('send', 'event', 'download', 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip');" rel="nofollow" title="Download version 4.0.0 of ne_10m_admin_1_states_provinces_lines.zip">4.0.0</a>
</li>
<li>
<a rel="nofollow" title="Download version 3.0.0 of ne_10m_admin_1_states_provinces_lines.zip" href="http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_1_states_provinces_lines.zip?version=3.0.0">3.0.0</a>
</li>
<li>
2.0.0
</li>
<li>
1.4.0
</li>
<li>
0.9.0
</li>
<li>
0.8.0
</li>
</ul>
<p><a href="https://github.com/nvkelso/natural-earth-vector/blob/master/CHANGELOG" onclick="__gaTracker('send', 'event', 'outbound-article', 'https://github.com/nvkelso/natural-earth-vector/blob/master/CHANGELOG', 'The master changelog is available on Github »');">The master changelog is available on Github »</a>
</div>
</div>
</div>
</div>
<div id="sidebar">
<ul><li id='text-5' class='widget widget_text'><h2 class="widgettitle">Stay up to Date</h2>
<div class="textwidget"> Know when a new version of Natural Earth is released by subscribing to our <a href="http://www.naturalearthdata.com/updates/" class="up-to-date-link" >announcement list</a>.</div>
</li></ul><ul><li id='text-2' class='widget widget_text'><h2 class="widgettitle">Find a Problem?</h2>
<div class="textwidget"><div>
<div style="float:left; width:65px;"><a href="/corrections/index.php?a=add"><img class="alignleft" title="New Ticket" src="http://www.naturalearthdata.com/corrections/img/newticket.png" alt="" width="60" height="60" /></a></div><div class="textwidget" style="float:left;width:120px; font-size:1.2em; font-size-adjust:none; font-style:normal;
font-variant:normal; font-weight:normal; line-height:normal;">Submit suggestions and bug reports via our <a href="/corrections/index.php?a=add">correction system</a> and track the progress of your edits.</div>
</div></div>
</li></ul><ul><li id='text-3' class='widget widget_text'><h2 class="widgettitle">Join Our Community</h2>
<div class="textwidget"><div>
<div style="float:left; width:65px;"><a href="/forums/"><img src="http://www.naturalearthdata.com/wp-content/uploads/2009/08/green_globe_chat_bubble_562e.png" alt="forums" title="Chat in the forum!" width="50" height="50" /></a></div><div class="textwidget" style="float:left;width:120px; font-size:1.2em; font-size-adjust:none; font-style:normal;
font-variant:normal; font-weight:normal; line-height:normal;">Talk back and discuss Natural Earth in the <a href="/forums/">Forums</a>.</div>
</div></div>
</li></ul><ul><li id='text-4' class='widget widget_text'><h2 class="widgettitle">Thank You</h2>
<div class="textwidget">Our data downloads are generously hosted by Florida State University.</div>
</li></ul><ul><li id='bbp_topics_widget-3' class='widget widget_display_topics'><h2 class="widgettitle">Recent Forum Topics</h2>
<ul>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/natural-earth-in-wagner-vii/">Natural Earth in Wagner VII</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/downloads-are-404ing/">Downloads are 404ing</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/disputed-territories-type-field/">Disputed Territories: "type" field</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/iso-code-confusion/">ISO code confusion</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/bad-adm1name-encoding-in-version-3-0-0-and-missing-diacritics-in-name/">Bad ADM1NAME, encoding in version 3.0.0 and missing diacritics in NAME</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/u-s-county-shape-file-2/">U.S. County Shape File</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/projection-proportion-compatibility/">Projection / Proportion / Compatibility?</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/download-urls-double-slash/">Download URLs – double slash</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/map-soft-writer-me/">map soft – writer: me</a>
</li>
<li>
<a class="bbp-forum-title" href="http://www.naturalearthdata.com/forums/topic/unicode-encoding-issue-ne_10m_lakes-dbf/">Unicode encoding issue – ne_10m_lakes.dbf</a>
</li>
</ul>
</li></ul><ul><li id='bbpresswptweaks_login_links_widget-3' class='widget bbpresswptweaks_login_links_widget'><h2 class="widgettitle">Forum Login</h2>
<div class="bbp-template-notice">
<a href="http://www.naturalearthdata.com/wp-login.php?redirect_to=/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/" rel="nofollow">Log in</a>
- or -
<a href="http://www.naturalearthdata.com/wp-login.php?action=register" rel="nofollow">Register</a>
</div></li></ul> </div>
</div>
<hr />
<div id="footer">
<div id="footerarea">
<div id="footerlogos">
<p>Supported by:</p>
<div class="footer-ad-box">
<a href="http://www.nacis.org" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/nacis.png" alt="NACIS" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.cartotalk.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/cartotalk_ad.png" alt="Cartotalk" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.mapgiving.org" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/mapgiving.png" alt="Mapgiving" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.geography.wisc.edu/cartography/" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/wisconsin.png" alt="University of Wisconsin Madison - Cartography Dept." /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.shadedrelief.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/shaded_relief.png" alt="Shaded Relief" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.xnrproductions.com " target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/xnr.png" alt="XNR Productions" /></a>
</div>
<p style="clear:both;"></p>
<div class="footer-ad-box">
<a href="http://www.freac.fsu.edu" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/fsu.png" alt="Florida State University - FREAC" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.springercartographics.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/scllc.png" alt="Springer Cartographics LLC" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.washingtonpost.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/wpost.png" alt="Washington Post" /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.redgeographics.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/redgeo.png" alt="Red Geographics" /></a>
</div>
<div class="footer-ad-box">
<a href="http://kelsocartography.com/blog " target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/kelso.png" alt="Kelso Cartography" /></a>
</div>
<p style="clear:both;"></p>
<div class="footer-ad-box">
<a href="http://www.avenza.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/avenza.png" alt="Avenza Systems Inc." /></a>
</div>
<div class="footer-ad-box">
<a href="http://www.stamen.com" target="_blank"><img src="http://www.naturalearthdata.com/wp-content/themes/NEV/images/stamen_ne_logo.png" alt="Stamen Design" /></a>
</div>
</div>
<p style="clear:both;"></p>
<span id="footerleft">
© 2009 - 2017. Natural Earth. All rights reserved.
</span>
<span id="footerright">
<!-- Please help promote WordPress and simpleX. Do not remove -->
<div>Powered by <a href="http://wordpress.org/">WordPress</a></div>
<div><a href="http://www.naturalearthdata.com/wp-admin">Staff Login »</a></div>
</span>
</div>
</div>
<script type='text/javascript' src='http://www.naturalearthdata.com/wp-includes/js/wp-embed.min.js?ver=4.4.11'></script>
</body>
</html>
<!--Generated by Endurance Page Cache--> | {
"pile_set_name": "Github"
} |
#!/usr/bin/env python3
"""
A program to filter tweets that contain links to a web archive. At the moment it
supports archive.org and archive.is, but please add more if you want!
"""
import json
import fileinput
archives = [
'archive.is',
'web.archive.org',
'wayback.archive.org'
]
for line in fileinput.input():
tweet = json.loads(line)
for url in tweet['entities']['urls']:
for host in archives:
if host in url['expanded_url']:
print(line, end='')
done = True
# prevent outputting same data twice if it contains
# multiple archive urls
if done:
break
| {
"pile_set_name": "Github"
} |
<testcase>
<info>
<keywords>
FTP
HTTPS-proxy
</keywords>
</info>
# Server-side
<reply>
# This is the HTTPS proxy response
<connect>
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Type: text/html
Funny-head: yesyes
Content-Length: 0
</connect>
# This is the FTP server response. The Life and Adventures of Robinson Crusoe
<data>
I was born in the year 1632, in the city of York, of a good family, though not
of that country, myfather being a foreigner of Bremen, who settled first at
Hull. He got a good estate by merchandise,and leaving off his trade, lived
afterwards at York, from whence he had married my mother, whoserelations were
named Robinson, a very good family in that country, and from whom I was
calledRobinson Kreutznaer; but, by the usual corruption of words in England,
we are now called—nay wecall ourselves and write our name—Crusoe; and so my
companions always called me.
</data>
</reply>
# Client-side
<client>
<server>
ftp
https-proxy
</server>
<name>
FTP through HTTPS-proxy
</name>
<command>
-p -x https://%HOSTIP:%HTTPSPROXYPORT ftp://ftp.site.thru.https.proxy:%FTPPORT/1631 --proxy-insecure
</command>
<features>
http
proxy
</features>
</client>
# Verify data after the test has been "shot"
<verify>
# The second CONNECT will be made to the dynamic port number the FTP server
# opens for us, so we can't compare with a known pre-existing number!
<strippart>
s/((https.proxy):(\d+))/$2:12345/
s/^(User-Agent: curl).*/$1/
</strippart>
<proxy>
CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1
Host: ftp.site.thru.https.proxy:12345
User-Agent: curl
Proxy-Connection: Keep-Alive
CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1
Host: ftp.site.thru.https.proxy:12345
User-Agent: curl
Proxy-Connection: Keep-Alive
</proxy>
<protocol>
USER anonymous
PASS [email protected]
PWD
EPSV
TYPE I
SIZE 1631
RETR 1631
QUIT
</protocol>
</verify>
</testcase>
| {
"pile_set_name": "Github"
} |
---
# required metadata
title: Credit holds for sales orders
description: This topic describes the setup of rules used to place a sales order on credit hold.
author: mikefalkner
manager: AnnBe
ms.date: 01/25/2019
ms.topic: article
ms.prod:
ms.service: dynamics-ax-applications
ms.technology:
# optional metadata
# ms.search.form:
# ROBOTS:
audience: Application User
# ms.devlang:
ms.reviewer: roschloma
ms.search.scope: Core, Operations
# ms.tgt_pltfrm:
# ms.custom:
# ms.assetid:
ms.search.region: Global
# ms.search.industry:
ms.author: mfalkner
ms.search.validFrom:
ms.dyn365.ops.version:
---
# Credit holds for sales orders
[!include [banner](../includes/banner.md)]
This topic describes the setup of rules used to place a sales order on credit hold. The credit management blocking rules can apply to an individual customer, or a group of customers. Blocking rules define responses to the following circumstances:
1. Number of days overdue
2. Accounts status
3. Terms of payment
4. Credit limit expired
5. Overdue amount
6. Sales order amount
7. Portion of available credit used
In addition, there are two parameters that control additional scenarios that will block a sales order
1. Change in payment terms
2. Change in settlement discounts
## Set up blocking rules and exclusion rules
When a customer initiates a sales transaction, the information on the sales order is reviewed against a set of blocking rules that guide the decision of whether or not to extend credit to the customer and allow the sale to move forward. You can also define exclusions that will override the blocking rules and allow a sales order to be processed. You can set up blocking rules and exclusion rules on the **Credit management > Setup > Credit management setup > Blocking rules** page.
### Days overdue
Open the **Days overdue** tab if the blocking rule applies to customer with one or more invoices that have been past due for a certain number of days.
1. Select the range of customer that this rule is **Valid for**.
- Select **Table** if the rule applies to a specific customer.
- Select **Group** if the rule is applied at the customer group level.
- Select **All** if the rule applies to all customers.
2. When you have specified the range, you must specify the **Account/group** that will be used in the range.
- For the **Table** range, the lookup will provide a list of customers to select.
- Select a **Group** if the rule applies to a customer credit group.
- Select **All** if the rule applies to all customers.
3. Select **Risk group** to use criteria for applying a credit management hold on customers that are grouped by a common set of factors, such as their Dun and Bradstreet rating, the number of years that they've been in business, the amount of time they've been your customer, and so on.
4. Select the type of rule that you are setting up. The **Blocking** option will create a rule that blocks an order. The **Exclusion** option will create a rule that will exclude another rule from blocking an order.
5. Select a **Value type**. The default entry is a fixed number of days. If you are creating an exclusion, you can specify a fixed number of days or an amount instead.
6. Enter the number of days **Overdue** that will be allowed for the selected blocking rule before an order is placed on credit management hold for review. The number of days overdue represents an additional number of grace days that are added to the number of days beyond the payment due date that the invoice can have before it is considered overdue. If you specified the **Value type** as an amount for an exclusion, then enter an amount and a currency for that amount.
### Accounts status
Open the **Account status** tab if the blocking rule applies to a customer with the selected account status.
1. Select the type of rule that you are setting up. **Blocking** will create a rule that blocks an order. **Exclusion** creates a rule that will exclude a rule from blocking an order.
2. Select the **Account status** that will cause the rule to place a sales order on hold or to exclude it.
### Terms of payment
Select **Terms of payment** if the blocking rule applies to the selected payment term.
1. Select the type of rule that you are setting up. **Blocking** will create a rule that blocks an order. **Exclusion** creates a rule that will exclude a rule from blocking an order.
2. Select the **Terms of payment** that will cause the rule to place a sales order on hold or to exclude it.
### Credit limit expired
Open the **Credit limit expired** tab if the blocking rule applies to customers with credit limits that have expired.
1. Select the range of customer that this rule is **Valid for**.
- Select **Table** if the rule applies to a specific customer.
- Select **Group** if the rule is applied at the Customer group level.
- Select **All** if the rule applies to all customers.
2. Once you have specified the range, you must specify the **Account/group** used in the range.
- For the **Table** range, the lookup will provide a list of customers to select from.
- Select a **Group** if the rule applies to a customer credit management group.
- Select **All** if the rule applies to all customers.
3. Select a **Risk group** to further limit the list of customers that will be placed on credit management hold.
4. Select the type of rule that you are setting up.
- Select **Blocking** to create a rule that blocks an order.
- Select **Exclusion** to create a rule that will exclude another rule from blocking an order.
5. Enter the **Days credit limit expired** for the selected blocking rule before an order is placed on credit management hold. The number of days overdue represents additional grace days that are added to the number of days that the credit limit has been expired.
### Overdue amount
Open the **Overdue Amount** tab if the blocking rule applies to customers with overdue amounts.
1. Select the range of customer that this rule is **Valid for**.
- Select **Table** if the rule applies to a specific customer.
- Select **Group** if the rule is applied at the Customer group level.
- Select **All** if the rule applies to all customers.
2. Once you have specified the range, you must specify the **Account/group** used in the range.
- For the **Table** range, the lookup will provide a customer lookup.
- Select a **Group** if the rule applies to a customer credit management group.
- Select **All** if the rule applies to all customers.
3. Select a **Risk group** if you want to further limit the list of customers that go on credit management hold.
4. Select the type of rule that you are setting up.
- Select **Blocking** to create a rule that blocks an order.
- Select **Exclusion** to create a rule that will exclude another rule from blocking an order.
5. Enter the **Overdue amount** for the selected blocking rule before an order is placed on credit management hold for review.
6. Select the **Value type** that defines the type of value that will be used to also test how much of the credit limit has been used. Blocking rules require a percentage but an exclusion can have a fixed amount or percentage. The Threshold relates to the Credit limit.
7. Enter the **Credit limit threshold** value for the selected rule before a customer goes on credit management hold. This can be an amount or a percentage based on the value type select in the value type.
8. The rule checks that the **Overdue amount** is exceeded and the **Credit limit threshold** is exceeded.
### Sales order
Select **Sales order** if the blocking rule applies to value of the sales order.
1. Select the range of customer that this rule is **Valid for**.
- Select **Table** if the rule applies to a specific customer.
- Select **Group** if the rule is applied at the Customer group level.
- Select **All** if the rule applies to all customers.
2. Once you have specified the range, you must specify the **Account/group** used in the range.
- For the **Table** range, the lookup will provide a customer lookup.
- Select a **Group** if the rule applies to a customer credit management group.
- Select **All** if the rule applies to all customers.
3. Select a **Risk group** if you want to further limit the list of customers that go on credit management hold.
4. Select the type of rule that you are setting up.
- Select **Blocking** to create a rule that blocks an order.
- Select **Exclusion** to create a rule that will exclude another rule from blocking an order.
5. Enter the **Sales order amount** for the selected blocking rule before an order is placed on credit management hold.
The sales order rule includes an additional setting that overrides all other rules. To create an exclusion that will release the sales order without taking into effects any other rules, select the **Release sales order** check box on the exclusion line.
### Credit limit used
Select **Credit limit used** if the blocking rule applies to the customer credit limit amount utilized.
1. Select the range of customer that this rule is **Valid for**.
- Select **Table** if the rule applies to a specific customer.
- Select **Group** if the rule is applied at the Customer group level.
- Select **All** if the rule applies to all customers.
2. Once you have specified the range, you must specify the **Account/group** used in the range.
- For the **Table** range, the lookup will provide a customer lookup.
- Select a **Group** if the rule applies to a customer credit management group.
- Select **All** if the rule applies to all customers.
3. Select a **Risk group** if you want to further limit the list of customers that go on credit management hold.
4. Select the type of rule that you are setting up.
- Select **Blocking** to create a rule that blocks an order.
- Select **Exclusion** to create a rule that will exclude another rule from blocking an order.
5. Select the **Threshold remaining** that defines the percentage of the credit limit that will block the sales order. If the value of an order increases the amount of the credit limit used above the percentage, then the order will be placed on hold.
## Put a sales order on hold based on other criteria
### Rank payment terms
You can force the credit control rules to be executed when payment terms are changed. You must rank the payment terms and assign them a ranking value. If you change the payment terms on the order to payment terms that are ranked higher than the old payment terms, then the order will be sent to credit management and require approval.
You can set up the payment terms rankings on the **Credit management > Setup > Credit management setup > Rank payment terms** page.
1. Select payment terms the **Terms of payment** field to rank; when you select a term, the description will be displayed in the **Description** field.
2. Select the term's rank in the **Rank** field. The values are all relative to each other so you can use 1,2,3 or 10,20,30. You can also use the same value for most of the terms of payment so that only one or two terms of payment will trigger the credit check.
### Rank settlement discounts
You can force the credit control rules to be executed when settlement discounts are changed. You must rank the settlement discounts and assign them a ranking value. If you change the settlement discounts on the order to settlement discounts that are ranked higher than the old settlement discounts, then the order will be sent to credit management and require approval.
You can set up the payment terms rankings on the **Credit management > Setup > Credit management setup > Rank settlement discounts** page.
1. Select the **Cash discount** that you want to rank. The **Description** of the settlement discount will be displayed.
2. Select the **Rank** value. The values are all relative to each other so you can use 1,2,3 or 10,20,30. You can also use the same value for most of the settlement discounts so that only one or two settlement discounts will trigger the credit check.
## Sequence the application of rules
Rules are run in a specific order that you change to suit the needs of your organization.
- One instance of the Sales order exclusion rules lets you override all rules that might block a sales order. Create a sales order exclusion rule and mark the **Release Sales order** option. The order will not be put on hold if that exclusion rule is true, and no other rules will be checked.
- Blocking rules can place the order on hold.
- Exclusion rules are run after blocking rules. Exclusion rules will only affect the rule on which they are defined.
- Blocking and exclusion rules are run in Table, then Group, then All order. Because of this order of processing, it is possible to have a blocking rule at the All level that will not be run because an exclusion rule at the Table or Group level is run.
- Exclusions do not override the blocking rule if they are at the same level. For example, an exclusion rule at the group level will not override the blocking rule at the group level. You will not need to set up exclusions at the All level except as noted above with the one instance of the sales order exclusion rule.
The behavior of the **Credit limit used** rule will change based on the settings for the **Check credit limit for sales order** parameter found in the Credit and Collections parameter form.
- If the parameter is set to No, then the Credit limit used rule will not be run.
- If the parameter is set to Yes and the **Message when exceeding credit limit** is set to warning, then you will get a warning when the credit limit is exceeded. The **Credit limit used** rules will be run to see if you have rules that you want to be run. However, for this scenario, you would normally not add any rules.
- If the parameter is set to Yes and the **Message when exceeding credit limit** is set to error, then the credit limit will be checked and the order will be put on hold if credit limit is exceeded. In addition, the **Credit limit used** rules will be run to see if there are additional rules that should be run. An error message won't display, but the **Exceeded credit limit** blocking reason will be shown.
## Settings that will change the way an order is placed on hold
Orders can be excluded from credit management even if there are rules in place.
- If you change the settings **Exclude customer from credit management** in **All customers > Select a customer > Credit and collections** FastTab to **Yes**, then no orders for that customer will be processed
- If you change the value **Exclude from credit management** on the **sales orders header** in the **Credit management fast tab** to **Yes**, then the credit management rules will not be processed. This setting can only be done by the credit clerk or credit manager.
## Processing orders on hold using the credit management hold list
The Credit management hold list lets credit managers view all sales orders that have been placed on hold and lets them remove the holds when the credit issues have been mitigated. The **Credit management hold list** page shows all sales orders that have been placed on hold. You can view the hold list on the **All credit holds** page (**Credit management > Credit management hold list > All credit holds**).
Sales orders from all legal entities are sent to the same credit management hold list, providing a centralized view of all transactions that require attention. Users will only see information for the legal entities that they have access to.
A sales order can be placed in the hold list for the following reasons:
1. The customer has an invoice that has been overdue for a specified number of days.
2. The order has a specific account status.
3. The order has specific terms of payment.
4. The customer has an expired credit limit.
5. The customer has an overdue amount and has used a specified percentage of its credit limit
6. The sales order exceeds a certain amount.
7. The customer has exceeded a certain percentage of its credit limit.
8. The payment terms differ from the default payment terms for the customer.
9. The settlement discounts differ from the default settlement discount for the customer.
The blocking reason is displayed for each sales order in the hold list. If there are more than one reason for the hold, the reason will show as **Multiple**. You can use the **Blocking reasons** menu on the Action Pane to view all of the reasons why the sales order was placed on hold. You can also view the **Blocking reasons** in a FactBox.
### Releasing orders from the hold list for processing
When you have researched the reasons for the hold and you have mitigated them, you can release the sales orders for further processing.
1) Select a line in the hold list. You can release multiple orders by selecting more than one line.
2) Select a **Release reason** for the order that has been selected for release.
3) Enter the **Review date** for each order that has been selected for release.
4) Select the **Release** menu on the action pane to release an order. This menu will only be available after transactions have been selected. The user is presented with two options:
- Select **With posting** to remove the hold and post the document using the same posting process that was used when it was placed on hold. For example, if the sales order confirmation was placed on hold, the sales order confirmation would be completed after the release. The sales order posting form will be displayed allowing the user to post the confirmation.
- Select **Without posting** to remove the hold without doing any further processing. The sales order can be manually posted.
### Rejecting orders in the hold list
You can use the **Reject** menu on the action pane to reject a sales order
1. Select a line in the hold list. You can release multiple orders by selecting more than one line.
2. The order will be removed from the hold list and the sales order header will be updated to show that the order was rejected.
### Automatically releasing credit management holds
Sales orders are placed in the hold list based on the blocking rules. However, some reasons for the holds may changes over time if the sales order remains in the hold list for a period of time. For example, a customer may pay their bill, freeing up their credit limit.
You can use the **Evaluate for release** menu to review the sales orders in the hold list and automatically release them if the reason for the hold has been mitigated.
1. Select the **Evaluate for release** menu
2. Select **Process blocking rules** to review all of the sales orders. Select **Process blocking rules for selected lines** to review only the lines that you have selected.
3. A slider will appear so that you can select a single customer. Leave the customer drop down blank for all customers.
4. When you click ok, the process is run in the background and you can continue working on other tasks. If you select batch processing before you click on Ok, the process will run in batch when you click Ok. It may take some time to process the orders on hold in the list so use Refresh to update the status of the orders.
5. If a blocking reason no longer is applicable for an order, the blocking reason will be considered no longer valid and you will no longer see a check mark next to the reason when you view the blocking reasons.
6. If all of the blocking reasons are cleared, then a new reason, **Ready to release**, is added to the list of blocking reasons. The sales order can be automatically released.
7. If the **Automatically release** parameter in **Credit and collections > Setup > Credit and collections parameters > Credit > Auto release** tab is set to **With posting**, then you will be prompted to post using the posting form for the document that was blocked.
8. If the **Automatically release** parameter in **Credit and collections > Setup > Credit and collections parameters > Credit > Auto release** tab is set to **Without posting**, then you must post the order manually.
### Credit management approval workflow
You can also create **Credit management workflows** to control the release of credit holds. Once you have set up workflow using the **Credit management > Setup > Credit management workflows** page, the orders marked for release or rejection will be sent to workflow where they must be approved first before they will be released or rejected.
If you include the tasks for release with posting or release without posting in your workflow, the workflow approval will also release the sales order. However, if there is a failure in the release process due to missing setup information or other causes, you will need to recall the sales order from workflow, fix the issue that caused the failure, and then submit the order to workflow again.
If you do not include the tasks for release with posting or release without posting in your workflow, the workflow approval process will simply enable you to release the sales order manually once the approval is complete.
### Forced credit hold
At times, sales orders may need to be blocked even though the order does not meet the criteria of the blocking rules. For example, a credit manager may be notified of a non-credit related issue with the customer and decide to manually put orders on hold immediately until the issue is cleared up. You can manually force a sales order to be on hold if that situation occurs.
1. Open the sales order that you want to place on hold.
2. Select **Force credit hold** in the **Credit management** tab on the **Credit management** action pane.
3. Select a **Forced Hold Reason**.
4. Click **OK.** The sales order will be returned to the Credit Management Hold list.
You can also force multiple orders to be on hold using the **Credit management > Periodic tasks > Force Credit Hold** page. For example, you can place all sales orders on hold for a specific customer.
1. Select the **Forced hold reason**.
2. Click **Records to include** to select the sales orders to place on hold.
3. Click **OK** to process the selected sales orders.
Sales orders that have been forced on hold cannot be processed with workflow.
#### Releasing orders that were added to the credit management hold list with a forced credit hold
Sales orders that have a forced hold reason cannot be released automatically. If the sales order was forced on hold and you have used a process that automatically releases sales orders, the sales order will show as **Ready to release** and remain in the hold list. You must use the **Release** menu to release the order.
## Free text invoices, orders, and project invoice support in Credit management
Credit management can only be used currently for sales orders. Free text invoices, point of sales orders and call center orders will use the temporary credit limits and insurance/guarantees that you add to adjust the credit limit. They will not use the blocking rules and they will not be placed in the hold list if there is an issue with the credit limit.
There is no support for project invoices in credit management.
| {
"pile_set_name": "Github"
} |
'use strict';
/**
* count_indexed.js
*
* Runs count on an indexed field (using hint), which results in an index scan,
* and verifies the result.
* Each thread picks a random 'modulus' in range [5, 10]
* and a random 'countPerNum' in range [50, 100]
* and then inserts 'modulus * countPerNum' documents. [250, 1000]
* Each thread inserts docs into a unique collection.
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
load('jstests/concurrency/fsm_workloads/count.js'); // for $config
load('jstests/concurrency/fsm_workload_helpers/drop_utils.js'); // for dropCollections
var $config = extendWorkload(
$config,
function($config, $super) {
$config.data.prefix = 'count_fsm';
$config.data.shardKey = {
tid: 1,
i: 1
};
$config.data.getCount = function getCount(db, predicate) {
var query = Object.extend({tid: this.tid}, predicate);
return db[this.threadCollName].find(query).hint({tid: 1, i: 1}).count();
};
$config.states.init = function init(db, collName) {
this.threadCollName = this.prefix + '_' + this.tid;
$super.states.init.apply(this, arguments);
assertAlways.commandWorked(db[this.threadCollName].ensureIndex({tid: 1, i: 1}));
};
$config.teardown = function teardown(db, collName) {
var pattern = new RegExp('^' + this.prefix + '_\\d+$');
dropCollections(db, pattern);
$super.teardown.apply(this, arguments);
};
return $config;
});
| {
"pile_set_name": "Github"
} |
# findBadExternals.tcl --
#
# This script scans the Tcl load library for exported symbols
# that do not begin with 'Tcl' or 'tcl'. It reports them on the
# standard output. It is used to make sure that the library does
# not inadvertently export externals that may be in conflict with
# other code.
#
# Usage:
#
# tclsh findBadExternals.tcl /path/to/tclXX.so-or-.dll
#
# Copyright (c) 2005 George Peter Staplin and Kevin Kenny
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#----------------------------------------------------------------------
proc main {argc argv} {
if {$argc != 1} {
puts stderr "syntax is: [info script] libtcl"
return 1
}
switch -exact -- $::tcl_platform(platform) {
unix -
macosx {
set status [catch {
exec nm --extern-only --defined-only [lindex $argv 0]
} result]
}
windows {
set status [catch {
exec dumpbin /exports [lindex $argv 0]
} result]
}
}
if {$status != 0 && $::errorCode ne "NONE"} {
puts $result
return 1
}
foreach line [split $result \n] {
if {! [string match {* [Tt]cl*} $line]} {
puts $line
}
}
return 0
}
exit [main $::argc $::argv]
| {
"pile_set_name": "Github"
} |
/*! =========================================================
* bootstrap-slider.js
*
* Maintainers:
* Kyle Kemp
* - Twitter: @seiyria
* - Github: seiyria
* Rohit Kalkur
* - Twitter: @Rovolutionary
* - Github: rovolution
*
* =========================================================
*
* 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.
* ========================================================= */
/**
* Bridget makes jQuery widgets
* v1.0.1
* MIT license
*/
(function(root, factory) {
if(typeof define === "function" && define.amd) {
define(["jquery"], factory);
}
else if(typeof module === "object" && module.exports) {
var jQuery;
try {
jQuery = require("jquery");
}
catch (err) {
jQuery = null;
}
module.exports = factory(jQuery);
}
else {
root.Slider = factory(root.jQuery);
}
}(this, function($) {
// Reference to Slider constructor
var Slider;
(function( $ ) {
'use strict';
// -------------------------- utils -------------------------- //
var slice = Array.prototype.slice;
function noop() {}
// -------------------------- definition -------------------------- //
function defineBridget( $ ) {
// bail if no jQuery
if ( !$ ) {
return;
}
// -------------------------- addOptionMethod -------------------------- //
/**
* adds option method -> $().plugin('option', {...})
* @param {Function} PluginClass - constructor class
*/
function addOptionMethod( PluginClass ) {
// don't overwrite original option method
if ( PluginClass.prototype.option ) {
return;
}
// option setter
PluginClass.prototype.option = function( opts ) {
// bail out if not an object
if ( !$.isPlainObject( opts ) ){
return;
}
this.options = $.extend( true, this.options, opts );
};
}
// -------------------------- plugin bridge -------------------------- //
// helper function for logging errors
// $.error breaks jQuery chaining
var logError = typeof console === 'undefined' ? noop :
function( message ) {
console.error( message );
};
/**
* jQuery plugin bridge, access methods like $elem.plugin('method')
* @param {String} namespace - plugin name
* @param {Function} PluginClass - constructor class
*/
function bridge( namespace, PluginClass ) {
// add to jQuery fn namespace
$.fn[ namespace ] = function( options ) {
if ( typeof options === 'string' ) {
// call plugin method when first argument is a string
// get arguments for method
var args = slice.call( arguments, 1 );
for ( var i=0, len = this.length; i < len; i++ ) {
var elem = this[i];
var instance = $.data( elem, namespace );
if ( !instance ) {
logError( "cannot call methods on " + namespace + " prior to initialization; " +
"attempted to call '" + options + "'" );
continue;
}
if ( !$.isFunction( instance[options] ) || options.charAt(0) === '_' ) {
logError( "no such method '" + options + "' for " + namespace + " instance" );
continue;
}
// trigger method with arguments
var returnValue = instance[ options ].apply( instance, args);
// break look and return first value if provided
if ( returnValue !== undefined && returnValue !== instance) {
return returnValue;
}
}
// return this if no return value
return this;
} else {
var objects = this.map( function() {
var instance = $.data( this, namespace );
if ( instance ) {
// apply options & init
instance.option( options );
instance._init();
} else {
// initialize new instance
instance = new PluginClass( this, options );
$.data( this, namespace, instance );
}
return $(this);
});
if(!objects || objects.length > 1) {
return objects;
} else {
return objects[0];
}
}
};
}
// -------------------------- bridget -------------------------- //
/**
* converts a Prototypical class into a proper jQuery plugin
* the class must have a ._init method
* @param {String} namespace - plugin name, used in $().pluginName
* @param {Function} PluginClass - constructor class
*/
$.bridget = function( namespace, PluginClass ) {
addOptionMethod( PluginClass );
bridge( namespace, PluginClass );
};
return $.bridget;
}
// get jquery from browser global
defineBridget( $ );
})( $ );
/*************************************************
BOOTSTRAP-SLIDER SOURCE CODE
**************************************************/
(function($) {
var ErrorMsgs = {
formatInvalidInputErrorMsg : function(input) {
return "Invalid input value '" + input + "' passed in";
},
callingContextNotSliderInstance : "Calling context element does not have instance of Slider bound to it. Check your code to make sure the JQuery object returned from the call to the slider() initializer is calling the method"
};
var SliderScale = {
linear: {
toValue: function(percentage) {
var rawValue = percentage/100 * (this.options.max - this.options.min);
if (this.options.ticks_positions.length > 0) {
var minv, maxv, minp, maxp = 0;
for (var i = 0; i < this.options.ticks_positions.length; i++) {
if (percentage <= this.options.ticks_positions[i]) {
minv = (i > 0) ? this.options.ticks[i-1] : 0;
minp = (i > 0) ? this.options.ticks_positions[i-1] : 0;
maxv = this.options.ticks[i];
maxp = this.options.ticks_positions[i];
break;
}
}
if (i > 0) {
var partialPercentage = (percentage - minp) / (maxp - minp);
rawValue = minv + partialPercentage * (maxv - minv);
}
}
var value = this.options.min + Math.round(rawValue / this.options.step) * this.options.step;
if (value < this.options.min) {
return this.options.min;
} else if (value > this.options.max) {
return this.options.max;
} else {
return value;
}
},
toPercentage: function(value) {
if (this.options.max === this.options.min) {
return 0;
}
if (this.options.ticks_positions.length > 0) {
var minv, maxv, minp, maxp = 0;
for (var i = 0; i < this.options.ticks.length; i++) {
if (value <= this.options.ticks[i]) {
minv = (i > 0) ? this.options.ticks[i-1] : 0;
minp = (i > 0) ? this.options.ticks_positions[i-1] : 0;
maxv = this.options.ticks[i];
maxp = this.options.ticks_positions[i];
break;
}
}
if (i > 0) {
var partialPercentage = (value - minv) / (maxv - minv);
return minp + partialPercentage * (maxp - minp);
}
}
return 100 * (value - this.options.min) / (this.options.max - this.options.min);
}
},
logarithmic: {
/* Based on http://stackoverflow.com/questions/846221/logarithmic-slider */
toValue: function(percentage) {
var min = (this.options.min === 0) ? 0 : Math.log(this.options.min);
var max = Math.log(this.options.max);
var value = Math.exp(min + (max - min) * percentage / 100);
value = this.options.min + Math.round((value - this.options.min) / this.options.step) * this.options.step;
/* Rounding to the nearest step could exceed the min or
* max, so clip to those values. */
if (value < this.options.min) {
return this.options.min;
} else if (value > this.options.max) {
return this.options.max;
} else {
return value;
}
},
toPercentage: function(value) {
if (this.options.max === this.options.min) {
return 0;
} else {
var max = Math.log(this.options.max);
var min = this.options.min === 0 ? 0 : Math.log(this.options.min);
var v = value === 0 ? 0 : Math.log(value);
return 100 * (v - min) / (max - min);
}
}
}
};
/*************************************************
CONSTRUCTOR
**************************************************/
Slider = function(element, options) {
createNewSlider.call(this, element, options);
return this;
};
function createNewSlider(element, options) {
/*
The internal state object is used to store data about the current 'state' of slider.
This includes values such as the `value`, `enabled`, etc...
*/
this._state = {
value: null,
enabled: null,
offset: null,
size: null,
percentage: null,
inDrag: false,
over: false
};
if(typeof element === "string") {
this.element = document.querySelector(element);
} else if(element instanceof HTMLElement) {
this.element = element;
}
/*************************************************
Process Options
**************************************************/
options = options ? options : {};
var optionTypes = Object.keys(this.defaultOptions);
for(var i = 0; i < optionTypes.length; i++) {
var optName = optionTypes[i];
// First check if an option was passed in via the constructor
var val = options[optName];
// If no data attrib, then check data atrributes
val = (typeof val !== 'undefined') ? val : getDataAttrib(this.element, optName);
// Finally, if nothing was specified, use the defaults
val = (val !== null) ? val : this.defaultOptions[optName];
// Set all options on the instance of the Slider
if(!this.options) {
this.options = {};
}
this.options[optName] = val;
}
/*
Validate `tooltip_position` against 'orientation`
- if `tooltip_position` is incompatible with orientation, swith it to a default compatible with specified `orientation`
-- default for "vertical" -> "right"
-- default for "horizontal" -> "left"
*/
if(this.options.orientation === "vertical" && (this.options.tooltip_position === "top" || this.options.tooltip_position === "bottom")) {
this.options.tooltip_position = "right";
}
else if(this.options.orientation === "horizontal" && (this.options.tooltip_position === "left" || this.options.tooltip_position === "right")) {
this.options.tooltip_position = "top";
}
function getDataAttrib(element, optName) {
var dataName = "data-slider-" + optName.replace(/_/g, '-');
var dataValString = element.getAttribute(dataName);
try {
return JSON.parse(dataValString);
}
catch(err) {
return dataValString;
}
}
/*************************************************
Create Markup
**************************************************/
var origWidth = this.element.style.width;
var updateSlider = false;
var parent = this.element.parentNode;
var sliderTrackSelection;
var sliderTrackLow, sliderTrackHigh;
var sliderMinHandle;
var sliderMaxHandle;
if (this.sliderElem) {
updateSlider = true;
} else {
/* Create elements needed for slider */
this.sliderElem = document.createElement("div");
this.sliderElem.className = "slider";
/* Create slider track elements */
var sliderTrack = document.createElement("div");
sliderTrack.className = "slider-track";
sliderTrackLow = document.createElement("div");
sliderTrackLow.className = "slider-track-low";
sliderTrackSelection = document.createElement("div");
sliderTrackSelection.className = "slider-selection";
sliderTrackHigh = document.createElement("div");
sliderTrackHigh.className = "slider-track-high";
sliderMinHandle = document.createElement("div");
sliderMinHandle.className = "slider-handle min-slider-handle";
sliderMinHandle.setAttribute('role', 'slider');
sliderMinHandle.setAttribute('aria-valuemin', this.options.min);
sliderMinHandle.setAttribute('aria-valuemax', this.options.max);
sliderMaxHandle = document.createElement("div");
sliderMaxHandle.className = "slider-handle max-slider-handle";
sliderMaxHandle.setAttribute('role', 'slider');
sliderMaxHandle.setAttribute('aria-valuemin', this.options.min);
sliderMaxHandle.setAttribute('aria-valuemax', this.options.max);
sliderTrack.appendChild(sliderTrackLow);
sliderTrack.appendChild(sliderTrackSelection);
sliderTrack.appendChild(sliderTrackHigh);
/* Add aria-labelledby to handle's */
var isLabelledbyArray = Array.isArray(this.options.labelledby);
if (isLabelledbyArray && this.options.labelledby[0]) {
sliderMinHandle.setAttribute('aria-labelledby', this.options.labelledby[0]);
}
if (isLabelledbyArray && this.options.labelledby[1]) {
sliderMaxHandle.setAttribute('aria-labelledby', this.options.labelledby[1]);
}
if (!isLabelledbyArray && this.options.labelledby) {
sliderMinHandle.setAttribute('aria-labelledby', this.options.labelledby);
sliderMaxHandle.setAttribute('aria-labelledby', this.options.labelledby);
}
/* Create ticks */
this.ticks = [];
if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
for (i = 0; i < this.options.ticks.length; i++) {
var tick = document.createElement('div');
tick.className = 'slider-tick';
this.ticks.push(tick);
sliderTrack.appendChild(tick);
}
sliderTrackSelection.className += " tick-slider-selection";
}
sliderTrack.appendChild(sliderMinHandle);
sliderTrack.appendChild(sliderMaxHandle);
this.tickLabels = [];
if (Array.isArray(this.options.ticks_labels) && this.options.ticks_labels.length > 0) {
this.tickLabelContainer = document.createElement('div');
this.tickLabelContainer.className = 'slider-tick-label-container';
for (i = 0; i < this.options.ticks_labels.length; i++) {
var label = document.createElement('div');
var noTickPositionsSpecified = this.options.ticks_positions.length === 0;
var tickLabelsIndex = (this.options.reversed && noTickPositionsSpecified) ? (this.options.ticks_labels.length - (i + 1)) : i;
label.className = 'slider-tick-label';
label.innerHTML = this.options.ticks_labels[tickLabelsIndex];
this.tickLabels.push(label);
this.tickLabelContainer.appendChild(label);
}
}
var createAndAppendTooltipSubElements = function(tooltipElem) {
var arrow = document.createElement("div");
arrow.className = "tooltip-arrow";
var inner = document.createElement("div");
inner.className = "tooltip-inner";
tooltipElem.appendChild(arrow);
tooltipElem.appendChild(inner);
};
/* Create tooltip elements */
var sliderTooltip = document.createElement("div");
sliderTooltip.className = "tooltip tooltip-main";
sliderTooltip.setAttribute('role', 'presentation');
createAndAppendTooltipSubElements(sliderTooltip);
var sliderTooltipMin = document.createElement("div");
sliderTooltipMin.className = "tooltip tooltip-min";
sliderTooltipMin.setAttribute('role', 'presentation');
createAndAppendTooltipSubElements(sliderTooltipMin);
var sliderTooltipMax = document.createElement("div");
sliderTooltipMax.className = "tooltip tooltip-max";
sliderTooltipMax.setAttribute('role', 'presentation');
createAndAppendTooltipSubElements(sliderTooltipMax);
/* Append components to sliderElem */
this.sliderElem.appendChild(sliderTrack);
this.sliderElem.appendChild(sliderTooltip);
this.sliderElem.appendChild(sliderTooltipMin);
this.sliderElem.appendChild(sliderTooltipMax);
if (this.tickLabelContainer) {
this.sliderElem.appendChild(this.tickLabelContainer);
}
/* Append slider element to parent container, right before the original <input> element */
parent.insertBefore(this.sliderElem, this.element);
/* Hide original <input> element */
this.element.style.display = "none";
}
/* If JQuery exists, cache JQ references */
if($) {
this.$element = $(this.element);
this.$sliderElem = $(this.sliderElem);
}
/*************************************************
Setup
**************************************************/
this.eventToCallbackMap = {};
this.sliderElem.id = this.options.id;
this.touchCapable = 'ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch);
this.tooltip = this.sliderElem.querySelector('.tooltip-main');
this.tooltipInner = this.tooltip.querySelector('.tooltip-inner');
this.tooltip_min = this.sliderElem.querySelector('.tooltip-min');
this.tooltipInner_min = this.tooltip_min.querySelector('.tooltip-inner');
this.tooltip_max = this.sliderElem.querySelector('.tooltip-max');
this.tooltipInner_max= this.tooltip_max.querySelector('.tooltip-inner');
if (SliderScale[this.options.scale]) {
this.options.scale = SliderScale[this.options.scale];
}
if (updateSlider === true) {
// Reset classes
this._removeClass(this.sliderElem, 'slider-horizontal');
this._removeClass(this.sliderElem, 'slider-vertical');
this._removeClass(this.tooltip, 'hide');
this._removeClass(this.tooltip_min, 'hide');
this._removeClass(this.tooltip_max, 'hide');
// Undo existing inline styles for track
["left", "top", "width", "height"].forEach(function(prop) {
this._removeProperty(this.trackLow, prop);
this._removeProperty(this.trackSelection, prop);
this._removeProperty(this.trackHigh, prop);
}, this);
// Undo inline styles on handles
[this.handle1, this.handle2].forEach(function(handle) {
this._removeProperty(handle, 'left');
this._removeProperty(handle, 'top');
}, this);
// Undo inline styles and classes on tooltips
[this.tooltip, this.tooltip_min, this.tooltip_max].forEach(function(tooltip) {
this._removeProperty(tooltip, 'left');
this._removeProperty(tooltip, 'top');
this._removeProperty(tooltip, 'margin-left');
this._removeProperty(tooltip, 'margin-top');
this._removeClass(tooltip, 'right');
this._removeClass(tooltip, 'top');
}, this);
}
if(this.options.orientation === 'vertical') {
this._addClass(this.sliderElem,'slider-vertical');
this.stylePos = 'top';
this.mousePos = 'pageY';
this.sizePos = 'offsetHeight';
} else {
this._addClass(this.sliderElem, 'slider-horizontal');
this.sliderElem.style.width = origWidth;
this.options.orientation = 'horizontal';
this.stylePos = 'left';
this.mousePos = 'pageX';
this.sizePos = 'offsetWidth';
}
this._setTooltipPosition();
/* In case ticks are specified, overwrite the min and max bounds */
if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
this.options.max = Math.max.apply(Math, this.options.ticks);
this.options.min = Math.min.apply(Math, this.options.ticks);
}
if (Array.isArray(this.options.value)) {
this.options.range = true;
this._state.value = this.options.value;
}
else if (this.options.range) {
// User wants a range, but value is not an array
this._state.value = [this.options.value, this.options.max];
}
else {
this._state.value = this.options.value;
}
this.trackLow = sliderTrackLow || this.trackLow;
this.trackSelection = sliderTrackSelection || this.trackSelection;
this.trackHigh = sliderTrackHigh || this.trackHigh;
if (this.options.selection === 'none') {
this._addClass(this.trackLow, 'hide');
this._addClass(this.trackSelection, 'hide');
this._addClass(this.trackHigh, 'hide');
}
this.handle1 = sliderMinHandle || this.handle1;
this.handle2 = sliderMaxHandle || this.handle2;
if (updateSlider === true) {
// Reset classes
this._removeClass(this.handle1, 'round triangle');
this._removeClass(this.handle2, 'round triangle hide');
for (i = 0; i < this.ticks.length; i++) {
this._removeClass(this.ticks[i], 'round triangle hide');
}
}
var availableHandleModifiers = ['round', 'triangle', 'custom'];
var isValidHandleType = availableHandleModifiers.indexOf(this.options.handle) !== -1;
if (isValidHandleType) {
this._addClass(this.handle1, this.options.handle);
this._addClass(this.handle2, this.options.handle);
for (i = 0; i < this.ticks.length; i++) {
this._addClass(this.ticks[i], this.options.handle);
}
}
this._state.offset = this._offset(this.sliderElem);
this._state.size = this.sliderElem[this.sizePos];
this.setValue(this._state.value);
/******************************************
Bind Event Listeners
******************************************/
// Bind keyboard handlers
this.handle1Keydown = this._keydown.bind(this, 0);
this.handle1.addEventListener("keydown", this.handle1Keydown, false);
this.handle2Keydown = this._keydown.bind(this, 1);
this.handle2.addEventListener("keydown", this.handle2Keydown, false);
this.mousedown = this._mousedown.bind(this);
if (this.touchCapable) {
// Bind touch handlers
this.sliderElem.addEventListener("touchstart", this.mousedown, false);
}
this.sliderElem.addEventListener("mousedown", this.mousedown, false);
// Bind tooltip-related handlers
if(this.options.tooltip === 'hide') {
this._addClass(this.tooltip, 'hide');
this._addClass(this.tooltip_min, 'hide');
this._addClass(this.tooltip_max, 'hide');
}
else if(this.options.tooltip === 'always') {
this._showTooltip();
this._alwaysShowTooltip = true;
}
else {
this.showTooltip = this._showTooltip.bind(this);
this.hideTooltip = this._hideTooltip.bind(this);
this.sliderElem.addEventListener("mouseenter", this.showTooltip, false);
this.sliderElem.addEventListener("mouseleave", this.hideTooltip, false);
this.handle1.addEventListener("focus", this.showTooltip, false);
this.handle1.addEventListener("blur", this.hideTooltip, false);
this.handle2.addEventListener("focus", this.showTooltip, false);
this.handle2.addEventListener("blur", this.hideTooltip, false);
}
if(this.options.enabled) {
this.enable();
} else {
this.disable();
}
}
/*************************************************
INSTANCE PROPERTIES/METHODS
- Any methods bound to the prototype are considered
part of the plugin's `public` interface
**************************************************/
Slider.prototype = {
_init: function() {}, // NOTE: Must exist to support bridget
constructor: Slider,
defaultOptions: {
id: "",
min: 0,
max: 10,
step: 1,
precision: 0,
orientation: 'horizontal',
value: 5,
range: false,
selection: 'before',
tooltip: 'show',
tooltip_split: false,
handle: 'round',
reversed: false,
enabled: true,
formatter: function(val) {
if (Array.isArray(val)) {
return val[0] + " : " + val[1];
} else {
return val;
}
},
natural_arrow_keys: false,
ticks: [],
ticks_positions: [],
ticks_labels: [],
ticks_snap_bounds: 0,
scale: 'linear',
focus: false,
tooltip_position: null,
labelledby: null
},
getElement: function() {
return this.sliderElem;
},
getValue: function() {
if (this.options.range) {
return this._state.value;
}
else {
return this._state.value[0];
}
},
setValue: function(val, triggerSlideEvent, triggerChangeEvent) {
if (!val) {
val = 0;
}
var oldValue = this.getValue();
this._state.value = this._validateInputValue(val);
var applyPrecision = this._applyPrecision.bind(this);
if (this.options.range) {
this._state.value[0] = applyPrecision(this._state.value[0]);
this._state.value[1] = applyPrecision(this._state.value[1]);
this._state.value[0] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[0]));
this._state.value[1] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[1]));
}
else {
this._state.value = applyPrecision(this._state.value);
this._state.value = [ Math.max(this.options.min, Math.min(this.options.max, this._state.value))];
this._addClass(this.handle2, 'hide');
if (this.options.selection === 'after') {
this._state.value[1] = this.options.max;
} else {
this._state.value[1] = this.options.min;
}
}
if (this.options.max > this.options.min) {
this._state.percentage = [
this._toPercentage(this._state.value[0]),
this._toPercentage(this._state.value[1]),
this.options.step * 100 / (this.options.max - this.options.min)
];
} else {
this._state.percentage = [0, 0, 100];
}
this._layout();
var newValue = this.options.range ? this._state.value : this._state.value[0];
if(triggerSlideEvent === true) {
this._trigger('slide', newValue);
}
if( (oldValue !== newValue) && (triggerChangeEvent === true) ) {
this._trigger('change', {
oldValue: oldValue,
newValue: newValue
});
}
this._setDataVal(newValue);
return this;
},
destroy: function(){
// Remove event handlers on slider elements
this._removeSliderEventHandlers();
// Remove the slider from the DOM
this.sliderElem.parentNode.removeChild(this.sliderElem);
/* Show original <input> element */
this.element.style.display = "";
// Clear out custom event bindings
this._cleanUpEventCallbacksMap();
// Remove data values
this.element.removeAttribute("data");
// Remove JQuery handlers/data
if($) {
this._unbindJQueryEventHandlers();
this.$element.removeData('slider');
}
},
disable: function() {
this._state.enabled = false;
this.handle1.removeAttribute("tabindex");
this.handle2.removeAttribute("tabindex");
this._addClass(this.sliderElem, 'slider-disabled');
this._trigger('slideDisabled');
return this;
},
enable: function() {
this._state.enabled = true;
this.handle1.setAttribute("tabindex", 0);
this.handle2.setAttribute("tabindex", 0);
this._removeClass(this.sliderElem, 'slider-disabled');
this._trigger('slideEnabled');
return this;
},
toggle: function() {
if(this._state.enabled) {
this.disable();
} else {
this.enable();
}
return this;
},
isEnabled: function() {
return this._state.enabled;
},
on: function(evt, callback) {
this._bindNonQueryEventHandler(evt, callback);
return this;
},
off: function(evt, callback) {
if($) {
this.$element.off(evt, callback);
this.$sliderElem.off(evt, callback);
} else {
this._unbindNonQueryEventHandler(evt, callback);
}
},
getAttribute: function(attribute) {
if(attribute) {
return this.options[attribute];
} else {
return this.options;
}
},
setAttribute: function(attribute, value) {
this.options[attribute] = value;
return this;
},
refresh: function() {
this._removeSliderEventHandlers();
createNewSlider.call(this, this.element, this.options);
if($) {
// Bind new instance of slider to the element
$.data(this.element, 'slider', this);
}
return this;
},
relayout: function() {
this._layout();
return this;
},
/******************************+
HELPERS
- Any method that is not part of the public interface.
- Place it underneath this comment block and write its signature like so:
_fnName : function() {...}
********************************/
_removeSliderEventHandlers: function() {
// Remove keydown event listeners
this.handle1.removeEventListener("keydown", this.handle1Keydown, false);
this.handle2.removeEventListener("keydown", this.handle2Keydown, false);
if (this.showTooltip) {
this.handle1.removeEventListener("focus", this.showTooltip, false);
this.handle2.removeEventListener("focus", this.showTooltip, false);
}
if (this.hideTooltip) {
this.handle1.removeEventListener("blur", this.hideTooltip, false);
this.handle2.removeEventListener("blur", this.hideTooltip, false);
}
// Remove event listeners from sliderElem
if (this.showTooltip) {
this.sliderElem.removeEventListener("mouseenter", this.showTooltip, false);
}
if (this.hideTooltip) {
this.sliderElem.removeEventListener("mouseleave", this.hideTooltip, false);
}
this.sliderElem.removeEventListener("touchstart", this.mousedown, false);
this.sliderElem.removeEventListener("mousedown", this.mousedown, false);
},
_bindNonQueryEventHandler: function(evt, callback) {
if(this.eventToCallbackMap[evt] === undefined) {
this.eventToCallbackMap[evt] = [];
}
this.eventToCallbackMap[evt].push(callback);
},
_unbindNonQueryEventHandler: function(evt, callback) {
var callbacks = this.eventToCallbackMap[evt];
if(callbacks !== undefined) {
for (var i = 0; i < callbacks.length; i++) {
if (callbacks[i] === callback) {
callbacks.splice(i, 1);
break;
}
}
}
},
_cleanUpEventCallbacksMap: function() {
var eventNames = Object.keys(this.eventToCallbackMap);
for(var i = 0; i < eventNames.length; i++) {
var eventName = eventNames[i];
this.eventToCallbackMap[eventName] = null;
}
},
_showTooltip: function() {
if (this.options.tooltip_split === false ){
this._addClass(this.tooltip, 'in');
this.tooltip_min.style.display = 'none';
this.tooltip_max.style.display = 'none';
} else {
this._addClass(this.tooltip_min, 'in');
this._addClass(this.tooltip_max, 'in');
this.tooltip.style.display = 'none';
}
this._state.over = true;
},
_hideTooltip: function() {
if (this._state.inDrag === false && this.alwaysShowTooltip !== true) {
this._removeClass(this.tooltip, 'in');
this._removeClass(this.tooltip_min, 'in');
this._removeClass(this.tooltip_max, 'in');
}
this._state.over = false;
},
_layout: function() {
var positionPercentages;
if(this.options.reversed) {
positionPercentages = [ 100 - this._state.percentage[0], this.options.range ? 100 - this._state.percentage[1] : this._state.percentage[1]];
}
else {
positionPercentages = [ this._state.percentage[0], this._state.percentage[1] ];
}
this.handle1.style[this.stylePos] = positionPercentages[0]+'%';
this.handle1.setAttribute('aria-valuenow', this._state.value[0]);
this.handle2.style[this.stylePos] = positionPercentages[1]+'%';
this.handle2.setAttribute('aria-valuenow', this._state.value[1]);
/* Position ticks and labels */
if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
var styleSize = this.options.orientation === 'vertical' ? 'height' : 'width';
var styleMargin = this.options.orientation === 'vertical' ? 'marginTop' : 'marginLeft';
var labelSize = this._state.size / (this.options.ticks.length - 1);
if (this.tickLabelContainer) {
var extraMargin = 0;
if (this.options.ticks_positions.length === 0) {
if (this.options.orientation !== 'vertical') {
this.tickLabelContainer.style[styleMargin] = -labelSize/2 + 'px';
}
extraMargin = this.tickLabelContainer.offsetHeight;
} else {
/* Chidren are position absolute, calculate height by finding the max offsetHeight of a child */
for (i = 0 ; i < this.tickLabelContainer.childNodes.length; i++) {
if (this.tickLabelContainer.childNodes[i].offsetHeight > extraMargin) {
extraMargin = this.tickLabelContainer.childNodes[i].offsetHeight;
}
}
}
if (this.options.orientation === 'horizontal') {
this.sliderElem.style.marginBottom = extraMargin + 'px';
}
}
for (var i = 0; i < this.options.ticks.length; i++) {
var percentage = this.options.ticks_positions[i] || this._toPercentage(this.options.ticks[i]);
if (this.options.reversed) {
percentage = 100 - percentage;
}
this.ticks[i].style[this.stylePos] = percentage + '%';
/* Set class labels to denote whether ticks are in the selection */
this._removeClass(this.ticks[i], 'in-selection');
if (!this.options.range) {
if (this.options.selection === 'after' && percentage >= positionPercentages[0]){
this._addClass(this.ticks[i], 'in-selection');
} else if (this.options.selection === 'before' && percentage <= positionPercentages[0]) {
this._addClass(this.ticks[i], 'in-selection');
}
} else if (percentage >= positionPercentages[0] && percentage <= positionPercentages[1]) {
this._addClass(this.ticks[i], 'in-selection');
}
if (this.tickLabels[i]) {
this.tickLabels[i].style[styleSize] = labelSize + 'px';
if (this.options.orientation !== 'vertical' && this.options.ticks_positions[i] !== undefined) {
this.tickLabels[i].style.position = 'absolute';
this.tickLabels[i].style[this.stylePos] = percentage + '%';
this.tickLabels[i].style[styleMargin] = -labelSize/2 + 'px';
} else if (this.options.orientation === 'vertical') {
this.tickLabels[i].style['marginLeft'] = this.sliderElem.offsetWidth + 'px';
this.tickLabelContainer.style['marginTop'] = this.sliderElem.offsetWidth / 2 * -1 + 'px';
}
}
}
}
var formattedTooltipVal;
if (this.options.range) {
formattedTooltipVal = this.options.formatter(this._state.value);
this._setText(this.tooltipInner, formattedTooltipVal);
this.tooltip.style[this.stylePos] = (positionPercentages[1] + positionPercentages[0])/2 + '%';
if (this.options.orientation === 'vertical') {
this._css(this.tooltip, 'margin-top', -this.tooltip.offsetHeight / 2 + 'px');
} else {
this._css(this.tooltip, 'margin-left', -this.tooltip.offsetWidth / 2 + 'px');
}
if (this.options.orientation === 'vertical') {
this._css(this.tooltip, 'margin-top', -this.tooltip.offsetHeight / 2 + 'px');
} else {
this._css(this.tooltip, 'margin-left', -this.tooltip.offsetWidth / 2 + 'px');
}
var innerTooltipMinText = this.options.formatter(this._state.value[0]);
this._setText(this.tooltipInner_min, innerTooltipMinText);
var innerTooltipMaxText = this.options.formatter(this._state.value[1]);
this._setText(this.tooltipInner_max, innerTooltipMaxText);
this.tooltip_min.style[this.stylePos] = positionPercentages[0] + '%';
if (this.options.orientation === 'vertical') {
this._css(this.tooltip_min, 'margin-top', -this.tooltip_min.offsetHeight / 2 + 'px');
} else {
this._css(this.tooltip_min, 'margin-left', -this.tooltip_min.offsetWidth / 2 + 'px');
}
this.tooltip_max.style[this.stylePos] = positionPercentages[1] + '%';
if (this.options.orientation === 'vertical') {
this._css(this.tooltip_max, 'margin-top', -this.tooltip_max.offsetHeight / 2 + 'px');
} else {
this._css(this.tooltip_max, 'margin-left', -this.tooltip_max.offsetWidth / 2 + 'px');
}
} else {
formattedTooltipVal = this.options.formatter(this._state.value[0]);
this._setText(this.tooltipInner, formattedTooltipVal);
this.tooltip.style[this.stylePos] = positionPercentages[0] + '%';
if (this.options.orientation === 'vertical') {
this._css(this.tooltip, 'margin-top', -this.tooltip.offsetHeight / 2 + 'px');
} else {
this._css(this.tooltip, 'margin-left', -this.tooltip.offsetWidth / 2 + 'px');
}
}
if (this.options.orientation === 'vertical') {
this.trackLow.style.top = '0';
this.trackLow.style.height = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
this.trackSelection.style.top = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
this.trackSelection.style.height = Math.abs(positionPercentages[0] - positionPercentages[1]) +'%';
this.trackHigh.style.bottom = '0';
this.trackHigh.style.height = (100 - Math.min(positionPercentages[0], positionPercentages[1]) - Math.abs(positionPercentages[0] - positionPercentages[1])) +'%';
}
else {
this.trackLow.style.left = '0';
this.trackLow.style.width = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
this.trackSelection.style.left = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
this.trackSelection.style.width = Math.abs(positionPercentages[0] - positionPercentages[1]) +'%';
this.trackHigh.style.right = '0';
this.trackHigh.style.width = (100 - Math.min(positionPercentages[0], positionPercentages[1]) - Math.abs(positionPercentages[0] - positionPercentages[1])) +'%';
var offset_min = this.tooltip_min.getBoundingClientRect();
var offset_max = this.tooltip_max.getBoundingClientRect();
if (offset_min.right > offset_max.left) {
this._removeClass(this.tooltip_max, 'top');
this._addClass(this.tooltip_max, 'bottom');
this.tooltip_max.style.top = 18 + 'px';
} else {
this._removeClass(this.tooltip_max, 'bottom');
this._addClass(this.tooltip_max, 'top');
this.tooltip_max.style.top = this.tooltip_min.style.top;
}
}
},
_removeProperty: function(element, prop) {
if (element.style.removeProperty) {
element.style.removeProperty(prop);
} else {
element.style.removeAttribute(prop);
}
},
_mousedown: function(ev) {
if(!this._state.enabled) {
return false;
}
this._state.offset = this._offset(this.sliderElem);
this._state.size = this.sliderElem[this.sizePos];
var percentage = this._getPercentage(ev);
if (this.options.range) {
var diff1 = Math.abs(this._state.percentage[0] - percentage);
var diff2 = Math.abs(this._state.percentage[1] - percentage);
this._state.dragged = (diff1 < diff2) ? 0 : 1;
} else {
this._state.dragged = 0;
}
this._state.percentage[this._state.dragged] = percentage;
this._layout();
if (this.touchCapable) {
document.removeEventListener("touchmove", this.mousemove, false);
document.removeEventListener("touchend", this.mouseup, false);
}
if(this.mousemove){
document.removeEventListener("mousemove", this.mousemove, false);
}
if(this.mouseup){
document.removeEventListener("mouseup", this.mouseup, false);
}
this.mousemove = this._mousemove.bind(this);
this.mouseup = this._mouseup.bind(this);
if (this.touchCapable) {
// Touch: Bind touch events:
document.addEventListener("touchmove", this.mousemove, false);
document.addEventListener("touchend", this.mouseup, false);
}
// Bind mouse events:
document.addEventListener("mousemove", this.mousemove, false);
document.addEventListener("mouseup", this.mouseup, false);
this._state.inDrag = true;
var newValue = this._calculateValue();
this._trigger('slideStart', newValue);
this._setDataVal(newValue);
this.setValue(newValue, false, true);
this._pauseEvent(ev);
if (this.options.focus) {
this._triggerFocusOnHandle(this._state.dragged);
}
return true;
},
_triggerFocusOnHandle: function(handleIdx) {
if(handleIdx === 0) {
this.handle1.focus();
}
if(handleIdx === 1) {
this.handle2.focus();
}
},
_keydown: function(handleIdx, ev) {
if(!this._state.enabled) {
return false;
}
var dir;
switch (ev.keyCode) {
case 37: // left
case 40: // down
dir = -1;
break;
case 39: // right
case 38: // up
dir = 1;
break;
}
if (!dir) {
return;
}
// use natural arrow keys instead of from min to max
if (this.options.natural_arrow_keys) {
var ifVerticalAndNotReversed = (this.options.orientation === 'vertical' && !this.options.reversed);
var ifHorizontalAndReversed = (this.options.orientation === 'horizontal' && this.options.reversed);
if (ifVerticalAndNotReversed || ifHorizontalAndReversed) {
dir = -dir;
}
}
var val = this._state.value[handleIdx] + dir * this.options.step;
if (this.options.range) {
val = [ (!handleIdx) ? val : this._state.value[0],
( handleIdx) ? val : this._state.value[1]];
}
this._trigger('slideStart', val);
this._setDataVal(val);
this.setValue(val, true, true);
this._setDataVal(val);
this._trigger('slideStop', val);
this._layout();
this._pauseEvent(ev);
return false;
},
_pauseEvent: function(ev) {
if(ev.stopPropagation) {
ev.stopPropagation();
}
if(ev.preventDefault) {
ev.preventDefault();
}
ev.cancelBubble=true;
ev.returnValue=false;
},
_mousemove: function(ev) {
if(!this._state.enabled) {
return false;
}
var percentage = this._getPercentage(ev);
this._adjustPercentageForRangeSliders(percentage);
this._state.percentage[this._state.dragged] = percentage;
this._layout();
var val = this._calculateValue(true);
this.setValue(val, true, true);
return false;
},
_adjustPercentageForRangeSliders: function(percentage) {
if (this.options.range) {
var precision = this._getNumDigitsAfterDecimalPlace(percentage);
precision = precision ? precision - 1 : 0;
var percentageWithAdjustedPrecision = this._applyToFixedAndParseFloat(percentage, precision);
if (this._state.dragged === 0 && this._applyToFixedAndParseFloat(this._state.percentage[1], precision) < percentageWithAdjustedPrecision) {
this._state.percentage[0] = this._state.percentage[1];
this._state.dragged = 1;
} else if (this._state.dragged === 1 && this._applyToFixedAndParseFloat(this._state.percentage[0], precision) > percentageWithAdjustedPrecision) {
this._state.percentage[1] = this._state.percentage[0];
this._state.dragged = 0;
}
}
},
_mouseup: function() {
if(!this._state.enabled) {
return false;
}
if (this.touchCapable) {
// Touch: Unbind touch event handlers:
document.removeEventListener("touchmove", this.mousemove, false);
document.removeEventListener("touchend", this.mouseup, false);
}
// Unbind mouse event handlers:
document.removeEventListener("mousemove", this.mousemove, false);
document.removeEventListener("mouseup", this.mouseup, false);
this._state.inDrag = false;
if (this._state.over === false) {
this._hideTooltip();
}
var val = this._calculateValue(true);
this._layout();
this._setDataVal(val);
this._trigger('slideStop', val);
return false;
},
_calculateValue: function(snapToClosestTick) {
var val;
if (this.options.range) {
val = [this.options.min,this.options.max];
if (this._state.percentage[0] !== 0){
val[0] = this._toValue(this._state.percentage[0]);
val[0] = this._applyPrecision(val[0]);
}
if (this._state.percentage[1] !== 100){
val[1] = this._toValue(this._state.percentage[1]);
val[1] = this._applyPrecision(val[1]);
}
} else {
val = this._toValue(this._state.percentage[0]);
val = parseFloat(val);
val = this._applyPrecision(val);
}
if (snapToClosestTick) {
var min = [val, Infinity];
for (var i = 0; i < this.options.ticks.length; i++) {
var diff = Math.abs(this.options.ticks[i] - val);
if (diff <= min[1]) {
min = [this.options.ticks[i], diff];
}
}
if (min[1] <= this.options.ticks_snap_bounds) {
return min[0];
}
}
return val;
},
_applyPrecision: function(val) {
var precision = this.options.precision || this._getNumDigitsAfterDecimalPlace(this.options.step);
return this._applyToFixedAndParseFloat(val, precision);
},
_getNumDigitsAfterDecimalPlace: function(num) {
var match = (''+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
if (!match) { return 0; }
return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));
},
_applyToFixedAndParseFloat: function(num, toFixedInput) {
var truncatedNum = num.toFixed(toFixedInput);
return parseFloat(truncatedNum);
},
/*
Credits to Mike Samuel for the following method!
Source: http://stackoverflow.com/questions/10454518/javascript-how-to-retrieve-the-number-of-decimals-of-a-string-number
*/
_getPercentage: function(ev) {
if (this.touchCapable && (ev.type === 'touchstart' || ev.type === 'touchmove')) {
ev = ev.touches[0];
}
var eventPosition = ev[this.mousePos];
var sliderOffset = this._state.offset[this.stylePos];
var distanceToSlide = eventPosition - sliderOffset;
// Calculate what percent of the length the slider handle has slid
var percentage = (distanceToSlide / this._state.size) * 100;
percentage = Math.round(percentage / this._state.percentage[2]) * this._state.percentage[2];
if (this.options.reversed) {
percentage = 100 - percentage;
}
// Make sure the percent is within the bounds of the slider.
// 0% corresponds to the 'min' value of the slide
// 100% corresponds to the 'max' value of the slide
return Math.max(0, Math.min(100, percentage));
},
_validateInputValue: function(val) {
if (typeof val === 'number') {
return val;
} else if (Array.isArray(val)) {
this._validateArray(val);
return val;
} else {
throw new Error( ErrorMsgs.formatInvalidInputErrorMsg(val) );
}
},
_validateArray: function(val) {
for(var i = 0; i < val.length; i++) {
var input = val[i];
if (typeof input !== 'number') { throw new Error( ErrorMsgs.formatInvalidInputErrorMsg(input) ); }
}
},
_setDataVal: function(val) {
this.element.setAttribute('data-value', val);
this.element.setAttribute('value', val);
this.element.value = val;
},
_trigger: function(evt, val) {
val = (val || val === 0) ? val : undefined;
var callbackFnArray = this.eventToCallbackMap[evt];
if(callbackFnArray && callbackFnArray.length) {
for(var i = 0; i < callbackFnArray.length; i++) {
var callbackFn = callbackFnArray[i];
callbackFn(val);
}
}
/* If JQuery exists, trigger JQuery events */
if($) {
this._triggerJQueryEvent(evt, val);
}
},
_triggerJQueryEvent: function(evt, val) {
var eventData = {
type: evt,
value: val
};
this.$element.trigger(eventData);
this.$sliderElem.trigger(eventData);
},
_unbindJQueryEventHandlers: function() {
this.$element.off();
this.$sliderElem.off();
},
_setText: function(element, text) {
if(typeof element.innerText !== "undefined") {
element.innerText = text;
} else if(typeof element.textContent !== "undefined") {
element.textContent = text;
}
},
_removeClass: function(element, classString) {
var classes = classString.split(" ");
var newClasses = element.className;
for(var i = 0; i < classes.length; i++) {
var classTag = classes[i];
var regex = new RegExp("(?:\\s|^)" + classTag + "(?:\\s|$)");
newClasses = newClasses.replace(regex, " ");
}
element.className = newClasses.trim();
},
_addClass: function(element, classString) {
var classes = classString.split(" ");
var newClasses = element.className;
for(var i = 0; i < classes.length; i++) {
var classTag = classes[i];
var regex = new RegExp("(?:\\s|^)" + classTag + "(?:\\s|$)");
var ifClassExists = regex.test(newClasses);
if(!ifClassExists) {
newClasses += " " + classTag;
}
}
element.className = newClasses.trim();
},
_offsetLeft: function(obj){
return obj.getBoundingClientRect().left;
},
_offsetTop: function(obj){
var offsetTop = obj.offsetTop;
while((obj = obj.offsetParent) && !isNaN(obj.offsetTop)){
offsetTop += obj.offsetTop;
}
return offsetTop;
},
_offset: function (obj) {
return {
left: this._offsetLeft(obj),
top: this._offsetTop(obj)
};
},
_css: function(elementRef, styleName, value) {
if ($) {
$.style(elementRef, styleName, value);
} else {
var style = styleName.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function (all, letter) {
return letter.toUpperCase();
});
elementRef.style[style] = value;
}
},
_toValue: function(percentage) {
return this.options.scale.toValue.apply(this, [percentage]);
},
_toPercentage: function(value) {
return this.options.scale.toPercentage.apply(this, [value]);
},
_setTooltipPosition: function(){
var tooltips = [this.tooltip, this.tooltip_min, this.tooltip_max];
if (this.options.orientation === 'vertical'){
var tooltipPos = this.options.tooltip_position || 'right';
var oppositeSide = (tooltipPos === 'left') ? 'right' : 'left';
tooltips.forEach(function(tooltip){
this._addClass(tooltip, tooltipPos);
tooltip.style[oppositeSide] = '100%';
}.bind(this));
} else if(this.options.tooltip_position === 'bottom') {
tooltips.forEach(function(tooltip){
this._addClass(tooltip, 'bottom');
tooltip.style.top = 22 + 'px';
}.bind(this));
} else {
tooltips.forEach(function(tooltip){
this._addClass(tooltip, 'top');
tooltip.style.top = -this.tooltip.outerHeight - 14 + 'px';
}.bind(this));
}
}
};
/*********************************
Attach to global namespace
*********************************/
if($) {
var namespace = $.fn.slider ? 'bootstrapSlider' : 'slider';
$.bridget(namespace, Slider);
}
})( $ );
return Slider;
}));
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html itemscope lang="en-us">
<head><meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="generator" content="Hugo 0.57.2" />
<meta property="og:title" content="How FIDO U2F Security Keys Work" />
<meta name="twitter:title" content="How FIDO U2F Security Keys Work"/>
<meta itemprop="name" content="How FIDO U2F Security Keys Work"><meta property="og:description" content="Effective user authentication is a critical part of securing your data and infrastructure. Passwords are not enough any more, multi-factor auth is a must. This talk will dive into how FIDO U2F security keys work, why they are awesome, and how they defend against phishing attacks.
SMS codes and one-time-password apps are a great improvement over passwords alone, but the FIDO Alliance’s Universal Two Factor specification attempts to take it a step further." />
<meta name="twitter:description" content="Effective user authentication is a critical part of securing your data and infrastructure. Passwords are not enough any more, multi-factor auth is a must. This talk will dive into how FIDO U2F security keys work, why they are awesome, and how they defend against phishing attacks.
SMS codes and one-time-password apps are a great improvement over passwords alone, but the FIDO Alliance’s Universal Two Factor specification attempts to take it a step further." />
<meta itemprop="description" content="Effective user authentication is a critical part of securing your data and infrastructure. Passwords are not enough any more, multi-factor auth is a must. This talk will dive into how FIDO U2F security keys work, why they are awesome, and how they defend against phishing attacks.
SMS codes and one-time-password apps are a great improvement over passwords alone, but the FIDO Alliance’s Universal Two Factor specification attempts to take it a step further."><meta name="twitter:site" content="@devopsdays">
<meta property="og:type" content="talk" />
<meta property="og:url" content="/events/2018-seattle/program/jen-tong/" /><meta name="twitter:creator" content="@DevOpsDaysSEA" /><meta name="twitter:label1" value="Event" />
<meta name="twitter:data1" value="devopsdays Seattle 2018" /><meta name="twitter:label2" value="Dates" />
<meta name="twitter:data2" value="April 24 - 25, 2018" /><meta property="og:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta itemprop="image" content="https://www.devopsdays.org/img/sharing.jpg" />
<meta property="fb:app_id" content="1904065206497317" /><meta itemprop="wordCount" content="147">
<title>How FIDO U2F Security Keys Work - devopsdays Seattle 2018
</title>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-9713393-1', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<link href="/css/site.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet"><link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link href="/events/index.xml" rel="alternate" type="application/rss+xml" title="DevOpsDays" />
<link href="/events/index.xml" rel="feed" type="application/rss+xml" title="DevOpsDays" />
<script src=/js/devopsdays-min.js></script></head>
<body lang="">
<nav class="navbar navbar-expand-md navbar-light">
<a class="navbar-brand" href="/">
<img src="/img/devopsdays-brain.png" height="30" class="d-inline-block align-top" alt="devopsdays Logo">
DevOpsDays
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto"><li class="nav-item global-navigation"><a class = "nav-link" href="/events">events</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/blog">blog</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/sponsor">sponsor</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/speaking">speaking</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/organizing">organizing</a></li><li class="nav-item global-navigation"><a class = "nav-link" href="/about">about</a></li></ul>
</div>
</nav>
<nav class="navbar event-navigation navbar-expand-md navbar-light">
<a href="/events/2018-seattle" class="nav-link">Seattle</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar2">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbar2">
<ul class="navbar-nav"><li class="nav-item active">
<a class="nav-link" href="/events/2018-seattle/location">location</a>
</li><li class="nav-item active">
<a class="nav-link" href="/events/2018-seattle/registration">registration</a>
</li><li class="nav-item active">
<a class="nav-link" href="/events/2018-seattle/program">program</a>
</li><li class="nav-item active">
<a class="nav-link" href="/events/2018-seattle/speakers">speakers</a>
</li><li class="nav-item active">
<a class="nav-link" href="/events/2018-seattle/sponsor">sponsor</a>
</li><li class="nav-item active">
<a class="nav-link" href="/events/2018-seattle/contact">contact</a>
</li><li class="nav-item active">
<a class="nav-link" href="/events/2018-seattle/conduct">conduct</a>
</li></ul>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-md-12"><div class = "row">
<div class = "col-md-5 offset-md-1">
<h2 class="talk-page">How FIDO U2F Security Keys Work</h2><br /><br /><br />
<span class="talk-page content-text">
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/DWrLBwi7ZBA" frameborder="0" allowfullscreen></iframe>
<p>Effective user authentication is a critical part of securing your data and infrastructure. Passwords are not enough any more, multi-factor auth is a must. This talk will dive into how FIDO U2F security keys work, why they are awesome, and how they defend against phishing attacks.</p>
<p>SMS codes and one-time-password apps are a great improvement over passwords alone, but the FIDO Alliance’s Universal Two Factor specification attempts to take it a step further. U2F provides a phishing resistant, hardware based second authentication factor.</p>
<p>Before you depend on a technology as a building block of security, it’s good to understand how it works, and why it’s a good fit for your needs. This talk will cover these things, so you don’t have to read the spec yourself.</p>
<p>An overview of the two-factor landscape</p>
<ul>
<li>Why U2F is awesome</li>
<li>How it resists phishing attacks</li>
<li>How those security keys work inside</li>
</ul>
</span></div>
<div class = "col-md-3 offset-md-1"><h2 class="talk-page">Speaker</h2><img src = "/events/2018-seattle/speakers/jen-tong.jpg" class="img-fluid" alt="jen-tong"/><br /><br /><h4 class="talk-page"><a href = "/events/2018-seattle/speakers/jen-tong">
Jen Tong
</a></h4><a href = "https://twitter.com/MimmingCodes"><i class="fa fa-twitter fa-2x" aria-hidden="true"></i> </a><br />
<span class="talk-page content-text"><p>Jen is a Security Advocate on Google Cloud Platform. In this role she helps developers and IT professionals stay out of trouble while getting the most out of cloud computing. Previously she worked in </p><a href = "https://www.devopsdays.org/events/2018-seattle/speakers/jen-tong/">...</a></span>
</div>
</div><div class="row cta-row">
<div class="col-md-12"><h4 class="sponsor-cta">Gold Sponsors</h4><a href = "/events/2018-seattle/sponsor" class="sponsor-cta"><i>Join as Gold Sponsor!</i>
</a></div>
</div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://gocd.org/"><img src = "/img/sponsors/thoughtworks-gocd-before-20190213.png" alt = "GoCD" title = "GoCD" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.rei.com/"><img src = "/img/sponsors/rei.png" alt = "REI" title = "REI" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://tmobile.careers/meet-our-teams/technology"><img src = "/img/sponsors/t-mobile.png" alt = "T-Mobile" title = "T-Mobile" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.scalyr.com"><img src = "/img/sponsors/scalyr.png" alt = "Scalyr" title = "Scalyr" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.slalom.com/"><img src = "/img/sponsors/slalom.png" alt = "Slalom" title = "Slalom" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.influxdata.com/"><img src = "/img/sponsors/influxdata.png" alt = "InfluxData" title = "InfluxData" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.pagerduty.com/"><img src = "/img/sponsors/pagerduty.png" alt = "PagerDuty" title = "PagerDuty" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://infogroupnw.com/"><img src = "/img/sponsors/ignw.png" alt = "ignw" title = "ignw" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.ca.com/"><img src = "/img/sponsors/ca_tech.png" alt = "CA Technologies" title = "CA Technologies" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://chef.io"><img src = "/img/sponsors/chef.png" alt = "Chef Software, Inc" title = "Chef Software, Inc" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.appdynamics.com/"><img src = "/img/sponsors/appdynamics-before-20190121.png" alt = "AppDynamics" title = "AppDynamics" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.extrahop.com/"><img src = "/img/sponsors/extrahop.png" alt = "ExtraHop" title = "ExtraHop" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.opsgenie.com"><img src = "/img/sponsors/opsgenie.png" alt = "OpsGenie" title = "OpsGenie" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.sumologic.com/"><img src = "/img/sponsors/sumologic-before-20181203.png" alt = "SumoLogic" title = "SumoLogic" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.mabl.com"><img src = "/img/sponsors/mabl.png" alt = "Mabl" title = "Mabl" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://portworx.com/use-case/kubernetes-storage/"><img src = "/img/sponsors/portworx.png" alt = "portworx" title = "portworx" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.dellemc.com"><img src = "/img/sponsors/dellemc.png" alt = "Dell EMC" title = "Dell EMC" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.launchdarkly.com/"><img src = "/img/sponsors/launch-darkly-before-20200828-before-20180423.png" alt = "launch-darkly-before-20200828" title = "launch-darkly-before-20200828" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.gettyimages.com/"><img src = "/img/sponsors/getty-images.png" alt = "Getty Images" title = "Getty Images" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.victorops.com"><img src = "/img/sponsors/victorops-before-20180823.png" alt = "VictorOps" title = "VictorOps" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.tasktop.com/"><img src = "/img/sponsors/tasktop.png" alt = "TaskTop" title = "TaskTop" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.jfrog.com/"><img src = "/img/sponsors/jfrog.png" alt = "jfrog" title = "jfrog" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.elastic.co"><img src = "/img/sponsors/elastic.png" alt = "Elastic" title = "Elastic" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.dynatrace.com/"><img src = "/img/sponsors/dynatrace.png" alt = "Dynatrace" title = "Dynatrace" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.newrelic.com/culture"><img src = "/img/sponsors/newrelic.png" alt = "New Relic" title = "New Relic" class="img-fluid"></a>
</div></div><div class="row cta-row">
<div class="col-md-12"><h4 class="sponsor-cta">Silver Sponsors</h4><a href = "/events/2018-seattle/sponsor" class="sponsor-cta"><i>Join as Silver Sponsor!</i>
</a></div>
</div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.techtowntraining.com/"><img src = "/img/sponsors/techtown-before-20190407.png" alt = "TechTown Training" title = "TechTown Training" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.rightstar.com"><img src = "/img/sponsors/rightstar-before-20180814.png" alt = "Right Star Systems" title = "Right Star Systems" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.contrastsecurity.com/"><img src = "/img/sponsors/contrast_security.png" alt = "Contrast Security" title = "Contrast Security" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "http://www.cloudbees.com/"><img src = "/img/sponsors/cloudbees.png" alt = "cloudbees" title = "cloudbees" class="img-fluid"></a>
</div></div><div class="row cta-row">
<div class="col-md-12"><h4 class="sponsor-cta">Bronze Sponsors</h4><a href = "/events/2018-seattle/sponsor" class="sponsor-cta"><i>Join as Bronze Sponsor!</i>
</a></div>
</div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.realself.com/about/jobs"><img src = "/img/sponsors/realself.png" alt = "realself" title = "realself" class="img-fluid"></a>
</div><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://codefresh.io/"><img src = "/img/sponsors/codefresh.png" alt = "codefresh" title = "codefresh" class="img-fluid"></a>
</div></div><div class="row cta-row">
<div class="col-md-12"><h4 class="sponsor-cta">Community Sponsors</h4><a href = "/events/2018-seattle/sponsor" class="sponsor-cta"><i>Join as Community Sponsor!</i>
</a></div>
</div><div class="row sponsor-row"><div class = "col-lg-1 col-md-2 col-4">
<a href = "https://www.meetup.com/Seattle-CoffeeOps/"><img src = "/img/sponsors/seattle-coffeeops-before-20190213.png" alt = "Seattle CoffeeOps" title = "Seattle CoffeeOps" class="img-fluid"></a>
</div></div><br />
</div></div>
</div>
<nav class="navbar bottom navbar-light footer-nav-row" style="background-color: #bfbfc1;">
<div class = "row">
<div class = "col-md-12 footer-nav-background">
<div class = "row">
<div class = "col-md-6 col-lg-3 footer-nav-col">
<h3 class="footer-nav">@DEVOPSDAYS</h3>
<div>
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/devopsdays/lists/devopsdays" data-chrome="noheader" height="440"></a>
<script>
! function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + "://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
}
}(document, "script", "twitter-wjs");
</script>
</div>
</div>
<div class="col-md-6 col-lg-3 footer-nav-col footer-content">
<h3 class="footer-nav">BLOG</h3><a href = "https://www.devopsdays.org/blog/2019/05/10/10-years-of-devopsdays/"><h1 class = "footer-heading">10 years of devopsdays</h1></a><h2 class="footer-heading">by Kris Buytaert - 10 May, 2019</h2><p class="footer-content">It’s hard to believe but it is almost 10 years ago since #devopsdays happened for the first time in Gent. Back then there were almost 70 of us talking about topics that were of interest to both Operations and Development, we were exchanging our ideas and experiences `on how we were improving the quality of software delivery.
Our ideas got started on the crossroads of Open Source, Agile and early Cloud Adoption.</p><a href = "https://www.devopsdays.org/blog/"><h1 class = "footer-heading">Blogs</h1></a><h2 class="footer-heading">10 May, 2019</h2><p class="footer-content"></p><a href="https://www.devopsdays.org/blog/index.xml">Feed</a>
</div>
<div class="col-md-6 col-lg-3 footer-nav-col">
<h3 class="footer-nav">CFP OPEN</h3><a href = "/events/2019-campinas" class = "footer-content">Campinas</a><br /><a href = "/events/2019-macapa" class = "footer-content">Macapá</a><br /><a href = "/events/2019-shanghai" class = "footer-content">Shanghai</a><br /><a href = "/events/2019-recife" class = "footer-content">Recife</a><br /><a href = "/events/2020-charlotte" class = "footer-content">Charlotte</a><br /><a href = "/events/2020-prague" class = "footer-content">Prague</a><br /><a href = "/events/2020-tokyo" class = "footer-content">Tokyo</a><br /><a href = "/events/2020-salt-lake-city" class = "footer-content">Salt Lake City</a><br />
<br />Propose a talk at an event near you!<br />
</div>
<div class="col-md-6 col-lg-3 footer-nav-col">
<h3 class="footer-nav">About</h3>
devopsdays is a worldwide community conference series for anyone interested in IT improvement.<br /><br />
<a href="/about/" class = "footer-content">About devopsdays</a><br />
<a href="/privacy/" class = "footer-content">Privacy Policy</a><br />
<a href="/conduct/" class = "footer-content">Code of Conduct</a>
<br />
<br />
<a href="https://www.netlify.com">
<img src="/img/netlify-light.png" alt="Deploys by Netlify">
</a>
</div>
</div>
</div>
</div>
</nav>
<script>
$(document).ready(function () {
$("#share").jsSocials({
shares: ["email", {share: "twitter", via: 'DevOpsDaysSEA'}, "facebook", "linkedin"],
text: 'devopsdays Seattle - 2018',
showLabel: false,
showCount: false
});
});
</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd">
<pov>
<cbid>service</cbid>
<replay>
<read><delim>\x0a</delim><match><data>2D Particle Simulator\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>Enter the number of particles to simulate \x281-10\x29:\x0a</data></match></read>
<write><data>3\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read>
<write><data>131.59465,148.95979\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read>
<write><data>6.43994,2.53288\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read>
<write><data>5.06101\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read>
<write><data>5.95283\x0a</data></write>
<read><delim>\x0a</delim><match><data>Particle #1 added at (131.59465,148.95979) velocity(6.43994,2.53288) mass(5.06101) radius(5.95283).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read>
<write><data>126.45479,136.33989\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read>
<write><data>4.00597,8.77870\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read>
<write><data>7.83018\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read>
<write><data>3.00889\x0a</data></write>
<read><delim>\x0a</delim><match><data>Particle #2 added at (126.45479,136.33989) velocity(4.00597,8.77870) mass(7.83018) radius(3.00889).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>Enter Position (x,y):\x0a</data></match></read>
<write><data>192.79427,134.20279\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Velocity (x,y):\x0a</data></match></read>
<write><data>6.29968,0.31368\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Mass:\x0a</data></match></read>
<write><data>9.22895\x0a</data></write>
<read><delim>\x0a</delim><match><data>Enter Radius:\x0a</data></match></read>
<write><data>4.45833\x0a</data></write>
<read><delim>\x0a</delim><match><data>Particle #3 added at (192.79427,134.20279) velocity(6.29968,0.31368) mass(9.22895) radius(4.45833).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>Running simulation with...\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>3 total particles:\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>0: Position (131.59000,148.95000) Velocity (6.43000,2.53000) mass (5.06000) radius (5.95000).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>1: Position (126.45000,136.33000) Velocity (4.00000,8.77000) mass (7.83000) radius (3.00000).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>2: Position (192.79000,134.20000) Velocity (6.29000,0.31000) mass (9.22000) radius (4.45000).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000010000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000100000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000010\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>Simulation complete, 0 collisions simulated over 10 seconds in 40 frames.\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>3 total particles:\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>0: Position (192.21000,174.25000) Velocity (-6.43000,2.53000) mass (5.06000) radius (5.95000).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>1: Position (166.45000,169.97000) Velocity (4.00000,-8.77000) mass (7.83000) radius (3.00000).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>2: Position (135.41000,137.30000) Velocity (-6.29000,0.31000) mass (9.22000) radius (4.45000).\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000010\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000001000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000001000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>00000000000000000000\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>--------------------\x0a</data></match></read>
<read><delim>\x0a</delim><match><data>Goodbye\x0a</data></match></read>
</replay>
</pov>
| {
"pile_set_name": "Github"
} |
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// The aim of this header is just to include <complex> but to do
// so in a way that does not result in recursive inclusion of
// the Boost TR1 components if boost/tr1/tr1/complex is in the
// include search path. We have to do this to avoid circular
// dependencies:
//
#ifndef BOOST_CONFIG_COMPLEX
# define BOOST_CONFIG_COMPLEX
# ifndef BOOST_TR1_NO_RECURSION
# define BOOST_TR1_NO_RECURSION
# define BOOST_CONFIG_NO_COMPLEX_RECURSION
# endif
# include <complex>
# ifdef BOOST_CONFIG_NO_COMPLEX_RECURSION
# undef BOOST_TR1_NO_RECURSION
# undef BOOST_CONFIG_NO_COMPLEX_RECURSION
# endif
#endif
| {
"pile_set_name": "Github"
} |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\Bundle\Block\DataProviders;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Pricing\Price\TierPrice;
use Magento\Framework\Pricing\Render;
use Magento\Framework\View\Element\Block\ArgumentInterface;
use Magento\Framework\View\LayoutInterface;
/**
* Provides additional data for bundle options
*/
class OptionPriceRenderer implements ArgumentInterface
{
/**
* Parent layout of the block
*
* @var LayoutInterface
*/
private $layout;
/**
* @param LayoutInterface $layout
*/
public function __construct(LayoutInterface $layout)
{
$this->layout = $layout;
}
/**
* Format tier price string
*
* @param Product $selection
* @param array $arguments
* @return string
*/
public function renderTierPrice(Product $selection, array $arguments = []): string
{
if (!array_key_exists('zone', $arguments)) {
$arguments['zone'] = Render::ZONE_ITEM_OPTION;
}
$priceHtml = '';
/** @var Render $priceRender */
$priceRender = $this->layout->getBlock('product.price.render.default');
if ($priceRender !== false) {
$priceHtml = $priceRender->render(
TierPrice::PRICE_CODE,
$selection,
$arguments
);
}
return $priceHtml;
}
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Faker\Provider\de_DE;
class Address extends \Faker\Provider\Address
{
protected static $buildingNumber = array('###', '##', '#', '#/#', '##[abc]', '#[abc]');
protected static $streetSuffixLong = array(
'Gasse', 'Platz', 'Ring', 'Straße', 'Weg', 'Allee'
);
protected static $streetSuffixShort = array(
'gasse', 'platz', 'ring', 'straße', 'str.', 'weg', 'allee'
);
protected static $postcode = array('#####');
/**
* @var array
* @see https://de.wikipedia.org/wiki/Liste_der_Gro%C3%9F-_und_Mittelst%C3%A4dte_in_Deutschland
*/
protected static $cityNames = array(
'Aachen', 'Aalen', 'Achern', 'Achim', 'Ahaus', 'Ahlen', 'Ahrensburg', 'Aichach', 'Albstadt', 'Alfter', 'Alsdorf', 'Altenburg', 'Amberg', 'Andernach', 'Annaberg-Buchholz', 'Ansbach', 'Apolda', 'Arnsberg', 'Arnstadt', 'Aschaffenburg', 'Aschersleben', 'Attendorn', 'Augsburg', 'Aurich',
'Backnang', 'Bad Harzburg', 'Bad Hersfeld', 'Bad Homburg vor der Höhe', 'Bad Honnef', 'Bad Kissingen', 'Bad Kreuznach', 'Bad Mergentheim', 'Bad Nauheim', 'Bad Neuenahr-Ahrweiler', 'Bad Oeynhausen', 'Bad Oldesloe', 'Bad Rappenau', 'Bad Salzuflen', 'Bad Soden am Taunus', 'Bad Vilbel', 'Bad Waldsee', 'Bad Zwischenahn', 'Baden-Baden', 'Baesweiler', 'Balingen', 'Bamberg', 'Barsinghausen', 'Baunatal', 'Bautzen', 'Bayreuth', 'Beckum', 'Bedburg', 'Bensheim', 'Bergheim', 'Bergisch Gladbach', 'Bergkamen', 'Berlin', 'Bernau bei Berlin', 'Bernburg (Saale)', 'Biberach an der Riß', 'Bielefeld', 'Bietigheim-Bissingen', 'Bingen am Rhein', 'Bitterfeld-Wolfen', 'Blankenburg (Harz)', 'Blankenfelde-Mahlow', 'Blieskastel', 'Böblingen', 'Bocholt', 'Bochum', 'Bonn', 'Borken', 'Bornheim', 'Bottrop', 'Bramsche', 'Brandenburg an der Havel', 'Braunschweig', 'Bremen', 'Bremerhaven', 'Bretten', 'Brilon', 'Bruchköbel', 'Bruchsal', 'Brühl', 'Buchholz in der Nordheide', 'Büdingen', 'Bühl', 'Bünde', 'Büren', 'Burg', 'Burgdorf', 'Burgwedel', 'Butzbach', 'Buxtehude',
'Calw', 'Castrop-Rauxel', 'Celle',
'Chemnitz', 'Cloppenburg', 'Coburg', 'Coesfeld', 'Coswig', 'Cottbus', 'Crailsheim', 'Cuxhaven',
'Dachau', 'Darmstadt', 'Datteln', 'Deggendorf', 'Delbrück', 'Delitzsch', 'Delmenhorst', 'Dessau-Roßlau', 'Detmold', 'Dietzenbach', 'Dillenburg', 'Dillingen/Saar', 'Dinslaken', 'Ditzingen', 'Döbeln', 'Donaueschingen', 'Dormagen', 'Dorsten', 'Dortmund', 'Dreieich', 'Dresden', 'Duderstadt', 'Duisburg', 'Dülmen', 'Düren', 'Düsseldorf',
'Eberswalde', 'Eckernförde', 'Edewecht', 'Ehingen', 'Einbeck', 'Eisenach', 'Eisenhüttenstadt', 'Lutherstadt Eisleben', 'Eislingen/Fils', 'Ellwangen (Jagst)', 'Elmshorn', 'Elsdorf', 'Emden', 'Emmendingen', 'Emmerich am Rhein', 'Emsdetten', 'Enger', 'Ennepetal', 'Ennigerloh', 'Eppingen', 'Erding', 'Erftstadt', 'Erfurt', 'Erkelenz', 'Erkrath', 'Erlangen', 'Eschborn', 'Eschweiler', 'Espelkamp', 'Essen', 'Esslingen am Neckar', 'Ettlingen', 'Euskirchen',
'Falkensee', 'Fellbach', 'Filderstadt', 'Flensburg', 'Flörsheim am Main', 'Forchheim', 'Frankenthal (Pfalz)', 'Frankfurt (Oder)', 'Frankfurt am Main', 'Frechen', 'Freiberg', 'Freiburg im Breisgau', 'Freising', 'Freital', 'Freudenstadt', 'Friedberg', 'Friedberg (Hessen)', 'Friedrichsdorf', 'Friedrichshafen', 'Friesoythe', 'Fröndenberg/Ruhr', 'Fulda', 'Fürstenfeldbruck', 'Fürstenwalde/Spree', 'Fürth',
'Gaggenau', 'Ganderkesee', 'Garbsen', 'Gardelegen', 'Garmisch-Partenkirchen', 'Gauting', 'Geesthacht', 'Geestland', 'Geilenkirchen', 'Geislingen an der Steige', 'Geldern', 'Gelnhausen', 'Gelsenkirchen', 'Georgsmarienhütte', 'Gera', 'Geretsried', 'Germering', 'Germersheim', 'Gersthofen', 'Geseke', 'Gevelsberg', 'Gießen', 'Gifhorn', 'Gladbeck', 'Glauchau', 'Goch', 'Göppingen', 'Görlitz', 'Goslar', 'Gotha', 'Göttingen', 'Greifswald', 'Greiz', 'Greven', 'Grevenbroich', 'Griesheim', 'Grimma', 'Gronau (Westf.)', 'Groß-Gerau', 'Groß-Umstadt', 'Gummersbach', 'Günzburg', 'Güstrow', 'Gütersloh',
'Haan', 'Haar', 'Hagen', 'Halberstadt', 'Halle (Saale)', 'Halle (Westf.)', 'Haltern am See', 'Hamburg', 'Hameln', 'Hamm', 'Hamminkeln', 'Hanau', 'Hann. Münden', 'Hannover', 'Haren (Ems)', 'Harsewinkel', 'Haßloch', 'Hattersheim am Main', 'Hattingen', 'Heide', 'Heidelberg', 'Heidenheim an der Brenz', 'Heilbronn', 'Heiligenhaus', 'Heinsberg', 'Helmstedt', 'Hemer', 'Hennef (Sieg)', 'Hennigsdorf', 'Henstedt-Ulzburg', 'Heppenheim (Bergstraße)', 'Herborn', 'Herdecke', 'Herford', 'Herne', 'Herrenberg', 'Herten', 'Herzogenaurach', 'Herzogenrath', 'Hilden', 'Hildesheim', 'Hockenheim', 'Hof', 'Hofheim am Taunus', 'Hohen Neuendorf', 'Holzminden', 'Homburg', 'Horb am Neckar', 'Höxter', 'Hoyerswerda', 'Hückelhoven', 'Hürth', 'Husum',
'Ibbenbüren', 'Idar-Oberstein', 'Idstein', 'Ilmenau', 'Ilsede', 'Ingelheim am Rhein', 'Ingolstadt', 'Iserlohn', 'Isernhagen', 'Itzehoe',
'Jena', 'Jüchen', 'Jülich',
'Kaarst', 'Kaiserslautern', 'Kaltenkirchen', 'Kamen', 'Kamp-Lintfort', 'Karben', 'Karlsfeld', 'Karlsruhe', 'Kassel', 'Kaufbeuren', 'Kehl', 'Kelkheim (Taunus)', 'Kempen', 'Kempten (Allgäu)', 'Kerpen', 'Kevelaer', 'Kiel', 'Kirchheim unter Teck', 'Kitzingen', 'Kleinmachnow', 'Kleve', 'Koblenz', 'Köln', 'Königs Wusterhausen', 'Königsbrunn', 'Königswinter', 'Konstanz', 'Korbach', 'Kornwestheim', 'Korschenbroich', 'Köthen (Anhalt)', 'Krefeld', 'Kreuztal', 'Kulmbach',
'Laatzen', 'Lage', 'Lahr/Schwarzwald', 'Lampertheim', 'Landau in der Pfalz', 'Landsberg am Lech', 'Landshut', 'Langen', 'Langenfeld (Rheinland)', 'Langenhagen', 'Lauf an der Pegnitz', 'Laupheim', 'Leer', 'Lehrte', 'Leichlingen (Rheinland)', 'Leimen', 'Leinfelden-Echterdingen', 'Leipzig', 'Lemgo', 'Lengerich', 'Lennestadt', 'Leonberg', 'Leutkirch im Allgäu', 'Leverkusen', 'Lichtenfels', 'Limbach-Oberfrohna', 'Limburg an der Lahn', 'Lindau (Bodensee)', 'Lindlar', 'Lingen (Ems)', 'Lippstadt', 'Lohmar', 'Löhne', 'Lohne (Oldenburg)', 'Lörrach', 'Lübbecke', 'Lübeck', 'Luckenwalde', 'Lüdenscheid', 'Lüdinghausen', 'Ludwigsburg', 'Ludwigsfelde', 'Ludwigshafen am Rhein', 'Lüneburg', 'Lünen',
'Magdeburg', 'Maintal', 'Mainz', 'Mannheim', 'Marburg', 'Markkleeberg', 'Marl', 'Mechernich', 'Meckenheim', 'Meerbusch', 'Meinerzhagen', 'Meiningen', 'Meißen', 'Melle', 'Memmingen', 'Menden (Sauerland)', 'Meppen', 'Merseburg', 'Merzig', 'Meschede', 'Mettmann', 'Metzingen', 'Minden', 'Moers', 'Mönchengladbach', 'Monheim am Rhein', 'Moormerland', 'Mörfelden-Walldorf', 'Mosbach', 'Mühlacker', 'Mühlhausen/Thüringen', 'Mühlheim am Main', 'Mülheim an der Ruhr', 'München', 'Münster',
'Nagold', 'Naumburg (Saale)', 'Neckarsulm', 'Netphen', 'Nettetal', 'Neu Wulmstorf', 'Neu-Isenburg', 'Neu-Ulm', 'Neubrandenburg', 'Neuburg an der Donau', 'Neukirchen-Vluyn', 'Neumarkt in der Oberpfalz', 'Neumünster', 'Neunkirchen', 'Neuruppin', 'Neusäß', 'Neuss', 'Neustadt am Rübenberge', 'Neustadt an der Weinstraße', 'Neustrelitz', 'Neuwied', 'Niederkassel', 'Nienburg/Weser', 'Norden', 'Nordenham', 'Norderstedt', 'Nordhausen', 'Nordhorn', 'Northeim', 'Nürnberg', 'Nürtingen',
'Oberhausen', 'Obertshausen', 'Oberursel (Taunus)', 'Oelde', 'Oer-Erkenschwick', 'Offenbach am Main', 'Offenburg', 'Öhringen', 'Olching', 'Oldenburg', 'Olpe', 'Oranienburg', 'Osnabrück', 'Osterholz-Scharmbeck', 'Osterode am Harz', 'Ostfildern', 'Ottobrunn', 'Overath',
'Paderborn', 'Panketal', 'Papenburg', 'Passau', 'Peine', 'Petershagen', 'Pfaffenhofen an der Ilm', 'Pforzheim', 'Pfungstadt', 'Pinneberg', 'Pirmasens', 'Pirna', 'Plauen', 'Plettenberg', 'Porta Westfalica', 'Potsdam', 'Puchheim', 'Pulheim',
'Quedlinburg', 'Quickborn',
'Radebeul', 'Radevormwald', 'Radolfzell am Bodensee', 'Rastatt', 'Rastede', 'Rathenow', 'Ratingen', 'Ravensburg', 'Recklinghausen', 'Rees', 'Regensburg', 'Reinbek', 'Remscheid', 'Remseck am Neckar', 'Rendsburg', 'Reutlingen', 'Rheda-Wiedenbrück', 'Rheinbach', 'Rheinberg', 'Rheine', 'Rheinfelden (Baden)', 'Rheinstetten', 'Riedstadt', 'Riesa', 'Rietberg', 'Rinteln', 'Rödermark', 'Rodgau', 'Ronnenberg', 'Rosenheim', 'Rösrath', 'Rostock', 'Rotenburg (Wümme)', 'Roth', 'Rottenburg am Neckar', 'Rottweil', 'Rudolstadt', 'Rüsselsheim am Main',
'Saalfeld/Saale', 'Saarbrücken', 'Saarlouis', 'Salzgitter', 'Salzkotten', 'Salzwedel', 'Sangerhausen', 'Sankt Augustin', 'Sankt Ingbert', 'Schleswig', 'Schloß Holte-Stukenbrock', 'Schmallenberg', 'Schönebeck', 'Schorndorf', 'Schortens', 'Schramberg', 'Schwabach', 'Schwäbisch Gmünd', 'Schwäbisch Hall', 'Schwandorf', 'Schwanewede', 'Schwedt/Oder', 'Schweinfurt', 'Schwelm', 'Schwerin', 'Schwerte', 'Schwetzingen', 'Seelze', 'Seevetal', 'Sehnde', 'Seligenstadt', 'Selm', 'Senden', 'Senden', 'Senftenberg', 'Siegburg', 'Siegen', 'Sindelfingen', 'Singen (Hohentwiel)', 'Sinsheim', 'Soest', 'Solingen', 'Soltau', 'Sondershausen', 'Sonneberg', 'Sonthofen', 'Speyer', 'Spremberg', 'Springe', 'Sprockhövel', 'St. Wendel', 'Stade', 'Stadtallendorf', 'Stadthagen', 'Stadtlohn', 'Starnberg', 'Staßfurt', 'Steinfurt', 'Steinhagen', 'Stendal', 'Stolberg (Rheinland)', 'Stralsund', 'Straubing', 'Strausberg', 'Stuhr', 'Stutensee', 'Stuttgart', 'Suhl', 'Sundern (Sauerland)', 'Syke',
'Taunusstein', 'Teltow', 'Tönisvorst', 'Torgau', 'Traunreut', 'Trier', 'Troisdorf', 'Tübingen', 'Tuttlingen',
'Übach-Palenberg', 'Überlingen',
'Uelzen', 'Uetze', 'Ulm', 'Unna', 'Unterhaching', 'Unterschleißheim',
'Vaihingen an der Enz', 'Varel', 'Vaterstetten', 'Vechta', 'Velbert', 'Verden (Aller)', 'Verl', 'Versmold', 'Viernheim', 'Viersen', 'Villingen-Schwenningen', 'Voerde (Niederrhein)', 'Völklingen', 'Vreden',
'Wachtberg', 'Waghäusel', 'Waiblingen', 'Waldkirch', 'Waldkraiburg', 'Waldshut-Tiengen', 'Wallenhorst', 'Walsrode', 'Waltrop', 'Wandlitz', 'Wangen im Allgäu', 'Warburg', 'Waren (Müritz)', 'Warendorf', 'Warstein', 'Wedel', 'Wedemark', 'Wegberg', 'Weiden in der Oberpfalz', 'Weil am Rhein', 'Weilheim in Oberbayern', 'Weimar', 'Weingarten', 'Weinheim', 'Weinstadt', 'Weißenfels', 'Weiterstadt', 'Werdau', 'Werder (Havel)', 'Werl', 'Wermelskirchen', 'Werne', 'Wernigerode', 'Wertheim', 'Wesel', 'Wesseling', 'Westerstede', 'Westoverledingen', 'Wetter (Ruhr)', 'Wetzlar', 'Weyhe', 'Wiehl', 'Wiesbaden', 'Wiesloch', 'Wilhelmshaven', 'Willich', 'Wilnsdorf', 'Winnenden', 'Winsen (Luhe)', 'Wipperfürth', 'Wismar', 'Witten', 'Lutherstadt Wittenberg', 'Wittmund', 'Wolfenbüttel', 'Wolfsburg', 'Worms', 'Wülfrath', 'Wunstorf', 'Wuppertal', 'Würselen', 'Würzburg',
'Xanten',
'Zeitz', 'Zerbst/Anhalt', 'Zirndorf', 'Zittau', 'Zülpich', 'Zweibrücken', 'Zwickau',
);
protected static $state = array(
'Baden-Württemberg', 'Bayern', 'Berlin', 'Brandenburg', 'Bremen', 'Hamburg', 'Hessen', 'Mecklenburg-Vorpommern', 'Niedersachsen', 'Nordrhein-Westfalen', 'Rheinland-Pfalz', 'Saarland', 'Sachsen', 'Sachsen-Anhalt', 'Schleswig-Holstein', 'Thüringen'
);
protected static $country = array(
'Afghanistan', 'Alandinseln', 'Albanien', 'Algerien', 'Amerikanisch-Ozeanien', 'Amerikanisch-Samoa', 'Amerikanische Jungferninseln', 'Andorra', 'Angola', 'Anguilla', 'Antarktis', 'Antigua und Barbuda', 'Argentinien', 'Armenien', 'Aruba', 'Aserbaidschan', 'Australien', 'Ägypten', 'Äquatorialguinea', 'Äthiopien', 'Äußeres Ozeanien',
'Bahamas', 'Bahrain', 'Bangladesch', 'Barbados', 'Belarus', 'Belgien', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivien', 'Bosnien und Herzegowina', 'Botsuana', 'Bouvetinsel', 'Brasilien', 'Britische Jungferninseln', 'Britisches Territorium im Indischen Ozean', 'Brunei Darussalam', 'Bulgarien', 'Burkina Faso', 'Burundi',
'Chile', 'China', 'Cookinseln', 'Costa Rica', 'Côte d’Ivoire',
'Demokratische Republik Kongo', 'Demokratische Volksrepublik Korea', 'Deutschland', 'Dominica', 'Dominikanische Republik', 'Dschibuti', 'Dänemark',
'Ecuador', 'El Salvador', 'Eritrea', 'Estland', 'Europäische Union',
'Falklandinseln', 'Fidschi', 'Finnland', 'Frankreich', 'Französisch-Guayana', 'Französisch-Polynesien', 'Französische Süd- und Antarktisgebiete', 'Färöer',
'Gabun', 'Gambia', 'Georgien', 'Ghana', 'Gibraltar', 'Grenada', 'Griechenland', 'Grönland', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana',
'Haiti', 'Heard- und McDonald-Inseln', 'Honduras',
'Indien', 'Indonesien', 'Irak', 'Iran', 'Irland', 'Island', 'Isle of Man', 'Israel', 'Italien',
'Jamaika', 'Japan', 'Jemen', 'Jersey', 'Jordanien',
'Kaimaninseln', 'Kambodscha', 'Kamerun', 'Kanada', 'Kap Verde', 'Kasachstan', 'Katar', 'Kenia', 'Kirgisistan', 'Kiribati', 'Kokosinseln', 'Kolumbien', 'Komoren', 'Kongo', 'Kroatien', 'Kuba', 'Kuwait',
'Laos', 'Lesotho', 'Lettland', 'Libanon', 'Liberia', 'Libyen', 'Liechtenstein', 'Litauen', 'Luxemburg',
'Madagaskar', 'Malawi', 'Malaysia', 'Malediven', 'Mali', 'Malta', 'Marokko', 'Marshallinseln', 'Martinique', 'Mauretanien', 'Mauritius', 'Mayotte', 'Mazedonien', 'Mexiko', 'Mikronesien', 'Monaco', 'Mongolei', 'Montenegro', 'Montserrat', 'Mosambik', 'Myanmar',
'Namibia', 'Nauru', 'Nepal', 'Neukaledonien', 'Neuseeland', 'Nicaragua', 'Niederlande', 'Niederländische Antillen', 'Niger', 'Nigeria', 'Niue', 'Norfolkinsel', 'Norwegen', 'Nördliche Marianen',
'Oman', 'Osttimor', 'Österreich',
'Pakistan', 'Palau', 'Palästinensische Gebiete', 'Panama', 'Papua-Neuguinea', 'Paraguay', 'Peru', 'Philippinen', 'Pitcairn', 'Polen', 'Portugal', 'Puerto Rico',
'Republik Korea', 'Republik Moldau', 'Ruanda', 'Rumänien', 'Russische Föderation', 'Réunion',
'Salomonen', 'Sambia', 'Samoa', 'San Marino', 'Saudi-Arabien', 'Schweden', 'Schweiz', 'Senegal', 'Serbien', 'Serbien und Montenegro', 'Seychellen', 'Sierra Leone', 'Simbabwe', 'Singapur', 'Slowakei', 'Slowenien', 'Somalia', 'Sonderverwaltungszone Hongkong', 'Sonderverwaltungszone Macao', 'Spanien', 'Sri Lanka', 'St. Barthélemy', 'St. Helena', 'St. Kitts und Nevis', 'St. Lucia', 'St. Martin', 'St. Pierre und Miquelon', 'St. Vincent und die Grenadinen', 'Sudan', 'Suriname', 'Svalbard und Jan Mayen', 'Swasiland', 'Syrien', 'São Tomé und Príncipe', 'Südafrika', 'Südgeorgien und die Südlichen Sandwichinseln',
'Tadschikistan', 'Taiwan', 'Tansania', 'Thailand', 'Togo', 'Tokelau', 'Tonga', 'Trinidad und Tobago', 'Tschad', 'Tschechische Republik', 'Tunesien', 'Turkmenistan', 'Turks- und Caicosinseln', 'Tuvalu', 'Türkei',
'Uganda', 'Ukraine', 'Unbekannte oder ungültige Region', 'Ungarn', 'Uruguay', 'Usbekistan',
'Vanuatu', 'Vatikanstadt', 'Venezuela', 'Vereinigte Arabische Emirate', 'Vereinigte Staaten', 'Vereinigtes Königreich', 'Vietnam',
'Wallis und Futuna', 'Weihnachtsinsel', 'Westsahara',
'Zentralafrikanische Republik', 'Zypern',
);
protected static $cityFormats = array(
'{{cityName}}',
);
protected static $streetNameFormats = array(
'{{lastName}}{{streetSuffixShort}}',
'{{firstName}}-{{lastName}}-{{streetSuffixLong}}'
);
protected static $streetAddressFormats = array(
'{{streetName}} {{buildingNumber}}',
);
protected static $addressFormats = array(
"{{streetAddress}}\n{{postcode}} {{city}}",
);
public function cityName()
{
return static::randomElement(static::$cityNames);
}
public function streetSuffixShort()
{
return static::randomElement(static::$streetSuffixShort);
}
public function streetSuffixLong()
{
return static::randomElement(static::$streetSuffixLong);
}
/**
* @example 'Berlin'
*/
public static function state()
{
return static::randomElement(static::$state);
}
public static function buildingNumber()
{
return static::regexify(self::numerify(static::randomElement(static::$buildingNumber)));
}
}
| {
"pile_set_name": "Github"
} |
#ifndef OUTPUT_H
#define OUTPUT_H
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include "main-src.h"
#include "unusedparm.h"
#include "masscan-app.h"
struct Masscan;
struct Output;
enum ApplicationProtocol;
enum PortStatus;
/**
* Output plugins
*
* The various means for writing output are essentially plugins. As new methods
* are created, we just fill in a structure of function pointers.
* TODO: this needs to be a loadable DLL, but in the meantime, it's just
* internal structures.
*/
struct OutputType {
const char *file_extension;
void *(*create)(struct Output *out);
void (*open)(struct Output *out, FILE *fp);
void (*close)(struct Output *out, FILE *fp);
void (*status)(struct Output *out, FILE *fp,
time_t timestamp, int status,
unsigned ip, unsigned ip_proto, unsigned port,
unsigned reason, unsigned ttl);
void (*banner)(struct Output *out, FILE *fp,
time_t timestamp, unsigned ip, unsigned ip_proto,
unsigned port, enum ApplicationProtocol proto,
unsigned ttl,
const unsigned char *px, unsigned length);
};
/**
* Masscan creates one "output" structure per thread.
*/
struct Output
{
const struct Masscan *masscan;
char *filename;
struct Source src[8];
FILE *fp;
const struct OutputType *funcs;
unsigned format;
/**
* The timestamp when this scan started. This is preserved in output files
* because that's what nmap does, and a lot of tools parse this.
*/
time_t when_scan_started;
/**
* Whether we've started writing to a file yet. We are lazy writing the
* the file header until we've actually go something to write
*/
unsigned is_virgin_file:1;
struct {
time_t next;
time_t last;
unsigned period;
unsigned offset;
uint64_t filesize;
uint64_t bytes_written;
unsigned filecount; /* filesize rotates */
char *directory;
} rotate;
unsigned is_banner:1;
unsigned is_gmt:1; /* --gmt */
unsigned is_interactive:1; /* echo to command line */
unsigned is_show_open:1; /* show open ports (default) */
unsigned is_show_closed:1; /* show closed ports */
unsigned is_show_host:1; /* show host status info, like up/down */
unsigned is_append:1; /* append to file */
struct {
struct {
uint64_t open;
uint64_t closed;
uint64_t banner;
} tcp;
struct {
uint64_t open;
uint64_t closed;
} udp;
struct {
uint64_t open;
uint64_t closed;
} sctp;
struct {
uint64_t echo;
uint64_t timestamp;
} icmp;
struct {
uint64_t open;
} arp;
} counts;
struct {
unsigned ip;
unsigned port;
ptrdiff_t fd;
uint64_t outstanding;
unsigned state;
} redis;
struct {
char *stylesheet;
} xml;
};
const char *name_from_ip_proto(unsigned ip_proto);
const char *status_string(enum PortStatus x);
const char *reason_string(int x, char *buffer, size_t sizeof_buffer);
const char *normalize_string(const unsigned char *px, size_t length,
char *buf, size_t buf_len);
extern const struct OutputType text_output;
extern const struct OutputType unicornscan_output;
extern const struct OutputType xml_output;
extern const struct OutputType json_output;
extern const struct OutputType certs_output;
extern const struct OutputType binary_output;
extern const struct OutputType null_output;
extern const struct OutputType redis_output;
extern const struct OutputType grepable_output;
/**
* Creates an "output" object. This is called by the receive thread in order
* to send "status" information (open/closed ports) and "banners" to either
* the command-line or to files in specific formats, such as XML or Redis
* @param masscan
* The master configuration.
* @param thread_index
* When there are more than one receive threads, they are differentiated
* by this index number.
* @return
* an output object that must eventually be destroyed by output_destroy().
*/
struct Output *
output_create(const struct Masscan *masscan, unsigned thread_index);
void output_destroy(struct Output *output);
void output_report_status(struct Output *output, time_t timestamp,
int status, unsigned ip, unsigned ip_proto, unsigned port, unsigned reason, unsigned ttl,
const unsigned char mac[6]);
typedef void (*OUTPUT_REPORT_BANNER)(
struct Output *output, time_t timestamp,
unsigned ip, unsigned ip_proto, unsigned port,
unsigned proto, unsigned ttl,
const unsigned char *px, unsigned length);
void output_report_banner(
struct Output *output,
time_t timestamp,
unsigned ip, unsigned ip_proto, unsigned port,
unsigned proto,
unsigned ttl,
const unsigned char *px, unsigned length);
/**
* Regression tests this unit.
* @return
* 0 on success, or positive integer on failure
*/
int
output_selftest(void);
#endif
| {
"pile_set_name": "Github"
} |
/* Software floating-point emulation.
Return 0 iff a == b, 1 iff a > b, 2 iff a ? b, -1 iff a < b
Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson ([email protected]) and
Jakub Jelinek ([email protected]).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
In addition to the permissions in the GNU Lesser General Public
License, the Free Software Foundation gives you unlimited
permission to link the compiled version of this file into
combinations with other programs, and to distribute those
combinations without any restriction coming from the use of this
file. (The Lesser General Public License restrictions do apply in
other respects; for example, they cover modification of the file,
and distribution when not linked into a combine executable.)
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "soft-fp.h"
#include "quad.h"
int __letf2(TFtype a, TFtype b)
{
FP_DECL_EX;
FP_DECL_Q(A); FP_DECL_Q(B);
int r;
FP_UNPACK_RAW_Q(A, a);
FP_UNPACK_RAW_Q(B, b);
FP_CMP_Q(r, A, B, 2);
if (r == 2 && (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B)))
FP_SET_EXCEPTION(FP_EX_INVALID);
FP_HANDLE_EXCEPTIONS;
return r;
}
strong_alias(__letf2, __lttf2);
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2009-2017. DigitalGlobe, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
package org.mrgeo.services.mrspyramid.rendering;
import org.mrgeo.data.raster.MrGeoRaster;
import org.mrgeo.image.MrsPyramid;
import org.mrgeo.services.ServletUtils;
import org.mrgeo.utils.tms.Bounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.Response;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
/**
* Base class for WMS image response writers; Each image format should subclass this.
*/
public abstract class ImageResponseWriterAbstract implements ImageResponseWriter
{
@SuppressWarnings("unused")
private static final Logger log = LoggerFactory.getLogger(ImageResponseWriterAbstract.class);
@Override
public Response.ResponseBuilder write(MrGeoRaster raster)
{
return write(raster, (double[]) (null));
}
@Override
public Response.ResponseBuilder write(MrGeoRaster raster, double[] defaults)
{
try
{
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
writeToStream(raster, defaults, byteStream);
return Response.ok().entity(byteStream.toByteArray())
.encoding(getResponseMimeType())
.header("Content-type", getResponseMimeType());
}
catch (Exception e)
{
log.error("Exception thrown", e);
if (e.getMessage() != null)
{
return Response.serverError().entity(e.getMessage());
}
return Response.serverError().entity("Internal Error");
}
}
@Override
public void write(MrGeoRaster raster, HttpServletResponse response) throws ServletException
{
write(raster, null, response);
}
@Override
public void write(MrGeoRaster raster, double[] defaults, HttpServletResponse response)
throws ServletException
{
response.setContentType(getResponseMimeType());
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
try
{
writeToStream(raster, defaults, byteStream);
ServletUtils.writeImageToResponse(response, byteStream.toByteArray());
}
catch (IOException e)
{
throw new ServletException("Error writing raster", e);
}
}
@Override
public Response.ResponseBuilder write(MrGeoRaster raster, int tileColumn, int tileRow,
double scale, MrsPyramid pyramid) throws IOException
{
return write(raster, pyramid.getMetadata().getDefaultValues());
}
@Override
public void write(MrGeoRaster raster, int tileColumn, int tileRow,
double scale, MrsPyramid pyramid, HttpServletResponse response)
throws ServletException, IOException
{
write(raster, pyramid.getMetadata().getDefaultValues(), response);
}
@Override
public Response.ResponseBuilder write(MrGeoRaster raster, String imageName, Bounds bounds)
{
return write(raster);
}
@Override
public void write(MrGeoRaster raster, String imageName, Bounds bounds,
HttpServletResponse response) throws ServletException
{
write(raster, response);
}
}
| {
"pile_set_name": "Github"
} |
import numpy as np
import tensorflow as tf
from parallel_trpo import utils
class VF(object):
coeffs = None
def __init__(self, session):
self.net = None
self.session = session
def create_net(self, shape):
hidden_size = 64
self.x = tf.placeholder(tf.float32, shape=[None, shape], name="x")
self.y = tf.placeholder(tf.float32, shape=[None], name="y")
with tf.variable_scope("VF"):
h1, _ = utils.make_fully_connected("h1", self.x, hidden_size)
h2, _ = utils.make_fully_connected("h2", h1, hidden_size)
h3, _ = utils.make_fully_connected("h3", h2, 1, final_op=None)
self.net = tf.reshape(h3, (-1,))
l2 = tf.nn.l2_loss(self.net - self.y)
self.train = tf.train.AdamOptimizer().minimize(l2)
self.session.run(tf.global_variables_initializer())
def _features(self, path):
o = path["obs"].astype('float32')
o = o.reshape(o.shape[0], -1)
act = path["action_dists"].astype('float32')
length = len(path["rewards"])
al = np.arange(length).reshape(-1, 1) / 10.0
ret = np.concatenate([o, act, al, np.ones((length, 1))], axis=1)
return ret
def fit(self, paths):
featmat = np.concatenate([self._features(path) for path in paths])
if self.net is None:
self.create_net(featmat.shape[1])
returns = np.concatenate([path["returns"] for path in paths])
for _ in range(50):
self.session.run(self.train, {self.x: featmat, self.y: returns})
def predict(self, path):
if self.net is None:
return np.zeros(len(path["rewards"]))
else:
ret = self.session.run(self.net, {self.x: self._features(path)})
return np.reshape(ret, (ret.shape[0],))
class LinearVF(object):
coeffs = None
def _features(self, path):
o = path["obs"].astype('float32')
o = o.reshape(o.shape[0], -1)
length = len(path["rewards"])
al = np.arange(length).reshape(-1, 1) / 100.0
return np.concatenate([o, o ** 2, al, al ** 2, np.ones((length, 1))], axis=1)
def fit(self, paths):
featmat = np.concatenate([self._features(path) for path in paths])
returns = np.concatenate([path["returns"] for path in paths])
n_col = featmat.shape[1]
lamb = 2.0
self.coeffs = np.linalg.lstsq(featmat.T.dot(featmat) + lamb * np.identity(n_col), featmat.T.dot(returns))[0]
def predict(self, path):
if self.coeffs is None:
return np.zeros(len(path["rewards"]))
else:
return self._features(path).dot(self.coeffs)
| {
"pile_set_name": "Github"
} |
#ifndef _SEPOL_NODE_RECORD_H_
#define _SEPOL_NODE_RECORD_H_
#include <stddef.h>
#include <sepol/context_record.h>
#include <sepol/handle.h>
#ifdef __cplusplus
extern "C" {
#endif
struct sepol_node;
struct sepol_node_key;
typedef struct sepol_node sepol_node_t;
typedef struct sepol_node_key sepol_node_key_t;
#define SEPOL_PROTO_IP4 0
#define SEPOL_PROTO_IP6 1
/* Key */
extern int sepol_node_compare(const sepol_node_t * node,
const sepol_node_key_t * key);
extern int sepol_node_compare2(const sepol_node_t * node,
const sepol_node_t * node2);
extern int sepol_node_key_create(sepol_handle_t * handle,
const char *addr,
const char *mask,
int proto, sepol_node_key_t ** key_ptr);
extern void sepol_node_key_unpack(const sepol_node_key_t * key,
const char **addr,
const char **mask, int *proto);
extern int sepol_node_key_extract(sepol_handle_t * handle,
const sepol_node_t * node,
sepol_node_key_t ** key_ptr);
extern void sepol_node_key_free(sepol_node_key_t * key);
/* Address */
extern int sepol_node_get_addr(sepol_handle_t * handle,
const sepol_node_t * node, char **addr);
extern int sepol_node_get_addr_bytes(sepol_handle_t * handle,
const sepol_node_t * node,
char **addr, size_t * addr_sz);
extern int sepol_node_set_addr(sepol_handle_t * handle,
sepol_node_t * node,
int proto, const char *addr);
extern int sepol_node_set_addr_bytes(sepol_handle_t * handle,
sepol_node_t * node,
const char *addr, size_t addr_sz);
/* Netmask */
extern int sepol_node_get_mask(sepol_handle_t * handle,
const sepol_node_t * node, char **mask);
extern int sepol_node_get_mask_bytes(sepol_handle_t * handle,
const sepol_node_t * node,
char **mask, size_t * mask_sz);
extern int sepol_node_set_mask(sepol_handle_t * handle,
sepol_node_t * node,
int proto, const char *mask);
extern int sepol_node_set_mask_bytes(sepol_handle_t * handle,
sepol_node_t * node,
const char *mask, size_t mask_sz);
/* Protocol */
extern int sepol_node_get_proto(const sepol_node_t * node);
extern void sepol_node_set_proto(sepol_node_t * node, int proto);
extern const char *sepol_node_get_proto_str(int proto);
/* Context */
extern sepol_context_t *sepol_node_get_con(const sepol_node_t * node);
extern int sepol_node_set_con(sepol_handle_t * handle,
sepol_node_t * node, sepol_context_t * con);
/* Create/Clone/Destroy */
extern int sepol_node_create(sepol_handle_t * handle, sepol_node_t ** node_ptr);
extern int sepol_node_clone(sepol_handle_t * handle,
const sepol_node_t * node,
sepol_node_t ** node_ptr);
extern void sepol_node_free(sepol_node_t * node);
#ifdef __cplusplus
}
#endif
#endif
| {
"pile_set_name": "Github"
} |
# Electronics
## Connection Diagram
![connections](files/connections.jpg)
## Bill of Materials (BOM)
### PCB
Name | Thumbnail | Required | Note |
-------- | --------- | -------- | ---- |
main | ![main](files/main_pcb_s.jpg) | 1 |
sub | ![sub](files/sub_pcb_s.jpg) | 2 | there is a difference (SJ1) between<br>the 2 PCB, refer to below
### Components
Name | Thumbnail | Required | Note |
-------- | --------- | -------- | ---- |
[Linkit 7697](https://labs.mediatek.com/zh-tw/platform/linkit-7697) | <img width=200 src='https://labs.mediatek.com/images/img_hdk_7697.png'/> | 1 |
[mini360 DC-DC](https://www.aliexpress.com/w/wholesale-mini360-dc-dc.html) Buck voltage regulator | ![](files/mini360.png) | 7 | adjust to 5V
[PCA9685](https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf) (TSSOP28)| ![](files/pca9685.png) | 2 | TSSOP28 |
Resistor: 220 ohm (0805) | | 18 | SMD |
Resistor: 10K ohm (0805) | | 12 | SMD |
Resistor: 470 ohm (0805) | | 1 | SMD |
LED: green or any color (0805) | | 1 | SMD |
Capacitor: 10 uF (0805) | | 2 | SMD |
14 pin 2.54mm female header | | 4 |
4 pin 2.54mm female header | | 2 |
6 pin 2.54mm female header | | 2 |
4 pin 2.54mm 90 degress male header | | 2 |
6 pin 2.54mm 90 degress male header | | 2 |
4 pin 2.54mm male header | | 2 |
3 pin 2.54mm male header (black) | | 6 |
3 pin 2.54mm male header (yellow) | | 6 |
3 pin 2.54mm male header (red) | | 6 |
2 pin 2.54mm male header | | 1 |
Jumper 2.54mm | | 1 |
## PCB detail
##### Software
Please use **Eagle 7.7** software to open schematic files (main.sch/main.brd and sub.sch/sub.brd)
Eagle 7.7 can be found at http://eagle.autodesk.com/eagle/software-versions/1
Note.
7.7 is an old and free version of Eagle.
Latest Eagle is not free anymore unless you are students
##### Manufacture
There are a lot of online service that can manufacture PCB/PCBA for you (just google `PCB/PCBA`).
Seeed (https://www.seeedstudio.io/fusion_pcb.html) is one of them.
They also provide instructions of generating necessary Gerber files at http://support.seeedstudio.com/knowledgebase/articles/1176532-how-to-generate-gerber-file.
### Main
`main.brd`/`main.sch`
##### Schematic
![main_sch](files/main_sch.png)
Note.
`MP2307` refer to mini360 DC-DC converter
##### Layout
![main_brd](files/main_brd.png)
##### PCB
![main_pcb](files/main_pcb_l.jpg)
### Sub (x2)
`sub.brd`/`usb.sch`
> There is 1 difference between left and right PCB. The SJ1 of right PCB is left open, but `SJ1` of left PCB should be **closed**. (This is i2c address setting of PCB9865)
##### Schematic
![sub_sch](files/sub_sch.png)
Note.
`MP2307` refer to mini360 DC-DC converter
##### Layout
![sub_brd](files/sub_brd.png)
##### PCB
![sub_pcb](files/sub_pcb_l.jpg)
## Servo Connection
Each leg of hexapod has 3 servos (body, thigh, foot), refer to below diagram for correct connection
![leg](files/leg.png)
![servo_conn](files/servo_conn.jpg)
| {
"pile_set_name": "Github"
} |
import random
import usermanager
from constants import *
CONFUSED = 'Растеряться'
SPINE = 'Войти спиной вперёд'
name = 'Человек'
def enter(user, reply):
msg = (
'—Проходи, {0}, чего хотел?\n\nНа негнущихся коленях ты проходишь '
'в середину комнаты. Да, глаза не подвели, это действительно...\n\n'
'*Билл Гейтс*!'
)
reply(msg.format(user.name))
user.set_room_temp('question', 'first')
def action(user, reply, text):
question = user.get_room_temp('question', def_val='first')
if question == 'first':
reply('—Ты чего там стоишь как не родной? Хочешь фокус? Следи за руками... Опа!')
reply('*ВАШЕ УСТРОЙСТВО ОБНОВЛЕНО ДО WINDOWS 10*')
user.set_room_temp('question', '14')
elif question == '14':
reply('Загрузка... 14%')
user.set_room_temp('question', '36')
elif question == '36':
reply('Загрузка... 36%')
user.set_room_temp('question', '28')
elif question == '28':
reply('Загрузка... 28%')
user.set_room_temp('question', '74')
elif question == '74':
reply('Загрузка... 74%')
user.set_room_temp('question', '97')
elif question == '97':
reply('Загрузка... 97%')
user.set_room_temp('question', '99')
elif question == '99':
reply('Загрузка... 99%')
user.set_room_temp('question', 'error')
else:
reply('*Ошибка 0х000009с*')
user.leave(reply)
def get_actions(user):
question = user.get_room_temp('question', def_val='first')
ans = [ ]
if question == 'first':
ans = [ 'Растеряться' ]
else:
ans = [ 'Загрузка' ]
return ans | {
"pile_set_name": "Github"
} |
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
ImageDraw iw(400, 100);
iw.DrawRect(0, 0, 400, 100, White());
iw.DrawEllipse(0, 0, 400, 100, Red());
iw.DrawText(20, 30, AsString(GetSysTime()));
ClearClipboard();
AppendClipboardImage(iw);
}
| {
"pile_set_name": "Github"
} |
#error "This file is just for the make check"
| {
"pile_set_name": "Github"
} |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
/*
Input to cgo -godefs. See README.md
*/
// +godefs map struct_in_addr [4]byte /* in_addr */
// +godefs map struct_in6_addr [16]byte /* in6_addr */
package unix
/*
#define KERNEL
#include <dirent.h>
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/event.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/ptrace.h>
#include <sys/resource.h>
#include <sys/select.h>
#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/route.h>
#include <netinet/in.h>
#include <netinet/icmp6.h>
#include <netinet/tcp.h>
enum {
sizeofPtr = sizeof(void*),
};
union sockaddr_all {
struct sockaddr s1; // this one gets used for fields
struct sockaddr_in s2; // these pad it out
struct sockaddr_in6 s3;
struct sockaddr_un s4;
struct sockaddr_dl s5;
};
struct sockaddr_any {
struct sockaddr addr;
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
};
*/
import "C"
// Machine characteristics; for internal use.
const (
sizeofPtr = C.sizeofPtr
sizeofShort = C.sizeof_short
sizeofInt = C.sizeof_int
sizeofLong = C.sizeof_long
sizeofLongLong = C.sizeof_longlong
)
// Basic types
type (
_C_short C.short
_C_int C.int
_C_long C.long
_C_long_long C.longlong
)
// Time
type Timespec C.struct_timespec
type Timeval C.struct_timeval
// Processes
type Rusage C.struct_rusage
type Rlimit C.struct_rlimit
type _Gid_t C.gid_t
// Files
const ( // Directory mode bits
S_IFMT = C.S_IFMT
S_IFIFO = C.S_IFIFO
S_IFCHR = C.S_IFCHR
S_IFDIR = C.S_IFDIR
S_IFBLK = C.S_IFBLK
S_IFREG = C.S_IFREG
S_IFLNK = C.S_IFLNK
S_IFSOCK = C.S_IFSOCK
S_ISUID = C.S_ISUID
S_ISGID = C.S_ISGID
S_ISVTX = C.S_ISVTX
S_IRUSR = C.S_IRUSR
S_IWUSR = C.S_IWUSR
S_IXUSR = C.S_IXUSR
)
type Stat_t C.struct_stat
type Statfs_t C.struct_statfs
type Flock_t C.struct_flock
type Dirent C.struct_dirent
type Fsid C.fsid_t
// File system limits
const (
PathMax = C.PATH_MAX
)
// Sockets
type RawSockaddrInet4 C.struct_sockaddr_in
type RawSockaddrInet6 C.struct_sockaddr_in6
type RawSockaddrUnix C.struct_sockaddr_un
type RawSockaddrDatalink C.struct_sockaddr_dl
type RawSockaddr C.struct_sockaddr
type RawSockaddrAny C.struct_sockaddr_any
type _Socklen C.socklen_t
type Linger C.struct_linger
type Iovec C.struct_iovec
type IPMreq C.struct_ip_mreq
type IPv6Mreq C.struct_ipv6_mreq
type Msghdr C.struct_msghdr
type Cmsghdr C.struct_cmsghdr
type Inet6Pktinfo C.struct_in6_pktinfo
type IPv6MTUInfo C.struct_ip6_mtuinfo
type ICMPv6Filter C.struct_icmp6_filter
const (
SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
SizeofLinger = C.sizeof_struct_linger
SizeofIPMreq = C.sizeof_struct_ip_mreq
SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
SizeofMsghdr = C.sizeof_struct_msghdr
SizeofCmsghdr = C.sizeof_struct_cmsghdr
SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
)
// Ptrace requests
const (
PTRACE_TRACEME = C.PT_TRACE_ME
PTRACE_CONT = C.PT_CONTINUE
PTRACE_KILL = C.PT_KILL
)
// Events (kqueue, kevent)
type Kevent_t C.struct_kevent
// Select
type FdSet C.fd_set
// Routing and interface messages
const (
SizeofIfMsghdr = C.sizeof_struct_if_msghdr
SizeofIfData = C.sizeof_struct_if_data
SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
SizeofRtMetrics = C.sizeof_struct_rt_metrics
)
type IfMsghdr C.struct_if_msghdr
type IfData C.struct_if_data
type IfaMsghdr C.struct_ifa_msghdr
type IfAnnounceMsghdr C.struct_if_announcemsghdr
type RtMsghdr C.struct_rt_msghdr
type RtMetrics C.struct_rt_metrics
type Mclpool C.struct_mclpool
// Berkeley packet filter
const (
SizeofBpfVersion = C.sizeof_struct_bpf_version
SizeofBpfStat = C.sizeof_struct_bpf_stat
SizeofBpfProgram = C.sizeof_struct_bpf_program
SizeofBpfInsn = C.sizeof_struct_bpf_insn
SizeofBpfHdr = C.sizeof_struct_bpf_hdr
)
type BpfVersion C.struct_bpf_version
type BpfStat C.struct_bpf_stat
type BpfProgram C.struct_bpf_program
type BpfInsn C.struct_bpf_insn
type BpfHdr C.struct_bpf_hdr
type BpfTimeval C.struct_bpf_timeval
// Terminal handling
type Termios C.struct_termios
type Winsize C.struct_winsize
// fchmodat-like syscalls.
const (
AT_FDCWD = C.AT_FDCWD
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
)
// poll
type PollFd C.struct_pollfd
const (
POLLERR = C.POLLERR
POLLHUP = C.POLLHUP
POLLIN = C.POLLIN
POLLNVAL = C.POLLNVAL
POLLOUT = C.POLLOUT
POLLPRI = C.POLLPRI
POLLRDBAND = C.POLLRDBAND
POLLRDNORM = C.POLLRDNORM
POLLWRBAND = C.POLLWRBAND
POLLWRNORM = C.POLLWRNORM
)
// Uname
type Utsname C.struct_utsname
| {
"pile_set_name": "Github"
} |
#!/bin/sh
#
# Detects OS we're compiling on and outputs a file specified by the first
# argument, which in turn gets read while processing Makefile.
#
# The output will set the following variables:
# CC C Compiler path
# CXX C++ Compiler path
# PLATFORM_LDFLAGS Linker flags
# PLATFORM_LIBS Libraries flags
# PLATFORM_SHARED_EXT Extension for shared libraries
# PLATFORM_SHARED_LDFLAGS Flags for building shared library
# This flag is embedded just before the name
# of the shared library without intervening spaces
# PLATFORM_SHARED_CFLAGS Flags for compiling objects for shared library
# PLATFORM_CCFLAGS C compiler flags
# PLATFORM_CXXFLAGS C++ compiler flags. Will contain:
# PLATFORM_SHARED_VERSIONED Set to 'true' if platform supports versioned
# shared libraries, empty otherwise.
#
# The PLATFORM_CCFLAGS and PLATFORM_CXXFLAGS might include the following:
#
# -DLEVELDB_ATOMIC_PRESENT if <atomic> is present
# -DLEVELDB_PLATFORM_POSIX for Posix-based platforms
# -DSNAPPY if the Snappy library is present
#
OUTPUT=$1
PREFIX=$2
if test -z "$OUTPUT" || test -z "$PREFIX"; then
echo "usage: $0 <output-filename> <directory_prefix>" >&2
exit 1
fi
# Delete existing output, if it exists
rm -f $OUTPUT
touch $OUTPUT
if test -z "$CC"; then
CC=cc
fi
if test -z "$CXX"; then
CXX=g++
fi
if test -z "$TMPDIR"; then
TMPDIR=/tmp
fi
# Detect OS
if test -z "$TARGET_OS"; then
TARGET_OS=`uname -s`
fi
COMMON_FLAGS=
CROSS_COMPILE=
PLATFORM_CCFLAGS=
PLATFORM_CXXFLAGS=
PLATFORM_LDFLAGS=
PLATFORM_LIBS=
PLATFORM_SHARED_EXT="so"
PLATFORM_SHARED_LDFLAGS="-shared -Wl,-soname -Wl,"
PLATFORM_SHARED_CFLAGS="-fPIC"
PLATFORM_SHARED_VERSIONED=true
MEMCMP_FLAG=
if [ "$CXX" = "g++" ]; then
# Use libc's memcmp instead of GCC's memcmp. This results in ~40%
# performance improvement on readrandom under gcc 4.4.3 on Linux/x86.
MEMCMP_FLAG="-fno-builtin-memcmp"
fi
case "$TARGET_OS" in
CYGWIN_*)
PLATFORM=OS_LINUX
COMMON_FLAGS="$MEMCMP_FLAG -lpthread -DOS_LINUX -DCYGWIN"
PLATFORM_LDFLAGS="-lpthread"
PORT_FILE=port/port_posix.cc
;;
Darwin)
PLATFORM=OS_MACOSX
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
PLATFORM_SHARED_EXT=dylib
[ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name $INSTALL_PATH/"
PORT_FILE=port/port_posix.cc
;;
Linux)
PLATFORM=OS_LINUX
COMMON_FLAGS="$MEMCMP_FLAG -pthread -DOS_LINUX"
PLATFORM_LDFLAGS="-pthread"
PORT_FILE=port/port_posix.cc
;;
SunOS)
PLATFORM=OS_SOLARIS
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_SOLARIS"
PLATFORM_LIBS="-lpthread -lrt"
PORT_FILE=port/port_posix.cc
;;
FreeBSD)
PLATFORM=OS_FREEBSD
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_FREEBSD"
PLATFORM_LIBS="-lpthread"
PORT_FILE=port/port_posix.cc
;;
GNU/kFreeBSD)
PLATFORM=OS_KFREEBSD
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_KFREEBSD"
PLATFORM_LIBS="-lpthread"
PORT_FILE=port/port_posix.cc
;;
NetBSD)
PLATFORM=OS_NETBSD
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_NETBSD"
PLATFORM_LIBS="-lpthread -lgcc_s"
PORT_FILE=port/port_posix.cc
;;
OpenBSD)
PLATFORM=OS_OPENBSD
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_OPENBSD"
PLATFORM_LDFLAGS="-pthread"
PORT_FILE=port/port_posix.cc
;;
DragonFly)
PLATFORM=OS_DRAGONFLYBSD
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_DRAGONFLYBSD"
PLATFORM_LIBS="-lpthread"
PORT_FILE=port/port_posix.cc
;;
OS_ANDROID_CROSSCOMPILE)
PLATFORM=OS_ANDROID
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_ANDROID -DLEVELDB_PLATFORM_POSIX"
PLATFORM_LDFLAGS="" # All pthread features are in the Android C library
PORT_FILE=port/port_posix.cc
CROSS_COMPILE=true
;;
HP-UX)
PLATFORM=OS_HPUX
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_HPUX"
PLATFORM_LDFLAGS="-pthread"
PORT_FILE=port/port_posix.cc
# man ld: +h internal_name
PLATFORM_SHARED_LDFLAGS="-shared -Wl,+h -Wl,"
;;
IOS)
PLATFORM=IOS
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
[ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
PORT_FILE=port/port_posix.cc
PLATFORM_SHARED_EXT=
PLATFORM_SHARED_LDFLAGS=
PLATFORM_SHARED_CFLAGS=
PLATFORM_SHARED_VERSIONED=
;;
OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS)
PLATFORM=OS_WINDOWS
COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1"
PLATFORM_SOURCES="util/env_win.cc"
PLATFORM_LIBS="-lshlwapi"
PORT_FILE=port/port_win.cc
CROSS_COMPILE=true
;;
*)
echo "Unknown platform!" >&2
exit 1
esac
# We want to make a list of all cc files within util, db, table, and helpers
# except for the test and benchmark files. By default, find will output a list
# of all files matching either rule, so we need to append -print to make the
# prune take effect.
DIRS="$PREFIX/db $PREFIX/util $PREFIX/table"
set -f # temporarily disable globbing so that our patterns aren't expanded
PRUNE_TEST="-name *test*.cc -prune"
PRUNE_BENCH="-name *_bench.cc -prune"
PRUNE_TOOL="-name leveldb_main.cc -prune"
PORTABLE_FILES=`find $DIRS $PRUNE_TEST -o $PRUNE_BENCH -o $PRUNE_TOOL -o -name '*.cc' -print | sort | sed "s,^$PREFIX/,," | tr "\n" " "`
set +f # re-enable globbing
# The sources consist of the portable files, plus the platform-specific port
# file.
echo "SOURCES=$PORTABLE_FILES $PORT_FILE" >> $OUTPUT
echo "MEMENV_SOURCES=helpers/memenv/memenv.cc" >> $OUTPUT
if [ "$CROSS_COMPILE" = "true" ]; then
# Cross-compiling; do not try any compilation tests.
true
else
CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$"
# If -std=c++0x works, use <atomic> as fallback for when memory barriers
# are not available.
$CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF
#include <atomic>
int main() {}
EOF
if [ "$?" = 0 ]; then
COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT"
PLATFORM_CXXFLAGS="-std=c++0x"
else
COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
fi
# Test whether tcmalloc is available
$CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF
int main() {}
EOF
if [ "$?" = 0 ]; then
PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
fi
rm -f $CXXOUTPUT 2>/dev/null
fi
PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
PLATFORM_CXXFLAGS="$PLATFORM_CXXFLAGS $COMMON_FLAGS"
echo "CC=$CC" >> $OUTPUT
echo "CXX=$CXX" >> $OUTPUT
echo "PLATFORM=$PLATFORM" >> $OUTPUT
echo "PLATFORM_LDFLAGS=$PLATFORM_LDFLAGS" >> $OUTPUT
echo "PLATFORM_LIBS=$PLATFORM_LIBS" >> $OUTPUT
echo "PLATFORM_CCFLAGS=$PLATFORM_CCFLAGS" >> $OUTPUT
echo "PLATFORM_CXXFLAGS=$PLATFORM_CXXFLAGS" >> $OUTPUT
echo "PLATFORM_SHARED_CFLAGS=$PLATFORM_SHARED_CFLAGS" >> $OUTPUT
echo "PLATFORM_SHARED_EXT=$PLATFORM_SHARED_EXT" >> $OUTPUT
echo "PLATFORM_SHARED_LDFLAGS=$PLATFORM_SHARED_LDFLAGS" >> $OUTPUT
echo "PLATFORM_SHARED_VERSIONED=$PLATFORM_SHARED_VERSIONED" >> $OUTPUT
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2018
* Ubiquitous Knowledge Processing (UKP) Lab and FG Language Technology
* Technische Universität Darmstadt
*
* 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 de.tudarmstadt.ukp.clarin.webanno.webapp.remoteapi.config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import de.tudarmstadt.ukp.clarin.webanno.webapp.remoteapi.LegacyRemoteApiController;
import de.tudarmstadt.ukp.clarin.webanno.webapp.remoteapi.aero.AeroRemoteApiController;
@Configuration
public class RemoteApiConfig
{
public static final String REMOTE_API_ENABLED_CONDITION =
"${remote-api.enabled:false} || ${webanno.remote-api.enable:false}";
@ConditionalOnExpression(REMOTE_API_ENABLED_CONDITION)
@Bean
public AeroRemoteApiController aeroRemoteApiController()
{
return new AeroRemoteApiController();
}
@ConditionalOnExpression(REMOTE_API_ENABLED_CONDITION)
@Bean
public LegacyRemoteApiController legacyRemoteApiController()
{
return new LegacyRemoteApiController();
}
}
| {
"pile_set_name": "Github"
} |
<div class="layout-absolute">
<div class="control-scrollbar" data-control="scrollbar">
<div class="control-assetlist" data-control="assetlist" id="<?= $this->getId('asset-list') ?>">
<?= $this->makePartial('items', ['items'=>$data]) ?>
</div>
</div>
</div> | {
"pile_set_name": "Github"
} |
# Copyright (C) 2016 WebDevStudios
# This file is distributed under the same license as the CMB2 package.
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: CMB2\n"
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/cmb2\n"
"POT-Creation-Date: 2016-06-27 17:01:22+00:00\n"
"PO-Revision-Date: 2016-06-27 17:01+0000\n"
"Last-Translator: Justin Sternberg <[email protected]>\n"
"Language-Team: Belarusian (http://www.transifex.com/wp-translations/cmb2/language/be/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: be\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
"X-Generator: grunt-wp-i18n 0.4.9\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-Country: United States\n"
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Textdomain-Support: yes\n"
#: example-functions.php:117 tests/test-cmb-field.php:255
msgid "Test Metabox"
msgstr ""
#: example-functions.php:130 example-functions.php:436
msgid "Test Text"
msgstr ""
#: example-functions.php:131 example-functions.php:144
#: example-functions.php:157 example-functions.php:165
#: example-functions.php:173 example-functions.php:182
#: example-functions.php:190 example-functions.php:205
#: example-functions.php:213 example-functions.php:221
#: example-functions.php:238 example-functions.php:247
#: example-functions.php:260 example-functions.php:267
#: example-functions.php:274 example-functions.php:288
#: example-functions.php:301 example-functions.php:314
#: example-functions.php:326 example-functions.php:335
#: example-functions.php:343 example-functions.php:352
#: example-functions.php:359 example-functions.php:373
#: example-functions.php:437 example-functions.php:528
#: example-functions.php:536 example-functions.php:543
#: example-functions.php:550 example-functions.php:557
#: example-functions.php:564 example-functions.php:571
#: example-functions.php:598 example-functions.php:606
#: example-functions.php:613 example-functions.php:650
#: tests/test-cmb-field.php:267
msgid "field description (optional)"
msgstr ""
#: example-functions.php:143
msgid "Test Text Small"
msgstr ""
#: example-functions.php:156
msgid "Test Text Medium"
msgstr ""
#: example-functions.php:164
msgid "Custom Rendered Field"
msgstr ""
#: example-functions.php:172
msgid "Website URL"
msgstr ""
#: example-functions.php:181
msgid "Test Text Email"
msgstr ""
#: example-functions.php:189
msgid "Test Time"
msgstr ""
#: example-functions.php:197 example-functions.php:198
msgid "Time zone"
msgstr ""
#: example-functions.php:204
msgid "Test Date Picker"
msgstr ""
#: example-functions.php:212
msgid "Test Date Picker (UNIX timestamp)"
msgstr ""
#: example-functions.php:220
msgid "Test Date/Time Picker Combo (UNIX timestamp)"
msgstr ""
#: example-functions.php:237
msgid "Test Money"
msgstr ""
#: example-functions.php:246
msgid "Test Color Picker"
msgstr ""
#: example-functions.php:259
msgid "Test Text Area"
msgstr ""
#: example-functions.php:266
msgid "Test Text Area Small"
msgstr ""
#: example-functions.php:273
msgid "Test Text Area for Code"
msgstr ""
#: example-functions.php:280
msgid "Test Title Weeeee"
msgstr ""
#: example-functions.php:281
msgid "This is a title description"
msgstr ""
#: example-functions.php:287
msgid "Test Select"
msgstr ""
#: example-functions.php:293 example-functions.php:306
#: example-functions.php:318
msgid "Option One"
msgstr ""
#: example-functions.php:294 example-functions.php:307
#: example-functions.php:319
msgid "Option Two"
msgstr ""
#: example-functions.php:295 example-functions.php:308
#: example-functions.php:320
msgid "Option Three"
msgstr ""
#: example-functions.php:300
msgid "Test Radio inline"
msgstr ""
#: example-functions.php:313
msgid "Test Radio"
msgstr ""
#: example-functions.php:325
msgid "Test Taxonomy Radio"
msgstr ""
#: example-functions.php:334
msgid "Test Taxonomy Select"
msgstr ""
#: example-functions.php:342
msgid "Test Taxonomy Multi Checkbox"
msgstr ""
#: example-functions.php:351
msgid "Test Checkbox"
msgstr ""
#: example-functions.php:358 tests/test-cmb-field.php:266
msgid "Test Multi Checkbox"
msgstr ""
#: example-functions.php:364 tests/test-cmb-field.php:272
msgid "Check One"
msgstr ""
#: example-functions.php:365 tests/test-cmb-field.php:273
msgid "Check Two"
msgstr ""
#: example-functions.php:366 tests/test-cmb-field.php:274
msgid "Check Three"
msgstr ""
#: example-functions.php:372
msgid "Test wysiwyg"
msgstr ""
#: example-functions.php:380
msgid "Test Image"
msgstr ""
#: example-functions.php:381
msgid "Upload an image or enter a URL."
msgstr ""
#: example-functions.php:387
msgid "Multiple Files"
msgstr ""
#: example-functions.php:388
msgid "Upload or add multiple images/attachments."
msgstr ""
#: example-functions.php:395
msgid "oEmbed"
msgstr ""
#: example-functions.php:396
msgid ""
"Enter a youtube, twitter, or instagram URL. Supports services listed at <a "
"href=\"http://codex.wordpress.org/Embeds\">http://codex.wordpress.org/Embeds</a>."
msgstr ""
#: example-functions.php:427
msgid "About Page Metabox"
msgstr ""
#: example-functions.php:456
msgid "Repeating Field Group"
msgstr ""
#: example-functions.php:464
msgid "Generates reusable form entries"
msgstr ""
#: example-functions.php:466
msgid "Entry {#}"
msgstr ""
#: example-functions.php:467
msgid "Add Another Entry"
msgstr ""
#: example-functions.php:468
msgid "Remove Entry"
msgstr ""
#: example-functions.php:481
msgid "Entry Title"
msgstr ""
#: example-functions.php:488
msgid "Description"
msgstr "Апісанне"
#: example-functions.php:489
msgid "Write a short description for this entry"
msgstr ""
#: example-functions.php:495
msgid "Entry Image"
msgstr ""
#: example-functions.php:501
msgid "Image Caption"
msgstr ""
#: example-functions.php:520
msgid "User Profile Metabox"
msgstr ""
#: example-functions.php:527 example-functions.php:597
msgid "Extra Info"
msgstr ""
#: example-functions.php:535
msgid "Avatar"
msgstr ""
#: example-functions.php:542
msgid "Facebook URL"
msgstr ""
#: example-functions.php:549
msgid "Twitter URL"
msgstr ""
#: example-functions.php:556
msgid "Google+ URL"
msgstr ""
#: example-functions.php:563
msgid "Linkedin URL"
msgstr ""
#: example-functions.php:570
msgid "User Field"
msgstr ""
#: example-functions.php:590
msgid "Category Metabox"
msgstr ""
#: example-functions.php:605
msgid "Term Image"
msgstr ""
#: example-functions.php:612
msgid "Arbitrary Term Field"
msgstr ""
#: example-functions.php:634
msgid "Theme Options Metabox"
msgstr ""
#: example-functions.php:649
msgid "Site Background Color"
msgstr ""
#: includes/CMB2.php:129
msgid "Metabox configuration is required to have an ID parameter"
msgstr ""
#: includes/CMB2.php:418
msgid "Click to toggle"
msgstr ""
#: includes/CMB2_Ajax.php:71
msgid "Please Try Again"
msgstr ""
#: includes/CMB2_Ajax.php:173 tests/cmb-tests-base.php:59
msgid "Remove Embed"
msgstr ""
#: includes/CMB2_Ajax.php:177 tests/cmb-tests-base.php:64
msgid "No oEmbed Results Found for %s. View more info at"
msgstr ""
#: includes/CMB2_Field.php:1186
msgid "Add Group"
msgstr ""
#: includes/CMB2_Field.php:1187
msgid "Remove Group"
msgstr ""
#: includes/CMB2_Field.php:1209 includes/CMB2_Field.php:1213
#: tests/test-cmb-field.php:229
msgid "None"
msgstr "Няма"
#: includes/CMB2_Field.php:1269
msgid "Sorry, this field does not have a cmb_id specified."
msgstr ""
#: includes/CMB2_Field_Display.php:408 includes/CMB2_JS.php:139
#: includes/types/CMB2_Type_File_Base.php:75 tests/test-cmb-types-base.php:143
#: tests/test-cmb-types.php:701
msgid "File:"
msgstr ""
#: includes/CMB2_JS.php:86 includes/CMB2_JS.php:119
msgid "Clear"
msgstr "Ачысціць"
#: includes/CMB2_JS.php:87
msgid "Default"
msgstr "Па змаўчанні"
#: includes/CMB2_JS.php:88
msgid "Select Color"
msgstr "Абраць колер"
#: includes/CMB2_JS.php:89
msgid "Current Color"
msgstr "Бягучы колер"
#: includes/CMB2_JS.php:110
msgid "Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday"
msgstr ""
#: includes/CMB2_JS.php:111
msgid "Su, Mo, Tu, We, Th, Fr, Sa"
msgstr ""
#: includes/CMB2_JS.php:112
msgid "Sun, Mon, Tue, Wed, Thu, Fri, Sat"
msgstr ""
#: includes/CMB2_JS.php:113
msgid ""
"January, February, March, April, May, June, July, August, September, "
"October, November, December"
msgstr ""
#: includes/CMB2_JS.php:114
msgid "Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec"
msgstr ""
#: includes/CMB2_JS.php:115
msgid "Next"
msgstr "Наступнае"
#: includes/CMB2_JS.php:116
msgid "Prev"
msgstr "Папярэдняе"
#: includes/CMB2_JS.php:117
msgid "Today"
msgstr ""
#: includes/CMB2_JS.php:118 includes/CMB2_JS.php:128
msgid "Done"
msgstr "Гатова"
#: includes/CMB2_JS.php:122
msgid "Choose Time"
msgstr ""
#: includes/CMB2_JS.php:123
msgid "Time"
msgstr ""
#: includes/CMB2_JS.php:124
msgid "Hour"
msgstr ""
#: includes/CMB2_JS.php:125
msgid "Minute"
msgstr ""
#: includes/CMB2_JS.php:126
msgid "Second"
msgstr ""
#: includes/CMB2_JS.php:127
msgid "Now"
msgstr ""
#: includes/CMB2_JS.php:135
msgid "Use this file"
msgstr ""
#: includes/CMB2_JS.php:136
msgid "Use these files"
msgstr ""
#: includes/CMB2_JS.php:137 includes/types/CMB2_Type_File_Base.php:61
msgid "Remove Image"
msgstr ""
#: includes/CMB2_JS.php:138 includes/CMB2_Types.php:257
#: includes/types/CMB2_Type_File_Base.php:80 tests/test-cmb-types-base.php:143
#: tests/test-cmb-types.php:47 tests/test-cmb-types.php:55
#: tests/test-cmb-types.php:701
msgid "Remove"
msgstr "Выдаліць"
#: includes/CMB2_JS.php:140 includes/types/CMB2_Type_File_Base.php:78
#: tests/test-cmb-types-base.php:143 tests/test-cmb-types.php:701
msgid "Download"
msgstr ""
#: includes/CMB2_JS.php:141
msgid "Select / Deselect All"
msgstr ""
#: includes/CMB2_Types.php:194
msgid "Add Row"
msgstr ""
#: includes/CMB2_hookup.php:145
msgid ""
"Term Metadata is a WordPress > 4.4 feature. Please upgrade your WordPress "
"install."
msgstr ""
#: includes/CMB2_hookup.php:149
msgid "Term metaboxes configuration requires a 'taxonomies' parameter"
msgstr ""
#: includes/helper-functions.php:93
msgid "No oEmbed Results Found for %s. View more info at %s"
msgstr ""
#: includes/helper-functions.php:279
msgid "Save"
msgstr "Захаваць"
#: includes/types/CMB2_Type_File.php:36 tests/test-cmb-types.php:683
#: tests/test-cmb-types.php:701
msgid "Add or Upload File"
msgstr ""
#: includes/types/CMB2_Type_File_List.php:36 tests/test-cmb-types.php:639
#: tests/test-cmb-types.php:663
msgid "Add or Upload Files"
msgstr ""
#: includes/types/CMB2_Type_Taxonomy_Multicheck.php:27
#: includes/types/CMB2_Type_Taxonomy_Radio.php:25
msgid "No terms"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "CMB2"
msgstr ""
#. Plugin URI of the plugin/theme
msgid "https://github.com/CMB2/CMB2"
msgstr ""
#. Description of the plugin/theme
msgid ""
"CMB2 will create metaboxes and forms with custom fields that will blow your "
"mind."
msgstr ""
#. Author of the plugin/theme
msgid "WebDevStudios"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://webdevstudios.com"
msgstr ""
#: includes/CMB2_JS.php:109
msgctxt "Valid formatDate string for jquery-ui datepicker"
msgid "mm/dd/yy"
msgstr ""
#: includes/CMB2_JS.php:129
msgctxt ""
"Valid formatting string, as per "
"http://trentrichardson.com/examples/timepicker/"
msgid "hh:mm TT"
msgstr ""
| {
"pile_set_name": "Github"
} |
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* https://opensso.dev.java.net/public/CDDLv1.0.html or
* opensso/legal/CDDLv1.0.txt
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: SsoServerTopologyImpl.java,v 1.2 2009/10/21 00:03:15 bigfatrat Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
package com.sun.identity.monitoring;
import com.sun.identity.shared.debug.Debug;
import com.sun.management.snmp.agent.SnmpMib;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
/**
* This class extends the "SsoServerTopology" class.
*/
public class SsoServerTopologyImpl extends SsoServerTopology {
private static Debug debug = null;
/**
* Constructor
*/
public SsoServerTopologyImpl (SnmpMib myMib) {
super(myMib);
init(myMib, null);
}
public SsoServerTopologyImpl (SnmpMib myMib, MBeanServer server) {
super(myMib, server);
init(myMib, server);
}
private void init (SnmpMib myMib, MBeanServer server) {
if (debug == null) {
debug = Debug.getInstance("amMonitoring");
}
String classModule = "SsoServerTopologyImpl.init:";
/*
* server topology has the
* servers table (all servers known to this server)
* SsoServerServerTable
* sites table (sites and servers)
* SsoServerSiteMapTable
* site map table (site-to-server mapping)
* SsoServerSitesTable
*
* this init should get instances of
* SsoServerServerEntryImpl
* SsoServerSitesEntryImpl
* SsoServerSiteMapEntryImpl
* and add them to their corresponding tables.
*/
Map<String, String> ntbl = Agent.getNamingTable();
Map<String, String> sidtbl = Agent.getSiteIdTable();
for (Map.Entry<String, String> entry : sidtbl.entrySet()) {
String svrId = entry.getKey();
String svrURL = ntbl.get(svrId);
String siteId = sidtbl.get(svrId);
URL url = null;
String proto = null;
String host = null;
int port = 0;
try {
url = new URL(svrURL);
proto = url.getProtocol();
host = url.getHost();
port = url.getPort();
} catch (MalformedURLException mue) {
debug.error(classModule + "invalid URL: " +
svrURL + "; " + mue.getMessage());
}
Integer iport = Integer.valueOf(1);
Integer iid = Integer.valueOf(0);
try {
iport = Integer.valueOf(port);
iid = Integer.valueOf(svrId);
} catch (NumberFormatException nfe) {
debug.error(classModule + "invalid port (" +
port + ") or server id (" + svrId + "): " +
nfe.getMessage(), nfe);
}
SsoServerServerEntryImpl ssrv =
new SsoServerServerEntryImpl(myMib);
ssrv.ServerPort = iport;
ssrv.ServerHostName = host;
ssrv.ServerProtocol = proto;
ssrv.ServerId = iid;
/* need a way to know what the real status is */
ssrv.ServerStatus = Integer.valueOf(1);
final ObjectName svrName =
ssrv.createSsoServerServerEntryObjectName(server);
try {
SsoServerServerTable.addEntry(ssrv, svrName);
if ((server != null) && (svrName != null)) {
server.registerMBean(ssrv, svrName);
}
} catch (Exception ex) {
debug.error(classModule + svrURL, ex);
}
/*
* fill the SsoServerSitesTable.
* entries have siteid, site name, and site state
* sidKeys has the serverIDs; the values are the site they
* belong to.
*
* unfortunately, SiteConfiguration.getSites(SSOToken) needs
* an SSOToken, which can be gotten after the server is more
* closer to being operational than when the Agent is started,
* so that part will have to be updated at a later time.
*
* where the key == value in sidKeys is the one that is the site
*/
if (debug.messageEnabled()) {
debug.message(classModule + "svrId = " + svrId
+ ", siteId = " + siteId);
}
try {
Integer.valueOf(siteId);
} catch (NumberFormatException nfe) {
debug.error(classModule + "invalid siteid ("
+ siteId + "): " + nfe.getMessage(), nfe);
}
}
}
}
| {
"pile_set_name": "Github"
} |
# Programmer: limodou
# E-mail: [email protected]
#
# Copyleft 2006 limodou
#
# Distributed under the terms of the GPL (GNU Public License)
#
# NewEdit 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
#
# $Id$
import wx
from modules import Mixin
from modules import common
pagename = tr("Spell Check")
def createSpellCheckWindow(win):
if not win.panel.getPage(pagename):
import SpellCheck
page = SpellCheck.SpellCheck(win.panel.createNotebook('bottom'))
win.panel.addPage('bottom', page, pagename)
return pagename
Mixin.setMixin('mainframe', 'createSpellCheckWindow', createSpellCheckWindow)
def add_mainframe_menu(menulist):
menulist.extend([('IDM_TOOL', #parent menu id
[
(160, 'IDM_TOOL_SPELLCHECK', tr('Spell Check') + '\tF7', wx.ITEM_NORMAL, 'OnToolSpellCheck', tr('Spell check for current document.')),
]),
])
Mixin.setPlugin('mainframe', 'add_menu', add_mainframe_menu)
def OnToolSpellCheck(win, event):
try:
from enchant.checker import SpellChecker
except:
common.showerror(win, tr('You should install PyEnchant module first.\n Or there are something wrong as import the module'))
return
p = win.createSpellCheckWindow()
win.panel.showPage(p)
Mixin.setMixin('mainframe', 'OnToolSpellCheck', OnToolSpellCheck)
def pref_init(pref):
pref.default_spellcheck_dict = ''
Mixin.setPlugin('preference', 'init', pref_init)
| {
"pile_set_name": "Github"
} |
// Drawing mixins
// generic drawing of more complex things
@function draw_widget_edge($c:$borders_edge) {
// outer highlight "used" on most widgets
@return 0 1px $c;
}
// provide font size in rem, with px fallback
@mixin fontsize($size: 24, $base: 16) {
font-size: round($size) + pt;
//font-size: ($size / $base) * 1rem;
}
@mixin draw_shadows($shadow1, $shadow2:none, $shadow3:none, $shadow4:none) {
//
// Helper function to stack up to 4 box-shadows;
//
@if $shadow4!=none { box-shadow: $shadow1, $shadow2, $shadow3, $shadow4; }
@else if $shadow3!=none { box-shadow: $shadow1, $shadow2, $shadow3; }
@else if $shadow2!=none { box-shadow: $shadow1, $shadow2; }
@else { box-shadow: $shadow1; }
}
// entries
@mixin entry($t, $fc:$selected_bg_color, $edge: $borders_edge) {
//
// Entries drawing function
//
// $t: entry type
// $fc: focus color
// $edge: set to none to not draw the bottom edge or specify a color to not use the default one
//
// possible $t values:
// normal, focus, insensitive
//
@if $t==normal {
background-color: $base_color;
border-color: $borders_color;
}
@if $t==focus {
border-color: if($fc==$selected_bg_color,
$selected_borders_color,
darken($fc,35%));
box-shadow: inset 0 0 0 1px $fc;
}
@if $t==hover { }
@if $t==insensitive {
color: $insensitive_fg_color;
border-color: $insensitive_bg_color;
box-shadow: none;
}
}
// buttons
@function draw_border_color ($c) {
//
// colored buttons want the border form the base color
//
@return if($variant == 'light', darken($c, 18%), darken($c, 4%));
}
@function draw_text_shadow_color ($tc:$fg_color, $bg:$bg_color) {
//
// calculate the color of text shadows
//
// $tc is the text color
// $bg is the background color
//
$lbg: lightness($bg)/100%;
@if lightness($tc)<50% { @return rgba(255,255,255,$lbg/($lbg*1.3)); }
@else { @return rgba(0,0,0,1-$lbg*0.8); }
}
@function draw_button_hilight_color($c) {
//
// calculate the right top highlight color for buttons
//
// $c: base color;
//
@if lightness($c)>90% { @return white; }
@else if lightness($c)>80% { @return rgba(255,255,255, 0.7); }
@else if lightness($c)>50% { @return rgba(255,255,255, 0.5); }
@else if lightness($c)>40% { @return rgba(255,255,255, 0.3); }
@else { @return rgba(255,255,255, 0.1); }
}
@mixin draw_button_text_shadow ($tc:$fg_color, $bg:$bg_color) {
//
// helper function for the text emboss effect
//
// $tc is the optional text color, not the shadow color
//
// TODO: this functions needs a way to deal with special cases
//
$shadow: draw_text_shadow_color($tc, $bg);
@if lightness($tc)<50% {
text-shadow: 0 1px $shadow;
icon-shadow: 0 1px $shadow;
}
@else {
text-shadow: 0 -1px $shadow;
icon-shadow: 0 -1px $shadow;
}
}
@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: $borders_edge, $shadow: $shadow_color) {
//
// Button drawing function
//
// $t: button type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
// $edge: set to none to not draw the bottom edge or specify a color to not
// use the default one
// $shadow: set to none to not draw the drop shadow or specify a color to not
// use the default one
//
// possible $t values:
// normal, hover, active, insensitive, insensitive-active,
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
//
$hilight_color: draw_button_hilight_color($c);
$button_edge: if($edge == none, none, draw_widget_edge($edge));
$blank_edge: if($edge == none, none, draw_widget_edge(transparentize($edge,1)));
$button_shadow: if($shadow == none, none, 0 1px 1px 0 $shadow);
// normal button
@if $t==normal {
color: $tc;
background-color: lighten($c, 3%);
border-color: draw_border_color($c);
@include draw_shadows($button_shadow);
// box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
text-shadow: 0 1px $text_shadow_color;
icon-shadow: 0 1px $text_shadow_color;
}
// focused button
@if $t==focus {
color: $tc;
text-shadow: 0 1px $text_shadow_color;
icon-shadow: 0 1px $text_shadow_color;
box-shadow: inset 0 0 0 2px transparentize($selected_bg_color, 0.4);
//border-color: $selected_bg_color;
}
// hover button
@else if $t==hover {
color: $tc;
background-color: lighten($c, if($variant == 'light', 8%, 5%));
border-color: if($variant == 'light', draw_border_color(lighten($c, 7%)), draw_border_color($c));
@include draw_shadows($button_shadow);
text-shadow: 0 1px $text_shadow_color;
icon-shadow: 0 1px $text_shadow_color;
}
// active button
@else if $t==active {
color: $tc;
background-color: darken($c,3%);
border-color: draw_border_color(if($variant == 'light', $c, darken($c,7%)));
text-shadow: none;
icon-shadow: none;
box-shadow: none;
}
// insensitive button
@else if $t==insensitive {
color: $insensitive_fg_color;
border-color: $insensitive_borders_color;
background-color: $insensitive_bg_color;
box-shadow: none;
text-shadow: none;
icon-shadow: none;
}
// reset
@else if $t==undecorated {
border-color: transparent;
background-color: transparent;
background-image: none;
@include draw_shadows(inset 0 1px rgba(255,255,255,0),$blank_edge);
text-shadow: none;
icon-shadow: none;
}
}
// overview icons
@mixin overview-icon($color) {
.overview-icon {
@extend %icon_tile;
color: $color;
}
&:hover,
&:selected {
.overview-icon {
background-color: transparentize($color, .9);
}
}
&:focus {
.overview-icon {
background-color: transparentize($color, .7);
// border-color: $selected_bg_color;
}
}
&:drop {
.overview-icon {
background-color: transparentize($selected_bg_color, .15);
}
}
&:active,
&:checked {
.overview-icon {
background-color: transparentize(darken($osd_bg_color, 10%), .5);
}
}
}
| {
"pile_set_name": "Github"
} |
Metadata-Version: 1.0
Name: discover
Version: 0.4.0
Summary: Test discovery for unittest. Backported from Python 2.7 for Python 2.4+
Home-page: http://pypi.python.org/pypi/discover/
Author: Michael Foord
Author-email: [email protected]
License: UNKNOWN
Description: This is the test discovery mechanism and ``load_tests`` protocol for unittest
backported from Python 2.7 to work with Python 2.4 or more recent (including
Python 3).
.. note::
Test discovery is just part of what is new in unittest in Python 2.7. All
of the new features have been backported to run on Python 2.4-2.6, including
test discovery. This is the
`unittest2 package <http://pypi.python.org/pypi/unittest2>`_.
discover can be installed with pip or easy_install. After installing switch the
current directory to the top level directory of your project and run::
python -m discover
python discover.py
(If you have setuptools or `distribute <http://pypi.python.org/pypi/distribute>`_
installed you will also have a ``discover`` script available.)
This will discover all tests (with certain restrictions) from the current
directory. The discover module has several options to control its behavior (full
usage options are displayed with ``python -m discover -h``)::
Usage: discover.py [options]
Options:
-v, --verbose Verbose output
-s directory Directory to start discovery ('.' default)
-p pattern Pattern to match test files ('test*.py' default)
-t directory Top level directory of project (default to
start directory)
For test discovery all test modules must be importable from the top
level directory of the project.
For example to use a different pattern for matching test modules run::
python -m discover -p '*test.py'
(For UNIX-like shells like Bash you need to put quotes around the test pattern
or the shell will attempt to expand the pattern instead of passing it through to
discover. On Windows you must *not* put quotes around the pattern as the
Windows shell will pass the quotes to discover as well.)
Test discovery is implemented in ``discover.DiscoveringTestLoader.discover``. As
well as using discover as a command line script you can import
``DiscoveringTestLoader``, which is a subclass of ``unittest.TestLoader``, and
use it in your test framework.
This method finds and returns all test modules from the specified start
directory, recursing into subdirectories to find them. Only test files that
match *pattern* will be loaded. (Using shell style pattern matching.)
All test modules must be importable from the top level of the project. If
the start directory is not the top level directory then the top level
directory must be specified separately.
The ``load_tests`` protocol allows test modules and packages to customize how
they are loaded. This is implemented in
``discover.DiscoveringTestLoader.loadTestsFromModule``. If a test module defines
a ``load_tests`` function then tests are loaded from the module by calling
``load_tests`` with three arguments: `loader`, `standard_tests`, `None`.
If a test package name (directory with `__init__.py`) matches the
pattern then the package will be checked for a ``load_tests``
function. If this exists then it will be called with *loader*, *tests*,
*pattern*.
.. note::
The default pattern for matching tests is ``test*.py``. The '.py' means
that it will match test files and *not* match package names. You can
change this by changing the pattern using a command line option like
``-p 'test*'``.
If ``load_tests`` exists then discovery does *not* recurse into the package,
``load_tests`` is responsible for loading all tests in the package.
The pattern is deliberately not stored as a loader attribute so that
packages can continue discovery themselves. *top_level_dir* is stored so
``load_tests`` does not need to pass this argument in to
``loader.discover()``.
discover.py is maintained in a google code project (where bugs and feature
requests should be posted): http://code.google.com/p/unittest-ext/
The latest development version of discover.py can be found at:
http://code.google.com/p/unittest-ext/source/browse/trunk/discover.py
CHANGELOG
=========
2010/06/11 0.4.0
----------------
* Addition of a setuptools compatible test collector. Set
"test_suite = 'discover.collector'" in setup.py. "setup.py test" will start
test discovery with default parameters from the same directory as the setup.py.
* Allow test discovery using dotted module names instead of a path.
* Addition of a setuptools compatible entrypoint for the discover script.
* A faulty load_tests function will not halt test discovery. A failing test
is created to report the error.
* If test discovery imports a module from the wrong location (usually because
the module is globally installed and the user is expecting to run tests
against a development version in a different location) then discovery halts
with an ImportError and the problem is reported.
* Matching files during test discovery is done in
``DiscoveringTestLoader._match_path``. This method can be overriden in
subclasses to, for example, match on the full file path or use regular
expressions for matching.
* Tests for discovery ported from unittest2. (The tests require unittest2 to
run.)
Feature parity with the ``TestLoader`` in Python 2.7 RC 1.
2010/02/07 0.3.2
----------------
* If ``load_tests`` exists it is passed the standard tests as a ``TestSuite``
rather than a list of tests.
2009/09/13 0.3.1
----------------
* Fixed a problem when a package directory matches the discovery pattern.
2009/08/20 0.3.0
----------------
* Failing to import a file (e.g. due to a syntax error) no longer halts
discovery but is reported as a failure.
* Discovery will not attempt to import test files whose names are not valid Python
identifiers, even if they match the pattern.
Keywords: unittest,testing,tests
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.4
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.0
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
| {
"pile_set_name": "Github"
} |
/*===---- clflushoptintrin.h - CLFLUSHOPT intrinsic ------------------------------------===
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*===-----------------------------------------------------------------------===
*/
#ifndef __IMMINTRIN_H
#error "Never use <clflushoptintrin.h> directly; include <immintrin.h> instead."
#endif
#ifndef __CLFLUSHOPTINTRIN_H
#define __CLFLUSHOPTINTRIN_H
/* Define the default attributes for the functions in this file. */
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("clflushopt")))
static __inline__ void __DEFAULT_FN_ATTRS
_mm_clflushopt(char * __m) {
__builtin_ia32_clflushopt(__m);
}
#undef __DEFAULT_FN_ATTRS
#endif
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<title>SpringBoot - validator</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p>当前时间:${.now?string("yyyy-MM-dd HH:mm:ss.sss")}</p>
<div class="body">
<form action="/saveUser" method="post">
<table>
<tbody>
<tr>
<td>姓名</td>
<td><input type="text" name="username" value="${user.username?if_exists}"></td>
</tr>
<tr>
<td>性别</td>
<td><input type="text" name="gender" value="${user.gender?if_exists}"></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="text" name="age" value="${user.age?if_exists}"></td>
</tr>
<tr>
<td>生日</td>
<td><input type="text" name="birthday" value="${user.birthday?if_exists}"></td>
</tr>
<tr>
<td>邮箱</td>
<td><input type="text" name="email" value="${user.email?if_exists}"></td>
</tr>
<tr>
<td>网址</td>
<td><input type="text" name="url" value="${user.url?if_exists}"></td>
</tr>
<tr>
<td>身份证</td>
<td><input type="text" name="idcard" value="${other.idcard?if_exists}"></td>
</tr>
<tr>
<td>手机</td>
<td><input type="text" name="phone" value="${other.phone?if_exists}"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="提交"></td>
</tr>
</tbody>
</table>
</form>
<div style="background-color: #F1F1F1;width: 80%;height: 200px">
user: ${user?if_exists}
<br>
other: ${other?if_exists}
<br>
<#if errorList?exists>
<ul>
<#list errorList as error>
<li>${error.field}-${error.message}</li>
</#list>
</ul>
</#if>
</div>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
package br.com.caelum.stella.faces.validation;
import static org.junit.Assert.assertTrue;
import javax.faces.validator.Validator;
import org.junit.Test;
/**
* @author Leonardo Bessa
*/
public class StellaTituloEleitoralValidatorTagTest {
@Test
public void shouldReturnTheStellaValidator() throws Exception {
StellaTituloEleitoralValidatorTag tag = new StellaTituloEleitoralValidatorTag();
Validator validator = tag.createValidator();
assertTrue(validator instanceof StellaTituloEleitoralValidator);
}
}
| {
"pile_set_name": "Github"
} |
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 4
| {
"pile_set_name": "Github"
} |
class AddRefreshTokenToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :refresh_token, :string
end
end
| {
"pile_set_name": "Github"
} |
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!126 &1
NavMeshAreas:
m_ObjectHideFlags: 0
serializedVersion: 2
areas:
- name: Walkable
cost: 1
- name: Not Walkable
cost: 1
- name: Jump
cost: 2
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
| {
"pile_set_name": "Github"
} |
import os
from datetime import timedelta
### Set the time after which the admin session expires
# There are two sessions on pagure, login that holds for 31 days and
# the session defined here after which an user has to re-login.
# This session is used when accessing all administrative parts of pagure
# (ie: changing a project's or a user's settings)
ADMIN_SESSION_LIFETIME = timedelta(minutes=20)
# Enable tickets and docs for all repos
ENABLE_TICKETS = True
ENABLE_DOCS = True
# Enables / Disables private projects
PRIVATE_PROJECTS = True
### Secret key for the Flask application
SECRET_KEY='<The web application secret key>'
### url to the database server:
#DB_URL = 'mysql://user:pass@host/db_name'
#DB_URL = 'postgres://user:pass@host/db_name'
DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite'
### Send FedMsg notifications of events in pagure
FEDMSG_NOTIFICATIONS = False
### The FAS group in which the admin of pagure are
ADMIN_GROUP = ['sysadmin-main']
### Hard-coded list of global admins
PAGURE_ADMIN_USERS = []
### Enables sending email using SMTP credentials.
EMAIL_SEND = False
### The email address to which the flask.log will send the errors (tracebacks)
EMAIL_ERROR = 'root@localhost'
### SMTP settings
SMTP_SERVER = 'localhost'
SMTP_PORT = 25
SMTP_SSL = False
#Specify both for enabling SMTP with auth
SMTP_USERNAME = None
SMTP_PASSWORD = None
### Information used to sent notifications
FROM_EMAIL = '[email protected]'
DOMAIN_EMAIL_NOTIFICATIONS = 'localhost.localdomain'
SALT_EMAIL = '<secret key to be changed>'
### Restrict outgoing emails to these domains:
## If set, adding emailaccounts that don't end with these domainnames
## will not be permitted. Mails to already existing emailaccounts
## that are not covered by this list will not get sent.
# ALLOWED_EMAIL_DOMAINS = [ 'localhost.localdomain', 'example.com' ]
### Disallow remote pull requests
## If set, remote pull requests will be disabled and not available
## anymore as a selection in the PR dropdown menus
DISABLE_REMOTE_PR = False
### The URL at which the project is available.
APP_URL = 'http://localhost.localdomain/'
### The URL at which the documentation of projects will be available
## This should be in a different domain to avoid XSS issues since we want
## to allow raw html to be displayed (different domain, ie not a sub-domain).
DOC_APP_URL = 'http://docs.localhost.localdomain'
### The URL to use to clone git repositories.
GIT_URL_SSH = 'ssh://[email protected]/'
GIT_URL_GIT = 'git://localhost.localdomain/'
### Folder containing to the git repos
GIT_FOLDER = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'..',
'repos'
)
REPOSPANNER_PSEUDO_FOLDER = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'..',
'pseudo'
)
### Folder containing the clones for the remote pull-requests
REMOTE_GIT_FOLDER = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'..',
'remotes'
)
### Whether to enable scanning for viruses in attachments
VIRUS_SCAN_ATTACHMENTS = False
### Configuration file for gitolite
GITOLITE_CONFIG = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'..',
'gitolite.conf'
)
### Home folder of the gitolite user
### Folder where to run gl-compile-conf from
GITOLITE_HOME = None
### Version of gitolite used: 2 or 3?
GITOLITE_VERSION = 3
### Folder containing all the public ssh keys for gitolite
GITOLITE_KEYDIR = None
### Path to the gitolite.rc file
GL_RC = None
### Path to the /bin directory where the gitolite tools can be found
GL_BINDIR = None
# SSH Information
### The ssh certificates of the git server to be provided to the user
### /!\ format is important
# SSH_KEYS = {'RSA': {'fingerprint': '<foo>', 'pubkey': '<bar>'}}
# Optional configuration
### Number of items displayed per page
# Used when listing items
ITEM_PER_PAGE = 50
### Maximum size of the uploaded content
# Used to limit the size of file attached to a ticket for example
MAX_CONTENT_LENGTH = 4 * 1024 * 1024 # 4 megabytes
### Lenght for short commits ids or file hex
SHORT_LENGTH = 6
### List of blacklisted project names that can conflicts for pagure's URLs
### or other
BLACKLISTED_PROJECTS = [
'static', 'pv', 'releases', 'new', 'api', 'settings',
'logout', 'login', 'users', 'groups', 'projects']
### IP addresses allowed to access the internal endpoints
### These endpoints are used by the milter and are security sensitive, thus
### the IP filter
IP_ALLOWED_INTERNAL = ['127.0.0.1', 'localhost', '::1']
### EventSource/Web-Hook/Redis configuration
# The eventsource integration is what allows pagure to refresh the content
# on your page when someone else comments on the ticket (and this without
# asking you to reload the page.
# By default it is off, ie: EVENTSOURCE_SOURCE is None, to turn it on, specify
# here what the URL of the eventsource server is, for example:
# https://ev.pagure.io or https://pagure.io:8080 or whatever you are using
# (Note: the urls sent to it start with a '/' so no need to add one yourself)
EVENTSOURCE_SOURCE = None
# Port where the event source server is running (maybe be the same port
# as the one specified in EVENTSOURCE_SOURCE or a different one if you
# have something running in front of the server such as apache or stunnel).
EVENTSOURCE_PORT = 8080
# If this port is specified, the event source server will run another server
# at this port and will provide information about the number of active
# connections running on the first (main) event source server
#EV_STATS_PORT = 8888
# Web-hook can be turned on or off allowing using them for notifications, or
# not.
WEBHOOK = False
### Redis configuration
# A redis server is required for both the Event-Source server or the web-hook
# server.
REDIS_HOST = '0.0.0.0'
REDIS_PORT = 6379
REDIS_DB = 0
# Authentication related configuration option
### Switch the authentication method
# Specify which authentication method to use.
# Available options: `fas`, `openid`, `oidc`, `local`
# Default: ``local``.
PAGURE_AUTH = 'local'
# When this is set to True, the session cookie will only be returned to the
# server via ssl (https). If you connect to the server via plain http, the
# cookie will not be sent. This prevents sniffing of the cookie contents.
# This may be set to False when testing your application but should always
# be set to True in production.
# Default: ``True``.
SESSION_COOKIE_SECURE = False
# The name of the cookie used to store the session id.
# Default: ``.pagure``.
SESSION_COOKIE_NAME = 'pagure'
# Boolean specifying whether to check the user's IP address when retrieving
# its session. This make things more secure (thus is on by default) but
# under certain setup it might not work (for example is there are proxies
# in front of the application).
CHECK_SESSION_IP = True
# Used by SESSION_COOKIE_PATH
APPLICATION_ROOT = '/'
# Allow the backward compatiblity endpoints for the old URLs schema to
# see the commits of a repo. This is only interesting if you pagure instance
# was running since before version 1.3 and if you care about backward
# compatibility in your URLs.
OLD_VIEW_COMMIT_ENABLED = False
# repoSpanner integration settings
# https://repospanner.org/
# Whether to create new repositories on repoSpanner by default.
# Either None or a region name.
REPOSPANNER_NEW_REPO = None
# Whether to allow admins to override region selection on creation.
REPOSPANNER_NEW_REPO_ADMIN_OVERRIDE = False
# Whether to create new forks on repoSpanner.
# Either None (no repoSpanner), True (same as origin project) or a region name.
REPOSPANNER_NEW_FORK = True
# Whether to allow an admin to manually migrate an individual project.
REPOSPANNER_ADMIN_MIGRATION = False
# The repoSpanner regions to be used in this Pagure instance.
# Example entry:
# 'default': {'url': 'https://nodea.regiona.repospanner.local:8444',
# 'repo_prefix': 'pagure/',
# 'hook': None,
# 'ca': '',
# 'admin_cert': {'cert': '',
# 'key': ''},
# 'push_cert': {'cert': '',
# 'key': ''}}
REPOSPANNER_REGIONS = {}
# Path to the plugins configuration file that is used to load plugins. Please
# look at files/plugins.cfg.sample for a configuration example.
# PAGURE_PLUGINS_CONFIG = "/etc/pagure/plugins.cfg"
| {
"pile_set_name": "Github"
} |
/* Kore Shared Data Server
* Copyright (C) 2005 Hongli Lai <hongli AT navi DOT cx>
*
* 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 <sys/types.h>
#include <sys/socket.h>
#include <sys/poll.h>
#include <sys/un.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include "unix-server.h"
#include "client.h"
#include "threads.h"
#define LOCKFILE "/tmp/kore-dataserver.lock"
/* Create a lockfile so you can't run two servers at the same time.
* This will also allow processes to check whether the server is already running.
*
* Returns:
* -1 (error)
* 0 (already locked by another process)
* 1 (sucessfully locked)
*/
int
unix_server_trylock ()
{
int fd, already_locked;
/* First, check whether the existing file is locked. */
fd = open (LOCKFILE, O_RDONLY);
if (fd == -1 && errno != ENOENT) {
/* Cannot open file, but it's not because the file doesn't exist. */
char msg[1024];
snprintf (msg, sizeof (msg), "datserver: Cannot open lock file %s", LOCKFILE);
perror (msg);
return -1;
} else if (fd != -1) {
already_locked = flock (fd, LOCK_EX | LOCK_NB) == -1;
close (fd);
if (already_locked)
/* File already locked. There's already a server running. */
return 0;
}
/* Lock file does not exist, or is not locked.
* Create a new lockfile and lock it. */
fd = open (LOCKFILE, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd == -1) {
perror ("dataserver: Cannot create lock file");
return -1;
}
flock (fd, LOCK_EX);
return 1;
}
UnixServer *
unix_server_new (char *filename, NewClientCallback callback)
{
int fd;
struct sockaddr_un addr;
UnixServer *server;
/* Create Unix Domain Socket. */
fd = socket (PF_UNIX, SOCK_STREAM, 0);
if (fd == -1)
return NULL;
/* Bind to a filename. */
addr.sun_family = AF_UNIX;
strncpy (addr.sun_path, filename, 107);
remove (filename);
if (bind (fd, (struct sockaddr *) &addr, sizeof (addr)) == -1) {
perror ("dataserver: cannot bind server socket");
close (fd);
return NULL;
}
/* Setup listen queue. */
if (listen (fd, 5) == -1) {
perror ("dataserver: cannot setup server socket for listening");
close (fd);
return NULL;
}
/* Ready to rock. */
server = malloc (sizeof (UnixServer));
server->fd = fd;
server->callback = callback;
server->filename = filename;
server->stop = 0;
server->retval = 0;
return server;
}
void
unix_server_main_loop (UnixServer *server)
{
while (!server->stop) {
struct pollfd ufds;
struct sockaddr_un addr;
socklen_t addr_len;
int fd, tmp;
Client *client;
/* Check whether there are incoming connections. */
ufds.fd = server->fd;
ufds.events = POLLIN;
tmp = poll (&ufds, 1, 500);
if (tmp == -1) {
/* Error. But it's OK if the system call was interrupted
* (by Ctrl-C or whatever). */
if (errno != EINTR) {
perror ("dataserver: Cannot poll server socket");
server->retval = 1;
}
return;
} else if (tmp == 0)
/* No incoming connections. */
continue;
/* Accept incoming connection. */
addr_len = sizeof (addr);
do {
fd = accept (server->fd, (struct sockaddr *) &addr, &addr_len);
} while (fd == -1 && errno == EINTR);
if (fd == -1) {
/* Accept failed but the error is not EINTR. */
perror ("dataserver: Cannot accept connection");
server->retval = 1;
return;
}
/* Create a Client structure and pass it to the callback. */
client = malloc (sizeof (Client));
client->fd = fd;
client_init (client);
server->callback (client);
}
}
int
unix_server_free (UnixServer *server)
{
int retval;
retval = server->retval;
close (server->fd);
remove (server->filename);
free (server->filename);
free (server);
remove (LOCKFILE);
return retval;
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Util.Helpers;
using Util.Tests.Samples;
using Util.Tests.XUnitHelpers;
using Xunit;
namespace Util.Tests.Helpers {
/// <summary>
/// Json测试
/// </summary>
public class JsonTest {
/// <summary>
/// 测试循环引用序列化
/// </summary>
[Fact]
public void TestLoop() {
A a = new A { Name = "a" };
B b = new B { Name = "b" };
C c = new C { Name = "c" };
a.B = b;
b.C = c;
c.A = a;
AssertHelper.Throws<JsonSerializationException>( () => Json.ToJson( c ) );
}
/// <summary>
/// 转成Json,验证空
/// </summary>
[Fact]
public void TestToJson_Null() {
Assert.Empty( Json.ToJson( null ) );
}
/// <summary>
/// 测试转成Json
/// </summary>
[Fact]
public void TestToJson() {
var result = new StringBuilder();
result.Append( "{" );
result.Append( "\"Name\":\"a\"," );
result.Append( "\"nickname\":\"b\"," );
result.Append( "\"Value\":null," );
result.Append( "\"Date\":\"2012/1/1 0:00:00\"," );
result.Append( "\"Age\":1," );
result.Append( "\"isShow\":true" );
result.Append( "}" );
var actualData = JsonTestSample.Create();
actualData.Date = DateTime.Parse(actualData.Date).ToString("yyyy/M/d 0:00:00");
Assert.Equal( result.ToString(), Json.ToJson(actualData) );
}
/// <summary>
/// 测试转成Json,将双引号转成单引号
/// </summary>
[Fact]
public void TestToJson_ToSingleQuotes() {
var result = new StringBuilder();
result.Append( "{" );
result.Append( "'Name':'a'," );
result.Append( "'nickname':'b'," );
result.Append( "'Value':null," );
result.Append( "'Date':'2012/1/1 0:00:00'," );
result.Append( "'Age':1," );
result.Append( "'isShow':true" );
result.Append( "}" );
var actualData = JsonTestSample.Create();
actualData.Date = DateTime.Parse(actualData.Date).ToString("yyyy/M/d 0:00:00");
Assert.Equal( result.ToString(), Json.ToJson(actualData, true ) );
}
/// <summary>
/// 测试转换实体为Json
/// </summary>
[Fact]
public void TestToJson_Entity() {
AggregateRootSample entity = new AggregateRootSample();
entity.Code = "a";
entity.IntSamples.Add( new IntAggregateRootSample{Name = "b"} );
var json = Util.Helpers.Json.ToJson( entity );
entity = Util.Helpers.Json.ToObject<AggregateRootSample>( json );
Assert.Equal( "a", entity.Code );
Assert.Equal( "b", entity.IntSamples.First().Name );
}
/// <summary>
/// 测试转成对象
/// </summary>
[Fact]
public void TestToObject() {
var customer = Json.ToObject<JsonTestSample>( "{\"Name\":\"a\"}" );
Assert.Equal( "a", customer.Name );
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* xfrm6_mode_ro.c - Route optimization mode for IPv6.
*
* Copyright (C)2003-2006 Helsinki University of Technology
* Copyright (C)2003-2006 USAGI/WIDE Project
*
* 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
*/
/*
* Authors:
* Noriaki TAKAMIYA @USAGI
* Masahide NAKAMURA @USAGI
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/stringify.h>
#include <linux/time.h>
#include <net/ipv6.h>
#include <net/xfrm.h>
/* Add route optimization header space.
*
* The IP header and mutable extension headers will be moved forward to make
* space for the route optimization header.
*/
static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb)
{
struct ipv6hdr *iph;
u8 *prevhdr;
int hdr_len;
iph = ipv6_hdr(skb);
hdr_len = x->type->hdr_offset(x, skb, &prevhdr);
skb_set_mac_header(skb, (prevhdr - x->props.header_len) - skb->data);
skb_set_network_header(skb, -x->props.header_len);
skb->transport_header = skb->network_header + hdr_len;
__skb_pull(skb, hdr_len);
memmove(ipv6_hdr(skb), iph, hdr_len);
x->lastused = get_seconds();
return 0;
}
static struct xfrm_mode xfrm6_ro_mode = {
.output = xfrm6_ro_output,
.owner = THIS_MODULE,
.encap = XFRM_MODE_ROUTEOPTIMIZATION,
};
static int __init xfrm6_ro_init(void)
{
return xfrm_register_mode(&xfrm6_ro_mode, AF_INET6);
}
static void __exit xfrm6_ro_exit(void)
{
int err;
err = xfrm_unregister_mode(&xfrm6_ro_mode, AF_INET6);
BUG_ON(err);
}
module_init(xfrm6_ro_init);
module_exit(xfrm6_ro_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_XFRM_MODE(AF_INET6, XFRM_MODE_ROUTEOPTIMIZATION);
| {
"pile_set_name": "Github"
} |