diff --git a/arch/arm/dts/rk3288-xt-q8l-v10.dts b/arch/arm/dts/rk3288-xt-q8l-v10.dts
new file mode 100755
index 00000000..be7a0806
--- /dev/null
+++ b/arch/arm/dts/rk3288-xt-q8l-v10.dts
@@ -0,0 +1,749 @@
+/*
+ * Copyright (c) 2014, 2015 FUKAUMI Naoki <naobsd@gmail.com>
+ * 					   2018 Paolo Sabatino <paolo.sabatino@gm**l.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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 file 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.
+ *
+ * Or, alternatively,
+ *
+ *  b) 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.
+ */
+
+/dts-v1/;
+
+#include "rk3288.dtsi"
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "XT-Q8L-V10-RK3288";
+	compatible = "generic,xt-q8l-v10-rk3288", "rockchip,rk3288";
+
+	chosen {
+		stdout-path = &uart2;
+		/*
+		 * We leave this here for future reference, but at the moment
+		 * rk3288 does not support "same-as-spl", instead as a workaround
+		 * we define the boot order statically in:
+		 * board/rockchip/xt-q8l-v10_rk3288/xt-q8l-v10-rk3288.c
+		 *
+		 */
+		u-boot,spl-boot-order = "same-as-spl", &emmc, &sdmmc;
+	};
+
+	config {
+		u-boot,dm-spl;
+		u-boot,boot-led = "power";
+	};
+
+	memory {
+		reg = <0x0 0x0 0x0 0x80000000>;
+	};
+
+	cpu0_opp_table: opp_table {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp@600000000 {
+			opp-hz = /bits/ 64 <600000000>;
+			opp-microvolt = <900000>;
+		};
+		opp@816000000 {
+			opp-hz = /bits/ 64 <816000000>;
+			opp-microvolt = <1000000>;
+		};
+		opp@1008000000 {
+			opp-hz = /bits/ 64 <1008000000>;
+			opp-microvolt = <1050000>;
+		};
+		opp@1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			opp-microvolt = <1100000>;
+		};
+		opp@1416000000 {
+			opp-hz = /bits/ 64 <1416000000>;
+			opp-microvolt = <1200000>;
+		};
+		opp@1512000000 {
+			opp-hz = /bits/ 64 <1512000000>;
+			opp-microvolt = <1250000>;
+		};
+		opp@1608000000 {
+			opp-hz = /bits/ 64 <1608000000>;
+			opp-microvolt = <1300000>;
+		};
+
+	};
+
+	ext_gmac: external-gmac-clock {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <125000000>;
+		clock-output-names = "ext_gmac";
+	};
+
+	keys: gpio-keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&pwr_key>;
+
+		button@0 {
+			gpio-key,wakeup;
+			gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
+			label = "GPIO Power";
+			linux,code = <116>;
+			wakeup-source;
+		};
+
+	};
+
+	leds {
+		u-boot,dm-spl;
+		compatible = "gpio-leds";
+
+		power {
+			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
+			u-boot,dm-spl;
+			label = "power";
+			pinctrl-names = "default";
+			pinctrl-0 = <&power_led>;
+		};
+
+	};
+
+	vcc_sys: vsys-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_sys";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	vcc_sd: sdmmc-regulator {
+		compatible = "regulator-fixed";
+		gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&sdmmc_pwr>;
+		regulator-name = "vcc_sd";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <100000>;
+		vin-supply = <&vcc_io>;
+	};
+
+	vcc_flash: flash-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_flash";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_io>;
+	};
+
+	vcc_host_5v: usb-host-regulator {
+		compatible = "regulator-fixed";
+		gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
+		regulator-name = "vcc_host_5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+	        regulator-boot-on;
+	        enable-active-high;
+		vin-supply = <&vcc_sys>;
+	};
+
+
+	vcc_otg_5v: usb-otg-regulator {
+		compatible = "regulator-fixed";
+		gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+		regulator-name = "vcc_otg_5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		enable-active-high;
+		vin-supply = <&vcc_sys>;
+	};
+
+	io_domains {
+		compatible = "rockchip,rk3288-io-voltage-domain";
+		audio-supply = <&vcca_33>;
+		bb-supply = <&vcc_io>;
+		dvp-supply = <&vcc_18>;
+		flash0-supply = <&vcc_flash>;
+		flash1-supply = <&vcc_lan>;
+		gpio30-supply = <&vcc_io>;
+		gpio1830-supply = <&vcc_io>;
+		lcdc-supply = <&vcc_io>;
+		sdcard-supply = <&vccio_sd>;
+		wifi-supply = <&vcc_18>;
+	};
+
+};
+
+&cpu0 {
+	cpu0-supply = <&vdd_cpu>;
+	operating-points-v2 = <&cpu0_opp_table>;
+	/delete-node/operating-points;
+	/*
+	// Rewrite the operating points table
+	operating-points = <
+		1608000 1350000
+		1512000 1300000
+		1416000 1200000
+		1200000 1100000
+		1008000 1050000
+		 816000 1000000
+		 696000  950000
+		 600000  900000
+	>;
+	*/
+
+};
+
+&gmac {
+	assigned-clocks = <&cru SCLK_MAC>;
+	assigned-clock-parents = <&ext_gmac>;
+	clock_in_out = "input";
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
+	phy-supply = <&vcc_lan>;
+	phy-mode = "rgmii";
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 10000 1000000>;
+	snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
+	tx_delay = <0x30>;
+	rx_delay = <0x10>;
+	status = "okay";
+};
+
+&hdmi {
+	status = "okay";
+};
+
+&hdmi_audio {
+	status = "okay";
+};
+
+&gpu {
+	mali-supply = <&vdd_gpu>;
+	status = "okay";
+};
+
+&i2c0 {
+	clock-frequency = <400000>;
+	status = "okay";
+
+	vdd_cpu: syr827@40 {
+		compatible = "silergy,syr827";
+		fcs,suspend-voltage-selector = <1>;
+		reg = <0x40>;
+		regulator-name = "vdd_cpu";
+		regulator-min-microvolt = <850000>;
+		regulator-max-microvolt = <1350000>;
+		regulator-ramp-delay = <8000>;
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vcc_sys>;
+	};
+
+	vdd_gpu: syr828@41 {
+		compatible = "silergy,syr828";
+		fcs,suspend-voltage-selector = <1>;
+		reg = <0x41>;
+		regulator-name = "vdd_gpu";
+		regulator-min-microvolt = <850000>;
+		regulator-max-microvolt = <1350000>;
+		regulator-ramp-delay = <8000>;
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&vcc_sys>;
+	};
+
+	hym8563: hym8563@51 {
+		compatible = "haoyu,hym8563";
+		reg = <0x51>;
+		#clock-cells = <0>;
+		clock-frequency = <32768>;
+		clock-output-names = "xin32k";
+		interrupt-parent = <&gpio0>;
+		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&rtc_int>;
+	};
+
+	act8846: act8846@5a {
+		compatible = "active-semi,act8846";
+		reg = <0x5a>;
+		system-power-controller;
+
+		vp1-supply = <&vcc_sys>;
+		vp2-supply = <&vcc_sys>;
+		vp3-supply = <&vcc_sys>;
+		vp4-supply = <&vcc_sys>;
+		inl1-supply = <&vcc_sys>;
+		inl2-supply = <&vcc_sys>;
+		inl3-supply = <&vcc_20>;
+
+		regulators {
+			vcc_ddr: REG1 {
+				regulator-name = "vcc_ddr";
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vcc_io: vcc33_lcd: REG2 {
+				regulator-name = "vcc_io";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vdd_log: REG3 {
+				regulator-name = "vdd_log";
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vcc_20: REG4 {
+				regulator-name = "vcc_20";
+				regulator-min-microvolt = <2000000>;
+				regulator-max-microvolt = <2000000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vccio_sd: REG5 {
+				regulator-name = "vccio_sd";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vdd10_lcd: REG6 {
+				regulator-name = "vdd10_lcd";
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vcca_18: REG7 {
+				regulator-name = "vcca_18";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+
+			vcca_33: REG8 {
+				regulator-name = "vcca_33";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+			};
+
+			vcc_lan: REG9 {
+				regulator-name = "vcc_lan";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+			};
+
+			vdd_10: REG10 {
+				regulator-name = "vdd_10";
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <1000000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vccio_wl: vcc_18: REG11 {
+				regulator-name = "vcc_18";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			vcc18_lcd: REG12 {
+				regulator-name = "vcc18_lcd";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+		};
+	};
+};
+
+&pinctrl {
+
+	u-boot,dm-spl;
+
+	/*
+		This pin configuration enables the power led and, most important,
+		the power hold pin of the act8846 pmic. Without the power hold
+		bit set, the pmic will shut itself down after a few milliseconds,
+		turning off the whole device. Be aware that in u-boot configuration
+		"pinctrl-names" and "pinctrl-0" properties MUST NOT be stripped
+		away from SPL.
+		Note also that we set the pwr_hold GPIO in board_init_f()
+		function directly in SPL u-boot code which gets executed very soon.
+		The definition here is just a way to be sure that the bit is set
+		again later.
+	*/
+	pinctrl-names = "default";
+	pinctrl-0 = <&power_led>, <&pwr_hold>;
+
+	pcfg_output_high: pcfg-output-high {
+		u-boot,dm-spl;
+		output-high;
+	};
+
+	pcfg_output_low: pcfg-output-low {
+		output-low;
+	};
+
+	pcfg_wl: pcfg-wl {
+                bias-pull-up;
+                drive-strength = <8>;
+        };
+
+        pcfg_wl_clk: pcfg-wl-clk {
+                bias-disable;
+                drive-strength = <12>;
+        };
+
+	pcfg_wl_int: pcfg-wl-int {
+                bias-pull-up;
+        };
+
+
+	act8846 {
+
+		/*
+		 * Original q8 device tree says:
+		 *  - gpio0 11 HIGH -> power hold
+		 *  - gpio7 1 LOW -> possibly pmic-vsel, we omit it here
+		 */
+		/*pmic_vsel: pmic-vsel {
+			rockchip,pins = <7 1 RK_FUNC_GPIO &pcfg_output_low>;
+		};*/
+
+		pwr_hold: pwr-hold {
+			rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+
+	};
+
+	gmac {
+		phy_int: phy-int {
+			rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+
+		phy_pmeb: phy-pmeb {
+			rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+
+		phy_rst: phy-rst {
+			rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
+		};
+	};
+
+	hym8563 {
+		rtc_int: rtc-int {
+			rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	keys {
+		pwr_key: pwr-key {
+			rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	leds {
+
+		power_led: power-led {
+			rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+
+	};
+
+	ir {
+		ir_int: ir-int {
+			rockchip,pins = <7 0 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	sdmmc {
+		sdmmc_pwr: sdmmc-pwr {
+			rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	usb_host1 {
+
+		host_vbus_drv: host-vbus-drv {
+			rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+    };
+
+	usb_otg {
+
+		otg_vbus_drv: otg-vbus-drv {
+			rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+	};
+
+};
+
+&saradc {
+	vref-supply = <&vcc_18>;
+	status = "okay";
+};
+
+&emmc {
+	/*
+	 * eMMC seems to be 52Mhz device on q8 devices, so set it here
+	 * vmmc-supply and vqmmc-supply are removed because they hang
+	 * u-boot >= v2018.03
+	 * From the original q8l firmware and eMMC datasheet it also should
+	 * support DDR highspeed mode, but using mmc-ddr-3_3v or mmc-ddr-1_8v
+	 * properties are not working
+	 */
+	clock-frequency = <50000000>;
+
+	broken-cd;
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	disable-wp;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
+
+	status = "okay";
+	u-boot,dm-spl;
+
+};
+
+&sdmmc {
+	bus-width = <4>;
+	supports-sd;
+	cap-mmc-highspeed;
+	cap-sd-highspeed;
+	card-detect-delay = <200>;
+	disable-wp;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
+	//vmmc-supply = <&vcc_sd>;
+	//vqmmc-supply = <&vccio_sd>;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+	sd-uhs-ddr50;
+	status = "okay";
+	u-boot,dm-spl;
+};
+
+&tsadc {
+	rockchip,hw-tshut-mode = <0>;
+	rockchip,hw-tshut-polarity = <0>;
+	status = "okay";
+};
+
+/*
+ * Accessible serial port for logging
+ */
+&uart2 {
+	dmas = <&dmac_bus_s 4 &dmac_bus_s 5>;
+	dma-names = "tx", "rx";
+	status = "okay";
+};
+
+/*
+ * Describing resets for usb phy is important because otherwise the USB
+ * port gets stuck in case it goes into autosuspend: plugging any device
+ * when the port is autosuspended will actually kill the port itself and
+ * require a power cycle.
+ * This is required for the usbphy1 phy, nonetheless it is a good idea to
+ * specify the proper resources for all the phys though.
+ * The reference patch which works in conjuction with the reset lines:
+ * https://patchwork.kernel.org/patch/9469811/
+ */
+&usbphy {
+	status = "okay";
+};
+
+&usbphy0 {
+    resets = <&cru SRST_USBOTG_PHY>;
+    reset-names = "phy-reset";
+    vbus-supply = <&vcc_otg_5v>;
+};
+
+&usbphy1 {
+    resets = <&cru SRST_USBHOST0_PHY>;
+    reset-names = "phy-reset";
+};
+
+&usbphy2 {
+    resets = <&cru SRST_USBHOST1_PHY>;
+    reset-names = "phy-reset";
+    vbus-supply = <&vcc_host_5v>;
+};
+
+&usb_host0_ehci {
+    dr_mode = "host";
+    reg = <0x0 0xff500000 0x0 0x20000>;
+    status = "disabled";
+};
+
+/*
+ * Enable the host only USB controller. vbus-supply property allows u-boot
+ * to turn power on for the vbus and allow booting from USB devices
+ */
+&usb_host1 {
+    dr_mode = "host";
+    vbus-supply = <&vcc_host_5v>;
+	status = "okay";
+};
+
+/*
+ * Enable the OTG USB controller. hnp-srp-disable is necessary to allow
+ * it work while in u-boot. Also we attach it to the proper regulator
+ * to enable power during boot phase and allow booting from USB devices
+ */
+&usb_otg {
+	hnp-srp-disable;
+    vbus-supply = <&vcc_otg_5v>;
+	status = "okay";
+};
+
+/*
+ * Disabling vop big because somewhere in some documentation it is stated
+ * that only one vop should be enabled to get video console
+ */
+&vopb {
+	status = "okay";
+};
+
+&vopb_mmu {
+	status = "okay";
+};
+
+&vopl {
+	status = "okay";
+};
+
+&vopl_mmu {
+	status = "okay";
+};
+
+&wdt {
+	status = "okay";
+};
+
+&uart2 {
+	u-boot,dm-spl;
+};
+
+/*
+ * xt-q8l-v10 timing registers, dumped directly from a live instance
+ * initialized by the binary rockchip blob.
+ *
+ * pctl-timing are dumped from address 0xff6100c0 to 0xff610144
+ * phy-timing are dumped from address 0xff620030 to 0xff620050
+ * sdram-params are extracted from interconnect, in particular the
+ * service_bus/msch0 part starting at address 0xffac0000 (see section 6.4.2
+ * of the TRM V1.0 manual)
+ */
+&dmc {
+	rockchip,pctl-timing = <0x00000190 0x000000c8 0x00000000 0x00000028
+							0x00000026 0x00000005 0x00000054 0x0002000a
+							0x00000005 0x00000000 0x00000006 0x00000003
+							0x00000011 0x0000001b 0x0000000a 0x00000004
+							0x00000003 0x00000006 0x00000003 0x00000058
+							0x00000003 0x00000000 0x00000024 0x00000000
+							0x00000001 0x00000001 0x00000002 0x00000003
+							0x00000000 0x00000000 0x00000090 0x00000002
+							0x00000006 0x000001f4>;
+	rockchip,phy-timing = <0x3691aa6f 0x185408a0 0x00118c58
+							0x00000000 0x00000083 0x00000004 0x00000001>;
+	/*
+	 * rockchip,sdram-params structure:
+	 *
+	   u32 noc_timing;
+	   u32 noc_activate;
+	   u32 ddrconfig;
+	   u32 ddr_freq;
+	   u32 dramtype;
+		 * DDR Stride is address mapping for DRAM space
+		 * Stride	Ch 0 range	Ch1 range	Total
+		 * 0x00		0-256MB		256MB-512MB	512MB
+		 * 0x05		0-1GB		0-1GB		1GB
+		 * 0x09		0-2GB		0-2GB		2GB
+		 * 0x0d		0-4GB		0-4GB		4GB
+		 * 0x17		N/A		0-4GB		4GB
+		 * 0x1a		0-4GB		4GB-8GB		8GB
+	  u32 stride;
+	  u32 odt;
+
+	 */
+	rockchip,sdram-params = <0x18b1d4db 0x544 0x2 400000000 5 0x9 0>;
+};
+
+&gpio0 {
+	u-boot,dm-spl;
+};
+
+&gpio7 {
+	u-boot,dm-spl;
+};
+
+&i2c5 {
+	status="okay";
+	u-boot,dm-spl;
+};
+
+&pcfg_pull_up {
+	u-boot,dm-spl;
+};
+


from dotenv import get_cli_string as c

def test_to_cli_string():
    assert c() == 'dotenv'
    assert c(path='/etc/.env') == 'dotenv -f /etc/.env'
    assert c(path='/etc/.env', action='list') == 'dotenv -f /etc/.env list'
    assert c(action='list') == 'dotenv list'
    assert c(action='get', key='DEBUG') == 'dotenv get DEBUG'
    assert c(action='set', key='DEBUG', value='True') == 'dotenv set DEBUG True'
    assert c(action='set', key='SECRET', value='=@asdfasf') == 'dotenv set SECRET =@asdfasf'
    assert c(action='set', key='SECRET', value='a b') == 'dotenv set SECRET "a b"'
    assert c(action='set', key='SECRET', value='a b', quote="always") == 'dotenv -q always set SECRET "a b"'


<?php

/*
 * This file is part of the Symfony2 PhoneNumberBundle.
 *
 * (c) University of Cambridge
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Misd\PhoneNumberBundle\Validator\Constraints;

use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumber as PhoneNumberObject;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberType;
use libphonenumber\PhoneNumberUtil;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;

/**
 * Phone number validator.
 */
class PhoneNumberValidator extends ConstraintValidator
{
    /**
     * {@inheritdoc}
     */
    public function validate($value, Constraint $constraint)
    {
        if (null === $value || '' === $value) {
            return;
        }

        if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) {
            throw new UnexpectedTypeException($value, 'string');
        }

        $phoneUtil = PhoneNumberUtil::getInstance();

        if (false === $value instanceof PhoneNumberObject) {
            $value = (string) $value;

            try {
                $phoneNumber = $phoneUtil->parse($value, $constraint->defaultRegion);
            } catch (NumberParseException $e) {
                $this->addViolation($value, $constraint);

                return;
            }
        } else {
            $phoneNumber = $value;
            $value = $phoneUtil->format($phoneNumber, PhoneNumberFormat::INTERNATIONAL);
        }

        if (false === $phoneUtil->isValidNumber($phoneNumber)) {
            $this->addViolation($value, $constraint);

            return;
        }

        switch ($constraint->getType()) {
            case PhoneNumber::FIXED_LINE:
                $validTypes = array(PhoneNumberType::FIXED_LINE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
                break;
            case PhoneNumber::MOBILE:
                $validTypes = array(PhoneNumberType::MOBILE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
                break;
            case PhoneNumber::PAGER:
                $validTypes = array(PhoneNumberType::PAGER);
                break;
            case PhoneNumber::PERSONAL_NUMBER:
                $validTypes = array(PhoneNumberType::PERSONAL_NUMBER);
                break;
            case PhoneNumber::PREMIUM_RATE:
                $validTypes = array(PhoneNumberType::PREMIUM_RATE);
                break;
            case PhoneNumber::SHARED_COST:
                $validTypes = array(PhoneNumberType::SHARED_COST);
                break;
            case PhoneNumber::TOLL_FREE:
                $validTypes = array(PhoneNumberType::TOLL_FREE);
                break;
            case PhoneNumber::UAN:
                $validTypes = array(PhoneNumberType::UAN);
                break;
            case PhoneNumber::VOIP:
                $validTypes = array(PhoneNumberType::VOIP);
                break;
            case PhoneNumber::VOICEMAIL:
                $validTypes = array(PhoneNumberType::VOICEMAIL);
                break;
            default:
                $validTypes = array();
                break;
        }

        if (count($validTypes)) {
            $type = $phoneUtil->getNumberType($phoneNumber);

            if (false === in_array($type, $validTypes)) {
                $this->addViolation($value, $constraint);

                return;
            }

        }
    }

    /**
     * Add a violation.
     *
     * @param mixed      $value      The value that should be validated.
     * @param Constraint $constraint The constraint for the validation.
     */
    private function addViolation($value, Constraint $constraint)
    {
        /** @var \Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber $constraint */
        if ($this->context instanceof ExecutionContextInterface) {
            $this->context->buildViolation($constraint->getMessage())
                ->setParameter('{{ type }}', $constraint->getType())
                ->setParameter('{{ value }}', $this->formatValue($value))
                ->setCode(PhoneNumber::INVALID_PHONE_NUMBER_ERROR)
                ->addViolation();
        } else {
            $this->context->addViolation($constraint->getMessage(), array(
                '{{ type }}' => $constraint->getType(),
                '{{ value }}' => $value
            ));
        }
    }
}


𣶭


/*
 * The MIT License
 *
 * Copyright 2013 Cameron Garnham.
 *
 * 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.
 */
package org.multibit.controller;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArrayList;
import org.multibit.ApplicationDataDirectoryLocator;
import org.multibit.Localiser;
import org.multibit.model.core.StatusEnum;
import org.multibit.viewsystem.DisplayHint;
import org.multibit.viewsystem.View;
import org.multibit.viewsystem.ViewSystem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author Cameron Garnham
 */
public abstract class BaseController<C extends BaseController<C>> implements Controller{

    private Logger log = LoggerFactory.getLogger(BaseController.class);

    /**
     * The view systems under control of the MultiBitController.
     */
    private final Collection<ViewSystem> viewSystems;

    /**
     * The localiser used to localise everything.
     */
    private Localiser localiser;

    /**
     * Class encapsulating the location of the Application Data Directory.
     */
    private final ApplicationDataDirectoryLocator applicationDataDirectoryLocator;

    private volatile boolean applicationStarting = true;

    protected BaseController(){
        this(null);
    }

    protected BaseController(ApplicationDataDirectoryLocator applicationDataDirectoryLocator){
        this.applicationDataDirectoryLocator = applicationDataDirectoryLocator;

        viewSystems = new CopyOnWriteArrayList<ViewSystem>();

        // By default localise to English.
        localiser = new Localiser(Locale.ENGLISH);
    }

    @Override
    public final Collection<ViewSystem> getViewSystem() {
        return viewSystems;
    }

    /**
     * Register a new MultiBitViewSystem from the list of views that are managed.
     *
     * @param viewSystem
     *            system
     */
    public final void registerViewSystem(ViewSystem viewSystem) {
        viewSystems.add(viewSystem);
    }

    @Override
    public final Localiser getLocaliser() {
        return localiser;
    }

    public final void setLocaliser(Localiser localiser) {
        this.localiser = localiser;
    }

    @Override
    public final void setOnlineStatus(StatusEnum statusEnum) {
        //log.debug("setOnlineStatus called");
        for (ViewSystem viewSystem : this.getViewSystem()) {
            viewSystem.setOnlineStatus(statusEnum);
        }
    }

    @Override
    public final boolean getApplicationStarting(){
        return this.applicationStarting;
    }

    @Override
    public final ApplicationDataDirectoryLocator getApplicationDataDirectoryLocator(){
        return applicationDataDirectoryLocator;
    }

    public final void setApplicationStarting(boolean applicationStarting){
        this.applicationStarting = applicationStarting;
    }

    /**
     * Fire that the model data has changed.
     */
    @Override
    public final void fireDataChangedUpdateNow() {
        //log.debug("fireDataChangedUpdateNow called");
        for (ViewSystem viewSystem : this.getViewSystem()) {
            viewSystem.fireDataChangedUpdateNow(DisplayHint.COMPLETE_REDRAW);
        }
    }

    /**
     * Fire that the model data has changed and similar events are to be collapsed.
     */
    @Override
    public final void fireDataChangedUpdateLater() {
        for (ViewSystem viewSystem : this.getViewSystem()) {
            viewSystem.fireDataChangedUpdateLater(DisplayHint.WALLET_TRANSACTIONS_HAVE_CHANGED);
        }
    }

    /**
     * Fire that all the views need recreating.
     */
    @Override
    public final void fireRecreateAllViews(boolean initUI) {
        //log.debug("fireRecreateAllViews called");
        // tell the viewSystems to refresh their views
        for (ViewSystem viewSystem : this.getViewSystem()) {
            viewSystem.recreateAllViews(initUI, getCurrentView());
        }
    }

    @Override
    abstract public void fireDataStructureChanged();

    /**
     * @return True if the application can quit
     */
    protected final boolean isOKToQuit() {
        return true;
    }

    @Override
    abstract public View getCurrentView();

    @Override
    abstract public void setCurrentView(View view);

    @Override
    abstract public void displayView(View viewToDisplay);

    @Override
    abstract public void displayHelpContext(String helpContextToDisplay);

    abstract protected void addEventHandler(AbstractEventHandler eventHandler);

}


--- hardware/arduino/sam/platform.txt.orig	2017-03-31 15:39:17 UTC
+++ hardware/arduino/sam/platform.txt
@@ -96,13 +96,13 @@ recipe.size.regex=\.text\s+([0-9]+).*
 # -------------------

 # BOSSA
-tools.bossac.path={runtime.tools.bossac.path}
+tools.bossac.path={runtime.tools.bossac.path}/bin
 tools.bossac.cmd=bossac
 tools.bossac.cmd.windows=bossac.exe

 tools.bossac.upload.params.verbose=-i -d
 tools.bossac.upload.params.quiet=
 tools.bossac.upload.params.verify=-v
-tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U {upload.native_usb} -e -w {upload.verify} -b "{build.path}/{build.project_name}.bin" -R
+tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} -a --port={serial.port.file} -U {upload.native_usb} -e -w {upload.verify} -b "{build.path}/{build.project_name}.bin" -R

-tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v -b /tmp/sketch.bin -R
+tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} -a --port=ttyATH0 -U {upload.native_usb} -e -w -v -b /tmp/sketch.bin -R


--TEST--
Test preg_replace() function : error - bad regular expressions
--FILE--
<?php
/*
* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
error_reporting(E_ALL&~E_NOTICE);
/*
* Testing how preg_replace reacts to being passed the wrong type of regex argument
*/
echo "*** Testing preg_replace() : error conditions***\n";
$regex_array = array('abcdef', //Regex without delimeter
'/[a-zA-Z]', //Regex without closing delimeter
'[a-zA-Z]/', //Regex without opening delimeter
'/[a-zA-Z]/F', array('[a-z]', //Array of Regexes
'[A-Z]', '[0-9]'), '/[a-zA-Z]/', //Regex string
);
$replace = 1;
$subject = 'a';
foreach($regex_array as $regex_value) {
    print "\nArg value is $regex_value\n";
    var_dump(preg_replace($regex_value, $replace, $subject));
}
$regex_value = new stdclass(); //Object
var_dump(preg_replace($regex_value, $replace, $subject));
?>
--EXPECTF--
*** Testing preg_replace() : error conditions***

Arg value is abcdef

Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in %spreg_replace_error1.php on line %d
NULL

Arg value is /[a-zA-Z]

Warning: preg_replace(): No ending delimiter '/' found in %spreg_replace_error1.php on line %d
NULL

Arg value is [a-zA-Z]/

Warning: preg_replace(): Unknown modifier '/' in %spreg_replace_error1.php on line %d
NULL

Arg value is /[a-zA-Z]/F

Warning: preg_replace(): Unknown modifier 'F' in %spreg_replace_error1.php on line %d
NULL

Arg value is Array
string(1) "a"

Arg value is /[a-zA-Z]/
string(1) "1"

Catchable fatal error: Object of class stdClass could not be converted to string in %spreg_replace_error1.php on line %d


// Copyright (c) Microsoft. All rights reserved.

namespace Microsoft.Azure.Devices.Edge.Util
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Text;

    public static class DurationMeasurer
    {
        public static IDisposable MeasureDuration(Action<TimeSpan> onCompleation)
        {
            return new DurationSetter(onCompleation);
        }

        class DurationSetter : IDisposable
        {
            Stopwatch timer = Stopwatch.StartNew();
            Action<TimeSpan> setDuration;

            internal DurationSetter(Action<TimeSpan> setDuration)
            {
                this.setDuration = setDuration;
            }

            public void Dispose()
            {
                this.timer.Stop();
                this.setDuration(this.timer.Elapsed);
            }
        }
    }
}


/* tag: openbios fixed address forth starter
 *
 * Copyright (C) 2003 Stefan Reinauer
 *
 * See the file "COPYING" for further information about
 * the copyright and warranty status of this work.
 */

#include "config.h"
#include "libopenbios/sys_info.h"
#include "multiboot.h"

#define FIXED_DICTSTART 0xfffe0000
#define FIXED_DICTEND   0xfffeffff

void collect_multiboot_info(struct sys_info *info);
void collect_multiboot_info(struct sys_info *info)
{
	info->dict_start=(unsigned long *)FIXED_DICTSTART;
	info->dict_end=(unsigned long *)FIXED_DICTEND;
}


<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<asset>
		<created>2017-03-08T13:35:39</created>
		<modified>2017-03-08T13:35:39</modified>
	</asset>
	<library_animations>
		<animation>
			<source id="source_0">
				<float_array id="float_array_0" count="1">0</float_array>
				<technique_common>
					<accessor source="#float_array_0" count="1"/>
				</technique_common>
			</source>
			<source id="source_2">
				<IDREF_array count="1">node_2</IDREF_array>
			</source>
			<sampler id="sampler_0">
				<input semantic="INPUT" source="#source_0"/>
			</sampler>
			<channel source="#sampler_0" target="node_1/translate.X"/>
		</animation>
	</library_animations>
	<library_cameras>
		<camera id="camera_0">
			<optics>
				<technique_common>
					<perspective>
						<xfov>90</xfov>
						<yfov>90</yfov>
						<znear>1</znear>
						<zfar>INF</zfar>
					</perspective>
				</technique_common>
			</optics>
		</camera>
	</library_cameras>
	<library_controllers>
		<controller id="controller_0">
			<skin source="#geometry_0">
				<source id="joints">
					<Name_array id="name_array_0" count="1">Root</Name_array>
					<technique_common>
						<accessor source="#name_array_0" count="1"/>
					</technique_common>
				</source>
				<source id="weights">
					<float_array id="float_array_1" count="1">0</float_array>
					<technique_common>
						<accessor source="#float_array_1" count="1"/>
					</technique_common>
				</source>
				<source id="inv_bind_mats">
					<float_array id="float_array_2" count="16">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</float_array>
					<technique_common>
						<accessor source="#float_array_2" count="1"/>
					</technique_common>
				</source>
				<joints>
					<input semantic="JOINT" source="#joints"/>
					<input semantic="INV_BIND_MATRIX" source="#inv_bind_mats"/>
				</joints>
				<vertex_weights count="1">
					<input offset="0" semantic="JOINT" source="#joints"/>
					<input offset="0" semantic="WEIGHT" source="#weights"/>
					<vcount>1</vcount>
					<v>0 0</v>
				</vertex_weights>
			</skin>
		</controller>
	</library_controllers>
	<library_effects>
		<effect id="effect_0">
			<profile_GLSL>
				<include sid="shader" url="./shader.glsl"/>
				<technique sid="shaded">
					<pass/>
				</technique>
			</profile_GLSL>
		</effect>
	</library_effects>
	<library_geometries>
		<geometry id="geometry_0">
			<mesh>
				<source id="source_1">
					<float_array id="float_array_3" count="1">0</float_array>
					<technique_common>
						<accessor source="#float_array_3" count="1" stride="1">
							<param name="X" type="float"/>
						</accessor>
					</technique_common>
				</source>
				<vertices id="vertices_0">
					<input semantic="POSITION" source="#float_array_3"/>
				</vertices>
				<triangles material="initialShadingGroup" count="1">
					<input semantic="VERTEX" source="#float_array_3" offset="0"/>

0 0 0

				</triangles>
			</mesh>
		</geometry>
		<geometry id="geometry_1">
			<convex_mesh convex_hull_of="#geometry_0"/>
		</geometry>
	</library_geometries>
	<library_images>
		<image>
			<init_from>./image.jpg</init_from>
		</image>
		<image>
			<init_from></init_from>
		</image>
	</library_images>
	<library_nodes>
		<node id="node_0"/>
	</library_nodes>
	<library_physics_models>
		<physics_model id="physics_model_0">
			<rigid_body sid="rigid_body_a">
				<technique_common>
					<dynamic>0</dynamic>
					<mass>1</mass>
					<mass_frame>
						<translate sid="translate">0 0 0</translate>
					</mass_frame>
					<inertia>1 1 1</inertia>
					<physics_material id="physics_material_0">
						<technique_common>
							<dynamic_friction>0.5</dynamic_friction>
							<restitution>0.5</restitution>
							<static_friction>0.5</static_friction>
						</technique_common>
					</physics_material>
					<shape>
						<density>1</density>
						<box>
							<half_extents>1 1 1</half_extents>
						</box>
					</shape>
				</technique_common>
			</rigid_body>
		</physics_model>
	</library_physics_models>
	<library_physics_scenes>
		<physics_scene id="{physics_scene_0">
			<instance_physics_model url="#physics_model_0" parent="#physics_model_0">
				<instance_rigid_body body="rigid_body_a" target="#node_1">
					<technique_common/>
				</instance_rigid_body>
			</instance_physics_model>
			<technique_common>
				<gravity>0 -9.81 0</gravity>
			</technique_common>
		</physics_scene>
	</library_physics_scenes>
	<library_visual_scenes>
		<visual_scene>
			<node id="node_1">
				<translate sid="translate">0 0 0</translate>
				<instance_node url="#node_0"/>
			</node>
			<node id="source_2">
				<instance_controller url="#controller_0">
					<skeleton>#node_3</skeleton>
				</instance_controller>
				<node id="node_3" sid="Root"/>
			</node>
			<evaluate_scene>
				<render camera_node="#camera_0"/>
			</evaluate_scene>
		</visual_scene>
	</library_visual_scenes>
</COLLADA>


<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">

	<description>webServices-aop</description>

	<object id="webCalculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
		<property name="ServiceUri" value="http://localhost/Spring.Calculator.2003/calculatorServiceWeaved.asmx"/>
		<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
	</object>

	<object id="calculatorService" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
		<property name="target" ref="webCalculatorService"/>
		<property name="interceptorNames">
			<list>
				<value>ConsoleLoggingAroundAdvice</value>
			</list>
		</property>
	</object>

</objects>


/****************************************************************************************

   Copyright (C) 2015 Autodesk, Inc.
   All rights reserved.

   Use of this software is subject to the terms of the Autodesk license agreement
   provided at the time of installation or download, or which otherwise accompanies
   this software in either electronic or hard copy form.

****************************************************************************************/

//! \file fbxanimcurvenode.h
#ifndef _FBXSDK_SCENE_ANIMATION_CURVE_NODE_H_
#define _FBXSDK_SCENE_ANIMATION_CURVE_NODE_H_

#include <fbxsdk/fbxsdk_def.h>

#include <fbxsdk/core/fbxobject.h>

#include <fbxsdk/fbxsdk_nsbegin.h>

//Standard curve node names
#define FBXSDK_CURVENODE_TRANSFORM		"Transform"
#define FBXSDK_CURVENODE_TRANSLATION	"T"
#define FBXSDK_CURVENODE_ROTATION		"R"
#define FBXSDK_CURVENODE_SCALING		"S"
#define FBXSDK_CURVENODE_COMPONENT_X	"X"
#define FBXSDK_CURVENODE_COMPONENT_Y	"Y"
#define FBXSDK_CURVENODE_COMPONENT_Z	"Z"
#define FBXSDK_CURVENODE_COLOR			"Color"
#define FBXSDK_CURVENODE_COLOR_RED		FBXSDK_CURVENODE_COMPONENT_X
#define FBXSDK_CURVENODE_COLOR_GREEN	FBXSDK_CURVENODE_COMPONENT_Y
#define FBXSDK_CURVENODE_COLOR_BLUE		FBXSDK_CURVENODE_COMPONENT_Z

class FbxAnimStack;
class FbxAnimCurve;
class FbxMultiMap;
class KFCurveNode;

/** This class is an composite of animation curves and is called as animation curve node.
  * \nosubgrouping
  * Animation curve node is used as the connection point for animation curves and other animation curve nodes
  * associated to a property.  FbxAnimCurveNode can be connected to other FbxAnimCurveNode,
  * in this case, the destination animation curve node may be considered as "composite", \ref IsComposite().
  * remarks  When created, the FbxAnimCurveNode has no valid channels unless it is created using the function CreateTypedCurveNode().
  * This function will add all the required channels to correctly match the number of values of the property.
  * For instance, when CreateTypedCurveNode(pNode.LclTranslation, pScene) is called, the resulting
  * FbxAnimCurveNode will automatically have 3 channels corresponding to the X,Y and Z components of the LclTranslation property.
  * You can add and remove channels dynamically but can never remove the channels that have been added by the call to CreateTypedCurveNode().
  *
  * However, the FBX SDK animation system's default implementation is to consider only the first curve connected to
  * the channel. Therefore, if the caller connects multiple animation curves to the same channel, then it becomes
  * the caller's responsibility to handle and manipulate these extra curves in a meaningful manner.
  */
class FBXSDK_DLL FbxAnimCurveNode : public FbxObject
{
    FBXSDK_OBJECT_DECLARE(FbxAnimCurveNode, FbxObject);

public:
    /**
      * \name Utility functions.
      *
      */
    //@{
        /** Check if the animation curve node contains any animation key.
          * \param pRecurse \c true to descend to the children if the animation curve node is composite.
          * \return \c true if at least one animation curve that contains one or more animation keys is found,
          *         \c false otherwise.
		  * \remarks This method only considers the first animation curve connected to each channel.
		  *          To check multiple animation curves that are connected to the same channel, it is the caller's
		  *          responsibility to write a new version of this method, and GetCurveCount() will be useful in this case.
          */
        bool IsAnimated(bool pRecurse=false) const;

        /** Find out start and end time of the animation.
          * This function retrieves the including time span for all animation curves of this animation curve node.
          * \param pTimeInterval Reference to receive start time and end time.
          * \return \c true on success, \c false otherwise.
          * \remarks \c false is also returned if this animation curve node has no animation.
		  * \remarks This method only considers the first animation curve connected to each channel.
		  *          To find time interval of multiple animation curves that are connected to the same channel, it is the caller's
		  *          responsibility to write a new version of this method, and GetCurveCount() will be useful in this case.
          */
        bool GetAnimationInterval(FbxTimeSpan& pTimeInterval) const;

        /** Test this object to see if it is a composite FbxAnimCurveNode or a "leaf".
          * A composite FbxAnimCurveNode is a FbxAnimCurveNode whose all source connections are FbxAnimCurveNode
          * and its property channels is totally empty. It is just a container to take other FbxAnimCurveNode.
          * \return \c true if this object is a composite, \c false otherwise.
          */
        bool IsComposite() const;

        /** Recursively look for the FbxAnimCurveNode matching the passed named argument.
          * \param pName Name of the FbxAnimCurveNode we are looking for.
          * \return The found anim curve node or NULL.
          * \remarks If pName is an empty string, this function automatically return NULL.
          */
        FbxAnimCurveNode* Find(const char* pName);

        /** Create a FbxAnimCurveNode compatible with the specified property data type.
          * \param pProperty The property that needs a FbxAnimCurveNode.
          * \param pScene The scene the created FbxAnimCurveNode will belong to.
          * \return The pointer to the newly created FbxAnimCurveNode. Returns NULL if an error occurred.
          * \remarks This function does not connect the newly created FbxAnimCurveNode to the property.
          * \remarks This function detects FbxDouble3, FbxDouble4 and FbxDouble4x4 properties DataTypes and
          *         automatically adds the required channels properties. Any other DataType is not
          *         specifically processed and the channels properties are left empty and need to be filled
          *         using the AddChannel() function.
          */
        static FbxAnimCurveNode* CreateTypedCurveNode(FbxProperty& pProperty, FbxScene* pScene);

        /** Get the total number of property channels defined in this animation curve node.
		  * For composite animation curve nodes, since they do not contain any channels, this function will always return 0.
          * \return The number of property channels.
          */
        unsigned int GetChannelsCount() const;

        /** Get the index of the named channel.
          * \param pChannelName Name of the channel for which we want the index.
          * \return the index of the named channel or -1 if no channel with this name is found.
          */
        int GetChannelIndex(const char* pChannelName) const;

        /** Get the name of the channel.
          * \param pChannelId Index of the channel for which we want the name.
          * \return the name of the indexed channel or "" if the index is invalid.
          */
        FbxString GetChannelName(int pChannelId) const;

        /** Empties the property channels of this animation curve node.
          * \remarks This function will remove all the channels added with the AddChannel() method
          *          regardless of their use and/or connections.
		  *          But it can not remove the channels that are added by the call to CreateTypedCurveNode().
          */
        void ResetChannels();

        /** Adds the specified channel property.
          * \param pChnlName Channel name.
          * \param pValue Default value of the channel.
          * \return \c true if successful, \c false otherwise.
          * \remarks It is an error to try to add a channel that already exists.
          */
        template <class T> bool AddChannel(const char* pChnlName, T const &pValue)
        {
            if (!pChnlName || strlen(pChnlName)==0) return false;
            FbxProperty c = GetChannel(pChnlName);
            if (c.IsValid())
            {
                return false;
            }

            mChannels.BeginCreateOrFindProperty();
            FbxDataType dt = FbxGetDataTypeFromEnum(FbxTypeOf(pValue));
            c = FbxProperty::Create(mChannels, dt, pChnlName);
            c.Set(pValue);
            mChannels.EndCreateOrFindProperty();
            return true;
        }

        /** Set the default value of the channel.
          * \param pChnlName Channel name.
          * \param pValue    New default value of this channel.
          */
        template <class T> void SetChannelValue(const char* pChnlName, T pValue)
        {
            FbxProperty c = GetChannel(pChnlName);
            if( c.IsValid() ) c.Set(pValue);
        }

        /** Set the default value of the channel.
          * \param pChnlId   Channel index.
          * \param pValue    New default value of this channel.
          */
        template <class T> void SetChannelValue(unsigned int pChnlId, T pValue)
        {
            FbxProperty c = GetChannel(pChnlId);
            if( c.IsValid() ) c.Set(pValue);
        }

        /** Get the default value of the channel.
          * \param pChnlName Channel name.
          * \param pInitVal  Value returned if the specified channel is invalid.
          * \return The default value of this channel.
          */
        template <class T> T GetChannelValue(const char* pChnlName, T pInitVal)
        {
            T v = pInitVal;
            FbxProperty c = GetChannel(pChnlName);
            if( c.IsValid() ) v = c.Get<T>();
            return v;
        }

        /** Get the default value of the channel.
          * \param pChnlId Channel index.
		  * \param pInitVal  Value returned if the specified channel is invalid.
          * \return The default value of this channel.
          */
        template <class T> T GetChannelValue(unsigned int pChnlId, T pInitVal)
        {
            T v = pInitVal;
            FbxProperty c = GetChannel(pChnlId);
            if( c.IsValid() ) v = c.Get<T>();
            return v;
        }
    //@}

    /**
      * \name FbxAnimCurve management.
      *
      */
    //@{
        /** Disconnect the animation curve from the channel.
          * \param pCurve       The curve to disconnect from the channel.
          * \param pChnlId      The channel index.
          * \return \c true if the disconnection was made, \c false if an error occurred.
          */
        bool DisconnectFromChannel(FbxAnimCurve* pCurve, unsigned int pChnlId);

        /** Connects the given animation curve to the specified channel.
          * \param pCurve   The curve to connect to the channel.
          * \param pChnl    The name of the channel the curve is to be connected to.
          * \param pInFront When \c true, all the current connections are moved after this one,
          *                 making this one the first. By default, the connection is the last one.
          * \return \c true if the connection was made, \c false if an error occurred.
          */
        bool ConnectToChannel(FbxAnimCurve* pCurve, const char* pChnl, bool pInFront = false);

        /** Connects the given animation curve to the specified channel.
          * \param pCurve   The curve to connect to the channel.
          * \param pChnlId  Index of the channel the curve is to be connected to.
          * \param pInFront When \c true, all the current connections are moved after this one.
          *                 making this one the first. By default, the connection is the last one.
          * \return \c true if the connection was made, \c false if an error occurred.
          * \remarks The index is 0 based.
          */
        bool ConnectToChannel(FbxAnimCurve* pCurve, unsigned int pChnlId, bool pInFront = false);

        /** Creates a new curve and connects it to the specified channel of the animation curve node named pCurveNodeName.
		  * If this animation curve node is composite, this function will try to search all children animation curve nodes
		  * recursively for the one named pCurveNodeName.
          * \param pCurveNodeName Name of the FbxAnimCurveNode we are looking for.
          * \param pChannel Channel identifier.
          * \return Pointer to the FbxAnimCurve or NULL if an error occurred.
          * \remarks pCurveNodeName cannot be empty.
          * \remarks If the pChannel identifier is left NULL, the first valid channel will be used to create curve.
          */
        FbxAnimCurve* CreateCurve(const char* pCurveNodeName, const char* pChannel);

        /** Creates a new curve and connects it to the specified channel of the animation curve node named pCurveNodeName.
		  * If this animation curve node is composite, this function will try to search all children animation curve nodes
		  * recursively for the one named pCurveNodeName.
    	  * \param pCurveNodeName Name of the FbxAnimCurveNode we are looking for.
          * \param pChannelId Channel index.
          * \return Pointer to the FbxAnimCurve or NULL if an error occurred.
          * \remarks pCurveNodeName cannot be empty.
          *          If the pChannelId is not assigned, the first valid channel will be used to create curve.
          */
        FbxAnimCurve* CreateCurve(const char* pCurveNodeName, unsigned int pChannelId = 0);

        /** Get the number of FbxAnimCurve connected to the specified channel.
		  * If this animation curve node is composite, this function will try to search all children animation curve nodes
   		  * recursively for the one named pCurveNodeName.
          * \param pChannelId Channel index.
          * \param pCurveNodeName Name of the FbxAnimCurveNode we are looking for.
          * \return The number of animation curves on the specified channel or 0 if an error occurred.
          * \remarks This method fails if the FbxAnimCurveNode with name pCurveNodeName does not exist and return 0.
          *          If the specified channel cannot be found on the FbxAnimCurveNode with name pCurveNodeName, return 0.
		  * \remarks If this animation curve node is composite, this function will try to search all
		  *          children animation curve nodes recursively for the one named pCurveNodeName.
          *          If the pCurveNodeName is left NULL, then only look for the curves on this animation curve node
		  *          even if it is composite.
          */
        int GetCurveCount(unsigned int pChannelId, const char* pCurveNodeName = NULL);

        /** Get the FbxAnimCurve of the specified channel.
		  * If this animation curve node is composite, this function will try to search all children animation curve nodes
		  * recursively for the one named pCurveNodeName.
		  * \param pChannelId Channel index.
          * \param pId The index of the desired anim curve (in case there is more than one).
          * \param pCurveNodeName Name of the FbxAnimCurveNode we are looking for (if this object is a composite).
          * \return Pointer to the FbxAnimCurve that matches the criteria.
          * \remarks This method fails if the FbxAnimCurveNode with name pCurveNodeName does not exist and return NULL.
          *          If the specified channel cannot be found in the FbxAnimCurveNode with name pCurveNodeName, return NULL.
		  * \remarks If the pCurveNodeName is left NULL, then only search in the curves on this animation curve node
		  *          even if it is composite.
          */
        FbxAnimCurve* GetCurve(unsigned int pChannelId, unsigned int pId = 0, const char* pCurveNodeName = NULL);

     //@}

/*****************************************************************************************************************************
** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
*****************************************************************************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_THIS
	virtual FbxObject& Copy(const FbxObject& pObject);

    static const char* CurveNodeNameFrom(const char* pName);
	static bool EvaluateChannels(FbxAnimCurveNode* pCurveNode, double* pData, unsigned int pCount, FbxTime pTime);

    void ReleaseKFCurveNode();
    void SyncChannelsWithKFCurve();

    inline bool UseQuaternionInterpolation() {return mQuaternionInterpolation != 0;};
	bool SetQuaternionInterpolation(unsigned short pVal);
    unsigned short GetQuaternionInterpolation() { return mQuaternionInterpolation; };
    void SetKFCurveNodeLayerType(FbxProperty& pProp);
	KFCurveNode* GetKFCurveNode(bool pNoCreate=false);

private:
	friend class FbxAnimCurveFilterMatrixConverter;
	friend class FbxAnimEvalClassic;
    void Evaluate(double* pData, FbxTime pTime);

protected:
	virtual void Construct(const FbxObject* pFrom);
    virtual void Destruct(bool pRecursive);
    virtual void ConstructProperties(bool pForceSet);
	virtual bool ConnectNotify(const FbxConnectEvent& pEvent);

    FbxAnimCurveNode* Find(FbxAnimCurveNode* pRoot, const FbxString& pName);

private:
    FbxProperty GetChannel(const char* pChnl);
    FbxProperty GetChannel(unsigned int pChnlId);

	friend void CollectAnimFromCurveNode(void **lSrc, void *fcn, unsigned int nbCrvs, FbxAnimCurveNode *cn, FbxMultiMap* pNickToAnimCurveTimeWarpsSet, FbxMultiMap& pNickToKFCurveNodeWarpSet);

    unsigned char	mNonRemovableChannels;
    FbxProperty		mChannels;
    FbxProperty*	mCurrentlyProcessed;
    KFCurveNode*	mFCurveNode;
    bool*			mOwnedKFCurve;
    int				mKFCurveNodeLayerType;
    unsigned short  mQuaternionInterpolation;
	int*			mDirectIndexes;
	int				mDirectIndexesSize;

    FbxAnimCurve* GetCurve(unsigned int pChannelId, unsigned int pId, FbxAnimCurveNode* pCurveNode);
    bool ConnectToChannel(FbxProperty& p, FbxAnimCurve* pCurve, bool pInFront);
    void ResetKFCurveNode();
    void SyncKFCurveValue(FbxAnimCurve* pCurve, double pVal);
	void ReleaseOwnershipOfKFCurve(int pIndex);

	template <class T> FbxAnimCurve* CreateCurveGeneral(const char* pCurveNodeName, T pChannel);
#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
};

FBXSDK_DLL void GetAllAnimCurves(FbxAnimStack* pAnimStack, FbxArray<FbxAnimCurve*>& pCurves);
FBXSDK_DLL void GetAllAnimCurves(FbxObject* pObj, FbxAnimStack* pAnimStack, FbxArray<FbxAnimCurve*>& pCurves);

#include <fbxsdk/fbxsdk_nsend.h>

#endif // FBXFILESDK_KFBXPLUGINS_KFBXANIMCURVENODE_H


//
//  ChromaKeyBlendFilter.cpp
//  ofxFilterLibraryExample
//
//  Created by Matthew Fargo on 2015/07/03.
//
//

#include "ChromaKeyBlendFilter.h"

ChromaKeyBlendFilter::ChromaKeyBlendFilter(ofVec3f keyColor, float thresholdSensitivity, float smoothing) {
    _name = "Chroma Key Blend";
    _addParameter(new Parameter3f("keyColor", keyColor));
    _addParameter(new ParameterF("thresholdSensitivity", thresholdSensitivity));
    _addParameter(new ParameterF("smoothing", smoothing));
    _setupShader();
}
ChromaKeyBlendFilter::~ChromaKeyBlendFilter() {}

string ChromaKeyBlendFilter::_getFragSrc() {
    return GLSL_STRING(120,
                       varying vec2 textureCoordinate;

                       uniform sampler2D inputImageTexture;
                       uniform sampler2D inputImageTexture2;

                       uniform float thresholdSensitivity;
                       uniform float smoothing;
                       uniform vec3 keyColor;

                       void main()
                       {
                           vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);
                           vec4 textureColor2 = texture2D(inputImageTexture2, textureCoordinate);

                           float maskY = 0.2989 * keyColor.r + 0.5866 * keyColor.g + 0.1145 * keyColor.b;
                           float maskCr = 0.7132 * (keyColor.r - maskY);
                           float maskCb = 0.5647 * (keyColor.b - maskY);

                           float Y = 0.2989 * textureColor.r + 0.5866 * textureColor.g + 0.1145 * textureColor.b;
                           float Cr = 0.7132 * (textureColor.r - Y);
                           float Cb = 0.5647 * (textureColor.b - Y);

                           float blendValue = 1.0 - smoothstep(thresholdSensitivity, thresholdSensitivity + smoothing, distance(vec2(Cr, Cb), vec2(maskCr, maskCb)));
                           gl_FragColor = mix(textureColor, textureColor2, blendValue);
                       }
                       );
}


<!DOCTYPE html>

  <title>The change you wanted was rejected (422)</title>

The change you wanted was rejected.

Maybe you tried to change something you didn't have access to.