code
stringlengths
5
1.01M
repo_name
stringlengths
5
84
path
stringlengths
4
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
5
1.01M
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
/* * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights * reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the NetLogic * license below: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NLM_HAL_IOMAP_H__ #define __NLM_HAL_IOMAP_H__ #define XLP_DEFAULT_IO_BASE 0x18000000 #define XLP_DEFAULT_PCI_ECFG_BASE XLP_DEFAULT_IO_BASE #define XLP_DEFAULT_PCI_CFG_BASE 0x1c000000 #define NMI_BASE 0xbfc00000 #define XLP_IO_CLK 133333333 #define XLP_PCIE_CFG_SIZE 0x1000 /* 4K */ #define XLP_PCIE_DEV_BLK_SIZE (8 * XLP_PCIE_CFG_SIZE) #define XLP_PCIE_BUS_BLK_SIZE (256 * XLP_PCIE_DEV_BLK_SIZE) #define XLP_IO_SIZE (64 << 20) /* ECFG space size */ #define XLP_IO_PCI_HDRSZ 0x100 #define XLP_IO_DEV(node, dev) ((dev) + (node) * 8) #define XLP_IO_PCI_OFFSET(b, d, f) (((b) << 20) | ((d) << 15) | ((f) << 12)) #define XLP_HDR_OFFSET(node, bus, dev, fn) \ XLP_IO_PCI_OFFSET(bus, XLP_IO_DEV(node, dev), fn) #define XLP_IO_BRIDGE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 0) /* coherent inter chip */ #define XLP_IO_CIC0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 1) #define XLP_IO_CIC1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 2) #define XLP_IO_CIC2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 3) #define XLP_IO_PIC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 4) #define XLP_IO_PCIE_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 1, i) #define XLP_IO_PCIE0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 0) #define XLP_IO_PCIE1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 1) #define XLP_IO_PCIE2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 2) #define XLP_IO_PCIE3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 3) #define XLP_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 2, i) #define XLP_IO_USB_EHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 0) #define XLP_IO_USB_OHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 1) #define XLP_IO_USB_OHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 2) #define XLP_IO_USB_EHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 3) #define XLP_IO_USB_OHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 4) #define XLP_IO_USB_OHCI3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 5) #define XLP_IO_SATA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 2) /* XLP2xx has an updated USB block */ #define XLP2XX_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 4, i) #define XLP2XX_IO_USB_XHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 1) #define XLP2XX_IO_USB_XHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 2) #define XLP2XX_IO_USB_XHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 3) #define XLP_IO_NAE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 0) #define XLP_IO_POE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 1) #define XLP_IO_CMS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 0) #define XLP_IO_DMA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 1) #define XLP_IO_SEC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 2) #define XLP_IO_CMP_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 3) #define XLP_IO_UART_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, i) #define XLP_IO_UART0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 0) #define XLP_IO_UART1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 1) #define XLP_IO_I2C_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, 2 + i) #define XLP_IO_I2C0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 2) #define XLP_IO_I2C1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 3) #define XLP_IO_GPIO_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 4) /* on 2XX, all I2C busses are on the same block */ #define XLP2XX_IO_I2C_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 7) /* system management */ #define XLP_IO_SYS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 5) #define XLP_IO_JTAG_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 6) /* Flash */ #define XLP_IO_NOR_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 0) #define XLP_IO_NAND_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 1) #define XLP_IO_SPI_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 2) #define XLP_IO_MMC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 3) /* Things have changed drastically in XLP 9XX */ #define XLP9XX_HDR_OFFSET(n, d, f) \ XLP_IO_PCI_OFFSET(xlp9xx_get_socbus(n), d, f) #define XLP9XX_IO_BRIDGE_OFFSET(node) XLP_IO_PCI_OFFSET(0, 0, node) #define XLP9XX_IO_PIC_OFFSET(node) XLP9XX_HDR_OFFSET(node, 2, 0) #define XLP9XX_IO_UART_OFFSET(node) XLP9XX_HDR_OFFSET(node, 2, 2) #define XLP9XX_IO_SYS_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 0) #define XLP9XX_IO_FUSE_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 1) #define XLP9XX_IO_CLOCK_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 2) #define XLP9XX_IO_POWER_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 3) #define XLP9XX_IO_JTAG_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 4) #define XLP9XX_IO_PCIE_OFFSET(node, i) XLP9XX_HDR_OFFSET(node, 1, i) #define XLP9XX_IO_PCIE0_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 0) #define XLP9XX_IO_PCIE2_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 2) #define XLP9XX_IO_PCIE3_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 3) /* XLP9xx USB block */ #define XLP9XX_IO_USB_OFFSET(node, i) XLP9XX_HDR_OFFSET(node, 4, i) #define XLP9XX_IO_USB_XHCI0_OFFSET(node) XLP9XX_HDR_OFFSET(node, 4, 1) #define XLP9XX_IO_USB_XHCI1_OFFSET(node) XLP9XX_HDR_OFFSET(node, 4, 2) /* XLP9XX on-chip SATA controller */ #define XLP9XX_IO_SATA_OFFSET(node) XLP9XX_HDR_OFFSET(node, 3, 2) /* Flash */ #define XLP9XX_IO_NOR_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 0) #define XLP9XX_IO_NAND_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 1) #define XLP9XX_IO_SPI_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 2) #define XLP9XX_IO_MMC_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 3) /* PCI config header register id's */ #define XLP_PCI_CFGREG0 0x00 #define XLP_PCI_CFGREG1 0x01 #define XLP_PCI_CFGREG2 0x02 #define XLP_PCI_CFGREG3 0x03 #define XLP_PCI_CFGREG4 0x04 #define XLP_PCI_CFGREG5 0x05 #define XLP_PCI_DEVINFO_REG0 0x30 #define XLP_PCI_DEVINFO_REG1 0x31 #define XLP_PCI_DEVINFO_REG2 0x32 #define XLP_PCI_DEVINFO_REG3 0x33 #define XLP_PCI_DEVINFO_REG4 0x34 #define XLP_PCI_DEVINFO_REG5 0x35 #define XLP_PCI_DEVINFO_REG6 0x36 #define XLP_PCI_DEVINFO_REG7 0x37 #define XLP_PCI_DEVSCRATCH_REG0 0x38 #define XLP_PCI_DEVSCRATCH_REG1 0x39 #define XLP_PCI_DEVSCRATCH_REG2 0x3a #define XLP_PCI_DEVSCRATCH_REG3 0x3b #define XLP_PCI_MSGSTN_REG 0x3c #define XLP_PCI_IRTINFO_REG 0x3d #define XLP_PCI_UCODEINFO_REG 0x3e #define XLP_PCI_SBB_WT_REG 0x3f /* PCI IDs for SoC device */ #define PCI_VENDOR_NETLOGIC 0x184e #define PCI_DEVICE_ID_NLM_ROOT 0x1001 #define PCI_DEVICE_ID_NLM_ICI 0x1002 #define PCI_DEVICE_ID_NLM_PIC 0x1003 #define PCI_DEVICE_ID_NLM_PCIE 0x1004 #define PCI_DEVICE_ID_NLM_EHCI 0x1007 #define PCI_DEVICE_ID_NLM_OHCI 0x1008 #define PCI_DEVICE_ID_NLM_NAE 0x1009 #define PCI_DEVICE_ID_NLM_POE 0x100A #define PCI_DEVICE_ID_NLM_FMN 0x100B #define PCI_DEVICE_ID_NLM_RAID 0x100D #define PCI_DEVICE_ID_NLM_SAE 0x100D #define PCI_DEVICE_ID_NLM_RSA 0x100E #define PCI_DEVICE_ID_NLM_CMP 0x100F #define PCI_DEVICE_ID_NLM_UART 0x1010 #define PCI_DEVICE_ID_NLM_I2C 0x1011 #define PCI_DEVICE_ID_NLM_NOR 0x1015 #define PCI_DEVICE_ID_NLM_NAND 0x1016 #define PCI_DEVICE_ID_NLM_MMC 0x1018 #define PCI_DEVICE_ID_NLM_SATA 0x101A #define PCI_DEVICE_ID_NLM_XHCI 0x101D #define PCI_DEVICE_ID_XLP9XX_MMC 0x9018 #define PCI_DEVICE_ID_XLP9XX_SATA 0x901A #define PCI_DEVICE_ID_XLP9XX_XHCI 0x901D #ifndef __ASSEMBLY__ #define nlm_read_pci_reg(b, r) nlm_read_reg(b, r) #define nlm_write_pci_reg(b, r, v) nlm_write_reg(b, r, v) static inline int xlp9xx_get_socbus(int node) { uint64_t socbridge; if (node == 0) { return 1; } socbridge = nlm_pcicfg_base(XLP9XX_IO_BRIDGE_OFFSET(node)); return (nlm_read_pci_reg(socbridge, 0x6) >> 8) & 0xff; } #endif /* !__ASSEMBLY */ #endif /* __NLM_HAL_IOMAP_H__ */
williamfdevine/PrettyLinux
arch/mips/include/asm/netlogic/xlp-hal/iomap.h
C
gpl-3.0
9,008
[ 30522, 1013, 1008, 1008, 9385, 2494, 1011, 2249, 5658, 27179, 12702, 29390, 1010, 4297, 1012, 1006, 5658, 27179, 1007, 1012, 2035, 2916, 1008, 9235, 1012, 1008, 1008, 2023, 4007, 2003, 2800, 2000, 2017, 2104, 1037, 3601, 1997, 2028, 1997, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module VhdlTestScript class Wait CLOCK_LENGTH = 2 def initialize(length) @length = length end def to_vhdl "wait for #{@length * CLOCK_LENGTH} ns;" end def in(ports) self end def origin self end end end
tomoasleep/vhdl_test_script
lib/vhdl_test_script/wait.rb
Ruby
mit
271
[ 30522, 11336, 1058, 14945, 7096, 4355, 22483, 2465, 3524, 5119, 1035, 3091, 1027, 1016, 13366, 3988, 4697, 1006, 3091, 1007, 1030, 3091, 1027, 3091, 2203, 13366, 2000, 1035, 1058, 14945, 2140, 1000, 3524, 2005, 1001, 1063, 1030, 3091, 1008,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// ---------------------------------------------------------------------------- // Copyright 2007-2013, GeoTelematic Solutions, Inc. // All rights reserved // ---------------------------------------------------------------------------- // // 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. // // ---------------------------------------------------------------------------- // Change History: // 2007/03/11 Martin D. Flynn // -Initial release // ---------------------------------------------------------------------------- package org.opengts.war.report; import java.util.*; import java.io.*; public class ReportException extends Exception { // ------------------------------------------------------------------------ public ReportException(String msg, Throwable cause) { super(msg, cause); } public ReportException(String msg) { super(msg); } // ------------------------------------------------------------------------ }
vimukthi-git/OpenGTS_2.4.9
src/org/opengts/war/report/ReportException.java
Java
apache-2.0
1,492
[ 30522, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!--The content below is only a placeholder and can be replaced.--> <div style="text-align:center"> <h1> Welcome to {{ title | translate }}! </h1> <img width="300" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="> </div> <div> <button (click)="setLang('ua')">Language: UA</button> <button (click)="setLang('en')">Language: EN</button> </div> <h2>Here are some links to help you start: </h2> <ul> <li> <h2><a target="_blank" href="https://angular.io/tutorial">Tour of Heroes</a></h2> </li> <li> <h2><a target="_blank" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2> </li> <li> <h2><a target="_blank" href="https://blog.angular.io/">Angular blog</a></h2> </li> </ul>
DenisVuyka/developing-with-angular
angular/app-i18n/src/app/app.component.html
HTML
mit
1,214
[ 30522, 1026, 999, 1011, 1011, 1996, 4180, 2917, 2003, 2069, 1037, 2173, 14528, 1998, 2064, 2022, 2999, 1012, 1011, 1011, 1028, 1026, 4487, 2615, 2806, 1027, 1000, 3793, 1011, 25705, 1024, 2415, 1000, 1028, 1026, 1044, 2487, 1028, 6160, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* This file is part of calliope. * * calliope 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. * * calliope 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 calliope. If not, see <http://www.gnu.org/licenses/>. */ package calliope.handler.post; import calliope.Connector; import calliope.exception.AeseException; import calliope.handler.post.importer.*; import calliope.constants.Formats; import calliope.importer.Archive; import calliope.constants.Config; import calliope.json.JSONDocument; import calliope.constants.Database; import calliope.constants.Params; import calliope.constants.JSONKeys; import java.util.ArrayList; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.fileupload.servlet.ServletFileUpload; /** * Handle import of a set of XML files from a tool like mmpupload. * @author desmond 23-7-2012 */ public class AeseXMLImportHandler extends AeseImportHandler { public void handle( HttpServletRequest request, HttpServletResponse response, String urn ) throws AeseException { try { if (ServletFileUpload.isMultipartContent(request) ) { parseImportParams( request ); Archive cortex = new Archive(docID.getWork(), docID.getAuthor(),Formats.MVD_TEXT,encoding); Archive corcode = new Archive(docID.getWork(), docID.getAuthor(),Formats.MVD_STIL,encoding); cortex.setStyle( style ); corcode.setStyle( style ); StageOne stage1 = new StageOne( files ); log.append( stage1.process(cortex,corcode) ); if ( stage1.hasFiles() ) { String suffix = ""; StageTwo stage2 = new StageTwo( stage1, false ); stage2.setEncoding( encoding ); log.append( stage2.process(cortex,corcode) ); StageThreeXML stage3Xml = new StageThreeXML( stage2, style, dict, hhExceptions ); stage3Xml.setStripConfig( getConfig(Config.stripper, stripperName) ); stage3Xml.setSplitConfig( getConfig(Config.splitter, splitterName) ); if ( stage3Xml.hasTEI() ) { ArrayList<File> notes = stage3Xml.getNotes(); if ( notes.size()> 0 ) { Archive nCorTex = new Archive(docID.getWork(), docID.getAuthor(),Formats.MVD_TEXT,encoding); nCorTex.setStyle( style ); Archive nCorCode = new Archive(docID.getWork(), docID.getAuthor(),Formats.MVD_STIL,encoding); StageThreeXML s3notes = new StageThreeXML( style,dict, hhExceptions); s3notes.setStripConfig( getConfig(Config.stripper, stripperName) ); s3notes.setSplitConfig( getConfig(Config.splitter, splitterName) ); for ( int j=0;j<notes.size();j++ ) s3notes.add(notes.get(j)); log.append( s3notes.process(nCorTex,nCorCode) ); addToDBase(nCorTex, "cortex", "notes" ); addToDBase( nCorCode, "corcode", "notes" ); // differentiate base from notes suffix = "base"; } if ( xslt == null ) xslt = Params.XSLT_DEFAULT; String transform = getConfig(Config.xslt,xslt); JSONDocument jDoc = JSONDocument.internalise( transform ); stage3Xml.setTransform( (String) jDoc.get(JSONKeys.BODY) ); } log.append( stage3Xml.process(cortex,corcode) ); addToDBase( cortex, "cortex", suffix ); addToDBase( corcode, "corcode", suffix ); // now get the json docs and add them at the right docid // Connector.getConnection().putToDb( Database.CORTEX, // docID.get(), cortex.toMVD("cortex") ); // log.append( cortex.getLog() ); // String fullAddress = docID.get()+"/"+Formats.DEFAULT; // log.append( Connector.getConnection().putToDb( // Database.CORCODE,fullAddress, corcode.toMVD("corcode")) ); // log.append( corcode.getLog() ); } response.setContentType("text/html;charset=UTF-8"); response.getWriter().println( wrapLog() ); } } catch ( Exception e ) { throw new AeseException( e ); } } }
discoverygarden/calliope
src/calliope/handler/post/AeseXMLImportHandler.java
Java
gpl-2.0
5,684
[ 30522, 1013, 1008, 2023, 5371, 2003, 2112, 1997, 2655, 3695, 5051, 1012, 1008, 1008, 2655, 3695, 5051, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1008, 2009, 2104, 1996, 3408, 1997, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU Affero Public License for more details. # # You should have received a copy of the GNU Affero Public License # along with this program. If not, see http://www.gnu.org/licenses. # # http://numenta.org/licenses/ # ---------------------------------------------------------------------- from cStringIO import StringIO import sys import tempfile import unittest2 as unittest import numpy from nupic.encoders.base import defaultDtype from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA from nupic.data.fieldmeta import FieldMetaType from nupic.support.unittesthelpers.algorithm_test_helpers import getSeed from nupic.encoders.random_distributed_scalar import ( RandomDistributedScalarEncoder ) try: import capnp except ImportError: capnp = None if capnp: from nupic.encoders.random_distributed_scalar_capnp import ( RandomDistributedScalarEncoderProto ) # Disable warnings about accessing protected members # pylint: disable=W0212 def computeOverlap(x, y): """ Given two binary arrays, compute their overlap. The overlap is the number of bits where x[i] and y[i] are both 1 """ return (x & y).sum() def validateEncoder(encoder, subsampling): """ Given an encoder, calculate overlaps statistics and ensure everything is ok. We don't check every possible combination for speed reasons. """ for i in range(encoder.minIndex, encoder.maxIndex+1, 1): for j in range(i+1, encoder.maxIndex+1, subsampling): if not encoder._overlapOK(i, j): return False return True class RandomDistributedScalarEncoderTest(unittest.TestCase): """ Unit tests for RandomDistributedScalarEncoder class. """ def testEncoding(self): """ Test basic encoding functionality. Create encodings without crashing and check they contain the correct number of on and off bits. Check some encodings for expected overlap. Test that encodings for old values don't change once we generate new buckets. """ # Initialize with non-default parameters and encode with a number close to # the offset encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0, w=23, n=500, offset=0.0) e0 = encoder.encode(-0.1) self.assertEqual(e0.sum(), 23, "Number of on bits is incorrect") self.assertEqual(e0.size, 500, "Width of the vector is incorrect") self.assertEqual(encoder.getBucketIndices(0.0)[0], encoder._maxBuckets / 2, "Offset doesn't correspond to middle bucket") self.assertEqual(len(encoder.bucketMap), 1, "Number of buckets is not 1") # Encode with a number that is resolution away from offset. Now we should # have two buckets and this encoding should be one bit away from e0 e1 = encoder.encode(1.0) self.assertEqual(len(encoder.bucketMap), 2, "Number of buckets is not 2") self.assertEqual(e1.sum(), 23, "Number of on bits is incorrect") self.assertEqual(e1.size, 500, "Width of the vector is incorrect") self.assertEqual(computeOverlap(e0, e1), 22, "Overlap is not equal to w-1") # Encode with a number that is resolution*w away from offset. Now we should # have many buckets and this encoding should have very little overlap with # e0 e25 = encoder.encode(25.0) self.assertGreater(len(encoder.bucketMap), 23, "Number of buckets is not 2") self.assertEqual(e25.sum(), 23, "Number of on bits is incorrect") self.assertEqual(e25.size, 500, "Width of the vector is incorrect") self.assertLess(computeOverlap(e0, e25), 4, "Overlap is too high") # Test encoding consistency. The encodings for previous numbers # shouldn't change even though we have added additional buckets self.assertTrue(numpy.array_equal(e0, encoder.encode(-0.1)), "Encodings are not consistent - they have changed after new buckets " "have been created") self.assertTrue(numpy.array_equal(e1, encoder.encode(1.0)), "Encodings are not consistent - they have changed after new buckets " "have been created") def testMissingValues(self): """ Test that missing values and NaN return all zero's. """ encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0) empty = encoder.encode(SENTINEL_VALUE_FOR_MISSING_DATA) self.assertEqual(empty.sum(), 0) empty = encoder.encode(float("nan")) self.assertEqual(empty.sum(), 0) def testResolution(self): """ Test that numbers within the same resolution return the same encoding. Numbers outside the resolution should return different encodings. """ encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0) # Since 23.0 is the first encoded number, it will be the offset. # Since resolution is 1, 22.9 and 23.4 should have the same bucket index and # encoding. e23 = encoder.encode(23.0) e23p1 = encoder.encode(23.1) e22p9 = encoder.encode(22.9) e24 = encoder.encode(24.0) self.assertEqual(e23.sum(), encoder.w) self.assertEqual((e23 == e23p1).sum(), encoder.getWidth(), "Numbers within resolution don't have the same encoding") self.assertEqual((e23 == e22p9).sum(), encoder.getWidth(), "Numbers within resolution don't have the same encoding") self.assertNotEqual((e23 == e24).sum(), encoder.getWidth(), "Numbers outside resolution have the same encoding") e22p9 = encoder.encode(22.5) self.assertNotEqual((e23 == e22p9).sum(), encoder.getWidth(), "Numbers outside resolution have the same encoding") def testMapBucketIndexToNonZeroBits(self): """ Test that mapBucketIndexToNonZeroBits works and that max buckets and clipping are handled properly. """ encoder = RandomDistributedScalarEncoder(resolution=1.0, w=11, n=150) # Set a low number of max buckets encoder._initializeBucketMap(10, None) encoder.encode(0.0) encoder.encode(-7.0) encoder.encode(7.0) self.assertEqual(len(encoder.bucketMap), encoder._maxBuckets, "_maxBuckets exceeded") self.assertTrue( numpy.array_equal(encoder.mapBucketIndexToNonZeroBits(-1), encoder.bucketMap[0]), "mapBucketIndexToNonZeroBits did not handle negative" " index") self.assertTrue( numpy.array_equal(encoder.mapBucketIndexToNonZeroBits(1000), encoder.bucketMap[9]), "mapBucketIndexToNonZeroBits did not handle negative index") e23 = encoder.encode(23.0) e6 = encoder.encode(6) self.assertEqual((e23 == e6).sum(), encoder.getWidth(), "Values not clipped correctly during encoding") ep8 = encoder.encode(-8) ep7 = encoder.encode(-7) self.assertEqual((ep8 == ep7).sum(), encoder.getWidth(), "Values not clipped correctly during encoding") self.assertEqual(encoder.getBucketIndices(-8)[0], 0, "getBucketIndices returned negative bucket index") self.assertEqual(encoder.getBucketIndices(23)[0], encoder._maxBuckets-1, "getBucketIndices returned bucket index that is too" " large") def testParameterChecks(self): """ Test that some bad construction parameters get handled. """ # n must be >= 6*w with self.assertRaises(ValueError): RandomDistributedScalarEncoder(name="mv", resolution=1.0, n=int(5.9*21)) # n must be an int with self.assertRaises(ValueError): RandomDistributedScalarEncoder(name="mv", resolution=1.0, n=5.9*21) # w can't be negative with self.assertRaises(ValueError): RandomDistributedScalarEncoder(name="mv", resolution=1.0, w=-1) # resolution can't be negative with self.assertRaises(ValueError): RandomDistributedScalarEncoder(name="mv", resolution=-2) def testOverlapStatistics(self): """ Check that the overlaps for the encodings are within the expected range. Here we ask the encoder to create a bunch of representations under somewhat stressful conditions, and then verify they are correct. We rely on the fact that the _overlapOK and _countOverlapIndices methods are working correctly. """ seed = getSeed() # Generate about 600 encodings. Set n relatively low to increase # chance of false overlaps encoder = RandomDistributedScalarEncoder(resolution=1.0, w=11, n=150, seed=seed) encoder.encode(0.0) encoder.encode(-300.0) encoder.encode(300.0) self.assertTrue(validateEncoder(encoder, subsampling=3), "Illegal overlap encountered in encoder") def testGetMethods(self): """ Test that the getWidth, getDescription, and getDecoderOutputFieldTypes methods work. """ encoder = RandomDistributedScalarEncoder(name="theName", resolution=1.0, n=500) self.assertEqual(encoder.getWidth(), 500, "getWidth doesn't return the correct result") self.assertEqual(encoder.getDescription(), [("theName", 0)], "getDescription doesn't return the correct result") self.assertEqual(encoder.getDecoderOutputFieldTypes(), (FieldMetaType.float, ), "getDecoderOutputFieldTypes doesn't return the correct" " result") def testOffset(self): """ Test that offset is working properly """ encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0) encoder.encode(23.0) self.assertEqual(encoder._offset, 23.0, "Offset not specified and not initialized to first input") encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0, offset=25.0) encoder.encode(23.0) self.assertEqual(encoder._offset, 25.0, "Offset not initialized to specified constructor" " parameter") def testSeed(self): """ Test that initializing twice with the same seed returns identical encodings and different when not specified """ encoder1 = RandomDistributedScalarEncoder(name="encoder1", resolution=1.0, seed=42) encoder2 = RandomDistributedScalarEncoder(name="encoder2", resolution=1.0, seed=42) encoder3 = RandomDistributedScalarEncoder(name="encoder3", resolution=1.0, seed=-1) encoder4 = RandomDistributedScalarEncoder(name="encoder4", resolution=1.0, seed=-1) e1 = encoder1.encode(23.0) e2 = encoder2.encode(23.0) e3 = encoder3.encode(23.0) e4 = encoder4.encode(23.0) self.assertEqual((e1 == e2).sum(), encoder1.getWidth(), "Same seed gives rise to different encodings") self.assertNotEqual((e1 == e3).sum(), encoder1.getWidth(), "Different seeds gives rise to same encodings") self.assertNotEqual((e3 == e4).sum(), encoder1.getWidth(), "seeds of -1 give rise to same encodings") def testCountOverlapIndices(self): """ Test that the internal method _countOverlapIndices works as expected. """ # Create a fake set of encodings. encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0, w=5, n=5*20) midIdx = encoder._maxBuckets/2 encoder.bucketMap[midIdx-2] = numpy.array(range(3, 8)) encoder.bucketMap[midIdx-1] = numpy.array(range(4, 9)) encoder.bucketMap[midIdx] = numpy.array(range(5, 10)) encoder.bucketMap[midIdx+1] = numpy.array(range(6, 11)) encoder.bucketMap[midIdx+2] = numpy.array(range(7, 12)) encoder.bucketMap[midIdx+3] = numpy.array(range(8, 13)) encoder.minIndex = midIdx - 2 encoder.maxIndex = midIdx + 3 # Indices must exist with self.assertRaises(ValueError): encoder._countOverlapIndices(midIdx-3, midIdx-2) with self.assertRaises(ValueError): encoder._countOverlapIndices(midIdx-2, midIdx-3) # Test some overlaps self.assertEqual(encoder._countOverlapIndices(midIdx-2, midIdx-2), 5, "_countOverlapIndices didn't work") self.assertEqual(encoder._countOverlapIndices(midIdx-1, midIdx-2), 4, "_countOverlapIndices didn't work") self.assertEqual(encoder._countOverlapIndices(midIdx+1, midIdx-2), 2, "_countOverlapIndices didn't work") self.assertEqual(encoder._countOverlapIndices(midIdx-2, midIdx+3), 0, "_countOverlapIndices didn't work") def testOverlapOK(self): """ Test that the internal method _overlapOK works as expected. """ # Create a fake set of encodings. encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0, w=5, n=5*20) midIdx = encoder._maxBuckets/2 encoder.bucketMap[midIdx-3] = numpy.array(range(4, 9)) # Not ok with # midIdx-1 encoder.bucketMap[midIdx-2] = numpy.array(range(3, 8)) encoder.bucketMap[midIdx-1] = numpy.array(range(4, 9)) encoder.bucketMap[midIdx] = numpy.array(range(5, 10)) encoder.bucketMap[midIdx+1] = numpy.array(range(6, 11)) encoder.bucketMap[midIdx+2] = numpy.array(range(7, 12)) encoder.bucketMap[midIdx+3] = numpy.array(range(8, 13)) encoder.minIndex = midIdx - 3 encoder.maxIndex = midIdx + 3 self.assertTrue(encoder._overlapOK(midIdx, midIdx-1), "_overlapOK didn't work") self.assertTrue(encoder._overlapOK(midIdx-2, midIdx+3), "_overlapOK didn't work") self.assertFalse(encoder._overlapOK(midIdx-3, midIdx-1), "_overlapOK didn't work") # We'll just use our own numbers self.assertTrue(encoder._overlapOK(100, 50, 0), "_overlapOK didn't work for far values") self.assertTrue(encoder._overlapOK(100, 50, encoder._maxOverlap), "_overlapOK didn't work for far values") self.assertFalse(encoder._overlapOK(100, 50, encoder._maxOverlap+1), "_overlapOK didn't work for far values") self.assertTrue(encoder._overlapOK(50, 50, 5), "_overlapOK didn't work for near values") self.assertTrue(encoder._overlapOK(48, 50, 3), "_overlapOK didn't work for near values") self.assertTrue(encoder._overlapOK(46, 50, 1), "_overlapOK didn't work for near values") self.assertTrue(encoder._overlapOK(45, 50, encoder._maxOverlap), "_overlapOK didn't work for near values") self.assertFalse(encoder._overlapOK(48, 50, 4), "_overlapOK didn't work for near values") self.assertFalse(encoder._overlapOK(48, 50, 2), "_overlapOK didn't work for near values") self.assertFalse(encoder._overlapOK(46, 50, 2), "_overlapOK didn't work for near values") self.assertFalse(encoder._overlapOK(50, 50, 6), "_overlapOK didn't work for near values") def testCountOverlap(self): """ Test that the internal method _countOverlap works as expected. """ encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0, n=500) r1 = numpy.array([1, 2, 3, 4, 5, 6]) r2 = numpy.array([1, 2, 3, 4, 5, 6]) self.assertEqual(encoder._countOverlap(r1, r2), 6, "_countOverlap result is incorrect") r1 = numpy.array([1, 2, 3, 4, 5, 6]) r2 = numpy.array([1, 2, 3, 4, 5, 7]) self.assertEqual(encoder._countOverlap(r1, r2), 5, "_countOverlap result is incorrect") r1 = numpy.array([1, 2, 3, 4, 5, 6]) r2 = numpy.array([6, 5, 4, 3, 2, 1]) self.assertEqual(encoder._countOverlap(r1, r2), 6, "_countOverlap result is incorrect") r1 = numpy.array([1, 2, 8, 4, 5, 6]) r2 = numpy.array([1, 2, 3, 4, 9, 6]) self.assertEqual(encoder._countOverlap(r1, r2), 4, "_countOverlap result is incorrect") r1 = numpy.array([1, 2, 3, 4, 5, 6]) r2 = numpy.array([1, 2, 3]) self.assertEqual(encoder._countOverlap(r1, r2), 3, "_countOverlap result is incorrect") r1 = numpy.array([7, 8, 9, 10, 11, 12]) r2 = numpy.array([1, 2, 3, 4, 5, 6]) self.assertEqual(encoder._countOverlap(r1, r2), 0, "_countOverlap result is incorrect") def testVerbosity(self): """ Test that nothing is printed out when verbosity=0 """ _stdout = sys.stdout sys.stdout = _stringio = StringIO() encoder = RandomDistributedScalarEncoder(name="mv", resolution=1.0, verbosity=0) output = numpy.zeros(encoder.getWidth(), dtype=defaultDtype) encoder.encodeIntoArray(23.0, output) encoder.getBucketIndices(23.0) sys.stdout = _stdout self.assertEqual(len(_stringio.getvalue()), 0, "zero verbosity doesn't lead to zero output") def testEncodeInvalidInputType(self): encoder = RandomDistributedScalarEncoder(name="encoder", resolution=1.0, verbosity=0) with self.assertRaises(TypeError): encoder.encode("String") @unittest.skipUnless( capnp, "pycapnp is not installed, skipping serialization test.") def testWriteRead(self): original = RandomDistributedScalarEncoder( name="encoder", resolution=1.0, w=23, n=500, offset=0.0) originalValue = original.encode(1) proto1 = RandomDistributedScalarEncoderProto.new_message() original.write(proto1) # Write the proto to a temp file and read it back into a new proto with tempfile.TemporaryFile() as f: proto1.write(f) f.seek(0) proto2 = RandomDistributedScalarEncoderProto.read(f) encoder = RandomDistributedScalarEncoder.read(proto2) self.assertIsInstance(encoder, RandomDistributedScalarEncoder) self.assertEqual(encoder.resolution, original.resolution) self.assertEqual(encoder.w, original.w) self.assertEqual(encoder.n, original.n) self.assertEqual(encoder.name, original.name) self.assertEqual(encoder.verbosity, original.verbosity) self.assertEqual(encoder.minIndex, original.minIndex) self.assertEqual(encoder.maxIndex, original.maxIndex) encodedFromOriginal = original.encode(1) encodedFromNew = encoder.encode(1) self.assertTrue(numpy.array_equal(encodedFromNew, originalValue)) self.assertEqual(original.decode(encodedFromNew), encoder.decode(encodedFromOriginal)) self.assertEqual(original.random.getSeed(), encoder.random.getSeed()) for key, value in original.bucketMap.items(): self.assertTrue(numpy.array_equal(value, encoder.bucketMap[key])) if __name__ == "__main__": unittest.main()
badlogicmanpreet/nupic
tests/unit/nupic/encoders/random_distributed_scalar_test.py
Python
agpl-3.0
19,742
[ 30522, 1001, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<h1>Carousel Settings</h1> <konko-alert alert="vm.alert" data-ng-if="vm.alert"></konko-alert> <form id="coreCarouselUpdateForm" name="coreCarouselUpdateForm" role="form" data-ng-submit="vm.updateCarousel(coreCarouselUpdateForm.$valid)" autocomplete="off"> <div class="form-group"> <div data-ng-class="{'p-t-1': !$first}" data-ng-repeat="slide in vm.slides | orderBy: 'order'"> <div data-ng-include="'coreSlideTemplate.html'"></div> </div> <div class="p-t-1"> <button type="button" class="btn btn-large btn-info btn-block" data-ng-click="vm.newSlide()">New Slide</button> </div> </div> </form> <script type="text/ng-template" id="coreSlideTemplate.html"> <div class="row admin-slide"> <div class="input-group col-xs-12 a-c-info"> <span class="input-group-addon" id="{{slide._id}}__title__addon">Title</span> <input type="text" class="form-control" id="core__slide__{{slide._id}}__title" data-ng-model="slide.title" placeholder="Slide title" aria-describedby="{{slide._id}}__title__addon" required> <span class="input-group-addon b-x-0" id="{{slide._id}}__url__addon">Url</span> <input type="text" class="form-control" id="core__slide__{{slide._id}}__url" data-ng-model="slide.url" placeholder="Slide link url" aria-describedby="{{slide._id}}__url__addon" required> <span class="input-group-addon b-x-0" id="{{slide._id}}__order__addon">Order</span> <input type="number" min="0" class="form-control" id="core__slide__{{slide._id}}__order" data-ng-model="slide.order" placeholder="Slide order" aria-describedby="{{slide._id}}__order__addon"> </div> <div class="input-group col-xs-12 a-c-desc"> <span class="input-group-addon" id="{{slide._id}}__description__addon">Description</span> <input type="text" class="form-control" id="core__slide__{{slide._id}}__description" data-ng-model="slide.description" placeholder="Slide description" aria-describedby="{{slide._id}}__description__addon"> <span class="input-group-btn" id="{{slide._id}}__remove__addon"> <button type="button" class="btn btn-outline-danger s-remove" data-ng-click="vm.removeSlide(slide)" data-ng-attr-title="{{vm.slideCrossButtonTitle(slide)}}">&cross;</button> </span> <span class="input-group-btn" id="{{slide._id}}__update__addon"> <button type="button" class="btn btn-outline-success" data-ng-click="vm.updateSlide(slide)" data-ng-attr-title="{{vm.slideCheckButtonTitle(slide)}}">&check;</button> </span> </div> <div class="input-group col-xs-12 a-c-img"> <span class="input-group-addon" id="{{slide._id}}__image__addon">Image</span> <input type="text" class="form-control" id="core__slide__{{slide._id}}__image" data-ng-model="slide.image" placeholder="Slide image url" aria-describedby="{{slide._id}}__image__addon" required> <span class="input-group-addon b-x-0" id="{{slide._id}}__image_alt__addon">Alt</span> <input type="text" class="form-control" id="core__slide__{{slide._id}}__image_alt" data-ng-model="slide.alt" placeholder="Slide image alt" aria-describedby="{{slide._id}}__image_alt__addon"> </div> </div> </script>
konko-project/konko
static/styles/core/views/admin/carousel.admin.view.html
HTML
mit
3,169
[ 30522, 1026, 1044, 2487, 1028, 27628, 10906, 1026, 1013, 1044, 2487, 1028, 1026, 12849, 16107, 1011, 9499, 9499, 1027, 1000, 1058, 2213, 1012, 9499, 1000, 2951, 1011, 12835, 1011, 2065, 1027, 1000, 1058, 2213, 1012, 9499, 1000, 1028, 1026, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Installation ### Table of Contents * [Requirements](#requirements) * [WARNING](#warning) * [Cloud Foundry](#cloud-foundry) * [Heroku](#heroku) * [dotCloud](#dotcloud) * [AppFog](#appfog) * [Stand Alone Server](#standalone-server) <hr> # <a name="requirements"></a>Requirements * Ruby 1.9 <hr> # <a name="warning"></a>WARNING We try and keep the __MASTER__ branch of the Kandan code clean and usable but it is __bleeding edge__ and can cause unpredictable results. If you need a version of Kandan that's both __tested & stable__ then please make sure you're installing from the lastest `tagged` version of the code. ``` git clone git@github.com:kandanapp/kandan.git cd kandan git tag -l git checkout <tag_name> ``` Depending on your setup you might also see the following error: ``` Building native extensions. This could take a while... ERROR: Error installing debugger-linecache: ERROR: Failed to build gem native extension. /home/jrg/.rbenv/versions/1.9.3-p385/bin/ruby extconf.rb checking for vm_core.h... no checking for vm_core.h... no Makefile creation failed ************************************************************************** No source for ruby-1.9.3-p385 provided with debugger-ruby_core_source gem. ************************************************************************** *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/jrg/.rbenv/versions/1.9.3-p385/bin/ruby --with-ruby-dir --without-ruby-dir --with-ruby-include --without-ruby-include=${ruby-dir}/include --with-ruby-lib --without-ruby-lib=${ruby-dir}/lib ``` To work around it run this then attempt to re-install. `gem install debugger-ruby_core_source` <hr> # <a name="cloud-foundry"></a>Cloud Foundry You'll need a [Cloud Foundry account](https://my.cloudfoundry.com/signup) and the [vmc gem](https://rubygems.org/gems/vmc) installed. Do you `vmc target <cloud foundry host>` and `vmc login`, and then this will get you up and running: git clone https://github.com/kandanapp/kandan.git cd kandan bundle install bundle exec rake assets:precompile vmc push my-company-chat --path . --instances 1 --mem 256M --runtime ruby19 You'll answer a few questions: Application Deployed URL [my-company-chat.cloudfoundry.com]: Detected a Rails Application, is this correct? [Yn]: Creating Application: OK Would you like to bind any services to 'my-company-chat'? [yN]: y Would you like to use an existing provisioned service? [yN]: n The following system services are available 1: mongodb 2: mysql 3: postgresql 4: rabbitmq 5: redis Please select one you wish to provision: 3 Specify the name of the service [postgresql-246de]: Creating Service: OK Binding Service [postgresql-246de]: OK Uploading Application: Checking for available resources: OK Processing resources: OK Packing application: OK Uploading (1M): OK Push Status: OK Staging Application: OK Starting Application: OK And Kandan should be available on your Cloud Foundry backend now! <hr> # <a name="heroku"></a>Heroku You'll need to have the [heroku CLI](https://github.com/heroku/heroku) installed and to have an existing [heroku account](https://api.heroku.com/signup). Assuming that, this should work reliably on Heroku: git clone https://github.com/kandanapp/kandan.git cd kandan heroku create __appname__ # appname is optional git push heroku master heroku run rake db:migrate kandan:bootstrap && heroku open echo "Done, go forth and chat!" # Not too bad If you want emails to work (forgotten passwords, etc), you'll also need to add a Heroku email add-on to your app. For example, to add SendGrid: heroku addons:add sendgrid:starter After you add an email provider to your Heroku app, you'll also need to setup your production.rb file to look similar to this (using SendGrid again as an example): config.action_mailer.default_url_options = { :host => "yourapp.herokuapp.com" } (Or whatever connected to your heroku app) config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.smtp_settings = { address: "smtp.sendgrid.net", port: 25, domain: "example.com", authentication: "plain", user_name: ENV["SENDGRID_USERNAME"], password: ENV["SENDGRID_PASSWORD"] } ### Integrate Kandan on Heroku with your Amazon S3_BUCKET ( [Heroku article on AWS S3 to store static assets and file uploads](https://devcenter.heroku.com/articles/s3) ). Run the following line, replacing the the global variable values with your own: heroku config:add S3_ACCESS_KEY_ID=abc S3_SECRET_ACCESS_KEY=xyz S3_BUCKET=bucket_name If successful you should get a response similar to: Setting config vars and restarting myapp... done, v12 S3_ACCESS_KEY_ID: xxx S3_SECRET_ACCESS_KEY: xxxx S3_BUCKET: bucket_name Your app should be up and running now. The default admin user is `Admin` with password `kandanappadmin`, or you can sign up as another user. <hr> # <a name="dotcloud"></a>dotCloud Looking for community help here. <hr> # <a name="appfog"></a>AppFog You'll need an [AppFog account](https://www.appfog.com/) and the [af command line tool](https://docs.appfog.com/getting-started/af-cli) installed. Once that's all set up, login from the command line: `af login`. You'll be prompted for the username/password you set on AppFog. You're returned to your operating system's command prompt. It's not a terminal emulator. If you want to use PostgreSQL rather than MySQL, provision the service on the Services page of the [console](https://console.appfog.com). Note the name of your database and app name on the console and substitute as appropriate. git clone https://github.com/kandanapp/kandan.git cd kandan bundle install bundle exec rake assets:precompile af push your_app_name --path . --instances 1 --mem 256M --runtime ruby19 You'll answer a few questions; you'll probably get an error at the end about an invalid app description. That's okay, we'll fix that next: Detected a Rails Application, is this correct? [Yn]: y 1: AWS US East - Virginia 2: AWS EU West - Ireland 3: AWS Asia SE - Singapore 4: Rackspace AZ 1 - Dallas 5: HP AZ 2 - Las Vegas Select Infrastructure: 1 Application Deployed URL [<your_app_name>.aws.af.cm]: <your_app_name> Memory reservation (128M, 256M, 512M, 1G, 2G) [256M]: How many instances? [1]: Bind existing services to '<your_app_name>'? [yN]: y 1: kandan_production 2: <your_app_name>-mysql-12781 Which one?: 1 Bind another? [yN]: n Create services to bind to '<your_app_name>'? [yN]: Would you like to save this configuration? [yN]: y Manifest written to manifest.yml. Creating Application: Error 300: Invalid application description If you get the invalid app description, open manifest.yml in a text editor and remove the space from the description. (It defaults to Rails Application, which causes the error.) Then, at the terminal: af update <your_app_name> And you should also restart the app on AppFog (in the console). Then, Kandan should be available on your AppFox backend now! With your browser, visit the domain name assigned to you by AppFog (or create a CNAME record at your DNS provider to use an alternate). <hr> # <a name="standalone-server"></a>Stand Alone Server If you're looking to install Kandan on a private server, or to develop locally for lemonodor fame, then here is the path you must follow, young hero: You still need kandan (from above) git clone https://github.com/kandanapp/kandan.git cd kandan Lots of the gems require other libraries: sudo apt-get install ruby1.9.1-dev ruby-bundler libxslt-dev libxml2-dev libpq-dev libsqlite3-dev Some gems build native extensions: sudo apt-get install gcc g++ make For development-mode sudo apt-get install nodejs # (execjs needs an execution environment) gem install execjs # (Could possibly be added to the gemfile in the assets group) Install the required gems: bundle install You can use the default database.yml to get started in development. For production you'll need to edit config/database.yml to add something like this: production: adapter: postgresql host: localhost database: kandan_production pool: 5 timeout: 5000 # You might need these depending on your Postgres auth setup. username: kandan password: something Now, bootstrap the install (you can omit the db:create step if you have already created the DB referenced above): bundle exec rake db:create db:migrate kandan:bootstrap If you plan to serve the app directly from Thin (rather than through a proxy), you will need to configure Rails to serve assets in the production environment. In config/environments/production.rb: config.serve_static_assets = true Start the server bundle exec thin start Your app should be up and running now. The default admin user is `Admin` with password `kandanappadmin`, or you can sign up as another user.
johanasplund/skamchat
DEPLOY.md
Markdown
agpl-3.0
9,584
[ 30522, 1001, 8272, 1001, 1001, 1001, 2795, 1997, 8417, 1008, 1031, 5918, 1033, 1006, 1001, 5918, 1007, 1008, 1031, 5432, 1033, 1006, 1001, 5432, 1007, 1008, 1031, 6112, 19853, 1033, 1006, 1001, 6112, 1011, 19853, 1007, 1008, 1031, 5394, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Atriplex stewartii I.M.Johnst. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Chenopodiaceae/Atriplex/Atriplex stewartii/README.md
Markdown
apache-2.0
180
[ 30522, 1001, 2012, 29443, 2571, 2595, 5954, 6137, 1045, 1012, 1049, 1012, 11545, 2102, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, 19701, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from django.db import models from django.contrib.auth.models import User import MySQLdb # Create your models here. class Comentario(models.Model): """Comentario""" contenido = models.TextField(help_text='Escribe un comentario') fecha_coment = models.DateField(auto_now=True) def __unicode__(self): return self.contenido class Estado(models.Model): """Estado""" nom_estado = models.CharField(max_length=50) def __unicode__(self): return nom_estado class Categoria(models.Model): """Categoria""" nombre = models.CharField(max_length=50) descripcion = models.TextField(help_text='Escribe una descripcion de la categoria') class Entrada(models.Model): """Entrada""" autor = models.ForeignKey(User) comentario = models.ForeignKey(Comentario) estado = models.ForeignKey(Estado) titulo = models.CharField(max_length=100) contenido = models.TextField(help_text='Redacta el contenido') fecha_pub = models.DateField(auto_now=True) def __unicode__(self): return self.titulo class Agregador(models.Model): """agreador""" entrada = models.ForeignKey(Entrada) categoria = models.ManyToManyField(Categoria)
darciga/cf
blog/models.py
Python
gpl-3.0
1,127
[ 30522, 2013, 6520, 23422, 1012, 16962, 12324, 4275, 2013, 6520, 23422, 1012, 9530, 18886, 2497, 1012, 8740, 2705, 1012, 4275, 12324, 5310, 12324, 2026, 2015, 4160, 6392, 2497, 1001, 3443, 2115, 4275, 2182, 1012, 2465, 2272, 12380, 9488, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* core/themes/classy/templates/navigation/breadcrumb.html.twig */ class __TwigTemplate_409f5f562164b0f9049b70e0b01c2edc7c70d123e0f9fa1f2378198c8de96bdf extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { $tags = array("if" => 10, "for" => 14); $filters = array("t" => 12); $functions = array(); try { $this->env->getExtension('Twig_Extension_Sandbox')->checkSecurity( array('if', 'for'), array('t'), array() ); } catch (Twig_Sandbox_SecurityError $e) { $e->setSourceContext($this->getSourceContext()); if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) { $e->setTemplateLine($tags[$e->getTagName()]); } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) { $e->setTemplateLine($filters[$e->getFilterName()]); } elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) { $e->setTemplateLine($functions[$e->getFunctionName()]); } throw $e; } // line 10 if ((isset($context["breadcrumb"]) ? $context["breadcrumb"] : null)) { // line 11 echo " <nav class=\"breadcrumb\" role=\"navigation\" aria-labelledby=\"system-breadcrumb\"> <h2 id=\"system-breadcrumb\" class=\"visually-hidden\">"; // line 12 echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Breadcrumb"))); echo "</h2> <ol> "; // line 14 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["breadcrumb"]) ? $context["breadcrumb"] : null)); foreach ($context['_seq'] as $context["_key"] => $context["item"]) { // line 15 echo " <li> "; // line 16 if ($this->getAttribute($context["item"], "url", array())) { // line 17 echo " <a href=\""; echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "url", array()), "html", null, true)); echo "\">"; echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text", array()), "html", null, true)); echo "</a> "; } else { // line 19 echo " "; echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute($context["item"], "text", array()), "html", null, true)); echo " "; } // line 21 echo " </li> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 23 echo " </ol> </nav> "; } } public function getTemplateName() { return "core/themes/classy/templates/navigation/breadcrumb.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 83 => 23, 76 => 21, 70 => 19, 62 => 17, 60 => 16, 57 => 15, 53 => 14, 48 => 12, 45 => 11, 43 => 10,); } /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ public function getSource() { @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); return $this->getSourceContext()->getCode(); } public function getSourceContext() { return new Twig_Source("", "core/themes/classy/templates/navigation/breadcrumb.html.twig", "D:\\Sachin\\work\\XAMPP\\htdocs\\sachlife\\core\\themes\\classy\\templates\\navigation\\breadcrumb.html.twig"); } }
sachinsuryavanshi/sachlife-xampp
sites/default/files/php/twig/5b08fe9a00394_breadcrumb.html.twig_bpT9qXxQz_4B9K3QemSggcJmT/IVc0q79j4Y19Uv2OOMsPaLuNWKUUGGyreYxX9ChfHYA.php
PHP
gpl-2.0
4,970
[ 30522, 1026, 1029, 25718, 1013, 1008, 4563, 1013, 6991, 1013, 2465, 2100, 1013, 23561, 2015, 1013, 9163, 1013, 7852, 26775, 25438, 1012, 16129, 1012, 1056, 16279, 1008, 1013, 2465, 1035, 1035, 1056, 16279, 18532, 15725, 1035, 2871, 2683, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Type definitions for jsreport-html-embedded-in-docx 1.0 // Project: https://github.com/jsreport/jsreport-html-embedded-in-docx // Definitions by: taoqf <https://github.com/taoqf> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { ExtensionDefinition } from 'jsreport-core'; declare module 'jsreport-core' { interface Template { recipe: 'html-embedded-in-docx' | string; } } declare function JsReportHtmlEmbeddedInDocx(): ExtensionDefinition; export = JsReportHtmlEmbeddedInDocx;
borisyankov/DefinitelyTyped
types/jsreport-html-embedded-in-docx/index.d.ts
TypeScript
mit
542
[ 30522, 1013, 1013, 2828, 15182, 2005, 1046, 21338, 13699, 11589, 1011, 16129, 1011, 11157, 1011, 1999, 1011, 9986, 2595, 1015, 1012, 1014, 1013, 1013, 2622, 1024, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 4012, 1013, 1046, 21338, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Utricularia reticulata Sm. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lentibulariaceae/Utricularia/Utricularia reticulata/README.md
Markdown
apache-2.0
176
[ 30522, 1001, 21183, 7277, 7934, 2401, 2128, 4588, 18060, 15488, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, 19701, 1001, 1001, 1001, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.tedmemo.others; import android.text.Editable; import android.text.style.ImageSpan; import com.tedmemo.view.ImageEditText; import java.util.Comparator; /** * Created by Ted on 2014/9/10. */ public class TComparator implements Comparator<ImageSpan> { private Editable mEditable = null; private ImageEditText mImageEditText; public TComparator(ImageEditText imageEditText, Editable editable) { this.mEditable = editable; this.mImageEditText = imageEditText; } @Override public int compare(ImageSpan lhs, ImageSpan rhs) { if (this.mEditable.getSpanStart(lhs) > this.mEditable.getSpanStart(rhs)) { return 1; } if (this.mEditable.getSpanStart(lhs) == this.mEditable.getSpanStart(rhs)) { return 0; } return -1; } }
xiongwei-git/TedMemo
src/com/tedmemo/others/TComparator.java
Java
apache-2.0
835
[ 30522, 7427, 4012, 1012, 6945, 4168, 5302, 1012, 2500, 1025, 12324, 11924, 1012, 3793, 1012, 10086, 3085, 1025, 12324, 11924, 1012, 3793, 1012, 2806, 1012, 4871, 9739, 1025, 12324, 4012, 1012, 6945, 4168, 5302, 1012, 3193, 1012, 3746, 2098,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using Aggregator.Core.Monitoring; namespace Aggregator.Core.Configuration { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; #pragma warning disable S101 // Types should be named in camel case /// <summary> /// This class represents Core settings as properties /// </summary> /// <remarks>Marked partial to apply nested trick</remarks> public partial class TFSAggregatorSettings #pragma warning restore S101 // Types should be named in camel case { private static readonly char[] ListSeparators = new char[] { ',', ';' }; /// <summary> /// Load configuration from file. Main scenario. /// </summary> /// <param name="settingsPath">Path to policies file</param> /// <param name="logger">Logging object</param> /// <returns>An instance of <see cref="TFSAggregatorSettings"/> or null</returns> public static TFSAggregatorSettings LoadFromFile(string settingsPath, ILogEvents logger) { DateTime lastWriteTime = System.IO.File.GetLastWriteTimeUtc(settingsPath); var parser = new AggregatorSettingsXmlParser(logger); return parser.Parse(lastWriteTime, (xmlLoadOptions) => XDocument.Load(settingsPath, xmlLoadOptions)); } /// <summary> /// Load configuration from string. Used by automated tests. /// </summary> /// <param name="content">Configuration data to parse</param> /// <param name="logger">Logging object</param> /// <returns>An instance of <see cref="TFSAggregatorSettings"/> or null</returns> public static TFSAggregatorSettings LoadXml(string content, ILogEvents logger) { // conventional point in time reference DateTime staticTimestamp = new DateTime(0, DateTimeKind.Utc); var parser = new AggregatorSettingsXmlParser(logger); return parser.Parse(staticTimestamp, (xmlLoadOptions) => XDocument.Parse(content, xmlLoadOptions)); } public LogLevel LogLevel { get; private set; } public string ScriptLanguage { get; private set; } public bool AutoImpersonate { get; private set; } public Uri ServerBaseUrl { get; private set; } public string PersonalToken { get; private set; } public string BasicPassword { get; private set; } public string BasicUsername { get; private set; } public string Hash { get; private set; } public IEnumerable<Snippet> Snippets { get; private set; } public IEnumerable<Function> Functions { get; private set; } public IEnumerable<Rule> Rules { get; private set; } public IEnumerable<Policy> Policies { get; private set; } public bool Debug { get; set; } public RateLimit RateLimit { get; set; } public bool WhatIf { get; set; } public bool IgnoreSslErrors { get; set; } } }
tfsaggregator/tfsaggregator
Aggregator.Core/Aggregator.Core/Configuration/TFSAggregatorSettings.cs
C#
apache-2.0
3,073
[ 30522, 2478, 24089, 1012, 4563, 1012, 8822, 1025, 3415, 15327, 24089, 1012, 4563, 1012, 9563, 1063, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 9185, 1025, 2478, 2291, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Sun Jun 09 12:16:28 GMT+05:30 2013 --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <TITLE> org.apache.solr (Solr 4.3.1 API) </TITLE> <META NAME="date" CONTENT="2013-06-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.apache.solr (Solr 4.3.1 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV PACKAGE&nbsp; &nbsp;<A HREF="../../../org/apache/solr/analysis/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/apache/solr/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <H2> Package org.apache.solr </H2> Common base classes for implementing tests. <P> <B>See:</B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A> <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/BaseDistributedSearchTestCase.html" title="class in org.apache.solr">BaseDistributedSearchTestCase</A></B></TD> <TD>Helper base class for distributed search test cases</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/BaseDistributedSearchTestCase.RandDate.html" title="class in org.apache.solr">BaseDistributedSearchTestCase.RandDate</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/BaseDistributedSearchTestCase.RandVal.html" title="class in org.apache.solr">BaseDistributedSearchTestCase.RandVal</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/JSONTestUtil.html" title="class in org.apache.solr">JSONTestUtil</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrIgnoredThreadsFilter.html" title="class in org.apache.solr">SolrIgnoredThreadsFilter</A></B></TD> <TD>This ignores those threads in Solr for which there is no way to clean up after a suite.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrJettyTestBase.html" title="class in org.apache.solr">SolrJettyTestBase</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.html" title="class in org.apache.solr">SolrTestCaseJ4</A></B></TD> <TD>A junit4 Solr test harness that extends LuceneTestCaseJ4.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.Doc.html" title="class in org.apache.solr">SolrTestCaseJ4.Doc</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.Fld.html" title="class in org.apache.solr">SolrTestCaseJ4.Fld</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.FVal.html" title="class in org.apache.solr">SolrTestCaseJ4.FVal</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.IRange.html" title="class in org.apache.solr">SolrTestCaseJ4.IRange</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.IVals.html" title="class in org.apache.solr">SolrTestCaseJ4.IVals</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.SVal.html" title="class in org.apache.solr">SolrTestCaseJ4.SVal</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.Vals.html" title="class in org.apache.solr">SolrTestCaseJ4.Vals</A></B></TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../org/apache/solr/SolrTestCaseJ4.XmlDoc.html" title="class in org.apache.solr">SolrTestCaseJ4.XmlDoc</A></B></TD> <TD>Necessary to make method signatures un-ambiguous</TD> </TR> </TABLE> &nbsp; <P> <A NAME="package_description"><!-- --></A><H2> Package org.apache.solr Description </H2> <P> Common base classes for implementing tests. <P> <P> <DL> </DL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV PACKAGE&nbsp; &nbsp;<A HREF="../../../org/apache/solr/analysis/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/apache/solr/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &copy; 2000-2013 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </BODY> </HTML>
jeffersonmolleri/sesra
bin/solr-4.3.1/docs/solr-test-framework/org/apache/solr/package-summary.html
HTML
gpl-3.0
9,958
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//////////////////////////////////////////////////////////////////////////////// /// @brief associative array implementation /// /// @file /// /// DISCLAIMER /// /// Copyright 2014 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Dr. Frank Celler /// @author Martin Schoenert /// @author Copyright 2014, ArangoDB GmbH, Cologne, Germany /// @author Copyright 2006-2013, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// #ifndef ARANGODB_BASICS_C_ASSOCIATIVE_H #define ARANGODB_BASICS_C_ASSOCIATIVE_H 1 #include <functional> #include "Basics/Common.h" #include "Basics/locks.h" // ----------------------------------------------------------------------------- // --SECTION-- ASSOCIATIVE ARRAY // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // --SECTION-- public types // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief associative array //////////////////////////////////////////////////////////////////////////////// typedef struct TRI_associative_array_s { uint64_t (*hashKey) (struct TRI_associative_array_s*, void*); uint64_t (*hashElement) (struct TRI_associative_array_s*, void*); void (*clearElement) (struct TRI_associative_array_s*, void*); bool (*isEmptyElement) (struct TRI_associative_array_s*, void*); bool (*isEqualKeyElement) (struct TRI_associative_array_s*, void*, void*); bool (*isEqualElementElement) (struct TRI_associative_array_s*, void*, void*); uint32_t _elementSize; uint32_t _nrAlloc; // the size of the table uint32_t _nrUsed; // the number of used entries char* _table; // the table itself #ifdef TRI_INTERNAL_STATS uint64_t _nrFinds; // statistics: number of lookup calls uint64_t _nrAdds; // statistics: number of insert calls uint64_t _nrRems; // statistics: number of remove calls uint64_t _nrResizes; // statistics: number of resizes uint64_t _nrProbesF; // statistics: number of misses while looking up uint64_t _nrProbesA; // statistics: number of misses while inserting uint64_t _nrProbesD; // statistics: number of misses while removing uint64_t _nrProbesR; // statistics: number of misses while adding #endif TRI_memory_zone_t* _memoryZone; } TRI_associative_array_t; // ----------------------------------------------------------------------------- // --SECTION-- constructors and destructors // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief initialises an array //////////////////////////////////////////////////////////////////////////////// int TRI_InitAssociativeArray (TRI_associative_array_t*, TRI_memory_zone_t*, size_t elementSize, uint64_t (*hashKey) (TRI_associative_array_t*, void*), uint64_t (*hashElement) (TRI_associative_array_t*, void*), void (*clearElement) (TRI_associative_array_t*, void*), bool (*isEmptyElement) (TRI_associative_array_t*, void*), bool (*isEqualKeyElement) (TRI_associative_array_t*, void*, void*), bool (*isEqualElementElement) (TRI_associative_array_t*, void*, void*)); //////////////////////////////////////////////////////////////////////////////// /// @brief destroys an array, but does not free the pointer //////////////////////////////////////////////////////////////////////////////// void TRI_DestroyAssociativeArray (TRI_associative_array_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief destroys an array and frees the pointer //////////////////////////////////////////////////////////////////////////////// void TRI_FreeAssociativeArray (TRI_memory_zone_t*, TRI_associative_array_t*); // ----------------------------------------------------------------------------- // --SECTION-- public functions // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief lookups an element given a key //////////////////////////////////////////////////////////////////////////////// void* TRI_LookupByKeyAssociativeArray (TRI_associative_array_t*, void* key); //////////////////////////////////////////////////////////////////////////////// /// @brief finds an element given a key, returns NULL if not found //////////////////////////////////////////////////////////////////////////////// void* TRI_FindByKeyAssociativeArray (TRI_associative_array_t*, void* key); //////////////////////////////////////////////////////////////////////////////// /// @brief lookups an element given an element //////////////////////////////////////////////////////////////////////////////// void* TRI_LookupByElementAssociativeArray (TRI_associative_array_t*, void* element); //////////////////////////////////////////////////////////////////////////////// /// @brief finds an element given an element, returns NULL if not found //////////////////////////////////////////////////////////////////////////////// void* TRI_FindByElementAssociativeArray (TRI_associative_array_t*, void* element); //////////////////////////////////////////////////////////////////////////////// /// @brief adds an element to the array //////////////////////////////////////////////////////////////////////////////// bool TRI_InsertElementAssociativeArray (TRI_associative_array_t*, void* element, bool overwrite); //////////////////////////////////////////////////////////////////////////////// /// @brief adds an key/element to the array //////////////////////////////////////////////////////////////////////////////// bool TRI_InsertKeyAssociativeArray (TRI_associative_array_t*, void* key, void* element, bool overwrite); //////////////////////////////////////////////////////////////////////////////// /// @brief removes an element from the array //////////////////////////////////////////////////////////////////////////////// bool TRI_RemoveElementAssociativeArray (TRI_associative_array_t*, void* element, void* old); //////////////////////////////////////////////////////////////////////////////// /// @brief removes an key/element to the array //////////////////////////////////////////////////////////////////////////////// bool TRI_RemoveKeyAssociativeArray (TRI_associative_array_t*, void* key, void* old); //////////////////////////////////////////////////////////////////////////////// /// @brief get the number of elements from the array //////////////////////////////////////////////////////////////////////////////// size_t TRI_GetLengthAssociativeArray (const TRI_associative_array_t* const); // ----------------------------------------------------------------------------- // --SECTION-- ASSOCIATIVE POINTERS // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // --SECTION-- public types // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief associative array of pointers //////////////////////////////////////////////////////////////////////////////// typedef struct TRI_associative_pointer_s { uint64_t (*hashKey) (struct TRI_associative_pointer_s*, void const*); uint64_t (*hashElement) (struct TRI_associative_pointer_s*, void const*); bool (*isEqualKeyElement) (struct TRI_associative_pointer_s*, void const*, void const*); bool (*isEqualElementElement) (struct TRI_associative_pointer_s*, void const*, void const*); uint32_t _nrAlloc; // the size of the table uint32_t _nrUsed; // the number of used entries void** _table; // the table itself #ifdef TRI_INTERNAL_STATS uint64_t _nrFinds; // statistics: number of lookup calls uint64_t _nrAdds; // statistics: number of insert calls uint64_t _nrRems; // statistics: number of remove calls uint64_t _nrResizes; // statistics: number of resizes uint64_t _nrProbesF; // statistics: number of misses while looking up uint64_t _nrProbesA; // statistics: number of misses while inserting uint64_t _nrProbesD; // statistics: number of misses while removing uint64_t _nrProbesR; // statistics: number of misses while adding #endif TRI_memory_zone_t* _memoryZone; } TRI_associative_pointer_t; // ----------------------------------------------------------------------------- // --SECTION-- constructors and destructors // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief initialises an array //////////////////////////////////////////////////////////////////////////////// int TRI_InitAssociativePointer (TRI_associative_pointer_t* array, TRI_memory_zone_t*, uint64_t (*hashKey) (TRI_associative_pointer_t*, void const*), uint64_t (*hashElement) (TRI_associative_pointer_t*, void const*), bool (*isEqualKeyElement) (TRI_associative_pointer_t*, void const*, void const*), bool (*isEqualElementElement) (TRI_associative_pointer_t*, void const*, void const*)); //////////////////////////////////////////////////////////////////////////////// /// @brief destroys an array, but does not free the pointer //////////////////////////////////////////////////////////////////////////////// void TRI_DestroyAssociativePointer (TRI_associative_pointer_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief destroys an array and frees the pointer //////////////////////////////////////////////////////////////////////////////// void TRI_FreeAssociativePointer (TRI_memory_zone_t*, TRI_associative_pointer_t*); // ----------------------------------------------------------------------------- // --SECTION-- public functions // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief General hash function that can be used to hash a pointer //////////////////////////////////////////////////////////////////////////////// uint64_t TRI_HashPointerKeyAssociativePointer (TRI_associative_pointer_t*, void const*); //////////////////////////////////////////////////////////////////////////////// /// @brief General hash function that can be used to hash a string key //////////////////////////////////////////////////////////////////////////////// uint64_t TRI_HashStringKeyAssociativePointer (TRI_associative_pointer_t*, void const*); //////////////////////////////////////////////////////////////////////////////// /// @brief General function to determine equality of two string values //////////////////////////////////////////////////////////////////////////////// bool TRI_EqualStringKeyAssociativePointer (TRI_associative_pointer_t*, void const*, void const*); //////////////////////////////////////////////////////////////////////////////// /// @brief reserves space in the array for extra elements //////////////////////////////////////////////////////////////////////////////// bool TRI_ReserveAssociativePointer (TRI_associative_pointer_t*, int32_t); //////////////////////////////////////////////////////////////////////////////// /// @brief lookups an element given a key //////////////////////////////////////////////////////////////////////////////// void* TRI_LookupByKeyAssociativePointer (TRI_associative_pointer_t*, void const* key); //////////////////////////////////////////////////////////////////////////////// /// @brief lookups an element given an element //////////////////////////////////////////////////////////////////////////////// void* TRI_LookupByElementAssociativePointer (TRI_associative_pointer_t*, void const* element); //////////////////////////////////////////////////////////////////////////////// /// @brief adds an element to the array //////////////////////////////////////////////////////////////////////////////// void* TRI_InsertElementAssociativePointer (TRI_associative_pointer_t*, void* element, bool overwrite); //////////////////////////////////////////////////////////////////////////////// /// @brief adds an key/element to the array //////////////////////////////////////////////////////////////////////////////// void* TRI_InsertKeyAssociativePointer (TRI_associative_pointer_t*, void const* key, void* element, bool overwrite); //////////////////////////////////////////////////////////////////////////////// /// @brief adds an key/element to the array /// returns a status code, and *found will contain a found element (if any) //////////////////////////////////////////////////////////////////////////////// int TRI_InsertKeyAssociativePointer2 (TRI_associative_pointer_t*, void const*, void*, void const**); //////////////////////////////////////////////////////////////////////////////// /// @brief removes an element from the array //////////////////////////////////////////////////////////////////////////////// void* TRI_RemoveElementAssociativePointer (TRI_associative_pointer_t*, void const* element); //////////////////////////////////////////////////////////////////////////////// /// @brief removes an key/element to the array //////////////////////////////////////////////////////////////////////////////// void* TRI_RemoveKeyAssociativePointer (TRI_associative_pointer_t*, void const* key); //////////////////////////////////////////////////////////////////////////////// /// @brief get the number of elements from the array //////////////////////////////////////////////////////////////////////////////// size_t TRI_GetLengthAssociativePointer (const TRI_associative_pointer_t* const); // ----------------------------------------------------------------------------- // --SECTION-- ASSOCIATIVE SYNCED // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // --SECTION-- public types // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief associative array of synced pointers /// /// Note that lookup, insert, and remove are protected using a read-write lock. //////////////////////////////////////////////////////////////////////////////// typedef struct TRI_associative_synced_s { uint64_t (*hashKey) (struct TRI_associative_synced_s*, void const*); uint64_t (*hashElement) (struct TRI_associative_synced_s*, void const*); bool (*isEqualKeyElement) (struct TRI_associative_synced_s*, void const*, void const*); bool (*isEqualElementElement) (struct TRI_associative_synced_s*, void const*, void const*); uint32_t _nrAlloc; // the size of the table uint32_t _nrUsed; // the number of used entries void** _table; // the table itself TRI_read_write_lock_t _lock; TRI_memory_zone_t* _memoryZone; } TRI_associative_synced_t; // ----------------------------------------------------------------------------- // --SECTION-- constructors and destructors // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief initialises an array //////////////////////////////////////////////////////////////////////////////// int TRI_InitAssociativeSynced (TRI_associative_synced_t* array, TRI_memory_zone_t*, uint64_t (*hashKey) (TRI_associative_synced_t*, void const*), uint64_t (*hashElement) (TRI_associative_synced_t*, void const*), bool (*isEqualKeyElement) (TRI_associative_synced_t*, void const*, void const*), bool (*isEqualElementElement) (TRI_associative_synced_t*, void const*, void const*)); //////////////////////////////////////////////////////////////////////////////// /// @brief destroys an array, but does not free the pointer //////////////////////////////////////////////////////////////////////////////// void TRI_DestroyAssociativeSynced (TRI_associative_synced_t*); //////////////////////////////////////////////////////////////////////////////// /// @brief destroys an array and frees the pointer //////////////////////////////////////////////////////////////////////////////// void TRI_FreeAssociativeSynced (TRI_memory_zone_t*, TRI_associative_synced_t*); // ----------------------------------------------------------------------------- // --SECTION-- public functions // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// /// @brief lookups an element given a key //////////////////////////////////////////////////////////////////////////////// void const* TRI_LookupByKeyAssociativeSynced (TRI_associative_synced_t*, void const* key); //////////////////////////////////////////////////////////////////////////////// /// @brief lookups an element given a key and calls the callback function while /// the read-lock is held //////////////////////////////////////////////////////////////////////////////// template<typename T> T TRI_ProcessByKeyAssociativeSynced (TRI_associative_synced_t* array, void const* key, std::function<T(void const*)> callback) { // compute the hash uint64_t const hash = array->hashKey(array, key); // search the table TRI_ReadLockReadWriteLock(&array->_lock); uint64_t const n = array->_nrAlloc; uint64_t i, k; i = k = hash % n; for (; i < n && array->_table[i] != nullptr && ! array->isEqualKeyElement(array, key, array->_table[i]); ++i); if (i == n) { for (i = 0; i < k && array->_table[i] != nullptr && ! array->isEqualKeyElement(array, key, array->_table[i]); ++i); } T result = callback(array->_table[i]); TRI_ReadUnlockReadWriteLock(&array->_lock); // return whatever we found return result; } //////////////////////////////////////////////////////////////////////////////// /// @brief lookups an element given an element //////////////////////////////////////////////////////////////////////////////// void const* TRI_LookupByElementAssociativeSynced (TRI_associative_synced_t*, void const*); //////////////////////////////////////////////////////////////////////////////// /// @brief adds an element to the array //////////////////////////////////////////////////////////////////////////////// void* TRI_InsertElementAssociativeSynced (TRI_associative_synced_t*, void*, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief adds an key/element to the array //////////////////////////////////////////////////////////////////////////////// void* TRI_InsertKeyAssociativeSynced (TRI_associative_synced_t*, void const*, void*, bool); //////////////////////////////////////////////////////////////////////////////// /// @brief removes an element from the array //////////////////////////////////////////////////////////////////////////////// void* TRI_RemoveElementAssociativeSynced (TRI_associative_synced_t*, void const*); //////////////////////////////////////////////////////////////////////////////// /// @brief removes an key/element to the array //////////////////////////////////////////////////////////////////////////////// void* TRI_RemoveKeyAssociativeSynced (TRI_associative_synced_t*, void const*); //////////////////////////////////////////////////////////////////////////////// /// @brief get the number of elements from the array //////////////////////////////////////////////////////////////////////////////// size_t TRI_GetLengthAssociativeSynced (TRI_associative_synced_t* const); #endif // ----------------------------------------------------------------------------- // --SECTION-- END-OF-FILE // ----------------------------------------------------------------------------- // Local Variables: // mode: outline-minor // outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}" // End:
kkdd/arangodb
lib/Basics/associative.h
C
apache-2.0
23,212
[ 30522, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 30524, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package uk.co.ourfriendirony.medianotifier.clients.tmdb.movie.get; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "adult", "backdrop_path", "belongs_to_collection", "budget", "movieGetGenres", "homepage", "id", "imdb_id", "original_language", "original_title", "overview", "popularity", "poster_path", "production_companies", "production_countries", "release_date", "revenue", "runtime", "spoken_languages", "status", "tagline", "title", "video", "vote_average", "vote_count", "external_ids" }) public class MovieGet { @JsonProperty("adult") private Boolean adult; @JsonProperty("backdrop_path") private String backdropPath; @JsonProperty("belongs_to_collection") private MovieGetBelongsToCollection belongsToCollection; @JsonProperty("budget") private Integer budget; @JsonProperty("movieGetGenres") private List<MovieGetGenre> movieGetGenres = null; @JsonProperty("homepage") private String homepage; @JsonProperty("id") private Integer id; @JsonProperty("imdb_id") private String imdbId; @JsonProperty("original_language") private String originalLanguage; @JsonProperty("original_title") private String originalTitle; @JsonProperty("overview") private String overview; @JsonProperty("popularity") private Double popularity; @JsonProperty("poster_path") private String posterPath; @JsonProperty("production_companies") private List<MovieGetProductionCompany> productionCompanies = null; @JsonProperty("production_countries") private List<MovieGetProductionCountry> productionCountries = null; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") @JsonProperty("release_date") private Date releaseDate; @JsonProperty("revenue") private Integer revenue; @JsonProperty("runtime") private Integer runtime; @JsonProperty("spoken_languages") private List<MovieGetSpokenLanguage> movieGetSpokenLanguages = null; @JsonProperty("status") private String status; @JsonProperty("tagline") private String tagline; @JsonProperty("title") private String title; @JsonProperty("video") private Boolean video; @JsonProperty("vote_average") private Double voteAverage; @JsonProperty("vote_count") private Integer voteCount; @JsonProperty("external_ids") private MovieGetExternalIds movieGetExternalIds; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); @JsonProperty("adult") public Boolean getAdult() { return adult; } @JsonProperty("adult") public void setAdult(Boolean adult) { this.adult = adult; } @JsonProperty("backdrop_path") public String getBackdropPath() { return backdropPath; } @JsonProperty("backdrop_path") public void setBackdropPath(String backdropPath) { this.backdropPath = backdropPath; } @JsonProperty("belongs_to_collection") public MovieGetBelongsToCollection getBelongsToCollection() { return belongsToCollection; } @JsonProperty("belongs_to_collection") public void setBelongsToCollection(MovieGetBelongsToCollection belongsToCollection) { this.belongsToCollection = belongsToCollection; } @JsonProperty("budget") public Integer getBudget() { return budget; } @JsonProperty("budget") public void setBudget(Integer budget) { this.budget = budget; } @JsonProperty("movieGetGenres") public List<MovieGetGenre> getMovieGetGenres() { return movieGetGenres; } @JsonProperty("movieGetGenres") public void setMovieGetGenres(List<MovieGetGenre> movieGetGenres) { this.movieGetGenres = movieGetGenres; } @JsonProperty("homepage") public String getHomepage() { return homepage; } @JsonProperty("homepage") public void setHomepage(String homepage) { this.homepage = homepage; } @JsonProperty("id") public Integer getId() { return id; } @JsonProperty("id") public void setId(Integer id) { this.id = id; } @JsonProperty("imdb_id") public String getImdbId() { return imdbId; } @JsonProperty("imdb_id") public void setImdbId(String imdbId) { this.imdbId = imdbId; } @JsonProperty("original_language") public String getOriginalLanguage() { return originalLanguage; } @JsonProperty("original_language") public void setOriginalLanguage(String originalLanguage) { this.originalLanguage = originalLanguage; } @JsonProperty("original_title") public String getOriginalTitle() { return originalTitle; } @JsonProperty("original_title") public void setOriginalTitle(String originalTitle) { this.originalTitle = originalTitle; } @JsonProperty("overview") public String getOverview() { return overview; } @JsonProperty("overview") public void setOverview(String overview) { this.overview = overview; } @JsonProperty("popularity") public Double getPopularity() { return popularity; } @JsonProperty("popularity") public void setPopularity(Double popularity) { this.popularity = popularity; } @JsonProperty("poster_path") public String getPosterPath() { return posterPath; } @JsonProperty("poster_path") public void setPosterPath(String posterPath) { this.posterPath = posterPath; } @JsonProperty("production_companies") public List<MovieGetProductionCompany> getProductionCompanies() { return productionCompanies; } @JsonProperty("production_companies") public void setProductionCompanies(List<MovieGetProductionCompany> productionCompanies) { this.productionCompanies = productionCompanies; } @JsonProperty("production_countries") public List<MovieGetProductionCountry> getProductionCountries() { return productionCountries; } @JsonProperty("production_countries") public void setProductionCountries(List<MovieGetProductionCountry> productionCountries) { this.productionCountries = productionCountries; } @JsonProperty("release_date") public Date getReleaseDate() { return releaseDate; } @JsonProperty("release_date") public void setReleaseDate(Date releaseDate) { this.releaseDate = releaseDate; } @JsonProperty("revenue") public Integer getRevenue() { return revenue; } @JsonProperty("revenue") public void setRevenue(Integer revenue) { this.revenue = revenue; } @JsonProperty("runtime") public Integer getRuntime() { return runtime; } @JsonProperty("runtime") public void setRuntime(Integer runtime) { this.runtime = runtime; } @JsonProperty("spoken_languages") public List<MovieGetSpokenLanguage> getMovieGetSpokenLanguages() { return movieGetSpokenLanguages; } @JsonProperty("spoken_languages") public void setMovieGetSpokenLanguages(List<MovieGetSpokenLanguage> movieGetSpokenLanguages) { this.movieGetSpokenLanguages = movieGetSpokenLanguages; } @JsonProperty("status") public String getStatus() { return status; } @JsonProperty("status") public void setStatus(String status) { this.status = status; } @JsonProperty("tagline") public String getTagline() { return tagline; } @JsonProperty("tagline") public void setTagline(String tagline) { this.tagline = tagline; } @JsonProperty("title") public String getTitle() { return title; } @JsonProperty("title") public void setTitle(String title) { this.title = title; } @JsonProperty("video") public Boolean getVideo() { return video; } @JsonProperty("video") public void setVideo(Boolean video) { this.video = video; } @JsonProperty("vote_average") public Double getVoteAverage() { return voteAverage; } @JsonProperty("vote_average") public void setVoteAverage(Double voteAverage) { this.voteAverage = voteAverage; } @JsonProperty("vote_count") public Integer getVoteCount() { return voteCount; } @JsonProperty("vote_count") public void setVoteCount(Integer voteCount) { this.voteCount = voteCount; } @JsonProperty("external_ids") public MovieGetExternalIds getMovieGetExternalIds() { return movieGetExternalIds; } @JsonProperty("external_ids") public void setMovieGetExternalIds(MovieGetExternalIds movieGetExternalIds) { this.movieGetExternalIds = movieGetExternalIds; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } } //@JsonInclude(JsonInclude.Include.NON_NULL) //@JsonPropertyOrder({ // "id", // "name", // "poster_path", // "backdrop_path" //}) //class MovieGetBelongsToCollection { // // @JsonProperty("id") // private Integer id; // @JsonProperty("name") // private String name; // @JsonProperty("poster_path") // private String posterPath; // @JsonProperty("backdrop_path") // private String backdropPath; // @JsonIgnore // private Map<String, Object> additionalProperties = new HashMap<String, Object>(); // // @JsonProperty("id") // public Integer getId() { // return id; // } // // @JsonProperty("id") // public void setId(Integer id) { // this.id = id; // } // // @JsonProperty("name") // public String getName() { // return name; // } // // @JsonProperty("name") // public void setName(String name) { // this.name = name; // } // // @JsonProperty("poster_path") // public String getPosterPath() { // return posterPath; // } // // @JsonProperty("poster_path") // public void setPosterPath(String posterPath) { // this.posterPath = posterPath; // } // // @JsonProperty("backdrop_path") // public String getBackdropPath() { // return backdropPath; // } // // @JsonProperty("backdrop_path") // public void setBackdropPath(String backdropPath) { // this.backdropPath = backdropPath; // } // // @JsonAnyGetter // public Map<String, Object> getAdditionalProperties() { // return this.additionalProperties; // } // // @JsonAnySetter // public void setAdditionalProperty(String name, Object value) { // this.additionalProperties.put(name, value); // } // //}
OurFriendIrony/MediaNotifier
app/src/main/java/uk/co/ourfriendirony/medianotifier/clients/tmdb/movie/get/MovieGet.java
Java
apache-2.0
11,616
[ 30522, 7427, 2866, 1012, 2522, 1012, 2256, 19699, 9013, 4305, 4948, 2100, 1012, 3991, 4140, 18095, 1012, 7846, 1012, 1056, 26876, 2497, 1012, 3185, 1012, 2131, 1025, 12324, 4012, 1012, 5514, 2595, 19968, 1012, 4027, 1012, 5754, 17287, 3508,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
cask 'sqlpro-for-mysql' do version '2019.09.12' sha256 '8d25777bd146561b37657b7f54890ed1b73595485f7d4753d13c11a34e14242a' # d3fwkemdw8spx3.cloudfront.net/mysql was verified as official when first introduced to the cask url "https://d3fwkemdw8spx3.cloudfront.net/mysql/SQLProMySQL.#{version}.app.zip" appcast 'https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://www.mysqlui.com/download.php' name 'SQLPro for MySQL' homepage 'https://www.mysqlui.com/' app 'SQLPro for MySQL.app' zap trash: [ '~/Library/Containers/com.hankinsoft.osx.mysql', '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.hankinsoft.osx.mysql.sfl*', ] end
esebastian/homebrew-cask
Casks/sqlpro-for-mysql.rb
Ruby
bsd-2-clause
777
[ 30522, 25222, 2243, 1005, 30524, 2079, 2544, 1005, 10476, 1012, 5641, 1012, 2260, 1005, 21146, 17788, 2575, 1005, 1022, 2094, 17788, 2581, 2581, 2581, 2497, 2094, 16932, 26187, 2575, 2487, 2497, 24434, 26187, 2581, 2497, 2581, 2546, 27009, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.intellij.codeInsight.daemon.quickFix; import com.intellij.codeInspection.LocalInspectionTool; import com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection; import org.jetbrains.annotations.NotNull; public class GenerifyFileTest extends LightQuickFixAvailabilityTestCase { @NotNull @Override protected LocalInspectionTool[] configureLocalInspectionTools() { return new LocalInspectionTool[] {new UncheckedWarningLocalInspection()}; } public void test() throws Exception { doAllTests(); } @Override protected String getBasePath() { return "/codeInsight/daemonCodeAnalyzer/quickFix/generifyFile"; } }
android-ia/platform_tools_idea
java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/GenerifyFileTest.java
Java
apache-2.0
665
[ 30522, 7427, 4012, 1012, 13420, 3669, 3501, 1012, 3642, 7076, 18743, 1012, 12828, 1012, 4248, 8873, 2595, 1025, 12324, 4012, 1012, 13420, 3669, 3501, 1012, 3642, 7076, 5051, 7542, 1012, 2334, 7076, 5051, 7542, 3406, 4747, 1025, 12324, 4012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Class represents records from table user_group * {autogenerated} * @property int $user_group_id * @property string $title * @property string $description * @property int $parent_id * @property int $sort_order * @see Am_Table */ class UserGroup extends Am_Record { protected $_childNodes = array(); function getChildNodes() { return $this->_childNodes; } function createChildNode() { $c = new self; $c->parent_id = $this->pk(); if (!$c->parent_id) throw new Am_Exception_InternalError("Could not add child node to not-saved object in ".__METHOD__); $this->_childNodes[] = $c; return $c; } public function fromRow(array $vars) { if (isset($vars['childNodes'])) { foreach ($vars['childNodes'] as $row) { $r = new self($this->getTable()); $r->fromRow($row); $this->_childNodes[] = $r; } unset($vars['childNodes']); } return parent::fromRow($vars); } } class UserGroupTable extends Am_Table { protected $_key = 'user_group_id'; protected $_table = '?_user_group'; protected $_recordClass = 'UserGroup'; /** * @return ProductCategory */ function getTree() { $ret = array(); foreach ($this->_db->select("SELECT user_group_id AS ARRAY_KEY, parent_id AS PARENT_KEY, pc.* FROM ?_user_group AS pc ORDER BY 0+sort_order") as $r) { $ret[] = $this->createRecord($r); } return $ret; } function getSelectOptions(array $options = array()) { $ret = array(); $sql = "SELECT user_group_id AS ARRAY_KEY, parent_id, title FROM ?_user_group ORDER BY parent_id, 0+sort_order"; $rows = $this->_db->select($sql); foreach ($rows as $id => $r){ $parent_id_used = array( $id ); $title = $r['title']; $parent_id = $r['parent_id']; while ($parent_id) { // protect against endless cycle if (in_array($parent_id, $parent_id_used)) break; if (empty($rows[$parent_id])) break; $parent = $rows[$parent_id]; $title = $parent['title'] . '/' . $title; $parent_id = $parent['parent_id']; } $ret [ $id ] = $title; } return $ret; } function getOptions() { return $this->getSelectOptions(); } function moveNodes($fromId, $toId) { $this->_db->query("UPDATE {$this->_table} SET parent_id=?d WHERE parent_id=?d", $toId, $fromId); } public function delete($key) { parent::delete($key); $this->_db->query("DELETE FROM ?_user_user_group WHERE user_group_id=?d", $key); } }
grlf/eyedock
amember/application/default/models/UserGroup.php
PHP
gpl-2.0
2,995
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 2465, 5836, 2636, 2013, 2795, 5310, 1035, 2177, 1008, 1063, 8285, 6914, 16848, 1065, 1008, 1030, 3200, 20014, 1002, 5310, 1035, 2177, 1035, 8909, 1008, 1030, 3200, 5164, 1002, 2516, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using UnityEngine; using UnityEditor; using System.Collections; using System.Collections.Generic; using Frontiers.World; [CustomEditor(typeof(BannerEditor))] public class BannerEditorEditor : Editor { protected BannerEditor be; public void Awake() { be = (BannerEditor)target; } public override void OnInspectorGUI() { EditorStyles.textField.wordWrap = true; DrawDefaultInspector(); be.DrawEditor(); } }
SignpostMarv/FRONTIERS
Assets/Editor/Frontiers/BannerEditorEditor.cs
C#
gpl-3.0
436
[ 30522, 2478, 8499, 13159, 3170, 1025, 2478, 8499, 2098, 15660, 1025, 2478, 2291, 1012, 6407, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 28750, 1012, 2088, 1025, 1031, 7661, 2098, 15660, 1006, 2828, 11253, 1006, 9484, 2098, 15660...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `News` struct in crate `proxer`."> <meta name="keywords" content="rust, rustlang, rust-lang, News"> <title>proxer::notification::News - Rust</title> <link rel="stylesheet" type="text/css" href="../../normalize.css"> <link rel="stylesheet" type="text/css" href="../../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../../main.css"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <p class='location'><a href='../index.html'>proxer</a>::<wbr><a href='index.html'>notification</a></p><script>window.sidebarCurrent = {name: 'News', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content struct"> <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>proxer</a>::<wbr><a href='index.html'>notification</a>::<wbr><a class='struct' href=''>News</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a class='srclink' href='../../src/proxer/notification.rs.html#12-42' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'>pub struct News { pub nid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>, pub time: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i64.html'>i64</a>, pub mid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>, pub description: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, pub image_id: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, pub image_style: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, pub subject: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, pub hits: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>, pub thread: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>, pub uid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>, pub uname: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, pub posts: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>, pub catid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a>, pub catname: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>, }</pre><div class='docblock'><p>Gibt die neuesten News aus. Der Bildlink einer News setzt sich zusammen aus: cdn.proxer.me/news/[News-ID]_[Image-ID].png Für Tumbnail: cdn.proxer.me/news/th/[News-ID]_[Image-ID].png Link zum Forumspost der News: proxer.me/forum/[catid]/[mid]</p> </div><h2 class='fields'>Fields</h2><span id='structfield.nid' class='structfield'> <span id='nid.v' class='invisible'> <code>nid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Die ID der News</p> </div><span id='structfield.time' class='structfield'> <span id='time.v' class='invisible'> <code>time: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i64.html'>i64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Der Zeitpunkt der publizierung (Unix-Timestamp als Sekunden gespeichert)</p> </div><span id='structfield.mid' class='structfield'> <span id='mid.v' class='invisible'> <code>mid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Die ID des entsprechenden Forumsbeitrags</p> </div><span id='structfield.description' class='structfield'> <span id='description.v' class='invisible'> <code>description: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Die Beschreibung der News</p> </div><span id='structfield.image_id' class='structfield'> <span id='image_id.v' class='invisible'> <code>image_id: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code> </span></span><span class='stab '></span><div class='docblock'><p>ID zum Bild.</p> </div><span id='structfield.image_style' class='structfield'> <span id='image_style.v' class='invisible'> <code>image_style: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code> </span></span><span class='stab '></span><div class='docblock'><p>CSS-Konforme Style-Elemente um die Positionierung des Bildes zu bestimmen.</p> </div><span id='structfield.subject' class='structfield'> <span id='subject.v' class='invisible'> <code>subject: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Der Titel des entsprechenden Forumsbeitrags</p> </div><span id='structfield.hits' class='structfield'> <span id='hits.v' class='invisible'> <code>hits: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Anzahl der Zugriffe auf den entsprechenden Forumsbeitrag</p> </div><span id='structfield.thread' class='structfield'> <span id='thread.v' class='invisible'> <code>thread: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>mid</p> </div><span id='structfield.uid' class='structfield'> <span id='uid.v' class='invisible'> <code>uid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>User-ID des Erstellers des Forumsposts</p> </div><span id='structfield.uname' class='structfield'> <span id='uname.v' class='invisible'> <code>uname: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Benutzername des Autors</p> </div><span id='structfield.posts' class='structfield'> <span id='posts.v' class='invisible'> <code>posts: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Anzahl der Antworten/Kommentare auf die News</p> </div><span id='structfield.catid' class='structfield'> <span id='catid.v' class='invisible'> <code>catid: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u64.html'>u64</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Die ID der Kategorie, in der sich eine News befindet.</p> </div><span id='structfield.catname' class='structfield'> <span id='catname.v' class='invisible'> <code>catname: <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code> </span></span><span class='stab '></span><div class='docblock'><p>Der Name der Kategorie.</p> </div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../../proxer/notification/struct.News.html' title='proxer::notification::News'>News</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/proxer/notification.rs.html#11' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.fmt' class='method'><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></span></h4> <div class='docblock'><p>Formats the value using the given formatter.</p> </div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../../proxer/notification/struct.News.html' title='proxer::notification::News'>News</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/proxer/notification.rs.html#11' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.clone' class='method'><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../../proxer/notification/struct.News.html' title='proxer::notification::News'>News</a></code></span></h4> <div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div><h4 id='method.clone_from' class='method'><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></span></h4> <div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div></div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "proxer"; </script> <script src="../../jquery.js"></script> <script src="../../main.js"></script> <script defer src="../../search-index.js"></script> </body> </html>
Souryo/proxer-rs
docs/proxer/notification/struct.News.html
HTML
mit
14,787
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/perl -w use strict; use warnings; (@ARGV > 1) or die "Need at least 2 integers, $!"; my $gcd = pop @ARGV; my $lcm = $gcd; while (my $value = pop @ARGV) { $gcd = gcd($gcd, $value); $lcm = $lcm * $value / gcd($lcm, $value); } print "GCD is $gcd\n"; print "LCM is $lcm\n"; sub gcd { # derived from c code at http://en.wikipedia.org/wiki/Binary_GCD_algorithm my ($u, $v) = @_; my $shift; # GCD(0,x) := x return $u | $v if ($u == 0 || $v == 0); # Let shift := lg K, where K is the greatest power of 2 dividing both u and v. for ($shift = 0; (($u | $v) & 1) == 0; ++$shift) { $u >>= 1; $v >>= 1; } $u >>= 1 while (not ($u & 1)); # From here on, u is always odd. do { $v >>= 1 while (not ($v & 1)); # Loop X # Now u and v are both odd, so diff(u, v) is even. # Let u = min(u, v), v = diff(u, v)/2. if ($u < $v) { $v -= $u; } else { my $diff = $u - $v; $u = $v; $v = $diff; } $v >>= 1; } while ($v != 0); return $u << $shift; }
bobblestiltskin/problems_for_computer_solution
13_gcd_lcm/gcd_lcm_tail.pl
Perl
gpl-3.0
1,064
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 2566, 2140, 1011, 1059, 2224, 9384, 1025, 2224, 16234, 1025, 1006, 1030, 12098, 2290, 2615, 1028, 1015, 1007, 2030, 3280, 1000, 2342, 2012, 2560, 1016, 24028, 1010, 1002, 999, 1000, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include <pthread.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <assert.h> #define THREAD_SIZE 8 void *job1(void *arg) { pthread_t pid = pthread_self(); sleep(1); printf("job1: print %p\n", arg); printf("job1: pthread_self: %lu\n", pid); sleep(1); return arg; } void *job2(void *arg) { pthread_t pid = pthread_self(); sleep(1); printf("job2: print %p\n", arg); printf("job2: pthread_self: %lu\n", pid); sleep(1); pthread_exit(NULL); return arg; } void *job3(void *arg) { pthread_t pid = pthread_self(); pthread_detach(pid); sleep(1); printf("job3: print %p\n", arg); printf("job3: pthread_self: %lu\n", pid); sleep(1); return arg; } void *job4(void *arg) { pthread_t pid = pthread_self(); pthread_detach(pid); sleep(1); printf("job4: print %p\n", arg); printf("job4: pthread_self: %lu\n", pid); sleep(1); return arg; } int main() { pthread_t tid1[THREAD_SIZE]; pthread_t tid2[THREAD_SIZE]; pthread_t tid3[THREAD_SIZE]; pthread_t tid4[THREAD_SIZE]; int i; void *res; for (i = 0; i < THREAD_SIZE; i++) { assert(pthread_create(&tid1[i], NULL, job1, (void*)i) == 0); assert(pthread_create(&tid2[i], NULL, job2, (void*)i) == 0); assert(pthread_create(&tid3[i], NULL, job3, (void*)i) == 0); assert(pthread_create(&tid4[i], NULL, job4, (void*)i) == 0); } for (i = 0; i < THREAD_SIZE; i++) { assert(pthread_join(tid1[i], &res) == 0); assert(res == (void*)i); assert(pthread_join(tid2[i], &res) == 0); assert(res == NULL); } return 0; }
zhaochenyou/Tips
cpp/stl/c/pthread/thread.c
C
bsd-3-clause
1,701
[ 30522, 1001, 2421, 1026, 13866, 28362, 4215, 1012, 1044, 1028, 1001, 2421, 1026, 2358, 20617, 1012, 1044, 1028, 1001, 2421, 1026, 5164, 1012, 1044, 1028, 1001, 2421, 1026, 9413, 19139, 1012, 1044, 1028, 1001, 2421, 1026, 4895, 2923, 2094, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # GuessIt 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 # Lesser GNU General Public License for more details. # # You should have received a copy of the Lesser GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from __future__ import unicode_literals from guessit import Guess from guessit.transfo import SingleNodeGuesser from guessit.patterns import video_rexps, sep import re import logging log = logging.getLogger(__name__) def guess_video_rexps(string): string = '-' + string + '-' for rexp, confidence, span_adjust in video_rexps: match = re.search(sep + rexp + sep, string, re.IGNORECASE) if match: metadata = match.groupdict() # is this the better place to put it? (maybe, as it is at least # the soonest that we can catch it) if metadata.get('cdNumberTotal', -1) is None: del metadata['cdNumberTotal'] span = (match.start() + span_adjust[0], match.end() + span_adjust[1] - 2) return (Guess(metadata, confidence=confidence, raw=string[span[0]:span[1]]), span) return None, None def process(mtree): SingleNodeGuesser(guess_video_rexps, None, log).process(mtree)
loulich/Couchpotato
libs/guessit/transfo/guess_video_rexps.py
Python
gpl-3.0
1,837
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 1001, 1001, 3984, 4183, 1011, 1037, 3075, 2005, 16986, 2592, 2013, 5371, 18442, 2015, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php //-------------------------------- //db_mysqli, db_pdo $var->db_driver = 'db_mysqli'; //$var->db_driver = 'db_pdo'; //for pdo: mysql, sqlite, ... //$var->db_engine = 'mysql'; $var->db_host = 'localhost'; $var->db_database = 'ada'; $var->db_user = 'ad'; $var->db_pass = 'dddd'; //$var->db_database = 'kargosha'; //$var->db_user = 'root'; //$var->db_pass = ''; $var->db_perfix = 'x_'; $var->db_set_utf8 = true; //-------------------------------- $var->session_unique = 'kargosha'; //-------------------------------- $var->auto_lang = false; $var->multi_domain = false; //------------ News letter { -------------------- $var->use_mailer_lite_api = true; $var->mailer_lite_api_key = ''; $var->mailer_lite_group_id = ''; //------------ } News letter -------------------- //-------------------------------- $var->cache_page = false; $var->cache_image = false; $var->cache_page_time = 1*24*60*60; // 1 day = 1 days * 24 hours * 60 mins * 60 secs $var->cache_image_time = 1*24*60*60; // 1 day = 1 days * 24 hours * 60 mins * 60 secs $var->cookie_expire_time = 30*24*60*60; // 30 day = 30 days * 24 hours * 60 mins * 60 secs //-------------------------------- $var->hit_counter = true; $var->hit_online = true; $var->hit_referers = false; $var->hit_requests = false; //-------------------------------- //--------------------------------bank: Beh Pardakht - Bank e Mellat $var->bank_mellat_terminal = 0; $var->bank_mellat_user = ''; $var->bank_mellat_pass = ''; $var->callBackUrl = "http://site.com/?a=transaction.callBack"; $var->bank_startpayUrl = "https://bpm.shaparak.ir/pgwchannel/startpay.mellat"; $var->bank_nusoap_client = "https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl"; $var->bank_namespace = "http://interfaces.core.sw.bps.com/"; //-------------------------------- $var->zarinpal_merchant_code = "AAAA-BBBB-CCCC-DDDD"; $var->zarinpal_callBackUrl = "http://site.com/?a=transaction_zarinpal.callBack"; //-------------------------------- ?>
ariax/phpcms
core/config.php
PHP
apache-2.0
1,959
[ 30522, 1026, 1029, 25718, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1013, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * 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 io.trino.parquet.predicate; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.VerifyException; import com.google.common.collect.ImmutableList; import io.airlift.slice.Slice; import io.airlift.slice.Slices; import io.trino.parquet.DictionaryPage; import io.trino.parquet.ParquetCorruptionException; import io.trino.parquet.ParquetDataSourceId; import io.trino.parquet.RichColumnDescriptor; import io.trino.parquet.dictionary.Dictionary; import io.trino.spi.predicate.Domain; import io.trino.spi.predicate.Range; import io.trino.spi.predicate.TupleDomain; import io.trino.spi.predicate.ValueSet; import io.trino.spi.type.DecimalType; import io.trino.spi.type.TimestampType; import io.trino.spi.type.Type; import io.trino.spi.type.VarcharType; import org.apache.parquet.column.ColumnDescriptor; import org.apache.parquet.column.statistics.Statistics; import org.apache.parquet.filter2.predicate.FilterApi; import org.apache.parquet.filter2.predicate.FilterPredicate; import org.apache.parquet.filter2.predicate.UserDefinedPredicate; import org.apache.parquet.hadoop.metadata.ColumnPath; import org.apache.parquet.internal.column.columnindex.ColumnIndex; import org.apache.parquet.internal.filter2.columnindex.ColumnIndexStore; import org.apache.parquet.io.api.Binary; import org.apache.parquet.schema.PrimitiveType; import org.joda.time.DateTimeZone; import java.io.Serializable; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.function.Function; import static com.google.common.base.Preconditions.checkArgument; import static io.trino.parquet.ParquetTimestampUtils.decode; import static io.trino.parquet.ParquetTypeUtils.getLongDecimalValue; import static io.trino.parquet.ParquetTypeUtils.getShortDecimalValue; import static io.trino.parquet.predicate.PredicateUtils.isStatisticsOverflow; import static io.trino.plugin.base.type.TrinoTimestampEncoderFactory.createTimestampEncoder; import static io.trino.spi.type.BigintType.BIGINT; import static io.trino.spi.type.BooleanType.BOOLEAN; import static io.trino.spi.type.DateType.DATE; import static io.trino.spi.type.DoubleType.DOUBLE; import static io.trino.spi.type.IntegerType.INTEGER; import static io.trino.spi.type.RealType.REAL; import static io.trino.spi.type.SmallintType.SMALLINT; import static io.trino.spi.type.TinyintType.TINYINT; import static java.lang.Float.floatToRawIntBits; import static java.lang.String.format; import static java.nio.ByteOrder.LITTLE_ENDIAN; import static java.util.Objects.requireNonNull; public class TupleDomainParquetPredicate implements Predicate { private final TupleDomain<ColumnDescriptor> effectivePredicate; private final List<RichColumnDescriptor> columns; private final DateTimeZone timeZone; public TupleDomainParquetPredicate(TupleDomain<ColumnDescriptor> effectivePredicate, List<RichColumnDescriptor> columns, DateTimeZone timeZone) { this.effectivePredicate = requireNonNull(effectivePredicate, "effectivePredicate is null"); this.columns = ImmutableList.copyOf(requireNonNull(columns, "columns is null")); this.timeZone = requireNonNull(timeZone, "timeZone is null"); } @Override public boolean matches(long numberOfRows, Map<ColumnDescriptor, Statistics<?>> statistics, ParquetDataSourceId id) throws ParquetCorruptionException { if (numberOfRows == 0) { return false; } if (effectivePredicate.isNone()) { return false; } Map<ColumnDescriptor, Domain> effectivePredicateDomains = effectivePredicate.getDomains() .orElseThrow(() -> new IllegalStateException("Effective predicate other than none should have domains")); for (RichColumnDescriptor column : columns) { Domain effectivePredicateDomain = effectivePredicateDomains.get(column); if (effectivePredicateDomain == null) { continue; } Statistics<?> columnStatistics = statistics.get(column); if (columnStatistics == null || columnStatistics.isEmpty()) { // no stats for column continue; } Domain domain = getDomain(effectivePredicateDomain.getType(), numberOfRows, columnStatistics, id, column.toString(), timeZone); if (!effectivePredicateDomain.overlaps(domain)) { return false; } } return true; } @Override public boolean matches(DictionaryDescriptor dictionary) { requireNonNull(dictionary, "dictionary is null"); if (effectivePredicate.isNone()) { return false; } Map<ColumnDescriptor, Domain> effectivePredicateDomains = effectivePredicate.getDomains() .orElseThrow(() -> new IllegalStateException("Effective predicate other than none should have domains")); Domain effectivePredicateDomain = effectivePredicateDomains.get(dictionary.getColumnDescriptor()); return effectivePredicateDomain == null || effectivePredicateMatches(effectivePredicateDomain, dictionary); } @Override public boolean matches(long numberOfRows, ColumnIndexStore columnIndexStore, ParquetDataSourceId id) throws ParquetCorruptionException { requireNonNull(columnIndexStore, "columnIndexStore is null"); if (numberOfRows == 0) { return false; } if (effectivePredicate.isNone()) { return false; } Map<ColumnDescriptor, Domain> effectivePredicateDomains = effectivePredicate.getDomains() .orElseThrow(() -> new IllegalStateException("Effective predicate other than none should have domains")); for (RichColumnDescriptor column : columns) { Domain effectivePredicateDomain = effectivePredicateDomains.get(column); if (effectivePredicateDomain == null) { continue; } ColumnIndex columnIndex = columnIndexStore.getColumnIndex(ColumnPath.get(column.getPath())); if (columnIndex == null || isEmptyColumnIndex(columnIndex)) { continue; } Domain domain = getDomain(effectivePredicateDomain.getType(), numberOfRows, columnIndex, id, column); if (!effectivePredicateDomain.overlaps(domain)) { return false; } } return true; } @Override public Optional<FilterPredicate> toParquetFilter(DateTimeZone timeZone) { return Optional.ofNullable(convertToParquetFilter(timeZone)); } private boolean effectivePredicateMatches(Domain effectivePredicateDomain, DictionaryDescriptor dictionary) { return effectivePredicateDomain.overlaps(getDomain(effectivePredicateDomain.getType(), dictionary, timeZone)); } @VisibleForTesting public static Domain getDomain( Type type, long rowCount, Statistics<?> statistics, ParquetDataSourceId id, String column, DateTimeZone timeZone) throws ParquetCorruptionException { if (statistics == null || statistics.isEmpty()) { return Domain.all(type); } if (statistics.isNumNullsSet() && statistics.getNumNulls() == rowCount) { return Domain.onlyNull(type); } boolean hasNullValue = !statistics.isNumNullsSet() || statistics.getNumNulls() != 0L; if (!statistics.hasNonNullValue() || statistics.genericGetMin() == null || statistics.genericGetMax() == null) { return Domain.create(ValueSet.all(type), hasNullValue); } try { return getDomain(type, ImmutableList.of(statistics.genericGetMin()), ImmutableList.of(statistics.genericGetMax()), hasNullValue, timeZone); } catch (Exception e) { throw corruptionException(column, id, statistics, e); } } /** * Get a domain for the ranges defined by each pair of elements from {@code minimums} and {@code maximums}. * Both arrays must have the same length. */ private static Domain getDomain( Type type, List<Object> minimums, List<Object> maximums, boolean hasNullValue, DateTimeZone timeZone) { checkArgument(minimums.size() == maximums.size(), "Expected minimums and maximums to have the same size"); if (type.equals(BOOLEAN)) { boolean hasTrueValues = minimums.stream().anyMatch(value -> (boolean) value) || maximums.stream().anyMatch(value -> (boolean) value); boolean hasFalseValues = minimums.stream().anyMatch(value -> !(boolean) value) || maximums.stream().anyMatch(value -> !(boolean) value); if (hasTrueValues && hasFalseValues) { return Domain.all(type); } if (hasTrueValues) { return Domain.create(ValueSet.of(type, true), hasNullValue); } if (hasFalseValues) { return Domain.create(ValueSet.of(type, false), hasNullValue); } // All nulls case is handled earlier throw new VerifyException("Impossible boolean statistics"); } if (type.equals(BIGINT) || type.equals(INTEGER) || type.equals(DATE) || type.equals(SMALLINT) || type.equals(TINYINT)) { List<Range> ranges = new ArrayList<>(); for (int i = 0; i < minimums.size(); i++) { long min = asLong(minimums.get(i)); long max = asLong(maximums.get(i)); if (isStatisticsOverflow(type, min, max)) { return Domain.create(ValueSet.all(type), hasNullValue); } ranges.add(Range.range(type, min, true, max, true)); } return Domain.create(ValueSet.ofRanges(ranges), hasNullValue); } if (type instanceof DecimalType) { DecimalType decimalType = (DecimalType) type; List<Range> ranges = new ArrayList<>(); if (decimalType.isShort()) { for (int i = 0; i < minimums.size(); i++) { Object min = minimums.get(i); Object max = maximums.get(i); long minValue = min instanceof Binary ? getShortDecimalValue(((Binary) min).getBytes()) : asLong(min); long maxValue = min instanceof Binary ? getShortDecimalValue(((Binary) max).getBytes()) : asLong(max); if (isStatisticsOverflow(type, minValue, maxValue)) { return Domain.create(ValueSet.all(type), hasNullValue); } ranges.add(Range.range(type, minValue, true, maxValue, true)); } } else { for (int i = 0; i < minimums.size(); i++) { Slice min = getLongDecimalValue(((Binary) minimums.get(i)).getBytes()); Slice max = getLongDecimalValue(((Binary) maximums.get(i)).getBytes()); ranges.add(Range.range(type, min, true, max, true)); } } return Domain.create(ValueSet.ofRanges(ranges), hasNullValue); } if (type.equals(REAL)) { List<Range> ranges = new ArrayList<>(); for (int i = 0; i < minimums.size(); i++) { Float min = (Float) minimums.get(i); Float max = (Float) maximums.get(i); if (min.isNaN() || max.isNaN()) { return Domain.create(ValueSet.all(type), hasNullValue); } ranges.add(Range.range(type, (long) floatToRawIntBits(min), true, (long) floatToRawIntBits(max), true)); } return Domain.create(ValueSet.ofRanges(ranges), hasNullValue); } if (type.equals(DOUBLE)) { List<Range> ranges = new ArrayList<>(); for (int i = 0; i < minimums.size(); i++) { Double min = (Double) minimums.get(i); Double max = (Double) maximums.get(i); if (min.isNaN() || max.isNaN()) { return Domain.create(ValueSet.all(type), hasNullValue); } ranges.add(Range.range(type, min, true, max, true)); } return Domain.create(ValueSet.ofRanges(ranges), hasNullValue); } if (type instanceof VarcharType) { List<Range> ranges = new ArrayList<>(); for (int i = 0; i < minimums.size(); i++) { Slice min = Slices.wrappedBuffer(((Binary) minimums.get(i)).toByteBuffer()); Slice max = Slices.wrappedBuffer(((Binary) maximums.get(i)).toByteBuffer()); ranges.add(Range.range(type, min, true, max, true)); } return Domain.create(ValueSet.ofRanges(ranges), hasNullValue); } if (type instanceof TimestampType) { List<Object> values = new ArrayList<>(); for (int i = 0; i < minimums.size(); i++) { Object min = minimums.get(i); Object max = maximums.get(i); // Parquet INT96 timestamp values were compared incorrectly for the purposes of producing statistics by older parquet writers, so // PARQUET-1065 deprecated them. The result is that any writer that produced stats was producing unusable incorrect values, except // the special case where min == max and an incorrect ordering would not be material to the result. PARQUET-1026 made binary stats // available and valid in that special case if (!(min instanceof Binary) || !(max instanceof Binary) || !min.equals(max)) { return Domain.create(ValueSet.all(type), hasNullValue); } values.add(createTimestampEncoder((TimestampType) type, timeZone).getTimestamp(decode((Binary) min))); } return Domain.multipleValues(type, values, hasNullValue); } return Domain.create(ValueSet.all(type), hasNullValue); } @VisibleForTesting public Domain getDomain(Type type, long rowCount, ColumnIndex columnIndex, ParquetDataSourceId id, RichColumnDescriptor descriptor) throws ParquetCorruptionException { if (columnIndex == null) { return Domain.all(type); } String columnName = descriptor.getPrimitiveType().getName(); if (isCorruptedColumnIndex(columnIndex)) { throw corruptionException(columnName, id, columnIndex, null); } if (isEmptyColumnIndex(columnIndex)) { return Domain.all(type); } long totalNullCount = columnIndex.getNullCounts().stream() .mapToLong(value -> value) .sum(); boolean hasNullValue = totalNullCount > 0; if (hasNullValue && totalNullCount == rowCount) { return Domain.onlyNull(type); } try { int pageCount = columnIndex.getMinValues().size(); ColumnIndexValueConverter converter = new ColumnIndexValueConverter(); Function<ByteBuffer, Object> converterFunction = converter.getConverter(descriptor.getPrimitiveType()); List<Object> min = new ArrayList<>(); List<Object> max = new ArrayList<>(); for (int i = 0; i < pageCount; i++) { min.add(converterFunction.apply(columnIndex.getMinValues().get(i))); max.add(converterFunction.apply(columnIndex.getMaxValues().get(i))); } return getDomain(type, min, max, hasNullValue, timeZone); } catch (Exception e) { throw corruptionException(columnName, id, columnIndex, e); } } @VisibleForTesting public static Domain getDomain(Type type, DictionaryDescriptor dictionaryDescriptor) { return getDomain(type, dictionaryDescriptor, DateTimeZone.getDefault()); } private static Domain getDomain(Type type, DictionaryDescriptor dictionaryDescriptor, DateTimeZone timeZone) { if (dictionaryDescriptor == null) { return Domain.all(type); } ColumnDescriptor columnDescriptor = dictionaryDescriptor.getColumnDescriptor(); Optional<DictionaryPage> dictionaryPage = dictionaryDescriptor.getDictionaryPage(); if (dictionaryPage.isEmpty()) { return Domain.all(type); } Dictionary dictionary; try { dictionary = dictionaryPage.get().getEncoding().initDictionary(columnDescriptor, dictionaryPage.get()); } catch (Exception e) { // In case of exception, just continue reading the data, not using dictionary page at all // OK to ignore exception when reading dictionaries return Domain.all(type); } int dictionarySize = dictionaryPage.get().getDictionarySize(); DictionaryValueConverter converter = new DictionaryValueConverter(dictionary); Function<Integer, Object> convertFunction = converter.getConverter(columnDescriptor.getPrimitiveType()); List<Object> values = new ArrayList<>(); for (int i = 0; i < dictionarySize; i++) { values.add(convertFunction.apply(i)); } // TODO: when min == max (i.e., singleton ranges, the construction of Domains can be done more efficiently return getDomain(type, values, values, true, timeZone); } private static ParquetCorruptionException corruptionException(String column, ParquetDataSourceId id, Statistics<?> statistics, Exception cause) { return new ParquetCorruptionException(cause, format("Corrupted statistics for column \"%s\" in Parquet file \"%s\": [%s]", column, id, statistics)); } private static ParquetCorruptionException corruptionException(String column, ParquetDataSourceId id, ColumnIndex columnIndex, Exception cause) { return new ParquetCorruptionException(cause, format("Corrupted statistics for column \"%s\" in Parquet file \"%s\". Corrupted column index: [%s]", column, id, columnIndex)); } private boolean isCorruptedColumnIndex(ColumnIndex columnIndex) { if (columnIndex.getMaxValues() == null || columnIndex.getMinValues() == null || columnIndex.getNullCounts() == null || columnIndex.getNullPages() == null) { return true; } if (columnIndex.getMaxValues().size() != columnIndex.getMinValues().size() || columnIndex.getMaxValues().size() != columnIndex.getNullPages().size() || columnIndex.getMaxValues().size() != columnIndex.getNullCounts().size()) { return true; } return false; } public static long asLong(Object value) { if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) { return ((Number) value).longValue(); } throw new IllegalArgumentException("Can't convert value to long: " + value.getClass().getName()); } // Caller should verify isCorruptedColumnIndex is false first private boolean isEmptyColumnIndex(ColumnIndex columnIndex) { return columnIndex.getMaxValues().size() == 0; } private FilterPredicate convertToParquetFilter(DateTimeZone timeZone) { FilterPredicate filter = null; for (RichColumnDescriptor column : columns) { Domain domain = effectivePredicate.getDomains().get().get(column); if (domain == null || domain.isNone()) { continue; } if (domain.isAll()) { continue; } FilterPredicate columnFilter = FilterApi.userDefined(FilterApi.intColumn(ColumnPath.get(column.getPath()).toDotString()), new DomainUserDefinedPredicate(domain, timeZone)); if (filter == null) { filter = columnFilter; } else { filter = FilterApi.and(filter, columnFilter); } } return filter; } /** * This class implements methods defined in UserDefinedPredicate based on the page statistic and tuple domain(for a column). */ static class DomainUserDefinedPredicate<T extends Comparable<T>> extends UserDefinedPredicate<T> implements Serializable // Required by argument of FilterApi.userDefined call { private final Domain columnDomain; private final DateTimeZone timeZone; public DomainUserDefinedPredicate(Domain domain, DateTimeZone timeZone) { this.columnDomain = domain; this.timeZone = timeZone; } @Override public boolean keep(T value) { if (value == null && !columnDomain.isNullAllowed()) { return false; } return true; } @Override public boolean canDrop(org.apache.parquet.filter2.predicate.Statistics<T> statistic) { if (statistic == null) { return false; } Domain domain = getDomain(columnDomain.getType(), ImmutableList.of(statistic.getMin()), ImmutableList.of(statistic.getMax()), true, timeZone); return !columnDomain.overlaps(domain); } @Override public boolean inverseCanDrop(org.apache.parquet.filter2.predicate.Statistics<T> statistics) { // Since we don't use LogicalNotUserDefined, this method is not called. // To be safe, we just keep the record by returning false. return false; } } private static class ColumnIndexValueConverter { private ColumnIndexValueConverter() { } private Function<ByteBuffer, Object> getConverter(PrimitiveType primitiveType) { switch (primitiveType.getPrimitiveTypeName()) { case BOOLEAN: return (buffer) -> buffer.get(0) != 0; case INT32: return (buffer) -> buffer.order(LITTLE_ENDIAN).getInt(0); case INT64: return (buffer) -> buffer.order(LITTLE_ENDIAN).getLong(0); case FLOAT: return (buffer) -> buffer.order(LITTLE_ENDIAN).getFloat(0); case DOUBLE: return (buffer) -> buffer.order(LITTLE_ENDIAN).getDouble(0); case FIXED_LEN_BYTE_ARRAY: case BINARY: case INT96: default: return (buffer) -> Binary.fromReusedByteBuffer(buffer); } } } private static class DictionaryValueConverter { private final Dictionary dictionary; private DictionaryValueConverter(Dictionary dictionary) { this.dictionary = dictionary; } private Function<Integer, Object> getConverter(PrimitiveType primitiveType) { switch (primitiveType.getPrimitiveTypeName()) { case INT32: return (i) -> dictionary.decodeToInt(i); case INT64: return (i) -> dictionary.decodeToLong(i); case FLOAT: return (i) -> dictionary.decodeToFloat(i); case DOUBLE: return (i) -> dictionary.decodeToDouble(i); case FIXED_LEN_BYTE_ARRAY: case BINARY: case INT96: default: return (i) -> dictionary.decodeToBinary(i); } } } }
dain/presto
lib/trino-parquet/src/main/java/io/trino/parquet/predicate/TupleDomainParquetPredicate.java
Java
apache-2.0
24,584
[ 30522, 1013, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 2007, 1996, 6105, 1012, 1008, 2017, 2089, 6855, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.rapidminer.deployment.client.wsimport; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for getTopDownloads complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="getTopDownloads"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "getTopDownloads") public class GetTopDownloads { }
aborg0/RapidMiner-Unuk
src_generated/com/rapidminer/deployment/client/wsimport/GetTopDownloads.java
Java
agpl-3.0
753
[ 30522, 7427, 4012, 1012, 5915, 11233, 2099, 1012, 10813, 1012, 7396, 1012, 1059, 5332, 8737, 11589, 1025, 12324, 9262, 2595, 1012, 20950, 1012, 14187, 1012, 5754, 17287, 3508, 1012, 20950, 6305, 9623, 21756, 5051, 1025, 12324, 9262, 2595, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<label class="redsheepHeadline">ROADMAP</label> <hr/> <p class="redsheepDescription"> Later. </p>
Tyralcori/RedSheepCMS
application/twigs/redsheepstudios/frontend/sites/roadmap.html
HTML
mit
101
[ 30522, 1026, 3830, 2465, 1027, 1000, 12281, 21030, 8458, 13775, 4179, 1000, 1028, 2346, 2863, 2361, 1026, 1013, 3830, 1028, 1026, 17850, 1013, 1028, 1026, 1052, 2465, 1027, 1000, 12281, 21030, 17299, 2229, 23235, 3258, 1000, 1028, 2101, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace Icinga\Module\Businessprocess\Web\Form; use Icinga\Application\Icinga; use Icinga\Exception\ProgrammingError; use Icinga\Web\Notification; use Icinga\Web\Request; use Icinga\Web\Response; use Icinga\Web\Url; use Exception; /** * QuickForm wants to be a base class for simple forms */ abstract class QuickForm extends QuickBaseForm { const ID = '__FORM_NAME'; const CSRF = '__FORM_CSRF'; /** * The name of this form */ protected $formName; /** * Whether the form has been sent */ protected $hasBeenSent; /** * Whether the form has been sent */ protected $hasBeenSubmitted; /** * The submit caption, element - still tbd */ // protected $submit; /** * Our request */ protected $request; /** * @var Url */ protected $successUrl; protected $successMessage; protected $submitLabel; protected $submitButtonName; protected $deleteButtonName; protected $fakeSubmitButtonName; /** * Whether form elements have already been created */ protected $didSetup = false; protected $isApiRequest = false; public function __construct($options = null) { parent::__construct($options); $this->setMethod('post'); $this->getActionFromRequest() ->createIdElement() ->regenerateCsrfToken() ->setPreferredDecorators(); } protected function getActionFromRequest() { $this->setAction(Url::fromRequest()); return $this; } protected function setPreferredDecorators() { $this->setAttrib('class', 'autofocus icinga-controls'); $this->setDecorators( array( 'Description', array('FormErrors', array('onlyCustomFormErrors' => true)), 'FormElements', 'Form' ) ); return $this; } protected function addSubmitButtonIfSet() { if (false === ($label = $this->getSubmitLabel())) { return; } if ($this->submitButtonName && $el = $this->getElement($this->submitButtonName)) { return; } $el = $this->createElement('submit', $label) ->setLabel($label) ->setDecorators(array('ViewHelper')); $this->submitButtonName = $el->getName(); $this->addElement($el); $fakeEl = $this->createElement('submit', '_FAKE_SUBMIT') ->setLabel($label) ->setDecorators(array('ViewHelper')); $this->fakeSubmitButtonName = $fakeEl->getName(); $this->addElement($fakeEl); $this->addDisplayGroup( array($this->fakeSubmitButtonName), 'fake_button', array( 'decorators' => array('FormElements'), 'order' => 1, ) ); $grp = array( $this->submitButtonName, $this->deleteButtonName ); $this->addDisplayGroup($grp, 'buttons', array( 'decorators' => array( 'FormElements', array('HtmlTag', array('tag' => 'dl')), 'DtDdWrapper', ), 'order' => 1000, )); } protected function addSimpleDisplayGroup($elements, $name, $options) { if (! array_key_exists('decorators', $options)) { $options['decorators'] = array( 'FormElements', array('HtmlTag', array('tag' => 'dl')), 'Fieldset', ); } return $this->addDisplayGroup($elements, $name, $options); } protected function createIdElement() { $this->detectName(); $this->addHidden(self::ID, $this->getName()); $this->getElement(self::ID)->setIgnore(true); return $this; } public function getSentValue($name, $default = null) { $request = $this->getRequest(); if ($request->isPost() && $this->hasBeenSent()) { return $request->getPost($name); } else { return $default; } } public function getSubmitLabel() { if ($this->submitLabel === null) { return $this->translate('Submit'); } return $this->submitLabel; } public function setSubmitLabel($label) { $this->submitLabel = $label; return $this; } public function setApiRequest($isApiRequest = true) { $this->isApiRequest = $isApiRequest; return $this; } public function isApiRequest() { return $this->isApiRequest; } public function regenerateCsrfToken() { if (! $element = $this->getElement(self::CSRF)) { $this->addHidden(self::CSRF, CsrfToken::generate()); $element = $this->getElement(self::CSRF); } $element->setIgnore(true); return $this; } public function removeCsrfToken() { $this->removeElement(self::CSRF); return $this; } public function setSuccessUrl($url, $params = null) { if (! $url instanceof Url) { $url = Url::fromPath($url); } if ($params !== null) { $url->setParams($params); } $this->successUrl = $url; return $this; } public function getSuccessUrl() { $url = $this->successUrl ?: $this->getAction(); if (! $url instanceof Url) { $url = Url::fromPath($url); } return $url; } protected function beforeSetup() { } public function setup() { } protected function onSetup() { } public function setAction($action) { if ($action instanceof Url) { $action = $action->getAbsoluteUrl('&'); } return parent::setAction($action); } public function hasBeenSubmitted() { if ($this->hasBeenSubmitted === null) { $req = $this->getRequest(); if ($req->isPost()) { if (! $this->hasSubmitButton()) { return $this->hasBeenSubmitted = $this->hasBeenSent(); } $this->hasBeenSubmitted = $this->pressedButton( $this->fakeSubmitButtonName, $this->getSubmitLabel() ) || $this->pressedButton( $this->submitButtonName, $this->getSubmitLabel() ); } else { $this->hasBeenSubmitted = false; } } return $this->hasBeenSubmitted; } protected function hasSubmitButton() { return $this->submitButtonName !== null; } protected function pressedButton($name, $label) { $req = $this->getRequest(); if (! $req->isPost()) { return false; } $req = $this->getRequest(); $post = $req->getPost(); return array_key_exists($name, $post) && $post[$name] === $label; } protected function beforeValidation($data = array()) { } public function prepareElements() { if (! $this->didSetup) { $this->beforeSetup(); $this->setup(); $this->addSubmitButtonIfSet(); $this->onSetup(); $this->didSetup = true; } return $this; } public function handleRequest(Request $request = null) { if ($request === null) { $request = $this->getRequest(); } else { $this->setRequest($request); } $this->prepareElements(); if ($this->hasBeenSent()) { $post = $request->getPost(); if ($this->hasBeenSubmitted()) { $this->beforeValidation($post); if ($this->isValid($post)) { try { $this->onSuccess(); } catch (Exception $e) { $this->addException($e); $this->onFailure(); } } else { $this->onFailure(); } } else { $this->setDefaults($post); } } else { // Well... } return $this; } public function addException(Exception $e, $elementName = null) { $file = preg_split('/[\/\\\]/', $e->getFile(), -1, PREG_SPLIT_NO_EMPTY); $file = array_pop($file); $msg = sprintf( '%s (%s:%d)', $e->getMessage(), $file, $e->getLine() ); if ($el = $this->getElement($elementName)) { $el->addError($msg); } else { $this->addError($msg); } } public function onSuccess() { $this->redirectOnSuccess(); } public function setSuccessMessage($message) { $this->successMessage = $message; return $this; } public function getSuccessMessage($message = null) { if ($message !== null) { return $message; } if ($this->successMessage === null) { return t('Form has successfully been sent'); } return $this->successMessage; } public function redirectOnSuccess($message = null) { if ($this->isApiRequest()) { // TODO: Set the status line message? $this->successMessage = $this->getSuccessMessage($message); return; } $url = $this->getSuccessUrl(); $this->notifySuccess($this->getSuccessMessage($message)); $this->redirectAndExit($url); } public function onFailure() { } public function notifySuccess($message = null) { if ($message === null) { $message = t('Form has successfully been sent'); } Notification::success($message); return $this; } public function notifyError($message) { Notification::error($message); return $this; } protected function redirectAndExit($url) { /** @var Response $response */ $response = Icinga::app()->getFrontController()->getResponse(); $response->redirectAndExit($url); } protected function setHttpResponseCode($code) { Icinga::app()->getFrontController()->getResponse()->setHttpResponseCode($code); return $this; } protected function onRequest() { } public function setRequest(Request $request) { if ($this->request !== null) { throw new ProgrammingError('Unable to set request twice'); } $this->request = $request; $this->prepareElements(); $this->onRequest(); return $this; } /** * @return Request */ public function getRequest() { if ($this->request === null) { /** @var Request $request */ $request = Icinga::app()->getFrontController()->getRequest(); $this->setRequest($request); } return $this->request; } public function hasBeenSent() { if ($this->hasBeenSent === null) { /** @var Request $req */ if ($this->request === null) { $req = Icinga::app()->getFrontController()->getRequest(); } else { $req = $this->request; } if ($req->isPost()) { $post = $req->getPost(); $this->hasBeenSent = array_key_exists(self::ID, $post) && $post[self::ID] === $this->getName(); } else { $this->hasBeenSent = false; } } return $this->hasBeenSent; } protected function detectName() { if ($this->formName !== null) { $this->setName($this->formName); } else { $this->setName(get_class($this)); } } }
Icinga/icingaweb2-module-businessprocess
library/Businessprocess/Web/Form/QuickForm.php
PHP
gpl-2.0
12,131
[ 30522, 1026, 1029, 25718, 3415, 15327, 24582, 28234, 1032, 11336, 1032, 2449, 21572, 9623, 2015, 1032, 4773, 1032, 2433, 1025, 2224, 24582, 28234, 1032, 4646, 1032, 30524, 2121, 29165, 1025, 2224, 24582, 28234, 1032, 4773, 1032, 26828, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.youku.player.util; public interface DetailMessage { public final int LOAD_NEXT_PAGE_SUCCESS = 100; public final int LOAD_NEXT_PAGE_FAILED = 101; public final int REFRESH_SUCCESS = 102; public final int REFRESH_FAILED = 103; public final int GET_SERIES_SUCCESS = 104; public final int GET_VARIETY_SERIES_SUCCESS = 1040; public final int TITLE_RQC_CACHE_LOGIN = 105; public final int LAYOUT_INIT_FINISH = 106; public final int WAIT = 107; public final static int MSG_UP_SUCCESS = 10; public final static int MSG_UP_FAIL = 11; public final static int MSG_DOWN_SUCCESS = 20; public final static int MSG_DOWN_FAIL = 21; public final static int MSG_RQC_FAV_LOG = 201; public final static int MSG_FAV_SUCCESS = 202; public final static int MSG_FAV_FAIL = 203; public final static int MSG_RQC_CACHE_LOGIN = 204; public final static int MSG_RQC_CACHE_LOCAL_BACK = 2041; public final static int GET_LAYOUT_DATA_FAIL = 206; public final static int DETAIL_PLAY_TASK = 207; public final static int SERIES_ITEM_TO_PLAY = 301; public final static int SHOW_CURRENT_PLAY = 302; public final static int SHOW_CACHED_ITEM = 401; public final static int SEEK_TO_POINT = 501; public final static int CACHE_START_DOWNLAOD = 502; public final static int GO_CACHED_LIST = 503; public final static int GO_RELATED_VIDEO = 504; public final static int WEAK_NETWORK = 506; public final static int SHOW_NETWORK_ERROR_DIALOG = 507; public final static int CACHED_ALREADY = 508; public final static int GET_CACHED_LIST = 509; public final static int DOWN_lOAD_SUCCESS = 610; public final static int DOWN_lOAD_FAILED = 611; public final static int GET_HIS_FINISH = 612; public final static int MSG_GET_PLAY_INFO_SUCCESS = 6130; public final static int MSG_GET_PLAY_INFO_FAIL = 6131; public final static int MSG_UPDATE_COMMENT = 6132; public final static int MSG_CANNOT_CACHE = 20120; public final static int MSG_CANNOT_CACHE_VARIETY = 20121; public final static int MSG_VIDEO_PLAY_CHANGE = 2013;// 播放视频更改 public final static int UPDATE_CACHE_ITEM = 201304; //用在刷新插件上 public static final int PLUGIN_SHOW_AD_PLAY = 1; public static final int PLUGIN_SHOW_SMALL_PLAYER = 2; public static final int PLUGIN_SHOW_FULLSCREEN_PLAYER = 3; public static final int PLUGIN_SHOW_FULLSCREEN_ENDPAGE = 4; public static final int PLUGIN_SHOW_IMAGE_AD = 5; public static final int PLUGIN_SHOW_INVESTIGATE = 6; public static final int PLUGIN_SHOW_NOT_SET = 7; }
uin3566/Dota2Helper
youkuPlayerOpenSDK/src/main/java/com/youku/player/util/DetailMessage.java
Java
apache-2.0
2,652
[ 30522, 7427, 4012, 1012, 2017, 5283, 1012, 2447, 1012, 21183, 4014, 1025, 2270, 8278, 6987, 7834, 3736, 3351, 1063, 2270, 2345, 20014, 7170, 1035, 2279, 1035, 3931, 1035, 3112, 1027, 2531, 1025, 2270, 2345, 20014, 7170, 1035, 2279, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* tslint:disable:no-unused-variable */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { DebugElement } from '@angular/core'; import { LoginComponent } from './login.component'; describe('LoginComponent', () => { let component: LoginComponent; let fixture: ComponentFixture<LoginComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ LoginComponent ] }) .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(LoginComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });
petrstehlik/pyngShop
www/src/app/components/login/login.component.spec.ts
TypeScript
mit
755
[ 30522, 1013, 1008, 24529, 4115, 2102, 1024, 4487, 19150, 1024, 30524, 12324, 1063, 2004, 6038, 2278, 1010, 6922, 8873, 18413, 5397, 1010, 3231, 8270, 1065, 2013, 1005, 1030, 16108, 1013, 4563, 1013, 5604, 1005, 1025, 12324, 1063, 2011, 1065...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright JS Foundation and other contributors, http://js.foundation // // 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. print("help tests");
grgustaf/jerryscript
tests/debugger/do_help.js
JavaScript
apache-2.0
651
[ 30522, 1013, 1013, 9385, 1046, 2015, 3192, 1998, 2060, 16884, 1010, 8299, 1024, 1013, 1013, 1046, 2015, 1012, 3192, 1013, 1013, 1013, 1013, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Permalink Settings Administration Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! current_user_can( 'manage_options' ) ) wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); $title = __('Permalink Settings'); $parent_file = 'options-general.php'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . __('Permalinks are the permanent URLs to your individual pages and blog posts, as well as your category and tag archives. A permalink is the web address used to link to your content. The URL to each post should be permanent, and never change &#8212; hence the name permalink.') . '</p>' . '<p>' . __('This screen allows you to choose your default permalink structure. You can choose from common settings or create custom URL structures.') . '</p>' . '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'common-settings', 'title' => __('Common Settings'), 'content' => '<p>' . __('Many people choose to use &#8220;pretty permalinks,&#8221; URLs that contain useful information such as the post title rather than generic post ID numbers. You can choose from any of the permalink formats under Common Settings, or can craft your own if you select Custom Structure.') . '</p>' . '<p>' . __('If you pick an option other than Default, your general URL path with structure tags, terms surrounded by <code>%</code>, will also appear in the custom structure field and your path can be further modified there.') . '</p>' . '<p>' . __('When you assign multiple categories or tags to a post, only one can show up in the permalink: the lowest numbered category. This applies if your custom structure includes <code>%category%</code> or <code>%tag%</code>.') . '</p>' . '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'custom-structures', 'title' => __('Custom Structures'), 'content' => '<p>' . __('The Optional fields let you customize the &#8220;category&#8221; and &#8220;tag&#8221; base names that will appear in archive URLs. For example, the page listing all posts in the &#8220;Uncategorized&#8221; category could be <code>/topics/uncategorized</code> instead of <code>/category/uncategorized</code>.') . '</p>' . '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="https://codex.wordpress.org/Settings_Permalinks_Screen" target="_blank">Documentation on Permalinks Settings</a>') . '</p>' . '<p>' . __('<a href="https://codex.wordpress.org/Using_Permalinks" target="_blank">Documentation on Using Permalinks</a>') . '</p>' . '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' ); /** * Display JavaScript on the page. * * @since 3.5.0 */ function options_permalink_add_js() { ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('.permalink-structure input:radio').change(function() { if ( 'custom' == this.value ) return; jQuery('#permalink_structure').val( this.value ); }); jQuery('#permalink_structure').focus(function() { jQuery("#custom_selection").attr('checked', 'checked'); }); }); </script> <?php } add_filter('admin_head', 'options_permalink_add_js'); $home_path = get_home_path(); $iis7_permalinks = iis7_supports_permalinks(); $prefix = $blog_prefix = ''; if ( ! got_url_rewrite() ) $prefix = '/index.php'; if ( is_multisite() && !is_subdomain_install() && is_main_site() ) $blog_prefix = '/blog'; if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { check_admin_referer('update-permalink'); if ( isset( $_POST['permalink_structure'] ) ) { if ( isset( $_POST['selection'] ) && 'custom' != $_POST['selection'] ) $permalink_structure = $_POST['selection']; else $permalink_structure = $_POST['permalink_structure']; if ( ! empty( $permalink_structure ) ) { $permalink_structure = preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) ); if ( $prefix && $blog_prefix ) $permalink_structure = $prefix . preg_replace( '#^/?index\.php#', '', $permalink_structure ); else $permalink_structure = $blog_prefix . $permalink_structure; } $wp_rewrite->set_permalink_structure( $permalink_structure ); } if ( isset( $_POST['category_base'] ) ) { $category_base = $_POST['category_base']; if ( ! empty( $category_base ) ) $category_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace( '#', '', $category_base ) ); $wp_rewrite->set_category_base( $category_base ); } if ( isset( $_POST['tag_base'] ) ) { $tag_base = $_POST['tag_base']; if ( ! empty( $tag_base ) ) $tag_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace( '#', '', $tag_base ) ); $wp_rewrite->set_tag_base( $tag_base ); } wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) ); exit; } $permalink_structure = get_option( 'permalink_structure' ); $category_base = get_option( 'category_base' ); $tag_base = get_option( 'tag_base' ); $update_required = false; if ( $iis7_permalinks ) { if ( ( ! file_exists($home_path . 'web.config') && win_is_writable($home_path) ) || win_is_writable($home_path . 'web.config') ) $writable = true; else $writable = false; } elseif ( $is_nginx ) { $writable = false; } else { if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) { $writable = true; } else { $writable = false; $existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) ); $new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) ); $update_required = ( $new_rules !== $existing_rules ); } } if ( $wp_rewrite->using_index_permalinks() ) $usingpi = true; else $usingpi = false; flush_rewrite_rules(); require( ABSPATH . 'wp-admin/admin-header.php' ); if ( ! empty( $_GET['settings-updated'] ) ) : ?> <div id="message" class="updated notice is-dismissible"><p><?php if ( ! is_multisite() ) { if ( $iis7_permalinks ) { if ( $permalink_structure && ! $usingpi && ! $writable ) { _e('You should update your web.config now.'); } elseif ( $permalink_structure && ! $usingpi && $writable ) { _e('Permalink structure updated. Remove write access on web.config file now!'); } else { _e('Permalink structure updated.'); } } elseif ( $is_nginx ) { _e('Permalink structure updated.'); } else { if ( $permalink_structure && ! $usingpi && ! $writable && $update_required ) { _e('You should update your .htaccess now.'); } else { _e('Permalink structure updated.'); } } } else { _e('Permalink structure updated.'); } ?> </p></div> <?php endif; ?> <div class="wrap"> <h2><?php echo esc_html( $title ); ?></h2> <form name="form" action="options-permalink.php" method="post"> <?php wp_nonce_field('update-permalink') ?> <p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them; however, WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="https://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p> <?php if ( is_multisite() && !is_subdomain_install() && is_main_site() ) { $permalink_structure = preg_replace( '|^/?blog|', '', $permalink_structure ); $category_base = preg_replace( '|^/?blog|', '', $category_base ); $tag_base = preg_replace( '|^/?blog|', '', $tag_base ); } $structures = array( 0 => '', 1 => $prefix . '/%year%/%monthnum%/%day%/%postname%/', 2 => $prefix . '/%year%/%monthnum%/%postname%/', 3 => $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%', 4 => $prefix . '/%postname%/', ); ?> <h3 class="title"><?php _e('Common Settings'); ?></h3> <table class="form-table permalink-structure"> <tr> <th><label><input name="selection" type="radio" value="" <?php checked('', $permalink_structure); ?> /> <?php _e('Default'); ?></label></th> <td><code><?php echo get_option('home'); ?>/?p=123</code></td> </tr> <tr> <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[1]); ?>" <?php checked($structures[1], $permalink_structure); ?> /> <?php _e('Day and name'); ?></label></th> <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td> </tr> <tr> <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[2]); ?>" <?php checked($structures[2], $permalink_structure); ?> /> <?php _e('Month and name'); ?></label></th> <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . date('Y') . '/' . date('m') . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td> </tr> <tr> <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[3]); ?>" <?php checked($structures[3], $permalink_structure); ?> /> <?php _e('Numeric'); ?></label></th> <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td> </tr> <tr> <th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[4]); ?>" <?php checked($structures[4], $permalink_structure); ?> /> <?php _e('Post name'); ?></label></th> <td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td> </tr> <tr> <th> <label><input name="selection" id="custom_selection" type="radio" value="custom" <?php checked( !in_array($permalink_structure, $structures) ); ?> /> <?php _e('Custom Structure'); ?> </label> </th> <td> <code><?php echo get_option('home') . $blog_prefix; ?></code> <input name="permalink_structure" id="permalink_structure" type="text" value="<?php echo esc_attr($permalink_structure); ?>" class="regular-text code" /> </td> </tr> </table> <h3 class="title"><?php _e('Optional'); ?></h3> <p><?php /* translators: %s is a placeholder that must come at the start of the URL. */ printf( __('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/uncategorized/</code>. If you leave these blank the defaults will be used.'), get_option('home') . $blog_prefix . $prefix ); ?></p> <table class="form-table"> <tr> <th><label for="category_base"><?php /* translators: prefix for category permalinks */ _e('Category base'); ?></label></th> <td><?php echo $blog_prefix; ?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td> </tr> <tr> <th><label for="tag_base"><?php _e('Tag base'); ?></label></th> <td><?php echo $blog_prefix; ?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr($tag_base); ?>" class="regular-text code" /></td> </tr> <?php do_settings_fields('permalink', 'optional'); ?> </table> <?php do_settings_sections('permalink'); ?> <?php submit_button(); ?> </form> <?php if ( !is_multisite() ) { ?> <?php if ( $iis7_permalinks ) : if ( isset($_POST['submit']) && $permalink_structure && ! $usingpi && ! $writable ) : if ( file_exists($home_path . 'web.config') ) : ?> <p><?php _e('If your <code>web.config</code> file were <a href="https://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code> element in <code>web.config</code> file.') ?></p> <form action="options-permalink.php" method="post"> <?php wp_nonce_field('update-permalink') ?> <p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p> </form> <p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p> <?php else : ?> <p><?php _e('If the root directory of your site were <a href="https://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your <code>web.config</code> file. Create a new file, called <code>web.config</code> in the root directory of your site. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this code into the <code>web.config</code> file.') ?></p> <form action="options-permalink.php" method="post"> <?php wp_nonce_field('update-permalink') ?> <p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules(true) ); ?></textarea></p> </form> <p><?php _e('If you temporarily make your site&#8217;s root directory writable for us to generate the <code>web.config</code> file automatically, do not forget to revert the permissions after the file has been created.') ?></p> <?php endif; ?> <?php endif; ?> <?php elseif ( ! $is_nginx ) : if ( $permalink_structure && ! $usingpi && ! $writable && $update_required ) : ?> <p><?php _e('If your <code>.htaccess</code> file were <a href="https://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p> <form action="options-permalink.php" method="post"> <?php wp_nonce_field('update-permalink') ?> <p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p> </form> <?php endif; ?> <?php endif; ?> <?php } // multisite ?> </div> <?php require( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
willford1/podehole
wp-admin/options-permalink.php
PHP
gpl-2.0
15,492
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 2566, 9067, 19839, 10906, 3447, 3898, 1012, 1008, 1008, 1030, 7427, 2773, 20110, 1008, 1030, 4942, 23947, 4270, 3447, 1008, 1013, 1013, 1008, 1008, 2773, 20110, 3447, 6879, 6494, 2361, 1008,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module Robotics.Thingomatic.Config where data PrinterConfig = Config { extSpeed::Double, extTemp::Int, platTemp::Int, layer::Double } deriving(Show,Read,Eq) defaultConfig = Config {extSpeed = 1.98, extTemp = 220, platTemp = 125, layer = 0.35}
matthewSorensen/weft
Robotics/Thingomatic/Config.hs
Haskell
gpl-3.0
434
[ 30522, 11336, 21331, 1012, 2518, 9626, 4588, 1012, 9530, 8873, 2290, 2073, 2951, 15041, 8663, 8873, 2290, 1027, 9530, 8873, 2290, 1063, 4654, 3215, 25599, 1024, 1024, 3313, 1010, 4654, 4674, 8737, 1024, 1024, 20014, 1010, 28005, 6633, 2361,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// @flow /* ********************************************************** * File: Footer.js * * Brief: The react footer component * * Authors: Craig Cheney, George Whitfield * * 2017.04.27 CC - Document created * ********************************************************* */ import React, { Component } from 'react'; import { Grid, Col, Row } from 'react-bootstrap'; let mitImagePath = '../resources/img/mitLogo.png'; /* Set mitImagePath to new path */ if (process.resourcesPath !== undefined) { mitImagePath = (`${String(process.resourcesPath)}resources/img/mitLogo.png`); // mitImagePath = `${process.resourcesPath}resources/img/mitLogo.png`; } // const nativeImage = require('electron').nativeImage; // const mitLogoImage = nativeImage.createFromPath(mitImagePath); const footerStyle = { position: 'absolute', right: 0, bottom: 0, left: 0, color: '#9d9d9d', backgroundColor: '#222', height: '25px', textAlign: 'center' }; const mitLogoStyle = { height: '20px' }; const bilabLogoStyle = { height: '20px' }; export default class Footer extends Component<{}> { render() { return ( <Grid className='Footer' style={footerStyle} fluid> <Row> <Col xs={4}><img src={'../resources/img/mitLogo.png' || mitImagePath} style={mitLogoStyle} alt='MICA' /></Col> <Col xs={4}>The MICA Group &copy; 2017</Col> <Col xs={4}><img src='../resources/img/bilabLogo_white.png' style={bilabLogoStyle} alt='BioInstrumentation Lab' /></Col> </Row> </Grid> ); } } /* [] - END OF FILE */
TheCbac/MICA-Desktop
app/components/Footer.js
JavaScript
mit
1,554
[ 30522, 1013, 1013, 1030, 4834, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post title: Sixth Blog!! --- This week we have learned some brand new concepts, like iterators, lambda, closure. It’s tricky for me to understand when to add const before passed parameters. Also, I learned that it’s easier to use a for each loop in python to traverse an iterable type of variable instead of using a while loop through iterator. Since I learned Haskell in a class called programming language, it’s relatively easier for me to understand the concept of closure. When writing in Haskell for a basic interpreter, it is important to catch the closure so that the value of a function, for example, is not lost after the return statement. When self-writing a range_iterator, I also learned that python can have nested class, but it can be only called in the syntax of class.nestedclass() instead of this.nestedclass() like in Java. For me, I think that range is an interesting name for that method because when it is passed in two arguments, it returns a list of integers in that range rather than the range of the two passed parameters. Sometimes, I need to think twice about what range actually returns. As for exam preparation, what I am trying to do is to review all the materials covered in class, and make a list of questions so that I can ask questions during the study session on Tuesday. # Tip Of the Week Same words as always, Never give up, keep learning!! Computer science is a subject that everybody at all ages is supposed to be encouraged to, and be able to learn. It’s a fascinating subject that can create something powerful. I also learned that mobile computing is also a studied area in MS and PhD.
XiangyiKong/old_blogs
_posts/2015-10-04-Week6.md
Markdown
mit
1,657
[ 30522, 1011, 1011, 1011, 9621, 1024, 2695, 2516, 1024, 4369, 9927, 999, 999, 1011, 1011, 1011, 2023, 2733, 2057, 2031, 4342, 2070, 4435, 2047, 8474, 1010, 2066, 2009, 6906, 6591, 1010, 23375, 1010, 8503, 1012, 2009, 1521, 1055, 24026, 200...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: vakit_dashboard title: KREMSMUNSTER, AVUSTURYA için iftar, namaz vakitleri ve hava durumu - ilçe/eyalet seç permalink: /AVUSTURYA/KREMSMUNSTER/ --- <script type="text/javascript"> var GLOBAL_COUNTRY = 'AVUSTURYA'; var GLOBAL_CITY = 'KREMSMUNSTER'; var GLOBAL_STATE = ''; var lat = 72; var lon = 21; </script>
hakanu/iftar
_posts_/vakit/AVUSTURYA/KREMSMUNSTER/2017-02-01-.markdown
Markdown
apache-2.0
335
[ 30522, 1011, 1011, 1011, 9621, 1024, 12436, 23615, 1035, 24923, 2516, 1024, 1047, 28578, 6491, 4609, 6238, 1010, 20704, 19966, 13098, 2050, 24582, 2378, 2065, 7559, 1010, 15125, 10936, 12436, 23615, 3917, 2072, 2310, 5292, 3567, 4241, 6824, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2013 Shaun Simpson shauns2029@gmail.com package uk.co.immutablefix.wifireset; import java.net.InetAddress; import java.net.UnknownHostException; import android.os.AsyncTask; public class NetTask extends AsyncTask<String, Integer, String> { @Override protected String doInBackground(String... params) { InetAddress addr = null; try { addr = InetAddress.getByName(params[0]); } catch (UnknownHostException e) { } if (addr != null) return addr.getHostAddress(); else return null; } }
shaun2029/Wifi-Reset
src/uk/co/immutablefix/wifireset/NetTask.java
Java
gpl-2.0
628
[ 30522, 1013, 1013, 9385, 2286, 16845, 9304, 16845, 2015, 11387, 24594, 1030, 20917, 4014, 1012, 4012, 7427, 2866, 1012, 2522, 1012, 10047, 28120, 3085, 8873, 2595, 1012, 15536, 26332, 3388, 1025, 12324, 9262, 1012, 5658, 1012, 1999, 12928, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace @false { class Program { static void Main(string[] args) { } } }
AlanBarber/WinCmdCoreUtilities
false/Program.cs
C#
apache-2.0
215
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 3793, 1025, 3415, 15327, 1030, 6270, 1063, 2465, 2565, 1063, 10763, 11675, 2364, 1006, 5164, 1031, 1033, 12098, 5620,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Changelog [![GitHub commits since latest release](https://img.shields.io/github/commits-since/ligato/vpp-agent/latest.svg?style=flat-square)](https://github.com/ligato/vpp-agent/compare/v3.2.0...master) ## Release Notes - [v3.2.0](#v3.2.0) - [v3.1.0](#v3.1.0) - [v3.0.0](#v3.0.0) - [v3.0.1](#v3.0.1) - [v2.5.0](#v2.5.0) - [v2.5.1](#v2.5.1) - [v2.4.0](#v2.4.0) - [v2.3.0](#v2.3.0) - [v2.2.0](#v2.2.0) - [v2.2.0-beta](#v2.2.0-beta) - [v2.1.0](#v2.1.0) - [v2.1.1](#v2.1.1) - [v2.0.0](#v2.0.0) - [v2.0.1](#v2.0.1) - [v2.0.2](#v2.0.2) - [v1.8.0](#v1.8.0) - [v1.8.1](#v1.8.1) - [v1.7.0](#v1.7.0) - [v1.6.0](#v1.6.0) - [v1.5.0](#v1.5.0) - [v1.5.1](#v1.5.1) - [v1.5.2](#v1.5.2) - [v1.4.0](#v1.4.0) - [v1.4.1](#v1.4.1) - [v1.3.0](#v1.3.0) - [v1.2.0](#v1.2.0) - [v1.1.0](#v1.1.0) - [v1.0.8](#v1.0.8) - [v1.0.7](#v1.0.7) - [v1.0.6](#v1.0.6) - [v1.0.5](#v1.0.5) - [v1.0.4](#v1.0.4) - [v1.0.3](#v1.0.3) - [v1.0.2](#v1.0.2) <!--- RELEASE CHANGELOG TEMPLATE: <a name="vX.Y.Z"></a> # [X.Y.Z](https://github.com/ligato/vpp-agent/compare/vX-1.Y-1.Z-1...vX.Y.Z) (YYYY-MM-DD) ### COMPATIBILITY ### KNOWN ISSUES ### BREAKING CHANGES ### Bug Fixes ### Features ### Improvements ### Docker Images ### Documentation --> <a name="v3.2.0"></a> # [3.2.0](https://github.com/ligato/vpp-agent/compare/v3.1.0...v3.2.0) (2020-10-XX) ### COMPATIBILITY - VPP 20.09 (compatible) - VPP 20.05 (default) - VPP 20.01 (backwards compatible) - VPP 19.08 (backwards compatible) - ~~VPP 19.04~~ (no longer supported) ### Bug Fixes - Fixes and improvements for agentctl and models [#1643](https://github.com/ligato/vpp-agent/pull/1643) - Fix creation of multiple ipip tunnels [#1650](https://github.com/ligato/vpp-agent/pull/1650) - Fix IPSec tun protect + add IPSec e2e test [#1654](https://github.com/ligato/vpp-agent/pull/1654) - Fix bridge domain dump for VPP 20.05 [#1663](https://github.com/ligato/vpp-agent/pull/1663) - Fix IPSec SA add/del in VPP 20.05 [#1664](https://github.com/ligato/vpp-agent/pull/1664) - Update expected output of agentctl status command [#1673](https://github.com/ligato/vpp-agent/pull/1673) - vpp/ifplugin: Recognize interface name prefix "tun" as TAP [#1674](https://github.com/ligato/vpp-agent/pull/1674) - Fix IPv4 link-local IP address handling [#1715](https://github.com/ligato/vpp-agent/pull/1715) - maps caching prometheus gauges weren't really used [#1741](https://github.com/ligato/vpp-agent/pull/1741) - Permit agent to run even when VPP stats are unavailable [#1712](https://github.com/ligato/vpp-agent/pull/1712) - Fix grpc context timeout for agentctl import command [#1718](https://github.com/ligato/vpp-agent/pull/1718) - Changed nat44 pool key to prevent possible key collisions [#1725](https://github.com/ligato/vpp-agent/pull/1725) - Remove forced delay for linux interface notifications [#1742](https://github.com/ligato/vpp-agent/pull/1742) ### Features - agentctl: Add config get/update commands [#1709](https://github.com/ligato/vpp-agent/pull/1709) - agentctl: Support specific history seq num and improve layout [#1717](https://github.com/ligato/vpp-agent/pull/1717) - agentctl: Add config.resync subcommand (with resync) [#1642](https://github.com/ligato/vpp-agent/pull/1642) - IP Flow Information eXport (IPFIX) plugin [#1649](https://github.com/ligato/vpp-agent/pull/1649) - Add IPIP & IPSec point-to-multipoint support [#1669](https://github.com/ligato/vpp-agent/pull/1669) - Wireguard plugin support [#1731](https://github.com/ligato/vpp-agent/pull/1731) - Add tunnel mode support for VPP TAP interfaces [#1671](https://github.com/ligato/vpp-agent/pull/1671) - New REST endpoint for retrieving version of Agent [#1670](https://github.com/ligato/vpp-agent/pull/1670) - Add support for IPv6 ND address autoconfig [#1676](https://github.com/ligato/vpp-agent/pull/1676) - Add VRF field to proxy ARP range [#1672](https://github.com/ligato/vpp-agent/pull/1672) - Switch to new proto v2 (google.golang.org/protobuf) [#1691](https://github.com/ligato/vpp-agent/pull/1691) - ipsec: allow configuring salt for encryption algorithm [#1698](https://github.com/ligato/vpp-agent/pull/1698) - gtpu: Add RemoteTeid to GTPU interface [#1719](https://github.com/ligato/vpp-agent/pull/1719) - Added support for NAT44 static mapping twice-NAT pool IP address reference [#1728](https://github.com/ligato/vpp-agent/pull/1728) - add IP protocol number to ACL model [#1726](https://github.com/ligato/vpp-agent/pull/1726) - gtpu: Add support for arbitrary DecapNextNode [#1721](https://github.com/ligato/vpp-agent/pull/1721) - configurator: Add support for waiting until config update is done [#1734](https://github.com/ligato/vpp-agent/pull/1734) - telemetry: Add reading VPP threads to the telemetry plugin [#1753](https://github.com/ligato/vpp-agent/pull/1753) - linux: Add support for Linux VRFs [#1744](https://github.com/ligato/vpp-agent/pull/1744) - VRRP support [#1744](https://github.com/ligato/vpp-agent/pull/1744) ### Improvements - perf: Performance enhancement for adding many rules to Linux IP… [#1644](https://github.com/ligato/vpp-agent/pull/1644) - Improve testing process for e2e/integration tests [#1757](https://github.com/ligato/vpp-agent/pull/1757) ### Documentation - docs: Add example for developing agents with custom VPP plugins [#1665](https://github.com/ligato/vpp-agent/pull/1665) ### Other - Delete unused REST handler for VPP commands [#1677](https://github.com/ligato/vpp-agent/pull/1677) - separate model for IPSec Security Policies [#1679](https://github.com/ligato/vpp-agent/pull/1679) - do not mark host_if_name for AF_PACKET as deprecated [#1745](https://github.com/ligato/vpp-agent/pull/1745) - Store interface internal name & dev type as metadata [#1706](https://github.com/ligato/vpp-agent/pull/1706) - Check if HostIfName contains non-printable characters [#1662](https://github.com/ligato/vpp-agent/pull/1662) - Fix error message for duplicate keys [#1659](https://github.com/ligato/vpp-agent/pull/1659) <a name="v3.1.0"></a> # [3.1.0](https://github.com/ligato/vpp-agent/compare/v3.0.0...v3.1.0) (2020-03-13) ### BREAKING CHANGES * Switch cn-infra dependency to using vanity import path [#1620](https://github.com/ligato/vpp-agent/pull/1620) To migrate, replace all cn-infra import paths (`github.com/ligato/cn-infra` -> `go.ligato.io/cn-infra/v2`) To update cn-infra dependency, run `go get -u go.ligato.io/cn-infra/v2@master`. ### Bug Fixes * Add missing models to ConfigData [#1625](https://github.com/ligato/vpp-agent/pull/1625) * Fix watching VPP events [#1640](https://github.com/ligato/vpp-agent/pull/1640) ### Features * Allow customizing polling from stats poller [#1634](https://github.com/ligato/vpp-agent/pull/1634) * IPIP tunnel + IPSec tunnel protection support [#1638](https://github.com/ligato/vpp-agent/pull/1638) * Add prometheus metrics to govppmux [#1626](https://github.com/ligato/vpp-agent/pull/1626) * Add prometheus metrics to kvscheduler [#1630](https://github.com/ligato/vpp-agent/pull/1630) ### Improvements * Improve performance testing suite [#1630](https://github.com/ligato/vpp-agent/pull/1630) <a name="v3.0.1"></a> # [3.0.1](https://github.com/ligato/vpp-agent/compare/v3.0.0...v3.0.1) (2020-02-20) ### Bug Fixes * Add missing models to ConfigData (https://github.com/ligato/vpp-agent/pull/1625) <a name="v3.0.0"></a> # [3.0.0](https://github.com/ligato/vpp-agent/compare/v2.5.0...master) (2020-02-10) ### COMPATIBILITY - **VPP 20.01** (default) - **VPP 19.08.1** (recommended) - **VPP 19.04.4** ### KNOWN ISSUES - VPP L3 plugin: `IPScanNeighbor` was disabled for VPP 20.01 due to VPP API changes (will be implemented later using new model) - VPP NAT plugin: `VirtualReassembly` in `Nat44Global` was disabled for VPP 20.01 due to VPP API changes (will be implemented later in VPP L3 plugin using new model) ### BREAKING CHANGES - migrate from dep to Go modules for dependency management and remove vendor directory [#1599](https://github.com/ligato/vpp-agent/pull/1599) - use vanity import path `go.ligato.io/vpp-agent/v3` in Go files [#1599](https://github.com/ligato/vpp-agent/pull/1599) - move all _.proto_ files into `proto/ligato` directory and add check for breaking changes [#1599](https://github.com/ligato/vpp-agent/pull/1599) ### Bug Fixes - check for duplicate Linux interface IP address [#1586](https://github.com/ligato/vpp-agent/pull/1586) ### New Features - VPP interface plugin: Allow AF-PACKET to reference target Linux interface via logical name [#1616](https://github.com/ligato/vpp-agent/pull/1616) - VPP L3 plugin: add support for L3 cross-connects [#1602](https://github.com/ligato/vpp-agent/pull/1602) - VPP L3 plugin: IP flow hash settings support [#1610](https://github.com/ligato/vpp-agent/pull/1610) - VPP NAT plugin: NAT interface and AddressPool API changes [#1595](https://github.com/ligato/vpp-agent/pull/1595) - VPP plugins: support disabling VPP plugins [#1593](https://github.com/ligato/vpp-agent/pull/1593) - VPP client: add support for govpp proxy [#1593](https://github.com/ligato/vpp-agent/pull/1593) ### Improvements - optimize getting model keys, with up to 20% faster transactions [#1615](https://github.com/ligato/vpp-agent/pull/1615) - agentctl output formatting improvements (#1581, #1582, #1589) - generated VPP binary API now imports common types from `*_types` packages - development docker images now have smaller size (~400MB less) - start using Github Workflows for CI/CD pipeline - add gRPC reflection service <a name="v2.5.1"></a> # [2.5.1](https://github.com/ligato/vpp-agent/compare/v2.5.0...v2.5.1) (2019-12-06) ### COMPATIBILITY - **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`) - **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 ### Bug Fixes * Fix linux interface dump ([#1577](https://github.com/ligato/vpp-agent/pull/1577)) * Fix VRF for SR policy ([#1578](https://github.com/ligato/vpp-agent/pull/1578)) <a name="v2.5.0"></a> # [2.5.0](https://github.com/ligato/vpp-agent/compare/v2.4.0...v2.5.0) (2019-11-29) ### Compatibility - **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`) - **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 ### New Features * SRv6 global config (encap source address) * Support for Linux configuration dumping ### Bug Fixes * Update GoVPP with fix for stats conversion panic <a name="v2.4.0"></a> # [2.4.0](https://github.com/ligato/vpp-agent/compare/v2.3.0...v2.4.0) (2019-10-21) ### Compatibility - **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`) - **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 ### New Features This release introduces compatibility with two different commits of the VPP 20.01. Previously compatible version was updated to commit `324-g66a332cf1`, and support for `379-ga6b93eac5` was added. Other previous versions remained. * [Telemetry][vpp-telemetry] - Added `StatsPoller` service periodically retrieving VPP stats. <a name="v2.3.0"></a> # [2.3.0](https://github.com/ligato/vpp-agent/compare/v2.2.0...v2.3.0) (2019-10-04) ### Compatibility - **VPP 20.01** (`20.01-rc0~161-ge5948fb49~b3570`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 VPP support for version 19.08 was updated to 19.08.1. Support for 19.01 was dropped in this release. ### Bug Fixes * Linux interfaces with 'EXISTING' type should be resynced properly. * Resolved issue with SRv6 removal. * AgentCTL dump command fixed. * ACL ICMP rule is now properly configured and data can be obtained using the ACL dump. * Missing dependency for SRv6 L2 steering fixed. * Fixed issue with possible division by zero and missing interface MTU. * Namespace plugin uses a Docker event listener instead of periodical polling. This should prevent cases where quickly started microservice container was not detected. ### New Features * [netalloc-plugin][netalloc-plugin] - A new plugin called netalloc which allows disassociating topology from addressing in the network configuration. Interfaces, routes and other network objects' addresses can be symbolic references into the pool of allocated addresses known to netalloc plugin. See [model][netalloc-plugin-model] for more information. * [if-plugin][vpp-interface-plugin] - Added support for GRE tunnel interfaces. Choose the `GRE_TUNNEL` interface type with appropriate link data. * [agentctl][agentctl] - Many new features and enhancements added to the AgentCTL: * version is defined as a parameter for root command instead of the separate command * ETCD endpoints can be defined via the `ETCD_ENDPOINTS` environment variable * sub-command `config` supports `get/put/del` commands * `model` sub-commands improved * added VPP command to manage VPP instance Additionally, starting with this release the AgentCTL is a VPP-Agent main control tool and the vpp-agent-ctl was definitely removed. ### Improvements Many end-to-end tests introduced, gradually increasing VPP-Agent stability. * [if-plugin][vpp-interface-plugin] - IP addresses assigned by the DHCP are excluded from the interface address descriptor. - VPP-Agent now processes status change notifications labeled by the VPP as UNKNOWN. * [ns-plugin][linux-ns-plugin] - Dockerclient microservice polling replaced with an event listener. * [sr-plugin][sr-plugin] - SRv6 dynamic proxy routing now can be connected to a non-zero VRF table. <a name="v2.2.0"></a> # [2.2.0](https://github.com/ligato/vpp-agent/compare/v2.2.0-beta...v2.2.0) (2019-08-26) ### Compatibility - **VPP 19.08** (rc1) - **VPP 19.04** (default) - **VPP 19.01** (backward compatible) - cn-infra v2.2 ### Bug Fixes - CN-infra version updated to 2.2 contains a supervisor fix which should prevent the issue where the supervisor logging occasionally caused the agent to crash during large outputs. ### New Features * [if-plugin][vpp-interface-plugin] - Added option to configure SPAN records. Northbound data are formatted by the [SPAN model][span-model]. ### Improvements * [orchestrator][orchestrator-plugin] - Clientv2 is now recognized as separate data source by the orchestrator plugin. This feature allows to use the localclient together with other data sources. ### Documentation - Updated documentation comments in the protobuf API. <a name="v2.2.0-beta"></a> # [2.2.0-beta](https://github.com/ligato/vpp-agent/compare/v2.1.1...v2.2.0-beta) (2019-08-09) ### Compatibility - **VPP 19.08** (rc1) - **VPP 19.04** (default) - **VPP 19.01** (backward compatible) ### Bug Fixes * Fixed SRv6 localsid delete case for non-zero VRF tables. * Fixed interface IPv6 detection in the descriptor. * Various bugs fixed in KV scheduler TXN post-processing. * Interface plugin config names fixed, no stats publishers are now used by default. Instead, datasync is used (by default ETCD, Redis and Consul). * Rx-placement and rx-mode is now correctly dependent on interface link state. * Fixed crash for iptables rulechain with default microservice. * Punt dump fixed in all supported VPP versions. * Removal of registered punt sockets fixed after a resync. * Punt socket paths should no longer be unintentionally recreated. * IP redirect is now correctly dependent on RX interface. * Fixed IPSec security association configuration for tunnel mode. * Fixed URL for VPP metrics in telemetry plugin * Routes are now properly dependent on VRF. ### New Features * Defined new environment variable `DISABLE_INTERFACE_STATS` to generally disable interface plugin stats. * Defined new environment variable `RESYNC_TIMEOU` to override default resync timeout. * Added [ETCD ansible python plugin][ansible] with example playbook. Consult [readme](ansible/README.md) for more information. ### Improvements * [govppmux-plugin][govppmux-plugin] - GoVPPMux stats can be read with rest under path `/govppmux/stats`. - Added disabling of interface stats via the environment variable `DISABLE_INTERFACE_STATS`. - Added disabling of interface status publishing via environment variable `DISABLE_STATUS_PUBLISHING`. * [kv-scheduler][kv-scheduler] - Added some more performance improvements. - The same key can be no more matched by multiple descriptors. * [abf-plugin][vpp-abf-plugin] - ABF plugin was added to config data model and is now initialized in configurator. * [if-plugin][vpp-interface-plugin] - Interface rx-placement and rx-mode was enhanced and now allows per-queue configuration. - Added [examples](examples/kvscheduler/rxplacement) for rx-placement and rx-mode. * [nat-plugin][vpp-nat-plugin] - NAT example updated for VPP 19.04 * [l3-plugin][vpp-l3-plugin] - Route keys were changed to prevent collisions with some types of configuration. Route with outgoing interface now contains the interface name in the key. - Added support for DHCP proxy. A new descriptor allows calling CRUD operations to VPP DHCP proxy servers. * [punt-plugin][vpp-punt-plugin] - Added support for Punt exceptions. - IP redirect dump was implemented for VPP 19.08. * [Telemetry][vpp-telemetry] - Interface metrics added to telemetry plugin. Note that the URL for prometheus export was changed to `/metrics/vpp`. - Plugin configuration file now has an option to skip certain metrics. * [rest-plugin][rest-plugin] - Added support for IPSec plugin - Added support for punt plugin * [agentctl][agentctl] - We continuously update the new CTL tool. Various bugs were fixed some new features added. - Added new command `import` which can import configuration from file. ### Docker Images * The supervisor was replaced with VPP-Agent init plugin. * Images now use pre-built VPP images from [ligato/vpp-base](https://github.com/ligato/vpp-base) <a name="v2.1.1"></a> # [2.1.1](https://github.com/ligato/vpp-agent/compare/v2.1.0...v2.1.1) (2019-04-05) ### Compatibility - **VPP 19.04** (`stable/1904`, recommended) - **VPP 19.01** (backward compatible) ### Bug Fixes * Fixed IPv6 detection for Linux interfaces [#1355](https://github.com/ligato/vpp-agent/pull/1355). * Fixed config file names for ifplugin in VPP & Linux [#1341](https://github.com/ligato/vpp-agent/pull/1341). * Fixed setting status publishers from env var: `VPP_STATUS_PUBLISHERS`. ### Improvements * The start/stop timeouts for agent can be configured using env vars: `START_TIMEOUT=15s` and `STOP_TIMEOUT=5s`, with values parsed as duration. * ABF was added to the `ConfigData` message for VPP [#1356](https://github.com/ligato/vpp-agent/pull/1356). ### Docker Images * Images now install all compiled .deb packages from VPP (including `vpp-plugin-dpdk`). <a name="v2.1.0"></a> # [2.1.0](https://github.com/ligato/vpp-agent/compare/v2.0.2...v2.1.0) (2019-05-09) ### Compatibility - **VPP 19.04** (`stable/1904`, recommended) - **VPP 19.01** (backward compatible) - cn-infra v2.1 - Go 1.11 The VPP 18.10 was deprecated and is no longer compatible. ### BREAKING CHANGES * All non-zero VRF tables now must be explicitly created, providing a VRF proto-modeled data to the VPP-Agent. Otherwise, some configuration items will not be created as before (for example interface IP addresses). ### Bug Fixes * VPP ARP `retrieve` now also returns IPv6 entries. ### New Features * [govppmux-plugin][govppmux-plugin] - The GoVPPMux plugin configuration file contains a new option `ConnectViaShm`, which when set to `true` forces connecting to the VPP via shared memory prefix. This is an alternative to environment variable `GOVPPMUX_NOSOCK`. * [configurator][configurator-plugin] - The configurator plugin now collects statistics which are available via the `GetStats()` function or via REST on URL `/stats/configurator`. * [kv-scheduler][kv-scheduler] - Added transaction statistics. * [abf-plugin][vpp-abf-plugin] - Added new plugin ABF - ACL-based forwarding, providing an option to configure routing based on matching ACL rules. An ABF entry configures interfaces which will be attached, list of forwarding paths and associated access control list. * [if-plugin][vpp-interface-plugin] - Added support for Generic Segmentation Offload (GSO) for TAP interfaces. * [l3-plugin][vpp-l3-plugin] - A new model for VRF tables was introduced. Every VRF is defined by an index and an IP version, a new optional label was added. Configuration types using non-zero VRF now require it to be created, since the VRF is considered a dependency. VRFs with zero-index are present in the VPP by default and do not need to be configured (applies for both, IPv4 and IPv6). * [agentctl][agentctl] - This tool becomes obsolete and was completely replaced with a new implementation. Please note that the development of this tool is in the early stages, and functionality is quite limited now. New and improved functionality is planned for the next couple of releases since our goal is to have a single vpp-agent control utility. Because of this, we have also deprecated the vpp-agent-ctl tool which will be most likely removed in the next release. ### Improvements * [kv-scheduler][kv-scheduler] - The KV Scheduler received another performance improvements. * [if-plugin][vpp-interface-plugin] - Attempt to configure a Bond interface with already existing ID returns a non-retriable error. * [linux-if-plugin][linux-interface-plugin] - Before adding an IPv6 address to the Linux interface, the plugins will use `sysctl` to ensure the IPv6 is enabled in the target OS. ### Docker Images - Supervisord is started as a process with PID 1 ### Documentation - The ligato.io webpage is finally available, check out it [here][ligato.io]! We have also released a [new documentation site][ligato-docs] with a lot of new or updated articles, guides, tutorials and many more. Most of the README.md files scattered across the code were removed or updated and moved to the site. <a name="v2.0.2"></a> # [2.0.2](https://github.com/ligato/vpp-agent/compare/v2.0.1...v2.0.2) (2019-04-19) ### Compatibility - **VPP 19.01** (updated to `v19.01.1-14-g0f36ef60d`) - **VPP 18.10** (backward compatible) - cn-infra v2.0 - Go 1.11 This minor release brought compatibility with updated version of the VPP 19.01. <a name="v2.0.1"></a> # [2.0.1](https://github.com/ligato/vpp-agent/compare/v2.0.0...v2.0.1) (2019-04-05) ### Compatibility - **VPP 19.01** (compatible by default, recommended) - **VPP 18.10** (backward compatible) - cn-infra v2.0 - Go 1.11 ### Bug Fixes * Fixed bug where Linux network namespace was not reverted in some cases. * The VPP socketclient connection checks (and waits) for the socket file in the same manner as for the shared memory, giving the GoVPPMux more time to connect in case the VPP startup is delayed. Also errors occurred during the shm/socket file watch are now properly handled. * Fixed wrong dependency for SRv6 end functions referencing VRF tables (DT6,DT4,T). ### Improvements * [GoVPPMux][govppmux-plugin] - Added option to adjust the number of connection attempts and time delay between them. Seek `retry-connect-count` and `retry-connect-timeout` fields in [govpp.conf][govppmux-conf]. Also keep in mind the total time in which plugins can be initialized when using these fields. * [linux-if-plugin][linux-interface-plugin] - Default loopback MTU was set to 65536. * [ns-plugin][linux-ns-plugin] - Plugin descriptor returns `ErrEscapedNetNs` if Linux namespace was changed but not reverted back before returned to scheduler. ### Docker Images * Supervisord process is now started with PID=1 <a name="v2.0.0"></a> # [2.0.0](https://github.com/ligato/vpp-agent/compare/v1.8...v2.0.0) (2019-04-02) ### Compatibility - **VPP 19.01** (compatible by default, recommended) - **VPP 18.10** (backward compatible) - cn-infra v2.0 - Go 1.11 ### BREAKING CHANGES * All northbound models were re-written and simplified and most of them are no longer compatible with model data from v1. * The `v1` label from all vpp-agent keys was updated to `v2`. * Plugins using some kind of dependency on other VPP/Linux plugin (for example required interface) should be updated and handled by the KVScheduler. ### Bug Fixes * We expect a lot of known and unknown race-condition and plugin dependency related issues to be solved by the KV Scheduler. * MTU is omitted for the sub-interface type. * If linux plugin attempts to switch to non-existing namespace, it prints appropriate log message as warning, and continues with execution instead of interrupt it with error. * Punt socket path string is cleaned from unwanted characters. * Added VPE compatibility check for L3 plugin vppcalls. * The MAC address assigned to an af-packet interface is used from the host only if not provided from the configuration. * Fixed bug causing the agent to crash in an attempt to 'update' rx-placement with empty value. * Switch interface from zero to non-zero VRF causes VPP issues - this limitation was now restricted only to unnumbered interfaces. * IPSec tunnel dump now also retrieves integ/crypto keys. * Errored operation should no more publish to the index mapping. * Some obsolete Retval checks were removed. * Error caused by missing DPDK interface is no longer retryable. * Linux interface IP address without mask is now handled properly. * Fixed bug causing agent to crash when some VPP plugin we support was not loaded. * Fixed metrics retrieval in telemetry plugin. ### Known Issues * The bidirectional forwarding detection (aka BFD plugin) was removed. We plan to add it in one of the future releases. * The L4 plugin (application namespaces) was removed. * We experienced problems with the VPP with some messages while using socket client connection. The issue kind was that the reply message was not returned (GoVPP could not decode it). If you encounter similar error, please try to setup VPP connection using shared memory (see below). ### Features * Performance - The vpp-agent now supports connection via socket client (in addition to shared memory). The socket client connection provides higher performance and message throughput, thus it was set as default connection type. The shared memory is still available via the environment variable `GOVPPMUX_NOSOCK`. - Many other changes, benchmarking and profiling was done to improve vpp-agent experience. * Multi-VPP support - The VPP-agent can connect to multiple versions of the VPP with the same binary file without any additional building or code changes. See compatibility part to know which versions are supported. The list will be extended in the future. * Models - All vpp-agent models were reviewed and cleaned up. Various changes were done, like simple renaming (in order to have more meaningful fields, avoid duplicated names in types, etc.), improved model convenience (interface type-specific fields are now defined as `oneof`, preventing to set multiple or incorrect data) and other. All models were also moved to the common [api][models] folder. * [KVScheduler][kv-scheduler] - Added new component called KVScheduler, as a reaction to various flaws and issues with race conditions between Vpp/Linux plugins, poor readability and poorly readable logging. Also the system of notifications between plugins was unreliable and hard to debug or even understand. Based on this experience, a new framework offers improved generic mechanisms to handle dependencies between configuration items and creates clean and readable transaction-based logging. Since this component significantly changed the way how plugins are defined, we recommend to learn more about it on the [VPP-Agent wiki page][wiki]. * [orchestrator][orchestrator-plugin] - The orchestrator is a new component which long-term added value will be a support for multiple northbound data sources (KVDB, GRPC, ...). The current implementation handles combination of GRPC + KVDB, which includes data changes and resync. In the future, any combination of sources will be supported. * [GoVPPMux][govppmux-plugin] - Added `Ping()` method to the VPE vppcalls usable to test the VPP connection. * [if-plugin][vpp-interface-plugin] - UDP encapsulation can be configured to an IPSec tunnel interface - Support for new Bond-type interfaces. - Support for L2 tag rewrite (currently present in the interface plugin because of the inconsistent VPP API) * [nat-plugin][vpp-nat-plugin] - Added support for session affinity in NAT44 static mapping with load balancer. * [sr-plugin][sr-plugin] - Support for Dynamic segment routing proxy with L2 segment routing unaware services. - Added support for SRv6 end function End.DT4 and End.DT6. * [linux-if-plugin][linux-interface-plugin] - Added support for new Linux interface type - loopback. - Attempt to assign already existing IP address to the interface does not cause an error. * [linux-iptables][linux-iptables-plugin] - Added new linux IP tables plugin able to configure IP tables chain in the specified table, manage chain rules and set default chain policy. ### Improvements * [KVScheduler][kv-scheduler] - Performance improvements related to memory management. * [GoVPPMux][govppmux-plugin] - Need for config file was removed, GoVPP is now set with default values if the startup config is not provided. - `DefaultReplyTimeout` is now configured globally, instead of set for every request separately. - Tolerated default health check timeout is now set to 250ms (up from 100ms). The old value had not provide enough time in some cases. * [acl-plugin][vpp-acl-plugin] - Model moved to the [api/models][models] * [if-plugin][vpp-interface-plugin] - Model reviewed, updated and moved to the [api/models][models]. - Interface plugin now handles IPSec tunnel interfaces (previously done in IPSec plugin). - NAT related configuration was moved to its own plugin. - New interface stats (added in 1.8.1) use new GoVPP API, and publishing frequency was significantly decreased to handle creation of multiple interfaces in short period of time. * [IPSec-plugin][vpp-ipsec-plugin] - Model moved to the [api/models][models] - The IPSec interface is no longer processed by the IPSec plugin (moved to interface plugin). - The ipsec link in interface model now uses the enum definitions from IPSec model. Also some missing crypto algorithms were added. * [l2-plugin][vpp-l2-plugin] - Model moved to the [api/models][models] and split to three separate models for bridge domains, FIBs and cross connects. * [l3-plugin][vpp-l3-plugin] - Model moved to the [api/models][models] and split to three separate models for ARPs, Proxy ARPs including IP neighbor and Routes. * [nat-plugin][vpp-nat-plugin] - Defined new plugin to handle NAT-related configuration and its own [model][nat-proto] (before a part of interface plugin). * [punt-plugin][vpp-punt-plugin] - Model moved to the [api/models][models]. - Added retrieve support for punt socket. The current implementation is not final - plugin uses local cache (it will be enhanced when the appropriate VPP binary API call will be added). * [stn-plugin][vpp-stn-plugin] - Model moved to the [api/models][models]. * [linux-if-plugin][linux-interface-plugin] - Model reviewed, updated and moved to the [api/models][models]. * [linux-l3-plugin][linux-l3-plugin] - Model moved to the [api/models][models] and split to separate models for ARPs and Routes. - Linux routes and ARPs have a new dependency - the target interface is required to contain an IP address. * [ns-plugin][ns-plugin] - New auxiliary plugin to handle linux namespaces and microservices (evolved from ns-handler). Also defines [model][ns-proto] for generic linux namespace definition. ### Docker Images * Configuration file for GoVPP was removed, forcing to use default values (which are the same as they were in the file). * Fixes for installing ARM64 debugger. * Kafka is no longer required in order to run vpp-agent from the image. ### Documentation * Added documentation for the punt plugin, describing main features and usage of the punt plugin. * Added documentation for the [IPSec plugin][vpp-ipsec-plugin], describing main and usage of the IPSec plugin. * Added documentation for the [interface plugin][vpp-interface-plugin]. The document is only available on [wiki page][wiki]. * Description improved in various proto files. * Added a lot of new documentation for the KVScheduler (examples, troubleshooting, debugging guides, diagrams, ...) * Added tutorial for KV Scheduler. * Added many new documentation articles to the [wiki page][wiki]. However, most of is there only temporary since we are preparing new ligato.io website with all the documentation and other information about the Ligato project. Also majority of readme files from the vpp-agent repository will be removed in the future. <a name="v1.8.1"></a> # [1.8.1](https://github.com/ligato/vpp-agent/compare/v1.8..v1.8.1) (2019-03-04) Motive for this minor release was updated VPP with several fixed bugs from the previous version. The VPP version also introduced new interface statistics mechanism, thus the stats processing was updated in the interface plugin. ### Compatibility - v19.01-16~gd30202244 - cn-infra v1.7 - GO 1.11 ### Bug Fixes - VPP bug: fixed crash when attempting to run in kubernetes pod - VPP bug: fixed crash in barrier sync when vlib_worker_threads is zero ### Features - [vpp-ifplugin][vpp-interface-plugin] * Support for new VPP stats (the support for old ones were deprecated by the VPP, thus removed from the vpp-agent as well). <a name="v1.8.0"></a> # [1.8.0](https://github.com/ligato/vpp-agent/compare/v1.7...v1.8) (2018-12-12) ### Compatibility - VPP v19.01-rc0~394-g6b4a32de - cn-infra v1.7 - Go 1.11 ### Bug Fixes * Pre-existing VETH-type interfaces are now read from the default OS namespace during resync if the Linux interfaces were dumped. * The Linux interface dump method does not return an error if some interface namespace becomes suddenly unavailable at the read-time. Instead, this case is logged and all the other interfaces are returned as usual. * The Linux localclient's delete case for Linux interfaces now works properly. * The Linux interface dump now uses OS link name (instead of vpp-agent specific name) to read the interface attributes. This sometimes caused errors where an incorrect or even none interface was read. * Fixed bug where the unsuccessful namespace switch left the namespace file opened. * Fixed crash if the Linux plugin was disabled. * Fixed occasional crash in vpp-agent interface notifications. * Corrected interface counters for TX packets. * Access list with created TCP/UDP/ICMP rule, which remained as empty struct no longer causes vpp-agent to crash ### Features - [vpp-ifplugin][vpp-interface-plugin] * Rx-mode and Rx-placement now support dump via the respective binary API call - vpp-rpc-plugin * GRPC now supports also IPSec configuration. * All currently supported configuration items can be also dumped/read via GRPC (similar to rest) * GRPC now allows to automatically persist configuration to the data store. The desired DB has to be defined in the new GRPC config file (see [readme][readme] for additional information). - [vpp-punt][punt-model] * Added simple new punt plugin. The plugin allows to register/unregister punt to host via Unix domain socket. The new [model][punt-model] was added for this configuration type. Since the VPP API is incomplete, the configuration does not support dump. ### Improvements - [vpp-ifplugin][vpp-interface-plugin] * The VxLAN interface now support IPv4/IPv6 virtual routing and forwarding (VRF tables). * Support for new interface type: VmxNet3. The VmxNet3 virtual network adapter has no physical counterpart since it is optimized for performance in a virtual machine. Because built-in drivers for this card are not provided by default in the OS, the user must install VMware Tools. The interface model was updated for the VmxNet3 specific configuration. - [ipsec-plugin][vpp-ipsec-plugin] * IPSec resync processing for security policy databases (SPD) and security associations (SA) was improved. Data are properly read from northbound and southbound, compared and partially configured/removed, instead of complete cleanup and re-configuration. This does not appeal to IPSec tunnel interfaces. * IPSec tunnel can be now set as an unnumbered interface. - [rest-plugin][rest-plugin] * In case of error, the output returns correct error code with cause (parsed from JSON) instead of an empty body <a name="v1.7.0"></a> # [1.7.0](https://github.com/ligato/vpp-agent/compare/v1.6...v1.7) (2018-10-02) ### Compatibility - VPP 18.10-rc0~505-ge23edac - cn-infra v1.6 - Go 1.11 ### Bug Fixes * Corrected several cases where various errors were silently ignored * GRPC registration is now done in Init() phase, ensuring that it finishes before GRPC server is started * Removed occasional cases where Linux tap interface was not configured correctly * Fixed FIB configuration failures caused by wrong updating of the metadata after several modifications * No additional characters are added to NAT tag and can be now configured with the full length without index out of range errors * Linux interface resync registers all VETH-type interfaces, despite the peer is not known * Status publishing to ETCD/Consul now should work properly * Fixed occasional failure caused by concurrent map access inside Linux plugin interface configurator * VPP route dump now correctly recognizes route type ### Features - [vpp-ifplugin][vpp-interface-plugin] * It is now possible to dump unnumbered interface data * Rx-placement now uses specific binary API to configure instead of generic CLI API - [vpp-l2plugin][vpp-l2-plugin] * Bridge domain ARP termination table can now be dumped - [linux-ifplugin][linux-interface-plugin] * Linux interface watcher was reintroduced. * Linux interfaces can be now dumped. - [linux-l3plugin][linux-l3-plugin] * Linux ARP entries and routes can be dumped. ### Improvements - [vpp-plugins][vpp-plugins] * Improved error propagation in all the VPP plugins. Majority of errors now print the stack trace to the log output allowing better error tracing and debugging. * Stopwatch was removed from all vppcalls - [linux-plugins][linux-plugins] * Improved error propagation in all Linux plugins (same way as for VPP) * Stopwatch was removed from all linuxcalls - [govpp-plugn][govppmux-plugin] * Tracer (introduced in cn-infra 1.6) added to VPP message processing, replacing stopwatch. The measurement should be more precise and logged for all binary API calls. Also the rest plugin now allows showing traced entries. ### Docker Images * The image can now be built on ARM64 platform <a name="v1.6.0"></a> # [1.6.0](https://github.com/ligato/vpp-agent/compare/v1.5.2...v1.6) (2018-08-24) ### Compatibility - VPP 18.10-rc0~169-gb11f903a - cn-infra v1.5 ### BREAKING CHANGES - Flavors were replaced with new way of managing plugins. - REST interface URLs were changed, see [readme][readme] for complete list. ### Bug Fixes * if VPP routes are dumped, all paths are returned * NAT load-balanced static mappings should be resynced correctly * telemetry plugin now correctly parses parentheses for `show node counters` * telemetry plugin will not hide an error caused by value loading if the config file is not present * Linux plugin namespace handler now correctly handles namespace switching for interfaces with IPv6 addresses. Default IPv6 address (link local) will not be moved to the new namespace if there are no more IPv6 addresses configured within the interface. This should prevent failures in some cases where IPv6 is not enabled in the destination namespace. * VxLAN with non-zero VRF can be successfully removed * Lint is now working again * VPP route resync works correctly if next hop IP address is not defined ### Features * Deprecating flavors - CN-infra 1.5 brought new replacement for flavors and it would be a shame not to implement it in the vpp-agent. The old flavors package was removed and replaced with this new concept, visible in app package vpp-agent. - [rest plugin][rest-plugin] * All VPP configuration types are now supported to be dumped using REST. The output consists of two parts; data formatted as NB proto model, and metadata with VPP specific configuration (interface indexes, different counters, etc.). * REST prefix was changed. The new URL now contains API version and purpose (dump, put). The list of all URLs can be found in the [readme][readme] - [ifplugin][vpp-interface-plugin] * Added support for NAT virtual reassembly for both, IPv4 and IPv6. See change in [nat proto file][nat-proto] - [l3plugin][vpp-l3-plugin] * Vpp-agent now knows about DROP-type routes. They can be configured and also dumped. VPP default routes, which are DROP-type is recognized and registered. Currently, resync does not remove or correlate such a route type automatically, so no default routes are unintentionally removed. * New configurator for L3 IP scan neighbor was added, allowing to set/unset IP scan neigh parameters to the VPP. ### Improvements - [vpp plugins][vpp-plugins] * all vppcalls were unified under API defined for every configuration type (e.g. interfaces, l2, l3, ...). Configurators now use special handler object to access vppcalls. This should prevent duplicates and make vppcalls cleaner and more understandable. - [ifplugin][vpp-interface-plugin] * VPP interface DHCP configuration can now be dumped and added to resync processing * Interfaces and also L3 routes can be configured for non-zero VRF table if IPv6 is used. - [examples][examples] * All examples were reworked to use new flavors concept. The purpose was not changed. ### Docker Images - using Ubuntu 18.04 as the base image <a name="v1.5.2"></a> ## [1.5.2](https://github.com/ligato/vpp-agent/compare/v1.5.1...v1.5.2) (2018-07-23) ### Compatibility - VPP 18.07-rc0~358-ga5ee900 - cn-infra v1.4.1 (minor version fixes bug in Consul) ### Bug Fixes - [Telemetry][vpp-telemetry] * Fixed bug where lack of config file could cause continuous polling. The interval now also cannot be changed to a value less than 5 seconds. * Telemetry plugin is now closed properly <a name="v1.5.1"></a> ## 1.5.1 (2018-07-20) ### Compatibility - VPP 18.07-rc0~358-ga5ee900 - cn-infra v1.4 ### Features - [Telemetry][vpp-telemetry] * Default polling interval was raised to 30s. * Added option to use telemetry config file to change polling interval, or turn the polling off, disabling the telemetry plugin. The change was added due to several reports where often polling is suspicious of interrupting VPP worker threads and causing packet drops and/or other negative impacts. More information how to use the config file can be found in the [readme][readme]. <a name="v1.5.0"></a> # [1.5.0](https://github.com/ligato/vpp-agent/compare/v1.4.1...v1.5) (2018-07-16) ### Compatibility - VPP 18.07-rc0~358-ga5ee900 - cn-infra v1.4 ### BREAKING CHANGES - The package `etcdv3` was renamed to `etcd`, along with its flag and configuration file. - The package `defaultplugins` was renamed to `vpp` to make the purpose of the package clear ### Bug Fixes - Fixed a few issues with parsing VPP metrics from CLI for [Telemetry][vpp-telemetry]. - Fixed bug in GoVPP occurring after some request timed out, causing the channel to receive replies from the previous request and always returning an error. - Fixed issue which prevented setting interface to non-existing VRF. - Fixed bug where removal of an af-packet interface caused attached Veth to go DOWN. - Fixed NAT44 address pool resolution which was not correct in some cases. - Fixed bug with adding SR policies causing incomplete configuration. ### Features - [LinuxPlugin][linux-interface-plugin] * Is now optional and can be disabled via configuration file. - [ifplugin][vpp-interface-plugin] * Added support for VxLAN multicast * Rx-placement can be configured on VPP interfaces - [IPsec][vpp-ipsec-plugin] * IPsec UDP encapsulation can now be set (NAT traversal) ### Docker Images - Replace `START_AGENT` with `OMIT_AGENT` to match `RETAIN_SUPERVISOR` and keep both unset by default. - Refactored and cleaned up execute scripts and remove unused scripts. - Fixed some issues with `RETAIN_SUPERVISOR` option. - Location of supervisord pid file is now explicitly set to `/run/supervisord.pid` in *supervisord.conf* file. - The vpp-agent is now started with single flag `--config-dir=/opt/vpp-agent/dev`, and will automatically load all configuration from that directory. <a name="v1.4.1"></a> ## [1.4.1](https://github.com/ligato/vpp-agent/compare/v1.4.0...v1.4.1) (2018-06-11) A minor release using newer VPP v18.04 version. ### Compatibility - VPP v18.04 (2302d0d) - cn-infra v1.3 ### Bug Fixes - VPP submodule was removed from the project. It should prevent various problems with dependency resolution. - Fixed known bug present in the previous version of the VPP, issued as [VPP-1280][vpp-issue-1280]. Current version contains appropriate fix. <a name="v1.4.0"></a> # [1.4.0](https://github.com/ligato/vpp-agent/compare/v1.3...v1.4.0) (2018-05-24) ### Compatibility - VPP v18.04 (ac2b736) - cn-infra v1.3 ### Bug Fixes * Fixed case where the creation of the Linux route with unreachable gateway threw an error. The route is now appropriately cached and created when possible. * Fixed issue with GoVPP channels returning errors after a timeout. * Fixed various issues related to caching and resync in L2 cross-connect * Split horizon group is now correctly assigned if an interface is created after bridge domain * Fixed issue where the creation of FIB while the interface was not a part of the bridge domain returned an error. ### Known issues * VPP crash may occur if there is interface with non-default VRF (>0). There is an [VPP-1280][vpp-issue-1280] issue created with more details ### Features - [Consul][consul] * Consul is now supported as a key-value store alternative to ETCD. More information in the [readme][readme]. - [Telemetry][vpp-telemetry] * New plugin for collecting telemetry data about VPP metrics and serving them via HTTP server for Prometheus. More information in the [readme][readme]. - [Ipsecplugin][vpp-ipsec-plugin] * Now supports tunnel interface for encrypting all the data passing through that interface. - GRPC * Vpp-agent itself can act as a GRPC server (no need for external executable) * All configuration types are supported (incl. Linux interfaces, routes and ARP) * Client can read VPP notifications via vpp-agent. - [SR plugin][sr-plugin] * New plugin with support for Segment Routing. More information in the [readme][readme]. ### Improvements - [ifplugin][vpp-interface-plugin] * Added support for self-twice-NAT - __vpp-agent-grpc__ executable merged with [vpp-agent][vpp-agent] command. - [govppmux][govppmux-plugin] * `configure reply timeout` can be configured. * Support for VPP started with custom shared memory prefix. SHM may be configured via the GoVPP plugin config file. More info in the [readme][readme] * Overall redundancy cleanup and corrected naming for all proto models. * Added more unit tests for increased coverage and code stability. ### Documentation - [localclient_linux][examples-vpp-local] now contains two examples, the old one demonstrating basic plugin functionality was moved to plugin package, and specialised example for [NAT][examples-nat] was added. - [localclient_linux][examples-linux-local] now contains two examples, the old one demonstrating [veth][examples-veth] interface usage was moved to package and new example for linux [tap][examples-tap] was added. <a name="v1.3.0"></a> # [1.3.0](https://github.com/ligato/vpp-agent/compare/v1.2...v1.3) (2018-03-22) The vpp-agent is now using custom VPP branch [stable-1801-contiv][contiv-vpp1810]. ### Compatibility - VPP v18.01-rc0~605-g954d437 - cn-infra v1.2 ### Bug Fixes * Resync of ifplugin in both, VPP and Linux, was improved. Interfaces with the same configuration data are not recreated during resync. * STN does not fail if IP address with a mask is provided. * Fixed ingress/egress interface resolution in ACL. * Linux routes now check network reachability for gateway address before configuration. It should prevent "network unreachable" errors during config. * Corrected bridge domain crash in case non-bvi interface was added to another non-bvi interface. * Fixed several bugs related to VETH and AF-PACKET configuration and resync. ### Features - [ipsecplugin][vpp-ipsec-plugin]: * New plugin for IPSec added. The IPSec is supported for VPP only with Linux set manually for now. IKEv2 is not yet supported. More information in the [readme][readme]. - [nsplugin][linux-ns-plugin] * New namespace plugin added. The configurator handles common namespace and microservice processing and communication with other Linux plugins. - [ifplugin][vpp-interface-plugin] * Added support for Network address translation. NAT plugin supports a configuration of NAT44 interfaces, address pools and DNAT. More information in the [readme][readme]. * DHCP can now be configured for the interface - [l2plugin][vpp-l2-plugin] * Split-horizon group can be configured for bridge domain interface. - [l3plugin][vpp-l3-plugin] * Added support for proxy ARP. For more information and configuration example, please see [readme][readme]. - [linux ifplugin][linux-interface-plugin] * Support for automatic interface configuration (currently only TAP). ### Improvements - [aclplugin][agentctl] * Removed configuration order of interfaces. The access list can be now configured even if interfaces do not exist yet, and add them later. - vpp-agent-ctl * The vpp-agent-ctl was refactored and command info was updated. ### Docker Images * VPP can be built and run in the release or debug mode. Read more information in the [readme][readme]. * Production image is now smaller by roughly 40% (229MB). <a name="v1.2.0"></a> # [1.2.0](https://github.com/ligato/vpp-agent/compare/v1.1...v1.2) (2018-02-07) ### Compatibility - VPP v18.04-rc0~90-gd95c39e - cn-infra v1.1 ### Bug Fixes - Fixed interface assignment in ACLs - Fixed bridge domain BVI modification resolution - vpp-agent-grpc (removed in 1.4 release, since then it is a part of the vpp-agent) now compiles properly together with other commands. ### Known Issues - VPP can occasionally cause a deadlock during checksum calculation (https://jira.fd.io/browse/VPP-1134) - VPP-Agent might not properly handle initialization across plugins (this is not occurring currently, but needs to be tested more) ### Improvements - [aclplugin][vpp-acl-plugin] * Improved resync of ACL entries. Every new ACL entry is correctly configured in the VPP and all obsolete entries are read and removed. - [ifplugin][vpp-interface-plugin] * Improved resync of interfaces, BFD sessions, authentication keys, echo functions and STN. Better resolution of persistence config for interfaces. - [l2plugin][vpp-l2-plugin] * Improved resync of bridge domains, FIB entries, and xConnect pairs. Resync now better correlates configuration present on the VPP with the NB setup. - [linux-ifplugin][linux-interface-plugin] * ARP does not need the interface to be present on the VPP. Configuration is cached and put to the VPP if requirements are fulfilled. - Dependencies * Migrated from glide to dep ### Docker Images * VPP compilation now skips building of Java/C++ APIs, this saves build time and final image size. * Development image now runs VPP in debug mode with various debug options added in [VPP config file][vpp-conf-file]. <a name="v1.1.0"></a> # [1.1.0](https://github.com/ligato/vpp-agent/compare/v1.0.8...v1.1) (2018-01-22) ### Compatibility - VPP version v18.04-rc0~33-gb59bd65 - cn-infra v1.0.8 ### Bug Fixes - fixed skip-resync parameter if vpp-plugin.conf is not provided. - corrected af_packet type interface behavior if veth interface is created/removed. - several fixes related to the af_packet and veth interface type configuration. - microservice and veth-interface related events are synchronized. ### Known Issues - VPP can occasionally cause a deadlock during checksum calculation (https://jira.fd.io/browse/VPP-1134) - VPP-Agent might not properly handle initialization across plugins (this is not occurring currently, but needs to be tested more) ### Features - [ifplugin][vpp-interface-plugin] - added support for un-numbered interfaces. The nterface can be marked as un-numbered with information about another interface containing required IP address. A un-numbered interface does not need to have IP address set. - added support for virtio-based TAPv2 interfaces. - interface status is no longer stored in the ETCD by default and it can be turned on using the appropriate setting in vpp-plugin.conf. See [readme][readme] for more details. - [l2plugin][vpp-l2-plugin] - bridge domain status is no longer stored in the ETCD by default and it can be turned on using the appropriate setting in vpp-plugin.conf. See [readme][readme] for more details. ### Improvements - [ifplugin][vpp-interface-plugin] - default MTU value was removed in order to be able to just pass empty MTU field. MTU now can be set only in interface configuration (preferred) or defined in vpp-plugin.conf. If none of them is set, MTU value will be empty. - interface state data are stored in statuscheck readiness probe - [l3plugin][vpp-l3-plugin] - removed strict configuration order for VPP ARP entries and routes. Both ARP entry or route can be configured without interface already present. - l4plugin (removed in v2.0) - removed strict configuration order for application namespaces. Application namespace can be configured without interface already present. - localclient - added API for ARP entries, L4 features, Application namespaces, and STN rules. - logging - consolidated and improved logging in vpp and Linux plugins. <a name="v1.0.8"></a> ## [1.0.8](https://github.com/ligato/vpp-agent/compare/v1.0.7...v1.0.8) (2017-11-21) ### Compatibility - VPP v18.01-rc0-309-g70bfcaf - cn-infra v1.0.7 ### Features - [ifplugin][vpp-interface-plugin] - ability to configure STN rules. See respective [readme][readme] in interface plugin for more details. - rx-mode settings can be set on interface. Ethernet-type interface can be set to POLLING mode, other types of interfaces supports also INTERRUPT and ADAPTIVE. Fields to set QueueID/QueueIDValid are also available - added possibility to add interface to any VRF table. - added defaultplugins API. - API contains new Method `DisableResync(keyPrefix ...string)`. One or more ETCD key prefixes can be used as a parameter to disable resync for that specific key(s). - l4plugin (removed in v2.0) - added new l4 plugin to the VPP plugins. It can be used to enable/disable L4 features and configure application namespaces. See respective [readme][readme] in L4 plugin for more details. - support for VPP plugins/l3plugin ARP configuration. The configurator can perform the basic CRUD operation with ARP config. - resync - resync error propagation improved. If any resynced configuration fails, rest of the resync completes and will not be interrupted. All errors which appear during resync are logged after. - [linux l3plugin][linux-l3-plugin] - route configuration does not return an error if the required interface is missing. Instead, the route data are internally stored and configured when the interface appears. - GoVPP - delay flag removed from GoVPP plugin ### Improvements - removed dead links from README files ### Documentation - improved in multiple vpp-agent packages <a name="v1.0.7"></a> ## [1.0.7](https://github.com/ligato/vpp-agent/compare/v1.0.6...v1.0.7) (2017-10-30) ### Compatibility - VPP version v18.01-rc0~154-gfc1c612 - cn-infra v1.0.6 ### Features - [Default VPP plugin][vpp-interface-plugin] - added resync strategies. Resync of VPP plugins can be set using defaultpluigns config file; Resync can be set to full (always resync everything) or dependent on VPP configuration (if there is none, skip resync). Resync can be also forced to skip using the parameter. - [Linuxplugins L3Plugin][linux-l3-plugin] - added support for basic CRUD operations with the static Address resolution protocol entries and static Routes. <a name="v1.0.6"></a> ## [1.0.6](https://github.com/ligato/vpp-agent/compare/v1.0.5...v1.0.6) (2017-10-17) ### Compatibility - cn-infra v1.0.5 ### Features - [LinuxPlugin][linux-interface-plugin] - The configuration of vEth interfaces modified. Veth configuration defines two names: symbolic used internally and the one used in host OS. `HostIfName` field is optional. If it is not defined, the name in the host OS will be the same as the symbolic one - defined by `Name` field. <a name="v1.0.5"></a> ## [1.0.5](https://github.com/ligato/vpp-agent/compare/v1.0.4...v1.0.5) (2017-09-26) ### Compatibility - VPP version v17.10-rc0~334-gce41a5c - cn-infra v1.0.4 ### Features - [GoVppMux][govppmux-plugin] - configuration file for govpp added - Kafka Partitions - Changes in offset handling, only automatically partitioned messages (hash, random) have their offset marked. Manually partitioned messages are not marked. - Implemented post-init consumer (for manual partitioner only) which allows starting consuming after kafka-plugin Init() - Minimalistic examples & documentation for Kafka API will be improved in a later release. <a name="v1.0.4"></a> ## [1.0.4](https://github.com/ligato/vpp-agent/compare/v1.0.3...v1.0.4) (2017-09-08) ### Features - Kafka Partitions - Implemented new methods that allow to specify partitions & offset parameters: * publish: Mux.NewSyncPublisherToPartition() & Mux.NewAsyncPublisherToPartition() * watch: ProtoWatcher.WatchPartition() - Minimalistic examples & documentation for Kafka API will be improved in a later release. - Flavors - reduced to only local.FlavorVppLocal & vpp.Flavor - GoVPP - updated version waits until the VPP is ready to accept a new connection <a name="v1.0.3"></a> ## [1.0.3](https://github.com/ligato/vpp-agent/compare/v1.0.2...v1.0.3) (2017-09-05) ### Compatibility - VPP version v17.10-rc0~265-g809bc74 (upgraded because of VPP MEMIF fixes) ### Features Enabled support for wathing data store `OfDifferentAgent()` - see: * examples/idx_iface_cache (removed in v2.0) * examples/examples/idx_bd_cache (removed in v2.0) * examples/idx_veth_cache (removed in v2.0) Preview of new Kafka client API methods that allows to fill also partition and offset argument. New methods implementation ignores these new parameters for now (fallback to existing implementation based on `github.com/bsm/sarama-cluster` and `github.com/Shopify/sarama`). <a name="v1.0.2"></a> ## [1.0.2](https://github.com/ligato/vpp-agent/compare/v1.0.1...v1.0.2) (2017-08-28) ### Compatibility - VPP version v17.10-rc0~203 ### Known Issues A rarely occurring problem during startup with binary API connectivity. VPP rejects binary API connectivity when VPP Agent tries to connect too early (plan fix this behavior in next release). ### Features Algorithms for applying northbound configuration (stored in ETCD key-value data store) to VPP in the proper order of VPP binary API calls implemented in [Default VPP plugin][vpp-interface-plugin]: - network interfaces, especially: - MEMIFs (optimized data plane network interface tailored for a container to container network connectivity) - VETHs (standard Linux Virtual Ethernet network interface) - AF_Packets (for accessing VETHs and similar type of interface) - VXLANs, Physical Network Interfaces, loopbacks ... - L2 BD & X-Connects - L3 IP Routes & VRFs - ACL (Access Control List) Support for Linux VETH northbound configuration implemented in [Linux Plugin][linux-interface-plugin] applied in proper order with VPP AF_Packet configuration. Data Synchronization during startup for network interfaces & L2 BD (support for the situation when ETCD contain configuration before VPP Agent starts). Data replication and events: - Updating operational data in ETCD (VPP indexes such as sw_if_index) and statistics (port counters). - Updating statistics in Redis (optional once redis.conf available - see flags). - Publishing links up/down events to Kafka message bus. - [Examples][examples] - Tools: - [agentctl CLI tool][agentctl] that show state & configuration of VPP agents - [docker][docker]: container-based development environment for the VPP agent - other features inherited from cn-infra: - health: status check & k8s HTTP/REST probes - logging: changing log level at runtime - Ability to extend the behavior of the VPP Agent by creating new plugins on top of VPP Agent flavor (removed with CN-Infra v1.5). New plugins can access API for configured: - VPP Network interfaces, - Bridge domains and VETHs based on [idxvpp][idx-vpp] threadsafe map tailored for VPP data with advanced features (multiple watchers, secondary indexes). - VPP Agent is embeddable in different software projects and with different systems by using Local Flavor (removed with CN-Infra v1.5) to reuse VPP Agent algorithms. For doing this there is VPP Agent client version 1 (removed in v2.0): - local client - for embedded VPP Agent (communication inside one operating system process, VPP Agent effectively used as a library) - remote client - for remote configuration of VPP Agent (while integrating for example with control plane) [agentctl]: cmd/agentctl [ansible]: ansible [configurator-plugin]: plugins/configurator [consul]: https://www.consul.io/ [contiv-vpp1810]: https://github.com/vpp-dev/vpp/tree/stable-1801-contiv [docker]: docker [examples]: examples [examples-linux-local]: examples/localclient_linux [examples-nat]: examples/localclient_vpp/nat [examples-tap]: examples/localclient_linux/tap [examples-veth]: examples/localclient_linux/veth [examples-vpp-local]: examples/localclient_vpp [govppmux-plugin]: plugins/govppmux [govppmux-conf]: plugins/govppmux/govpp.conf [idx-vpp]: pkg/idxvpp [kv-scheduler]: plugins/kvscheduler [ligato.io]: https://ligato.io/ [ligato-docs]: https://docs.ligato.io/en/latest/ [linux-interface-plugin]: plugins/linux/ifplugin [linux-iptables-plugin]: plugins/linux/iptablesplugin [linux-l3-plugin]: plugins/linux/l3plugin [linux-ns-plugin]: plugins/linux/nsplugin [linux-plugins]: plugins/linux [nat-proto]: api/models/vpp/nat/nat.proto [netalloc-plugin]: plugins/netalloc [netalloc-plugin-model]: api/models/netalloc/netalloc.proto [ns-plugin]: plugins/linux/nsplugin [ns-proto]: api/models/linux/namespace/namespace.proto [models]: api/models [orchestrator-plugin]: plugins/orchestrator [punt-model]: api/models/vpp/punt/punt.proto [readme]: README.md [rest-plugin]: plugins/restapi [span-model]: api/models/vpp/interfaces/span.proto [sr-plugin]: plugins/vpp/srplugin [vpp-abf-plugin]: plugins/vpp/abfplugin [vpp-acl-plugin]: plugins/vpp/aclplugin [vpp-agent]: cmd/vpp-agent [vpp-conf-file]: docker/dev/vpp.conf [vpp-interface-plugin]: plugins/vpp/ifplugin [vpp-issue-1280]: https://jira.fd.io/browse/VPP-1280 [vpp-ipsec-plugin]: plugins/vpp/ipsecplugin [vpp-l2-plugin]: plugins/vpp/l2plugin [vpp-l3-plugin]: plugins/vpp/l3plugin [vpp-nat-plugin]: plugins/vpp/natplugin [vpp-plugins]: plugins/vpp [vpp-punt-plugin]: plugins/vpp/puntplugin [vpp-stn-plugin]: plugins/vpp/stnplugin [vpp-telemetry]: plugins/telemetry [wiki]: https://github.com/ligato/vpp-agent/wiki
VladoLavor/vpp-agent
CHANGELOG.md
Markdown
apache-2.0
63,920
[ 30522, 1001, 2689, 21197, 1031, 999, 1031, 21025, 2705, 12083, 27791, 2144, 6745, 2713, 1033, 1006, 16770, 1024, 1013, 1013, 10047, 2290, 1012, 11824, 1012, 22834, 1013, 21025, 2705, 12083, 1013, 27791, 1011, 2144, 1013, 8018, 3406, 1013, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2008 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // BOINC 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 BOINC. If not, see <http://www.gnu.org/licenses/>. // The BOINC API and runtime system. // // Notes: // 1) Thread structure: // Sequential apps // Unix // getting CPU time and suspend/resume have to be done // in the worker thread, so we use a SIGALRM signal handler. // However, many library functions and system calls // are not "asynch signal safe": see, e.g. // http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03 // (e.g. sprintf() in a signal handler hangs Mac OS X) // so we do as little as possible in the signal handler, // and do the rest in a separate "timer thread". // Win // the timer thread does everything // Multi-thread apps: // Unix: // fork // original process runs timer loop: // handle suspend/resume/quit, heartbeat (use signals) // new process call boinc_init_options() with flags to // send status messages and handle checkpoint stuff, // and returns from boinc_init_parallel() // NOTE: THIS DOESN'T RESPECT CRITICAL SECTIONS. // NEED TO MASK SIGNALS IN CHILD DURING CRITICAL SECTIONS // Win: // like sequential case, except suspend/resume must enumerate // all threads (except timer) and suspend/resume them all // // 2) All variables that are accessed by two threads (i.e. worker and timer) // MUST be declared volatile. // // 3) For compatibility with C, we use int instead of bool various places // // 4) We must periodically check that the client is still alive and exit if not. // Originally this was done using heartbeat msgs from client. // This is unreliable, e.g. if the client is blocked for a long time. // As of Oct 11 2012 we use a different mechanism: // the client passes its PID and we periodically check whether it exists. // But we need to support the heartbeat mechanism also for compatibility. // // Terminology: // The processing of a result can be divided // into multiple "episodes" (executions of the app), // each of which resumes from the checkpointed state of the previous episode. // Unless otherwise noted, "CPU time" refers to the sum over all episodes // (not counting the part after the last checkpoint in an episode). #if defined(_WIN32) && !defined(__STDWX_H__) && !defined(_BOINC_WIN_) && !defined(_AFX_STDAFX_H_) #include "boinc_win.h" #endif #ifdef _WIN32 #include "version.h" #include "win_util.h" #else #include "config.h" #include <cstdlib> #include <cstring> #include <cstdio> #include <cstdarg> #include <sys/types.h> #include <errno.h> #include <unistd.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> #include <pthread.h> #include <vector> #ifndef __EMX__ #include <sched.h> #endif #endif #include "app_ipc.h" #include "common_defs.h" #include "diagnostics.h" #include "error_numbers.h" #include "filesys.h" #include "mem_usage.h" #include "parse.h" #include "proc_control.h" #include "shmem.h" #include "str_replace.h" #include "str_util.h" #include "util.h" #include "boinc_api.h" using std::vector; //#define DEBUG_BOINC_API #ifdef __APPLE__ #include "mac_backtrace.h" #define GETRUSAGE_IN_TIMER_THREAD // call getrusage() in the timer thread, // rather than in the worker thread's signal handler // (which can cause crashes on Mac) // If you want, you can set this for Linux too: // CPPFLAGS=-DGETRUSAGE_IN_TIMER_THREAD #endif const char* api_version = "API_VERSION_" PACKAGE_VERSION; static APP_INIT_DATA aid; static FILE_LOCK file_lock; APP_CLIENT_SHM* app_client_shm = 0; static volatile int time_until_checkpoint; // time until enable checkpoint static volatile double fraction_done; static volatile double last_checkpoint_cpu_time; static volatile bool ready_to_checkpoint = false; static volatile int in_critical_section = 0; static volatile double last_wu_cpu_time; static volatile bool standalone = false; static volatile double initial_wu_cpu_time; static volatile bool have_new_trickle_up = false; static volatile bool have_trickle_down = true; // on first call, scan slot dir for msgs static volatile int heartbeat_giveup_count; // interrupt count value at which to give up on core client #ifdef _WIN32 static volatile int nrunning_ticks = 0; #endif static volatile int interrupt_count = 0; // number of timer interrupts // used to measure elapsed time in a way that's // not affected by user changing system clock, // and doesn't have big jump after hibernation static volatile int running_interrupt_count = 0; // number of timer interrupts while not suspended. // Used to compute elapsed time static volatile bool finishing; // used for worker/timer synch during boinc_finish(); static int want_network = 0; static int have_network = 1; static double bytes_sent = 0; static double bytes_received = 0; bool boinc_disable_timer_thread = false; // simulate unresponsive app by setting to true (debugging) static FUNC_PTR timer_callback = 0; char web_graphics_url[256]; bool send_web_graphics_url = false; char remote_desktop_addr[256]; bool send_remote_desktop_addr = false; int app_min_checkpoint_period = 0; // min checkpoint period requested by app #define TIMER_PERIOD 0.1 // Sleep interval for timer thread; // determines max rate of handling messages from client. // Unix: period of worker-thread timer interrupts. #define TIMERS_PER_SEC 10 // reciprocal of TIMER_PERIOD // This determines the resolution of fraction done and CPU time reporting // to the client, and of checkpoint enabling. #define HEARTBEAT_GIVEUP_SECS 30 #define HEARTBEAT_GIVEUP_COUNT ((int)(HEARTBEAT_GIVEUP_SECS/TIMER_PERIOD)) // quit if no heartbeat from core in this #interrupts #define LOCKFILE_TIMEOUT_PERIOD 35 // quit if we cannot aquire slot lock file in this #secs after startup #ifdef _WIN32 static HANDLE hSharedMem; HANDLE worker_thread_handle; // used to suspend worker thread, and to measure its CPU time DWORD timer_thread_id; #else static volatile bool worker_thread_exit_flag = false; static volatile int worker_thread_exit_status; // the above are used by the timer thread to tell // the worker thread to exit static pthread_t worker_thread_handle; static pthread_t timer_thread_handle; #ifndef GETRUSAGE_IN_TIMER_THREAD static struct rusage worker_thread_ru; #endif #endif static BOINC_OPTIONS options; volatile BOINC_STATUS boinc_status; // vars related to intermediate file upload struct UPLOAD_FILE_STATUS { std::string name; int status; }; static bool have_new_upload_file; static std::vector<UPLOAD_FILE_STATUS> upload_file_status; static int resume_activities(); static void boinc_exit(int); static void block_sigalrm(); static int start_worker_signals(); char* boinc_msg_prefix(char* sbuf, int len) { char buf[256]; struct tm tm; struct tm *tmp = &tm; int n; time_t x = time(0); if (x == -1) { strlcpy(sbuf, "time() failed", len); return sbuf; } #ifdef _WIN32 #ifdef __MINGW32__ if ((tmp = localtime(&x)) == NULL) { #else if (localtime_s(&tm, &x) == EINVAL) { #endif #else if (localtime_r(&x, &tm) == NULL) { #endif strlcpy(sbuf, "localtime() failed", len); return sbuf; } if (strftime(buf, sizeof(buf)-1, "%H:%M:%S", tmp) == 0) { strlcpy(sbuf, "strftime() failed", len); return sbuf; } #ifdef _WIN32 n = _snprintf(sbuf, len, "%s (%d):", buf, GetCurrentProcessId()); #else n = snprintf(sbuf, len, "%s (%d):", buf, getpid()); #endif if (n < 0) { strlcpy(sbuf, "sprintf() failed", len); return sbuf; } sbuf[len-1] = 0; // just in case return sbuf; } static int setup_shared_mem() { char buf[256]; if (standalone) { fprintf(stderr, "%s Standalone mode, so not using shared memory.\n", boinc_msg_prefix(buf, sizeof(buf)) ); return 0; } app_client_shm = new APP_CLIENT_SHM; #ifdef _WIN32 sprintf(buf, "%s%s", SHM_PREFIX, aid.shmem_seg_name); hSharedMem = attach_shmem(buf, (void**)&app_client_shm->shm); if (hSharedMem == NULL) { delete app_client_shm; app_client_shm = NULL; } #else #ifdef __EMX__ if (attach_shmem(aid.shmem_seg_name, (void**)&app_client_shm->shm)) { delete app_client_shm; app_client_shm = NULL; } #else if (aid.shmem_seg_name == -1) { // Version 6 Unix/Linux/Mac client if (attach_shmem_mmap(MMAPPED_FILE_NAME, (void**)&app_client_shm->shm)) { delete app_client_shm; app_client_shm = NULL; } } else { // version 5 Unix/Linux/Mac client if (attach_shmem(aid.shmem_seg_name, (void**)&app_client_shm->shm)) { delete app_client_shm; app_client_shm = NULL; } } #endif #endif // ! _WIN32 if (app_client_shm == NULL) return -1; return 0; } // a mutex for data structures shared between time and worker threads // #ifdef _WIN32 static HANDLE mutex; static void init_mutex() { mutex = CreateMutex(NULL, FALSE, NULL); } static inline void acquire_mutex() { WaitForSingleObject(mutex, INFINITE); } static inline void release_mutex() { ReleaseMutex(mutex); } #else pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static void init_mutex() {} static inline void acquire_mutex() { #ifdef DEBUG_BOINC_API char buf[256]; fprintf(stderr, "%s acquiring mutex\n", boinc_msg_prefix(buf, sizeof(buf)) ); #endif pthread_mutex_lock(&mutex); } static inline void release_mutex() { #ifdef DEBUG_BOINC_API char buf[256]; fprintf(stderr, "%s releasing mutex\n", boinc_msg_prefix(buf, sizeof(buf)) ); #endif pthread_mutex_unlock(&mutex); } #endif // Return CPU time of process. // double boinc_worker_thread_cpu_time() { double cpu; #ifdef _WIN32 int retval; retval = boinc_process_cpu_time(GetCurrentProcess(), cpu); if (retval) { cpu = nrunning_ticks * TIMER_PERIOD; // for Win9x } #else #ifdef GETRUSAGE_IN_TIMER_THREAD struct rusage worker_thread_ru; getrusage(RUSAGE_SELF, &worker_thread_ru); #endif cpu = (double)worker_thread_ru.ru_utime.tv_sec + (((double)worker_thread_ru.ru_utime.tv_usec)/1000000.0); cpu += (double)worker_thread_ru.ru_stime.tv_sec + (((double)worker_thread_ru.ru_stime.tv_usec)/1000000.0); #endif return cpu; } // Communicate to the core client (via shared mem) // the current CPU time and fraction done. // NOTE: various bugs could cause some of these FP numbers to be enormous, // possibly overflowing the buffer. // So use strlcat() instead of strcat() // // This is called only from the timer thread (so no need for synch) // static bool update_app_progress(double cpu_t, double cp_cpu_t) { char msg_buf[MSG_CHANNEL_SIZE], buf[256]; if (standalone) return true; sprintf(msg_buf, "<current_cpu_time>%e</current_cpu_time>\n" "<checkpoint_cpu_time>%e</checkpoint_cpu_time>\n", cpu_t, cp_cpu_t ); if (want_network) { strlcat(msg_buf, "<want_network>1</want_network>\n", sizeof(msg_buf)); } if (fraction_done >= 0) { double range = aid.fraction_done_end - aid.fraction_done_start; double fdone = aid.fraction_done_start + fraction_done*range; sprintf(buf, "<fraction_done>%e</fraction_done>\n", fdone); strlcat(msg_buf, buf, sizeof(msg_buf)); } if (bytes_sent) { sprintf(buf, "<bytes_sent>%f</bytes_sent>\n", bytes_sent); strlcat(msg_buf, buf, sizeof(msg_buf)); } if (bytes_received) { sprintf(buf, "<bytes_received>%f</bytes_received>\n", bytes_received); strlcat(msg_buf, buf, sizeof(msg_buf)); } return app_client_shm->shm->app_status.send_msg(msg_buf); } static void handle_heartbeat_msg() { char buf[MSG_CHANNEL_SIZE]; double dtemp; bool btemp; if (app_client_shm->shm->heartbeat.get_msg(buf)) { boinc_status.network_suspended = false; if (match_tag(buf, "<heartbeat/>")) { heartbeat_giveup_count = interrupt_count + HEARTBEAT_GIVEUP_COUNT; } if (parse_double(buf, "<wss>", dtemp)) { boinc_status.working_set_size = dtemp; } if (parse_double(buf, "<max_wss>", dtemp)) { boinc_status.max_working_set_size = dtemp; } if (parse_bool(buf, "suspend_network", btemp)) { boinc_status.network_suspended = btemp; } } } static bool client_dead() { char buf[256]; bool dead; if (aid.client_pid) { // check every 10 sec // if (interrupt_count%(TIMERS_PER_SEC*10)) return false; #ifdef _WIN32 HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, aid.client_pid); // If the process exists but is running under a different user account (boinc_master) // then the handle returned is NULL and GetLastError() returns ERROR_ACCESS_DENIED. // if ((h == NULL) && (GetLastError() != ERROR_ACCESS_DENIED)) { dead = true; } else { if (h) CloseHandle(h); dead = false; } #else int retval = kill(aid.client_pid, 0); dead = (retval == -1 && errno == ESRCH); #endif } else { dead = (interrupt_count > heartbeat_giveup_count); } if (dead) { boinc_msg_prefix(buf, sizeof(buf)); fputs(buf, stderr); // don't use fprintf() here if (aid.client_pid) { fputs(" BOINC client no longer exists - exiting\n", stderr); } else { fputs(" No heartbeat from client for 30 sec - exiting\n", stderr); } return true; } return false; } #ifndef _WIN32 // For multithread apps on Unix, the main process executes the following. // static void parallel_master(int child_pid) { char buf[MSG_CHANNEL_SIZE]; int exit_status; while (1) { boinc_sleep(TIMER_PERIOD); interrupt_count++; if (app_client_shm) { handle_heartbeat_msg(); if (app_client_shm->shm->process_control_request.get_msg(buf)) { if (match_tag(buf, "<suspend/>")) { kill(child_pid, SIGSTOP); } else if (match_tag(buf, "<resume/>")) { kill(child_pid, SIGCONT); } else if (match_tag(buf, "<quit/>")) { kill(child_pid, SIGKILL); exit(0); } else if (match_tag(buf, "<abort/>")) { kill(child_pid, SIGKILL); exit(EXIT_ABORTED_BY_CLIENT); } } if (client_dead()) { kill(child_pid, SIGKILL); exit(0); } } if (interrupt_count % TIMERS_PER_SEC) continue; if (waitpid(child_pid, &exit_status, WNOHANG) == child_pid) break; } boinc_finish(exit_status); } #endif int boinc_init() { int retval; if (!diagnostics_is_initialized()) { retval = boinc_init_diagnostics(BOINC_DIAG_DEFAULTS); if (retval) return retval; } boinc_options_defaults(options); return boinc_init_options(&options); } int boinc_init_options(BOINC_OPTIONS* opt) { int retval; #ifndef _WIN32 if (options.multi_thread) { int child_pid = fork(); if (child_pid) { // original process - master // options.send_status_msgs = false; retval = boinc_init_options_general(options); if (retval) { kill(child_pid, SIGKILL); return retval; } parallel_master(child_pid); } // new process - slave // options.main_program = false; options.check_heartbeat = false; options.handle_process_control = false; options.multi_thread = false; options.multi_process = false; return boinc_init_options(&options); } #endif retval = boinc_init_options_general(*opt); if (retval) return retval; retval = start_timer_thread(); if (retval) return retval; #ifndef _WIN32 retval = start_worker_signals(); if (retval) return retval; #endif return 0; } int boinc_init_parallel() { BOINC_OPTIONS _options; boinc_options_defaults(_options); _options.multi_thread = true; return boinc_init_options(&_options); } static int min_checkpoint_period() { int x = (int)aid.checkpoint_period; if (app_min_checkpoint_period > x) { x = app_min_checkpoint_period; } if (x == 0) x = DEFAULT_CHECKPOINT_PERIOD; return x; } int boinc_set_min_checkpoint_period(int x) { app_min_checkpoint_period = x; if (x > time_until_checkpoint) { time_until_checkpoint = x; } return 0; } int boinc_init_options_general(BOINC_OPTIONS& opt) { int retval; char buf[256]; options = opt; if (!diagnostics_is_initialized()) { retval = boinc_init_diagnostics(BOINC_DIAG_DEFAULTS); if (retval) return retval; } boinc_status.no_heartbeat = false; boinc_status.suspended = false; boinc_status.quit_request = false; boinc_status.abort_request = false; if (options.main_program) { // make sure we're the only app running in this slot // retval = file_lock.lock(LOCKFILE); if (retval) { // give any previous occupant a chance to timeout and exit // fprintf(stderr, "%s Can't acquire lockfile (%d) - waiting %ds\n", boinc_msg_prefix(buf, sizeof(buf)), retval, LOCKFILE_TIMEOUT_PERIOD ); boinc_sleep(LOCKFILE_TIMEOUT_PERIOD); retval = file_lock.lock(LOCKFILE); } if (retval) { fprintf(stderr, "%s Can't acquire lockfile (%d) - exiting\n", boinc_msg_prefix(buf, sizeof(buf)), retval ); #ifdef _WIN32 char buf2[256]; windows_format_error_string(GetLastError(), buf2, 256); fprintf(stderr, "%s Error: %s\n", boinc_msg_prefix(buf, sizeof(buf)), buf2); #endif // if we can't acquire the lock file there must be // another app instance running in this slot. // If we exit(0), the client will keep restarting us. // Instead, tell the client not to restart us for 10 min. // boinc_temporary_exit(600, "Waiting to acquire lock"); } } retval = boinc_parse_init_data_file(); if (retval) { standalone = true; } else { retval = setup_shared_mem(); if (retval) { fprintf(stderr, "%s Can't set up shared mem: %d. Will run in standalone mode.\n", boinc_msg_prefix(buf, sizeof(buf)), retval ); standalone = true; } } // copy the WU CPU time to a separate var, // since we may reread the structure again later. // initial_wu_cpu_time = aid.wu_cpu_time; fraction_done = -1; time_until_checkpoint = min_checkpoint_period(); last_checkpoint_cpu_time = aid.wu_cpu_time; last_wu_cpu_time = aid.wu_cpu_time; if (standalone) { options.check_heartbeat = false; } heartbeat_giveup_count = interrupt_count + HEARTBEAT_GIVEUP_COUNT; init_mutex(); return 0; } int boinc_get_status(BOINC_STATUS *s) { s->no_heartbeat = boinc_status.no_heartbeat; s->suspended = boinc_status.suspended; s->quit_request = boinc_status.quit_request; s->reread_init_data_file = boinc_status.reread_init_data_file; s->abort_request = boinc_status.abort_request; s->working_set_size = boinc_status.working_set_size; s->max_working_set_size = boinc_status.max_working_set_size; s->network_suspended = boinc_status.network_suspended; return 0; } // if we have any new trickle-ups or file upload requests, // send a message describing them // static void send_trickle_up_msg() { char buf[MSG_CHANNEL_SIZE]; BOINCINFO("Sending Trickle Up Message"); if (standalone) return; strcpy(buf, ""); if (have_new_trickle_up) { strcat(buf, "<have_new_trickle_up/>\n"); } if (have_new_upload_file) { strcat(buf, "<have_new_upload_file/>\n"); } if (strlen(buf)) { if (app_client_shm->shm->trickle_up.send_msg(buf)) { have_new_trickle_up = false; have_new_upload_file = false; } } } // NOTE: a non-zero status tells the core client that we're exiting with // an "unrecoverable error", which will be reported back to server. // A zero exit-status tells the client we've successfully finished the result. // int boinc_finish(int status) { char buf[256]; fraction_done = 1; fprintf(stderr, "%s called boinc_finish(%d)\n", boinc_msg_prefix(buf, sizeof(buf)), status ); finishing = true; boinc_sleep(2.0); // let the timer thread send final messages boinc_disable_timer_thread = true; // then disable it if (options.main_program && status==0) { FILE* f = fopen(BOINC_FINISH_CALLED_FILE, "w"); if (f) fclose(f); } boinc_exit(status); return 0; // never reached } int boinc_temporary_exit(int delay, const char* reason) { FILE* f = fopen(TEMPORARY_EXIT_FILE, "w"); if (!f) { return ERR_FOPEN; } fprintf(f, "%d\n", delay); if (reason) { fprintf(f, "%s\n", reason); } fclose(f); boinc_exit(0); return 0; } // unlock the lockfile and call the appropriate exit function // Unix: called only from the worker thread. // Win: called from the worker or timer thread. // // make static eventually // void boinc_exit(int status) { int retval; char buf[256]; if (options.main_program && file_lock.locked) { retval = file_lock.unlock(LOCKFILE); if (retval) { #ifdef _WIN32 windows_format_error_string(GetLastError(), buf, 256); fprintf(stderr, "%s Can't unlock lockfile (%d): %s\n", boinc_msg_prefix(buf, sizeof(buf)), retval, buf ); #else fprintf(stderr, "%s Can't unlock lockfile (%d)\n", boinc_msg_prefix(buf, sizeof(buf)), retval ); perror("file unlock failed"); #endif } } // kill any processes the app may have created // if (options.multi_process) { kill_descendants(); } boinc_finish_diag(); // various platforms have problems shutting down a process // while other threads are still executing, // or triggering endless exit()/atexit() loops. // BOINCINFO("Exit Status: %d", status); fflush(NULL); #if defined(_WIN32) // Halt all the threads and clean up. TerminateProcess(GetCurrentProcess(), status); // note: the above CAN return! Sleep(1000); DebugBreak(); #elif defined(__APPLE_CC__) // stops endless exit()/atexit() loops. _exit(status); #else // arrange to exit with given status even if errors happen // in atexit() functions // set_signal_exit_code(status); exit(status); #endif } void boinc_network_usage(double sent, double received) { bytes_sent = sent; bytes_received = received; } int boinc_is_standalone() { if (standalone) return 1; return 0; } static void exit_from_timer_thread(int status) { #ifdef DEBUG_BOINC_API char buf[256]; fprintf(stderr, "%s exit_from_timer_thread(%d) called\n", boinc_msg_prefix(buf, sizeof(buf)), status ); #endif #ifdef _WIN32 // TerminateProcess() doesn't work if there are suspended threads? if (boinc_status.suspended) { resume_activities(); } // this seems to work OK on Windows // boinc_exit(status); #else // but on Unix there are synchronization problems; // set a flag telling the worker thread to exit // worker_thread_exit_status = status; worker_thread_exit_flag = true; pthread_exit(NULL); #endif } // parse the init data file. // This is done at startup, and also if a "reread prefs" message is received // int boinc_parse_init_data_file() { FILE* f; int retval; char buf[256]; if (aid.project_preferences) { free(aid.project_preferences); aid.project_preferences = NULL; } aid.clear(); aid.checkpoint_period = DEFAULT_CHECKPOINT_PERIOD; if (!boinc_file_exists(INIT_DATA_FILE)) { fprintf(stderr, "%s Can't open init data file - running in standalone mode\n", boinc_msg_prefix(buf, sizeof(buf)) ); return ERR_FOPEN; } f = boinc_fopen(INIT_DATA_FILE, "r"); retval = parse_init_data_file(f, aid); fclose(f); if (retval) { fprintf(stderr, "%s Can't parse init data file - running in standalone mode\n", boinc_msg_prefix(buf, sizeof(buf)) ); return retval; } return 0; } int boinc_report_app_status_aux( double cpu_time, double checkpoint_cpu_time, double _fraction_done, int other_pid, double _bytes_sent, double _bytes_received ) { char msg_buf[MSG_CHANNEL_SIZE], buf[1024]; if (standalone) return 0; sprintf(msg_buf, "<current_cpu_time>%e</current_cpu_time>\n" "<checkpoint_cpu_time>%e</checkpoint_cpu_time>\n" "<fraction_done>%e</fraction_done>\n", cpu_time, checkpoint_cpu_time, _fraction_done ); if (other_pid) { sprintf(buf, "<other_pid>%d</other_pid>\n", other_pid); strcat(msg_buf, buf); } if (_bytes_sent) { sprintf(buf, "<bytes_sent>%f</bytes_sent>\n", _bytes_sent); strcat(msg_buf, buf); } if (_bytes_received) { sprintf(buf, "<bytes_received>%f</bytes_received>\n", _bytes_received); strcat(msg_buf, buf); } if (app_client_shm->shm->app_status.send_msg(msg_buf)) { return 0; } return ERR_WRITE; } int boinc_report_app_status( double cpu_time, double checkpoint_cpu_time, double _fraction_done ){ return boinc_report_app_status_aux( cpu_time, checkpoint_cpu_time, _fraction_done, 0, 0, 0 ); } int boinc_get_init_data_p(APP_INIT_DATA* app_init_data) { *app_init_data = aid; return 0; } int boinc_get_init_data(APP_INIT_DATA& app_init_data) { app_init_data = aid; return 0; } int boinc_wu_cpu_time(double& cpu_t) { cpu_t = last_wu_cpu_time; return 0; } // Suspend this job. // Can be called from either timer or worker thread. // static int suspend_activities(bool called_from_worker) { #ifdef DEBUG_BOINC_API char log_buf[256]; fprintf(stderr, "%s suspend_activities() called from %s\n", boinc_msg_prefix(log_buf, sizeof(log_buf)), called_from_worker?"worker thread":"timer thread" ); #endif #ifdef _WIN32 static vector<int> pids; if (options.multi_thread) { if (pids.size() == 0) { pids.push_back(GetCurrentProcessId()); } suspend_or_resume_threads(pids, timer_thread_id, false, true); } else { SuspendThread(worker_thread_handle); } #else if (options.multi_process) { suspend_or_resume_descendants(false); } // if called from worker thread, sleep until suspension is over // if called from time thread, don't need to do anything; // suspension is done by signal handler in worker thread // if (called_from_worker) { while (boinc_status.suspended) { sleep(1); } } #endif return 0; } int resume_activities() { #ifdef DEBUG_BOINC_API char log_buf[256]; fprintf(stderr, "%s resume_activities()\n", boinc_msg_prefix(log_buf, sizeof(log_buf)) ); #endif #ifdef _WIN32 static vector<int> pids; if (options.multi_thread) { if (pids.size() == 0) pids.push_back(GetCurrentProcessId()); suspend_or_resume_threads(pids, timer_thread_id, true, true); } else { ResumeThread(worker_thread_handle); } #else if (options.multi_process) { suspend_or_resume_descendants(true); } #endif return 0; } static void handle_upload_file_status() { char path[MAXPATHLEN], buf[256], log_name[256], *p, log_buf[256]; std::string filename; int status; relative_to_absolute("", path); DirScanner dirscan(path); while (dirscan.scan(filename)) { strlcpy(buf, filename.c_str(), sizeof(buf)); if (strstr(buf, UPLOAD_FILE_STATUS_PREFIX) != buf) continue; strlcpy(log_name, buf+strlen(UPLOAD_FILE_STATUS_PREFIX), sizeof(log_name)); FILE* f = boinc_fopen(filename.c_str(), "r"); if (!f) { fprintf(stderr, "%s handle_file_upload_status: can't open %s\n", boinc_msg_prefix(buf, sizeof(buf)), filename.c_str() ); continue; } p = fgets(buf, sizeof(buf), f); fclose(f); if (p && parse_int(buf, "<status>", status)) { UPLOAD_FILE_STATUS uf; uf.name = std::string(log_name); uf.status = status; upload_file_status.push_back(uf); } else { fprintf(stderr, "%s handle_upload_file_status: can't parse %s\n", boinc_msg_prefix(log_buf, sizeof(log_buf)), buf ); } } } // handle trickle and file upload messages // static void handle_trickle_down_msg() { char buf[MSG_CHANNEL_SIZE]; if (app_client_shm->shm->trickle_down.get_msg(buf)) { BOINCINFO("Received Trickle Down Message"); if (match_tag(buf, "<have_trickle_down/>")) { have_trickle_down = true; } if (match_tag(buf, "<upload_file_status/>")) { handle_upload_file_status(); } } } // This flag is set of we get a suspend request while in a critical section, // and options.direct_process_action is set. // As soon as we're not in the critical section we'll do the suspend. // static bool suspend_request = false; // runs in timer thread // static void handle_process_control_msg() { char buf[MSG_CHANNEL_SIZE]; if (app_client_shm->shm->process_control_request.get_msg(buf)) { acquire_mutex(); #ifdef DEBUG_BOINC_API char log_buf[256]; fprintf(stderr, "%s got process control msg %s\n", boinc_msg_prefix(log_buf, sizeof(log_buf)), buf ); #endif if (match_tag(buf, "<suspend/>")) { BOINCINFO("Received suspend message"); if (options.direct_process_action) { if (in_critical_section) { suspend_request = true; } else { boinc_status.suspended = true; suspend_request = false; suspend_activities(false); } } else { boinc_status.suspended = true; } } if (match_tag(buf, "<resume/>")) { BOINCINFO("Received resume message"); if (options.direct_process_action) { if (boinc_status.suspended) { resume_activities(); } else if (suspend_request) { suspend_request = false; } } boinc_status.suspended = false; } if (boinc_status.quit_request || match_tag(buf, "<quit/>")) { BOINCINFO("Received quit message"); boinc_status.quit_request = true; if (!in_critical_section && options.direct_process_action) { exit_from_timer_thread(0); } } if (boinc_status.abort_request || match_tag(buf, "<abort/>")) { BOINCINFO("Received abort message"); boinc_status.abort_request = true; if (!in_critical_section && options.direct_process_action) { diagnostics_set_aborted_via_gui(); #if defined(_WIN32) // Cause a controlled assert and dump the callstacks. DebugBreak(); #elif defined(__APPLE__) PrintBacktrace(); #endif release_mutex(); exit_from_timer_thread(EXIT_ABORTED_BY_CLIENT); } } if (match_tag(buf, "<reread_app_info/>")) { boinc_status.reread_init_data_file = true; } if (match_tag(buf, "<network_available/>")) { have_network = 1; } release_mutex(); } } // timer handler; runs in the timer thread // static void timer_handler() { char buf[512]; #ifdef DEBUG_BOINC_API fprintf(stderr, "%s timer handler: disabled %s; in critical section %s; finishing %s\n", boinc_msg_prefix(buf, sizeof(buf)), boinc_disable_timer_thread?"yes":"no", in_critical_section?"yes":"no", finishing?"yes":"no" ); #endif if (boinc_disable_timer_thread) { return; } if (finishing) { if (options.send_status_msgs) { double cur_cpu = boinc_worker_thread_cpu_time(); last_wu_cpu_time = cur_cpu + initial_wu_cpu_time; update_app_progress(last_wu_cpu_time, last_checkpoint_cpu_time); } boinc_disable_timer_thread = true; return; } interrupt_count++; if (!boinc_status.suspended) { running_interrupt_count++; } // handle messages from the core client // if (app_client_shm) { if (options.check_heartbeat) { handle_heartbeat_msg(); } if (options.handle_trickle_downs) { handle_trickle_down_msg(); } if (options.handle_process_control) { handle_process_control_msg(); } } if (interrupt_count % TIMERS_PER_SEC) return; #ifdef DEBUG_BOINC_API fprintf(stderr, "%s 1 sec elapsed - doing slow actions\n", boinc_msg_prefix(buf, sizeof(buf))); #endif // here if we're at a one-second boundary; do slow stuff // if (!ready_to_checkpoint) { time_until_checkpoint -= 1; if (time_until_checkpoint <= 0) { ready_to_checkpoint = true; } } // see if the core client has died, which means we need to die too // (unless we're in a critical section) // if (in_critical_section==0 && options.check_heartbeat) { if (client_dead()) { fprintf(stderr, "%s timer handler: client dead, exiting\n", boinc_msg_prefix(buf, sizeof(buf)) ); if (options.direct_process_action) { exit_from_timer_thread(0); } else { boinc_status.no_heartbeat = true; } } } // don't bother reporting CPU time etc. if we're suspended // if (options.send_status_msgs && !boinc_status.suspended) { double cur_cpu = boinc_worker_thread_cpu_time(); last_wu_cpu_time = cur_cpu + initial_wu_cpu_time; update_app_progress(last_wu_cpu_time, last_checkpoint_cpu_time); } if (options.handle_trickle_ups) { send_trickle_up_msg(); } if (timer_callback) { timer_callback(); } // send graphics-related messages // if (send_web_graphics_url && !app_client_shm->shm->graphics_reply.has_msg()) { sprintf(buf, "<web_graphics_url>%s</web_graphics_url>", web_graphics_url ); app_client_shm->shm->graphics_reply.send_msg(buf); send_web_graphics_url = false; } if (send_remote_desktop_addr && !app_client_shm->shm->graphics_reply.has_msg()) { sprintf(buf, "<remote_desktop_addr>%s</remote_desktop_addr>", remote_desktop_addr ); app_client_shm->shm->graphics_reply.send_msg(buf); send_remote_desktop_addr = false; } } #ifdef _WIN32 DWORD WINAPI timer_thread(void *) { while (1) { Sleep((int)(TIMER_PERIOD*1000)); timer_handler(); // poor man's CPU time accounting for Win9x // if (!boinc_status.suspended) { nrunning_ticks++; } } return 0; } #else static void* timer_thread(void*) { block_sigalrm(); while(1) { boinc_sleep(TIMER_PERIOD); timer_handler(); } return 0; } // This SIGALRM handler gets handled only by the worker thread. // It gets CPU time and implements sleeping. // It must call only signal-safe functions, and must not do FP math // static void worker_signal_handler(int) { #ifndef GETRUSAGE_IN_TIMER_THREAD getrusage(RUSAGE_SELF, &worker_thread_ru); #endif if (worker_thread_exit_flag) { boinc_exit(worker_thread_exit_status); } if (options.direct_process_action) { while (boinc_status.suspended && in_critical_section==0) { #ifdef ANDROID // per-thread signal masking doesn't work // on old (pre-4.1) versions of Android. // If we're handling this signal in the timer thread, // send signal explicitly to worker thread. // if (pthread_self() == timer_thread_handle) { pthread_kill(worker_thread_handle, SIGALRM); return; } #endif sleep(1); // don't use boinc_sleep() because it does FP math } } } #endif // Called from the worker thread; create the timer thread // int start_timer_thread() { char buf[256]; #ifdef _WIN32 // get the worker thread handle // DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &worker_thread_handle, 0, FALSE, DUPLICATE_SAME_ACCESS ); // Create the timer thread // if (!CreateThread(NULL, 0, timer_thread, 0, 0, &timer_thread_id)) { fprintf(stderr, "%s start_timer_thread(): CreateThread() failed, errno %d\n", boinc_msg_prefix(buf, sizeof(buf)), errno ); return errno; } if (!options.normal_thread_priority) { // lower our (worker thread) priority // SetThreadPriority(worker_thread_handle, THREAD_PRIORITY_IDLE); } #else worker_thread_handle = pthread_self(); pthread_attr_t thread_attrs; pthread_attr_init(&thread_attrs); pthread_attr_setstacksize(&thread_attrs, 32768); int retval = pthread_create(&timer_thread_handle, &thread_attrs, timer_thread, NULL); if (retval) { fprintf(stderr, "%s start_timer_thread(): pthread_create(): %d", boinc_msg_prefix(buf, sizeof(buf)), retval ); return retval; } #endif return 0; } #ifndef _WIN32 // set up a periodic SIGALRM, to be handled by the worker thread // static int start_worker_signals() { int retval; struct sigaction sa; itimerval value; sa.sa_handler = worker_signal_handler; sa.sa_flags = SA_RESTART; sigemptyset(&sa.sa_mask); retval = sigaction(SIGALRM, &sa, NULL); if (retval) { perror("boinc start_timer_thread() sigaction"); return retval; } value.it_value.tv_sec = 0; value.it_value.tv_usec = (int)(TIMER_PERIOD*1e6); value.it_interval = value.it_value; retval = setitimer(ITIMER_REAL, &value, NULL); if (retval) { perror("boinc start_timer_thread() setitimer"); return retval; } return 0; } #endif int boinc_send_trickle_up(char* variety, char* p) { if (!options.handle_trickle_ups) return ERR_NO_OPTION; FILE* f = boinc_fopen(TRICKLE_UP_FILENAME, "wb"); if (!f) return ERR_FOPEN; fprintf(f, "<variety>%s</variety>\n", variety); size_t n = fwrite(p, strlen(p), 1, f); fclose(f); if (n != 1) return ERR_WRITE; have_new_trickle_up = true; return 0; } int boinc_time_to_checkpoint() { if (ready_to_checkpoint) { boinc_begin_critical_section(); return 1; } return 0; } int boinc_checkpoint_completed() { double cur_cpu; cur_cpu = boinc_worker_thread_cpu_time(); last_wu_cpu_time = cur_cpu + aid.wu_cpu_time; last_checkpoint_cpu_time = last_wu_cpu_time; time_until_checkpoint = min_checkpoint_period(); boinc_end_critical_section(); ready_to_checkpoint = false; return 0; } void boinc_begin_critical_section() { #ifdef DEBUG_BOINC_API char buf[256]; fprintf(stderr, "%s begin_critical_section\n", boinc_msg_prefix(buf, sizeof(buf)) ); #endif in_critical_section++; } void boinc_end_critical_section() { #ifdef DEBUG_BOINC_API char buf[256]; fprintf(stderr, "%s end_critical_section\n", boinc_msg_prefix(buf, sizeof(buf)) ); #endif in_critical_section--; if (in_critical_section < 0) { in_critical_section = 0; // just in case } if (in_critical_section) return; // We're out of the critical section. // See if we got suspend/quit/abort while in critical section, // and handle them here. // if (boinc_status.quit_request) { boinc_exit(0); } if (boinc_status.abort_request) { boinc_exit(EXIT_ABORTED_BY_CLIENT); } if (options.direct_process_action) { acquire_mutex(); if (suspend_request) { suspend_request = false; boinc_status.suspended = true; release_mutex(); suspend_activities(true); } else { release_mutex(); } } } int boinc_fraction_done(double x) { fraction_done = x; return 0; } int boinc_receive_trickle_down(char* buf, int len) { std::string filename; char path[MAXPATHLEN]; if (!options.handle_trickle_downs) return false; if (have_trickle_down) { relative_to_absolute("", path); DirScanner dirscan(path); while (dirscan.scan(filename)) { if (strstr(filename.c_str(), "trickle_down")) { strncpy(buf, filename.c_str(), len); return true; } } have_trickle_down = false; } return false; } int boinc_upload_file(std::string& name) { char buf[256]; std::string pname; int retval; retval = boinc_resolve_filename_s(name.c_str(), pname); if (retval) return retval; sprintf(buf, "%s%s", UPLOAD_FILE_REQ_PREFIX, name.c_str()); FILE* f = boinc_fopen(buf, "w"); if (!f) return ERR_FOPEN; have_new_upload_file = true; fclose(f); return 0; } int boinc_upload_status(std::string& name) { for (unsigned int i=0; i<upload_file_status.size(); i++) { UPLOAD_FILE_STATUS& ufs = upload_file_status[i]; if (ufs.name == name) { return ufs.status; } } return ERR_NOT_FOUND; } void boinc_need_network() { want_network = 1; have_network = 0; } int boinc_network_poll() { return have_network?0:1; } void boinc_network_done() { want_network = 0; } #ifndef _WIN32 // block SIGALRM, so that the worker thread will be forced to handle it // static void block_sigalrm() { sigset_t mask; sigemptyset(&mask); sigaddset(&mask, SIGALRM); pthread_sigmask(SIG_BLOCK, &mask, NULL); } #endif void boinc_register_timer_callback(FUNC_PTR p) { timer_callback = p; } double boinc_get_fraction_done() { return fraction_done; } double boinc_elapsed_time() { return running_interrupt_count*TIMER_PERIOD; } void boinc_web_graphics_url(char* url) { if (standalone) return; strlcpy(web_graphics_url, url, sizeof(web_graphics_url)); send_web_graphics_url = true; } void boinc_remote_desktop_addr(char* addr) { if (standalone) return; strlcpy(remote_desktop_addr, addr, sizeof(remote_desktop_addr)); send_remote_desktop_addr = true; }
hanxue/Boinc
api/boinc_api.cpp
C++
gpl-3.0
44,618
[ 30522, 1013, 1013, 2023, 5371, 2003, 2112, 1997, 8945, 2378, 2278, 1012, 1013, 1013, 8299, 1024, 1013, 1013, 8945, 2378, 2278, 1012, 8256, 1012, 3968, 2226, 1013, 1013, 9385, 1006, 1039, 1007, 2263, 2118, 1997, 2662, 1013, 1013, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */ /* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */ export default {"viewBox":"0 0 100 100","xmlns":"http://www.w3.org/2000/svg","path":{"d":"M50.6 52.9c2.6-3.7 5.3-5.6 7.1-8.4 3.2-4.8 3.9-11.6 1.8-16.8-2.1-5.3-7-8.4-12.7-8.3S36.5 23 34.7 28.3c-2.1 5.8-1.2 12.8 3.5 17.2 1.9 1.8 3.7 4.7 2.7 7.4-.9 2.6-4 3.7-6.2 4.8-5 2.2-11.1 5.3-12.1 11.2-1 4.9 2.3 10 7.6 10h23.3c1 0 1.9-1.2 1.3-1.9-3.2-3.7-6.6-8.7-6.6-13.6-.3-3.5.7-7.4 2.4-10.5zm14.2 13.5c-2.7 0-5-2.2-5-4.9s2.2-4.9 5-4.9c2.7 0 5 2.2 5 4.9.1 2.7-2.3 4.9-5 4.9zm0-16.8c-6.6 0-11.9 5.3-11.9 11.9 0 8.1 8.5 15.8 11.1 17.7.4.4 1 .4 1.6 0 2.6-2.1 11.1-9.6 11.1-17.7 0-6.6-5.3-11.9-11.9-11.9z"}};
salesforce/design-system-react
icons/standard/visits.js
JavaScript
bsd-3-clause
746
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2325, 1011, 2556, 1010, 4341, 14821, 1012, 4012, 1010, 4297, 1012, 2035, 2916, 9235, 1008, 1013, 1013, 1008, 7000, 2104, 18667, 2094, 1017, 1011, 11075, 1011, 2156, 6105, 1012, 19067, 2102, 2030, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
body { background-image: url('../img/abaker-ui-read-hand.png'); background-repeat: no-repeat; background-size: cover; background-position:center center; } .overlay { }
drking0211/Whoswho-android
baker/src/main/assets/abaker_usage/css/read.css
CSS
bsd-3-clause
184
[ 30522, 2303, 1063, 4281, 1011, 3746, 1024, 24471, 2140, 1006, 1005, 1012, 1012, 1013, 10047, 2290, 1013, 19557, 5484, 1011, 21318, 1011, 3191, 1011, 2192, 1012, 1052, 3070, 1005, 1007, 1025, 4281, 1011, 9377, 1024, 2053, 1011, 9377, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/******************************************************************************* * Copyright (c) 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package com.ibm.ws.jpa.fvt.entity.tests.web; import java.util.HashMap; import javax.annotation.PostConstruct; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceContext; import javax.persistence.PersistenceUnit; import javax.servlet.annotation.WebServlet; import org.junit.Test; import com.ibm.ws.jpa.fvt.entity.testlogic.EmbeddableIDTestLogic; import com.ibm.ws.testtooling.testinfo.JPAPersistenceContext; import com.ibm.ws.testtooling.testinfo.JPAPersistenceContext.PersistenceContextType; import com.ibm.ws.testtooling.testinfo.JPAPersistenceContext.PersistenceInjectionType; import com.ibm.ws.testtooling.vehicle.web.JPATestServlet; @SuppressWarnings("serial") @WebServlet(urlPatterns = "/EmbeddableIDTestServlet") public class EmbeddableIDTestServlet extends JPATestServlet { // Container Managed Transaction Scope @PersistenceContext(unitName = "ENTITY_JTA") private EntityManager cmtsEm; // Application Managed JTA @PersistenceUnit(unitName = "ENTITY_JTA") private EntityManagerFactory amjtaEmf; // Application Managed Resource-Local @PersistenceUnit(unitName = "ENTITY_RL") private EntityManagerFactory amrlEmf; @PostConstruct private void initFAT() { testClassName = EmbeddableIDTestLogic.class.getName(); jpaPctxMap.put("test-jpa-resource-amjta", new JPAPersistenceContext("test-jpa-resource-amjta", PersistenceContextType.APPLICATION_MANAGED_JTA, PersistenceInjectionType.FIELD, "amjtaEmf")); jpaPctxMap.put("test-jpa-resource-amrl", new JPAPersistenceContext("test-jpa-resource-amrl", PersistenceContextType.APPLICATION_MANAGED_RL, PersistenceInjectionType.FIELD, "amrlEmf")); jpaPctxMap.put("test-jpa-resource-cmts", new JPAPersistenceContext("test-jpa-resource-cmts", PersistenceContextType.CONTAINER_MANAGED_TS, PersistenceInjectionType.FIELD, "cmtsEm")); } @Test public void jpa10_Entity_EmbeddableID_Ano_AMJTA_Web() throws Exception { final String testName = "jpa10_Entity_EmbeddableID_Ano_AMJTA_Web"; final String testMethod = "testEmbeddableIDClass001"; final String testResource = "test-jpa-resource-amjta"; HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>(); properties.put("EntityName", "EmbeddableIdEntity"); executeTest(testName, testMethod, testResource, properties); } @Test public void jpa10_Entity_EmbeddableID_XML_AMJTA_Web() throws Exception { final String testName = "jpa10_Entity_EmbeddableID_XML_AMJTA_Web"; final String testMethod = "testEmbeddableIDClass001"; final String testResource = "test-jpa-resource-amjta"; HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>(); properties.put("EntityName", "XMLEmbeddableIdEntity"); executeTest(testName, testMethod, testResource, properties); } @Test public void jpa10_Entity_EmbeddableID_Ano_AMRL_Web() throws Exception { final String testName = "jpa10_Entity_EmbeddableID_Ano_AMRL_Web"; final String testMethod = "testEmbeddableIDClass001"; final String testResource = "test-jpa-resource-amrl"; HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>(); properties.put("EntityName", "EmbeddableIdEntity"); executeTest(testName, testMethod, testResource, properties); } @Test public void jpa10_Entity_EmbeddableID_XML_AMRL_Web() throws Exception { final String testName = "jpa10_Entity_EmbeddableID_XML_AMRL_Web"; final String testMethod = "testEmbeddableIDClass001"; final String testResource = "test-jpa-resource-amrl"; HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>(); properties.put("EntityName", "XMLEmbeddableIdEntity"); executeTest(testName, testMethod, testResource, properties); } @Test public void jpa10_Entity_EmbeddableID_Ano_CMTS_Web() throws Exception { final String testName = "jpa10_Entity_EmbeddableID_Ano_CMTS_Web"; final String testMethod = "testEmbeddableIDClass001"; final String testResource = "test-jpa-resource-cmts"; HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>(); properties.put("EntityName", "EmbeddableIdEntity"); executeTest(testName, testMethod, testResource, properties); } @Test public void jpa10_Entity_EmbeddableID_XML_CMTS_Web() throws Exception { final String testName = "jpa10_Entity_EmbeddableID_XML_CMTS_Web"; final String testMethod = "testEmbeddableIDClass001"; final String testResource = "test-jpa-resource-cmts"; HashMap<String, java.io.Serializable> properties = new HashMap<String, java.io.Serializable>(); properties.put("EntityName", "XMLEmbeddableIdEntity"); executeTest(testName, testMethod, testResource, properties); } }
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.tests.spec10.entity_fat.common/test-applications/entity/src/com/ibm/ws/jpa/fvt/entity/tests/web/EmbeddableIDTestServlet.java
Java
epl-1.0
5,713
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 305...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package table; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Toolkit; import java.net.URL; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; public class WelcomeWindow implements Runnable { private JFrame frame; private String fileName="image.png"; public void run() { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int a=screenSize.width/2-250; int b=screenSize.height/2-250; frame = new JFrame("»¶Ó­Ê¹ÓÃÁõÊöÇåÏÈÉú±àдµÄÈí¼þ"); frame.setBounds(a-80, b, 500, 500); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); URL base = this.getClass().getResource(fileName); //Properties property= System.getProperties(); //String classPath=property.get("java.class.path").toString(); //String path=base.toString().substring(6).replace("Drawing/bin/table/", "").replace("le:/","").replace("drawing.jar!/table/","")+"Image/image.gif"; String path=base.getPath(); System.out.println(path); //System.out.println("classPath is:"+classPath); JLabel lable=new JLabel(new ImageIcon(base)); lable.setSize(500, 500); lable.setVisible(true); frame.add(lable, BorderLayout.CENTER); frame.pack(); frame.setVisible(true); //JOptionPane.showMessageDialog(frame, path+"\n"); } }
nanchengking/Drawing
src/table/WelcomeWindow.java
Java
apache-2.0
1,380
[ 30522, 7427, 2795, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 3675, 8485, 5833, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 9812, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 6994, 23615, 1025, 12324, 9262, 1012, 5658, 1012, 24471, 2140, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Copyright (c) 2014 Mirantis, 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 os import socket import time import uuid import testresources import testtools from heatclient import client as heatclient from keystoneclient.v2_0 import client as ksclient from muranoclient import client as mclient import muranoclient.common.exceptions as exceptions import murano.tests.functional.engine.config as cfg CONF = cfg.cfg.CONF class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes, testresources.ResourcedTestCase): @classmethod def setUpClass(cls): super(MuranoBase, cls).setUpClass() cfg.load_config() keystone_client = ksclient.Client(username=CONF.murano.user, password=CONF.murano.password, tenant_name=CONF.murano.tenant, auth_url=CONF.murano.auth_url) heat_url = keystone_client.service_catalog.url_for( service_type='orchestration', endpoint_type='publicURL') cls.heat_client = heatclient.Client('1', endpoint=heat_url, token=keystone_client.auth_token) url = CONF.murano.murano_url murano_url = url if 'v1' not in url else "/".join( url.split('/')[:url.split('/').index('v1')]) cls.muranoclient = mclient.Client('1', endpoint=murano_url, token=keystone_client.auth_token) cls.linux = CONF.murano.linux_image cls.pkgs_path = os.path.abspath(os.path.join( os.path.dirname(__file__), os.path.pardir, 'murano-app-incubator' )) def upload_package(package_name, body, app): files = {'%s' % package_name: open(app, 'rb')} return cls.muranoclient.packages.create(body, files) upload_package( 'PostgreSQL', {"categories": ["Databases"], "tags": ["tag"]}, os.path.join(cls.pkgs_path, 'io.murano.databases.PostgreSql.zip') ) upload_package( 'SqlDatabase', {"categories": ["Databases"], "tags": ["tag"]}, os.path.join(cls.pkgs_path, 'io.murano.databases.SqlDatabase.zip') ) upload_package( 'Apache', {"categories": ["Application Servers"], "tags": ["tag"]}, os.path.join(cls.pkgs_path, 'io.murano.apps.apache.ApacheHttpServer.zip') ) upload_package( 'Tomcat', {"categories": ["Application Servers"], "tags": ["tag"]}, os.path.join(cls.pkgs_path, 'io.murano.apps.apache.Tomcat.zip') ) upload_package( 'Telnet', {"categories": ["Web"], "tags": ["tag"]}, os.path.join(cls.pkgs_path, 'io.murano.apps.linux.Telnet.zip') ) def setUp(self): super(MuranoBase, self).setUp() self.environments = [] def tearDown(self): super(MuranoBase, self).tearDown() for env in self.environments: try: self.environment_delete(env) except Exception: pass def environment_delete(self, environment_id, timeout=180): self.muranoclient.environments.delete(environment_id) start_time = time.time() while time.time() - start_time < timeout: try: self.muranoclient.environments.get(environment_id) except exceptions.HTTPNotFound: return raise Exception( 'Environment {0} was not deleted in {1} seconds'.format( environment_id, timeout)) def wait_for_environment_deploy(self, environment): start_time = time.time() while environment.manager.get(environment.id).status != 'ready': if time.time() - start_time > 1200: self.fail( 'Environment deployment is not finished in 1200 seconds') time.sleep(5) return environment.manager.get(environment.id) def check_port_access(self, ip, port): result = 1 start_time = time.time() while time.time() - start_time < 300: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = sock.connect_ex((str(ip), port)) sock.close() if result == 0: break time.sleep(5) self.assertEqual(0, result, '%s port is closed on instance' % port) def deployment_success_check(self, environment, port): deployment = self.muranoclient.deployments.list(environment.id)[-1] self.assertEqual('success', deployment.state, 'Deployment status is {0}'.format(deployment.state)) ip = environment.services[-1]['instance']['floatingIpAddress'] if ip: self.check_port_access(ip, port) else: self.fail('Instance does not have floating IP') def test_deploy_telnet(self): post_body = { "instance": { "flavor": "m1.medium", "image": self.linux, "assignFloatingIp": True, "?": { "type": "io.murano.resources.LinuxMuranoInstance", "id": str(uuid.uuid4()) }, "name": "testMurano" }, "name": "teMurano", "?": { "type": "io.murano.apps.linux.Telnet", "id": str(uuid.uuid4()) } } environment_name = 'Telnetenv' + uuid.uuid4().hex[:5] env = self._quick_deploy(environment_name, post_body) self.deployment_success_check(env, 23) def test_deploy_apache(self): post_body = { "instance": { "flavor": "m1.medium", "image": self.linux, "assignFloatingIp": True, "?": { "type": "io.murano.resources.LinuxMuranoInstance", "id": str(uuid.uuid4()) }, "name": "testMurano" }, "name": "teMurano", "?": { "type": "io.murano.apps.apache.ApacheHttpServer", "id": str(uuid.uuid4()) } } environment_name = 'Apacheenv' + uuid.uuid4().hex[:5] env = self._quick_deploy(environment_name, post_body) self.deployment_success_check(env, 80) def test_deploy_postgresql(self): post_body = { "instance": { "flavor": "m1.medium", "image": self.linux, "assignFloatingIp": True, "?": { "type": "io.murano.resources.LinuxMuranoInstance", "id": str(uuid.uuid4()) }, "name": "testMurano" }, "name": "teMurano", "database": "test_db", "username": "test_usr", "password": "test_pass", "?": { "type": "io.murano.databases.PostgreSql", "id": str(uuid.uuid4()) } } environment_name = 'Postgreenv' + uuid.uuid4().hex[:5] env = self._quick_deploy(environment_name, post_body) self.deployment_success_check(env, 5432) def test_deploy_tomcat(self): post_body = { "instance": { "flavor": "m1.medium", "image": self.linux, "assignFloatingIp": True, "?": { "type": "io.murano.resources.LinuxMuranoInstance", "id": str(uuid.uuid4()) }, "name": "testMurano" }, "name": "teMurano", "?": { "type": "io.murano.apps.apache.Tomcat", "id": str(uuid.uuid4()) } } environment_name = 'Tomcatenv' + uuid.uuid4().hex[:5] env = self._quick_deploy(environment_name, post_body) self.deployment_success_check(env, 8080) def _get_telnet_app(self): return { "instance": { "?": { "type": "io.murano.resources.LinuxMuranoInstance", "id": str(uuid.uuid4()) }, "flavor": "m1.medium", "image": self.linux, "name": "instance{0}".format(uuid.uuid4().hex[:5]), }, "name": "app{0}".format(uuid.uuid4().hex[:5]), "?": { "type": "io.murano.apps.linux.Telnet", "id": str(uuid.uuid4()) } } def _quick_deploy(self, name, *apps): environment = self.muranoclient.environments.create({'name': name}) self.environments.append(environment.id) session = self.muranoclient.sessions.configure(environment.id) for app in apps: self.muranoclient.services.post(environment.id, path='/', data=app, session_id=session.id) self.muranoclient.sessions.deploy(environment.id, session.id) return self.wait_for_environment_deploy(environment) def _get_stack(self, environment_id): for stack in self.heat_client.stacks.list(): if environment_id in stack.description: return stack def test_instance_refs_are_removed_after_application_is_removed(self): # FIXME(sergmelikyan): Revise this as part of proper fix for #1359998 self.skipTest('Skipped until proper fix for #1359998 is proposed') name = 'e' + uuid.uuid4().hex # create environment with telnet application application1 = self._get_telnet_app() application2 = self._get_telnet_app() application_id = application1['?']['id'] instance_name = application1['instance']['name'] apps = [application1, application2] environment = self._quick_deploy(name, *apps) # delete telnet application session = self.muranoclient.sessions.configure(environment.id) self.muranoclient.services.delete(environment.id, '/' + application_id, session.id) self.muranoclient.sessions.deploy(environment.id, session.id) self.wait_for_environment_deploy(environment) stack_name = self._get_stack(environment.id).stack_name template = self.heat_client.stacks.template(stack_name) ip_addresses = '{0}-assigned-ip'.format(instance_name) floating_ip = '{0}-FloatingIPaddress'.format(instance_name) self.assertNotIn(ip_addresses, template['outputs']) self.assertNotIn(floating_ip, template['outputs']) self.assertNotIn(instance_name, template['resources']) def test_stack_deletion_after_env_is_deleted(self): name = 'e' + uuid.uuid4().hex application = self._get_telnet_app() environment = self._quick_deploy(name, application) stack = self._get_stack(environment.id) self.assertIsNotNone(stack) self.muranoclient.environments.delete(environment.id) start_time = time.time() while stack is not None: if time.time() - start_time > 300: break time.sleep(5) stack = self._get_stack(environment.id) self.assertIsNone(stack, 'stack is not deleted')
telefonicaid/murano
murano/tests/functional/engine/base.py
Python
apache-2.0
12,267
[ 30522, 1001, 9385, 1006, 1039, 1007, 2297, 18062, 16778, 2015, 1010, 4297, 1012, 1001, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 1001, 2025, 2224, 2023, 5371, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jQuery(function($) { /////////////////////////////////////////////////////////////////// ///// META BOXES JS /////////////////////////////////////////////////////////////////// jQuery('.repeatable-add').live('click', function() { var field = jQuery(this).closest('td').find('.custom_repeatable li:last').clone(true); var fieldLocation = jQuery(this).closest('td').find('.custom_repeatable li:last'); field.find('input.regular-text, textarea, select').val(''); field.find('input, textarea, select').attr('name', function(index, name) { return name.replace(/(\d+)/, function(fullMatch, n) { return Number(n) + 1; }); }); field.insertAfter(fieldLocation, jQuery(this).closest('td')); var fieldsCount = jQuery('.repeatable-remove').length; if( fieldsCount > 1 ) { jQuery('.repeatable-remove').css('display','inline'); } return false; }); var fieldsCount = jQuery('.repeatable-remove').length; if( fieldsCount == 1 ) { jQuery('.repeatable-remove').css('display','none'); } jQuery('.repeatable-remove').live('click', function() { jQuery(this).parent().remove(); var fieldsCount = jQuery('.repeatable-remove').length; if( fieldsCount == 1 ) { jQuery('.repeatable-remove').css('display','none'); } return false; }); jQuery('.custom_repeatable').sortable({ opacity: 0.6, revert: true, cursor: 'move', handle: '.sort' }); // the upload image button, saves the id and outputs a preview of the image var imageFrame; $('.rg-bb_upload_image_button').live('click', function(event) { event.preventDefault(); var options, attachment; $self = $(event.target); $div = $self.closest('div.rg-bb_image'); // if the frame already exists, open it if ( imageFrame ) { imageFrame.open(); return; } // set our settings imageFrame = wp.media({ title: 'Choose Image', multiple: true, library: { type: 'image' }, button: { text: 'Use This Image' } }); // set up our select handler imageFrame.on( 'select', function() { selection = imageFrame.state().get('selection'); if ( ! selection ) return; // loop through the selected files selection.each( function( attachment ) { console.log(attachment); var src = attachment.attributes.sizes.full.url; var id = attachment.id; $div.find('.rg-bb_preview_image').attr('src', src); $div.find('.rg-bb_upload_image').val(id); } ); }); // open the frame imageFrame.open(); }); // the remove image link, removes the image id from the hidden field and replaces the image preview $('.rg-bb_clear_image_button').live('click', function() { var defaultImage = $(this).parent().siblings('.rg-bb_default_image').text(); $(this).parent().siblings('.rg-bb_upload_image').val(''); $(this).parent().siblings('.rg-bb_preview_image').attr('src', defaultImage); return false; }); // function to create an array of input values function ids(inputs) { var a = []; for (var i = 0; i < inputs.length; i++) { a.push(inputs[i].val); } //$("span").text(a.join(" ")); } // repeatable fields $('.toggle').on("click", function() { console.log($(this).parent().siblings().toggleClass('closed')); }); $('.meta_box_repeatable_add').live('click', function(e) { e.preventDefault(); // clone var row = $(this).closest('.meta_box_repeatable').find('tbody tr:last-child'); var clone = row.clone(); var defaultImage = clone.find('.meta_box_default_image').text(); clone.find('select.chosen').removeAttr('style', '').removeAttr('id', '').removeClass('chzn-done').data('chosen', null).next().remove(); // clone.find('input.regular-text, textarea, select').val(''); clone.find('.meta_box_preview_image').attr('src', defaultImage).removeClass('loaded'); clone.find('input[type=checkbox], input[type=radio]').attr('checked', false); row.after(clone); // increment name and id clone.find('input, textarea, select').attr('name', function(index, name) { return name.replace(/(\d+)/, function(fullMatch, n) { return Number(n) + 1; }); }); var arr = []; $('input.repeatable_id:text').each(function(){ arr.push($(this).val()); }); clone.find('input.repeatable_id') .val(Number(Math.max.apply( Math, arr )) + 1); if (!!$.prototype.chosen) { clone.find('select.chosen') .chosen({allow_single_deselect: true}); } }); $('.meta_box_repeatable_remove').live('click', function(e){ e.preventDefault(); $(this).closest('tr').remove(); }); $('.meta_box_repeatable tbody').sortable({ opacity: 0.6, revert: true, cursor: 'move', handle: '.hndle' }); // post_drop_sort $('.sort_list').sortable({ connectWith: '.sort_list', opacity: 0.6, revert: true, cursor: 'move', cancel: '.post_drop_sort_area_name', items: 'li:not(.post_drop_sort_area_name)', update: function(event, ui) { var result = $(this).sortable('toArray'); var thisID = $(this).attr('id'); $('.store-' + thisID).val(result) } }); $('.sort_list').disableSelection(); // turn select boxes into something magical if (!!$.prototype.chosen) $('.chosen').chosen({ allow_single_deselect: true }); });
StefanDindyal/wordpresser
wp-content/themes/bobbarnyc/inc/settings-panel/js/custom-admin.js
JavaScript
gpl-2.0
5,266
[ 30522, 1046, 4226, 2854, 1006, 3853, 1006, 1002, 1007, 1063, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <p>Test that an inner multicol that's also a spanner is rendered correctly.</p> <p>There should be a green cross below. The word "PASS" should be seen on its right arm.</p> <div style="-webkit-column-count:2; line-height:50px; width:300px; -webkit-column-rule:100px solid green;"> <br> <br> <br> <div style="-webkit-column-span:all; -webkit-columns:3; -webkit-column-gap:0; text-align:center; color:white; background:green;"> <br><br><br><br><br>PASS </div> <br> <br> <br> </div>
scheib/chromium
third_party/blink/web_tests/fast/multicol/span/as-inner-multicol.html
HTML
bsd-3-clause
536
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 1052, 1028, 3231, 2008, 2019, 5110, 4800, 25778, 2008, 1005, 1055, 2036, 1037, 8487, 3678, 2003, 10155, 11178, 1012, 1026, 1013, 1052, 1028, 1026, 1052, 1028, 2045, 2323, 2022, 1037, 2665, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#pragma once #include <WeaselIPC.h> struct KeyInfo { UINT repeatCount: 16; UINT scanCode: 8; UINT isExtended: 1; UINT reserved: 4; UINT contextCode: 1; UINT prevKeyState: 1; UINT isKeyUp: 1; KeyInfo(LPARAM lparam) { *this = *reinterpret_cast<KeyInfo*>(&lparam); } operator UINT32() { return *reinterpret_cast<UINT32*>(this); } }; bool ConvertKeyEvent(UINT vkey, KeyInfo kinfo, const LPBYTE keyState, weasel::KeyEvent& result); namespace ibus { // keycodes enum Keycode { VoidSymbol = 0xFFFFFF, space = 0x020, grave = 0x060, BackSpace = 0xFF08, Tab = 0xFF09, Linefeed = 0xFF0A, Clear = 0xFF0B, Return = 0xFF0D, Pause = 0xFF13, Scroll_Lock = 0xFF14, Sys_Req = 0xFF15, Escape = 0xFF1B, Delete = 0xFFFF, Multi_key = 0xFF20, Codeinput = 0xFF37, SingleCandidate = 0xFF3C, MultipleCandidate = 0xFF3D, PreviousCandidate = 0xFF3E, Kanji = 0xFF21, Muhenkan = 0xFF22, Henkan_Mode = 0xFF23, Henkan = 0xFF23, Romaji = 0xFF24, Hiragana = 0xFF25, Katakana = 0xFF26, Hiragana_Katakana = 0xFF27, Zenkaku = 0xFF28, Hankaku = 0xFF29, Zenkaku_Hankaku = 0xFF2A, Touroku = 0xFF2B, Massyo = 0xFF2C, Kana_Lock = 0xFF2D, Kana_Shift = 0xFF2E, Eisu_Shift = 0xFF2F, Eisu_toggle = 0xFF30, Kanji_Bangou = 0xFF37, Zen_Koho = 0xFF3D, Mae_Koho = 0xFF3E, Home = 0xFF50, Left = 0xFF51, Up = 0xFF52, Right = 0xFF53, Down = 0xFF54, Prior = 0xFF55, Page_Up = 0xFF55, Next = 0xFF56, Page_Down = 0xFF56, End = 0xFF57, Begin = 0xFF58, Select = 0xFF60, Print = 0xFF61, Execute = 0xFF62, Insert = 0xFF63, Undo = 0xFF65, Redo = 0xFF66, Menu = 0xFF67, Find = 0xFF68, Cancel = 0xFF69, Help = 0xFF6A, Break = 0xFF6B, Mode_switch = 0xFF7E, script_switch = 0xFF7E, Num_Lock = 0xFF7F, KP_Space = 0xFF80, KP_Tab = 0xFF89, KP_Enter = 0xFF8D, KP_F1 = 0xFF91, KP_F2 = 0xFF92, KP_F3 = 0xFF93, KP_F4 = 0xFF94, KP_Home = 0xFF95, KP_Left = 0xFF96, KP_Up = 0xFF97, KP_Right = 0xFF98, KP_Down = 0xFF99, KP_Prior = 0xFF9A, KP_Page_Up = 0xFF9A, KP_Next = 0xFF9B, KP_Page_Down = 0xFF9B, KP_End = 0xFF9C, KP_Begin = 0xFF9D, KP_Insert = 0xFF9E, KP_Delete = 0xFF9F, KP_Equal = 0xFFBD, KP_Multiply = 0xFFAA, KP_Add = 0xFFAB, KP_Separator = 0xFFAC, KP_Subtract = 0xFFAD, KP_Decimal = 0xFFAE, KP_Divide = 0xFFAF, KP_0 = 0xFFB0, KP_1 = 0xFFB1, KP_2 = 0xFFB2, KP_3 = 0xFFB3, KP_4 = 0xFFB4, KP_5 = 0xFFB5, KP_6 = 0xFFB6, KP_7 = 0xFFB7, KP_8 = 0xFFB8, KP_9 = 0xFFB9, F1 = 0xFFBE, F2 = 0xFFBF, F3 = 0xFFC0, F4 = 0xFFC1, F5 = 0xFFC2, F6 = 0xFFC3, F7 = 0xFFC4, F8 = 0xFFC5, F9 = 0xFFC6, F10 = 0xFFC7, F11 = 0xFFC8, L1 = 0xFFC8, F12 = 0xFFC9, L2 = 0xFFC9, F13 = 0xFFCA, L3 = 0xFFCA, F14 = 0xFFCB, L4 = 0xFFCB, F15 = 0xFFCC, L5 = 0xFFCC, F16 = 0xFFCD, L6 = 0xFFCD, F17 = 0xFFCE, L7 = 0xFFCE, F18 = 0xFFCF, L8 = 0xFFCF, F19 = 0xFFD0, L9 = 0xFFD0, F20 = 0xFFD1, L10 = 0xFFD1, F21 = 0xFFD2, R1 = 0xFFD2, F22 = 0xFFD3, R2 = 0xFFD3, F23 = 0xFFD4, R3 = 0xFFD4, F24 = 0xFFD5, R4 = 0xFFD5, F25 = 0xFFD6, R5 = 0xFFD6, F26 = 0xFFD7, R6 = 0xFFD7, F27 = 0xFFD8, R7 = 0xFFD8, F28 = 0xFFD9, R8 = 0xFFD9, F29 = 0xFFDA, R9 = 0xFFDA, F30 = 0xFFDB, R10 = 0xFFDB, F31 = 0xFFDC, R11 = 0xFFDC, F32 = 0xFFDD, R12 = 0xFFDD, F33 = 0xFFDE, R13 = 0xFFDE, F34 = 0xFFDF, R14 = 0xFFDF, F35 = 0xFFE0, R15 = 0xFFE0, Shift_L = 0xFFE1, Shift_R = 0xFFE2, Control_L = 0xFFE3, Control_R = 0xFFE4, Caps_Lock = 0xFFE5, Shift_Lock = 0xFFE6, Meta_L = 0xFFE7, Meta_R = 0xFFE8, Alt_L = 0xFFE9, Alt_R = 0xFFEA, Super_L = 0xFFEB, Super_R = 0xFFEC, Hyper_L = 0xFFED, Hyper_R = 0xFFEE, Null = 0 }; // modifiers, modified to fit a UINT16 enum Modifier { NULL_MASK = 0, SHIFT_MASK = 1 << 0, LOCK_MASK = 1 << 1, CONTROL_MASK = 1 << 2, ALT_MASK = 1 << 3, MOD1_MASK = 1 << 3, MOD2_MASK = 1 << 4, MOD3_MASK = 1 << 5, MOD4_MASK = 1 << 6, MOD5_MASK = 1 << 7, HANDLED_MASK = 1 << 8, // 24 IGNORED_MASK = 1 << 9, // 25 FORWARD_MASK = 1 << 9, // 25 SUPER_MASK = 1 << 10, // 26 HYPER_MASK = 1 << 11, // 27 META_MASK = 1 << 12, // 28 RELEASE_MASK = 1 << 14, // 30 MODIFIER_MASK = 0x2fff }; }
rime/weasel
WeaselIME/KeyEvent.h
C
gpl-3.0
4,532
[ 30522, 1001, 10975, 8490, 2863, 2320, 1001, 2421, 1026, 29268, 11514, 2278, 1012, 1044, 1028, 2358, 6820, 6593, 3145, 2378, 14876, 1063, 21318, 3372, 9377, 3597, 16671, 1024, 2385, 1025, 21318, 3372, 13594, 16044, 1024, 1022, 1025, 21318, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) --> <!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca --> <head> <!-- Title begins / Début du titre --> <title> Insured Creativity - Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada </title> <!-- Title ends / Fin du titre --> <!-- Meta-data begins / Début des métadonnées --> <meta charset="utf-8" /> <meta name="dcterms.language" title="ISO639-2" content="eng" /> <meta name="dcterms.title" content="" /> <meta name="description" content="" /> <meta name="dcterms.description" content="" /> <meta name="dcterms.type" content="report, data set" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.issued" title="W3CDTF" content="" /> <meta name="dcterms.modified" title="W3CDTF" content="" /> <meta name="keywords" content="" /> <meta name="dcterms.creator" content="" /> <meta name="author" content="" /> <meta name="dcterms.created" title="W3CDTF" content="" /> <meta name="dcterms.publisher" content="" /> <meta name="dcterms.audience" title="icaudience" content="" /> <meta name="dcterms.spatial" title="ISO3166-1" content="" /> <meta name="dcterms.spatial" title="gcgeonames" content="" /> <meta name="dcterms.format" content="HTML" /> <meta name="dcterms.identifier" title="ICsiteProduct" content="536" /> <!-- EPI-11240 --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- MCG-202 --> <meta content="width=device-width,initial-scale=1" name="viewport"> <!-- EPI-11567 --> <meta name = "format-detection" content = "telephone=no"> <!-- EPI-12603 --> <meta name="robots" content="noarchive"> <!-- EPI-11190 - Webtrends --> <script> var startTime = new Date(); startTime = startTime.getTime(); </script> <!--[if gte IE 9 | !IE ]><!--> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css"> <!--<![endif]--> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css"> <!--[if lt IE 9]> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script> <![endif]--> <!--[if lte IE 9]> <![endif]--> <noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <script>dataLayer1 = [];</script> <!-- End Google Tag Manager --> <!-- EPI-11235 --> <link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body class="home" vocab="http://schema.org/" typeof="WebPage"> <!-- EPIC HEADER BEGIN --> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script> <!-- End Google Tag Manager --> <!-- EPI-12801 --> <span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span> <ul id="wb-tphp"> <li class="wb-slc"> <a class="wb-sl" href="#wb-cont">Skip to main content</a> </li> <li class="wb-slc visible-sm visible-md visible-lg"> <a class="wb-sl" href="#wb-info">Skip to "About this site"</a> </li> </ul> <header role="banner"> <div id="wb-bnr" class="container"> <section id="wb-lng" class="visible-md visible-lg text-right"> <h2 class="wb-inv">Language selection</h2> <div class="row"> <div class="col-md-12"> <ul class="list-inline mrgn-bttm-0"> <li><a href="nvgt.do?V_TOKEN=1492294053849&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=23379&V_SEARCH.docsStart=23378&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/rgstr.sec?_flId?_flxKy=e1s1&amp;estblmntNo=234567041301&amp;profileId=61&amp;_evId=bck&amp;lang=eng&amp;V_SEARCH.showStricts=false&amp;prtl=1&amp;_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li> </ul> </div> </div> </section> <div class="row"> <div class="brand col-xs-8 col-sm-9 col-md-6"> <a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a> </div> <section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn"> <h2>Search and menus</h2> <ul class="list-inline text-right chvrn"> <li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li> </ul> <div id="mb-pnl"></div> </section> <!-- Site Search Removed --> </div> </div> <nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement"> <h2 class="wb-inv">Topics menu</h2> <div class="container nvbar"> <div class="row"> <ul class="list-inline menu"> <li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li> <li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li> <li><a href="https://travel.gc.ca/">Travel</a></li> <li><a href="https://www.canada.ca/en/services/business.html">Business</a></li> <li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li> <li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li> <li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li> <li><a href="https://www.canada.ca/en/services.html">More services</a></li> </ul> </div> </div> </nav> <!-- EPIC BODY BEGIN --> <nav role="navigation" id="wb-bc" class="" property="breadcrumb"> <h2 class="wb-inv">You are here:</h2> <div class="container"> <div class="row"> <ol class="breadcrumb"> <li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li> <li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li> <li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li> </ol> </div> </div> </nav> </header> <main id="wb-cont" role="main" property="mainContentOfPage" class="container"> <!-- End Header --> <!-- Begin Body --> <!-- Begin Body Title --> <!-- End Body Title --> <!-- Begin Body Head --> <!-- End Body Head --> <!-- Begin Body Content --> <br> <!-- Complete Profile --> <!-- Company Information above tabbed area--> <input id="showMore" type="hidden" value='more'/> <input id="showLess" type="hidden" value='less'/> <h1 id="wb-cont"> Company profile - Canadian Company Capabilities </h1> <div class="profileInfo hidden-print"> <ul class="list-inline"> <li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&amp;rstBtn.x=" class="btn btn-link">New Search</a>&nbsp;|</li> <li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do"> <input type="hidden" name="lang" value="eng" /> <input type="hidden" name="profileId" value="" /> <input type="hidden" name="prtl" value="1" /> <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" /> <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" /> <input type="hidden" name="V_SEARCH.depth" value="1" /> <input type="hidden" name="V_SEARCH.showStricts" value="false" /> <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" /> </form></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=23377&amp;V_DOCUMENT.docRank=23378&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492294061099&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567088623&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=23379&amp;V_DOCUMENT.docRank=23380&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492294061099&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567160801&amp;profileId=&amp;key.newSearchLabel=">Next Company</a></li> </ul> </div> <details> <summary>Third-Party Information Liability Disclaimer</summary> <p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p> </details> <h2> ICSB LP </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal Name:</h2> <p>ICSB LP</p> <h2 class="h5 mrgn-bttm-0">Operating Name:</h2> <p>Insured Creativity</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http://www.insuredcreativity.com" target="_blank" title="Website URL">http://www.insuredcreativity.com</a></p> <p><a href="mailto:info@insuredcreativity.com" title="info@insuredcreativity.com">info@insuredcreativity.com</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 300-251 North Service Rd<br/> OAKVILLE, Ontario<br/> L6M 3E7 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 300-251 North Service Rd<br/> OAKVILLE, Ontario<br/> L6M 3E7 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (905) 608-1999 </p> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (800) 575-5590</p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: </p> </div> <div class="col-md-3 mrgn-tp-md"> <h2 class="wb-inv">Logo</h2> <img class="img-responsive text-left" src="https://www.ic.gc.ca/app/ccc/srch/media?estblmntNo=234567166026&amp;graphFileName=ICSB-Logo-White-72dp&amp;applicationCode=AP&amp;lang=eng" alt="Logo" /> </div> </div> <div class="row mrgn-tp-md mrgn-bttm-md"> <div class="col-md-12"> <h2 class="wb-inv">Company Profile</h2> <br> Insured Creativity designs and executes rewards and incentive solutions for brand and agency marketers around the world. Specializing in shopper marketing, sponsorship activation and promotional offers, Insured Creativity develops turn-key and custom programs designed to influence and engage consumers with award winning programs.<br> </div> </div> <!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> --> <div class="wb-tabs ignore-session"> <div class="tabpanels"> <details id="details-panel1"> <summary> Full profile </summary> <!-- Tab 1 --> <h2 class="wb-invisible"> Full profile </h2> <!-- Contact Information --> <h3 class="page-header"> Contact information </h3> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Dylan MacTavish </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Business Development Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Domestic Sales & Marketing. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (905) 844-7408 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> dylan.mactavish@insuredcreativity.com </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 541899 - All Other Services Related to Advertising </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> </section> <!-- Products / Services / Licensing --> <h3 class="page-header"> Product / Service / Licensing </h3> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Instant Win Games<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Instant Win Games are a fun and exciting way of encouraging consumers to purchase a product, with a chance to win a lucrative prize for doing so.<br> <br> </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Technology Profile --> <!-- Market Profile --> <h3 class="page-header"> Market profile </h3> <section class="container-fluid"> <h4> Industry sector market interests: </h4> <ul> <li>Consumer Products</li> <li>Food and Beverage Manufacturing</li> </ul> <h4> Geographic markets: </h4> <h5> Export experience: </h5> <ul> <li>Germany</li> <li>United Kingdom</li> <li>United States</li> </ul> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Sector Information --> <details class="mrgn-tp-md mrgn-bttm-md"> <summary> Third-Party Information Liability Disclaimer </summary> <p> Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements. </p> </details> </details> <details id="details-panel2"> <summary> Contacts </summary> <h2 class="wb-invisible"> Contact information </h2> <!-- Contact Information --> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Dylan MacTavish </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Business Development Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Domestic Sales & Marketing. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (905) 844-7408 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> dylan.mactavish@insuredcreativity.com </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 541899 - All Other Services Related to Advertising </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> </section> </details> <details id="details-panel4"> <summary> Products, services and licensing </summary> <h2 class="wb-invisible"> Product / Service / Licensing </h2> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Instant Win Games<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Instant Win Games are a fun and exciting way of encouraging consumers to purchase a product, with a chance to win a lucrative prize for doing so.<br> <br> </div> </div> </section> </details> <details id="details-panel6"> <summary> Market </summary> <h2 class="wb-invisible"> Market profile </h2> <section class="container-fluid"> <h4> Industry sector market interests: </h4> <ul> <li>Consumer Products</li> <li>Food and Beverage Manufacturing</li> </ul> <h4> Geographic markets: </h4> <h5> Export experience: </h5> <ul> <li>Germany</li> <li>United Kingdom</li> <li>United States</li> </ul> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2016-12-16 </div> </div> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z --> <!-- End Body Content --> <!-- Begin Body Foot --> <!-- End Body Foot --> <!-- END MAIN TABLE --> <!-- End body --> <!-- Begin footer --> <div class="row pagedetails"> <div class="col-sm-5 col-xs-12 datemod"> <dl id="wb-dtmd"> <dt class=" hidden-print">Date Modified:</dt> <dd class=" hidden-print"> <span><time>2017-03-02</time></span> </dd> </dl> </div> <div class="clear visible-xs"></div> <div class="col-sm-4 col-xs-6"> </div> <div class="col-sm-3 col-xs-6 text-right"> </div> <div class="clear visible-xs"></div> </div> </main> <footer role="contentinfo" id="wb-info"> <nav role="navigation" class="container wb-navcurr"> <h2 class="wb-inv">About government</h2> <!-- EPIC FOOTER BEGIN --> <!-- EPI-11638 Contact us --> <ul class="list-unstyled colcount-sm-2 colcount-md-3"> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&amp;from=Industries">Contact us</a></li> <li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li> <li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li> <li><a href="https://www.canada.ca/en/news.html">News</a></li> <li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li> <li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li> <li><a href="http://pm.gc.ca/eng">Prime Minister</a></li> <li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li> <li><a href="http://open.canada.ca/en/">Open government</a></li> </ul> </nav> <div class="brand"> <div class="container"> <div class="row"> <nav class="col-md-10 ftr-urlt-lnk"> <h2 class="wb-inv">About this site</h2> <ul> <li><a href="https://www.canada.ca/en/social.html">Social media</a></li> <li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li> <li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li> </ul> </nav> <div class="col-xs-6 visible-sm visible-xs tofpg"> <a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a> </div> <div class="col-xs-6 col-md-2 text-right"> <object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object> </div> </div> </div> </div> </footer> <!--[if gte IE 9 | !IE ]><!--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script> <![endif]--> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script> <!-- EPI-10519 --> <span class="wb-sessto" data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span> <script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script> <!-- EPI-11190 - Webtrends --> <script src="/eic/home.nsf/js/webtrends.js"></script> <script>var endTime = new Date();</script> <noscript> <div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=9.4.0&amp;dcssip=www.ic.gc.ca"/></div> </noscript> <!-- /Webtrends --> <!-- JS deps --> <script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script> <!-- EPI-11262 - Util JS --> <script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script> <!-- EPI-11383 --> <script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script> <span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span> </body></html> <!-- End Footer --> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z -->
GoC-Spending/data-corporations
html/234567166026.html
HTML
mit
37,877
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 999, 1011, 1011, 1031, 2065, 8318, 29464, 1023, 1033, 1028, 1026, 16129, 2465, 1027, 1000, 2053, 1011, 1046, 2015, 8318, 1011, 29464, 2683, 1000, 11374, 1027, 1000, 4372, 1000, 16101, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ul#primary > li.current_page_item > a, ul#primary > li.current-menu-ancestor > a {color:#55ac1e;} ul#primary li a:hover { color: #55ac1e;} ul#secondary li a:hover {color:#55ac1e;} ul#secondary > li.current_page_item > a, ul#primary > li.current-menu-ancestor > a, ul.superfish.nav > li > a:hover {color:#55ac1e; } ul#primary ul li a:hover { background: url(images/green/top-menu-active-bullet.png) no-repeat 0px 11px; } ul#secondary ul li a:hover { background: url(images/green/second-active-bullet.png) no-repeat 2px 15px;} #featured p.meta a { color: #55ac1e;} #featured #controllers .alignleft span.date { background: url(images/green/big-date-bg.png) no-repeat;} span.date { background: url(images/green/date-small-bg.png) no-repeat;} #featured #controllers a.active img { border-color: #63c31f; } .slide h4.cat-title {color: #55ac1e; } h4#recent, div#breadcrumbs {color: #55ac1e; text-shadow: 1px 1px 1px #b0d896; } #sidebar h4 {color: #55ac1e; text-shadow: 1px 1px 1px #b0d896;} .footer-widget h4.widgettitle { color: #55ac1e;} div#breadcrumbs a { color:#55ac1e; } span.fn, span.fn a { color: #55ac1e;} .wp-pagenavi span.current, .wp-pagenavi span.extend, .wp-pagenavi a:active, .wp-pagenavi a:hover { color:#55ac1e !important; } span.date {text-shadow: -1px -1px 1px #126d00;} #tabbed-area li a span { color: #55ac1e;}
rjbaniel/upoor
wp-content/themes/DelicateNews/style-Green.css
CSS
gpl-2.0
1,416
[ 30522, 17359, 1001, 3078, 1028, 5622, 1012, 2783, 1035, 3931, 1035, 8875, 1028, 1037, 1010, 17359, 1001, 3078, 1028, 5622, 1012, 2783, 1011, 12183, 1011, 13032, 1028, 1037, 1063, 3609, 1024, 1001, 4583, 6305, 2487, 2063, 1025, 1065, 17359, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using System.Text; namespace Zh.DAL.Base.Define.Query { public class OrderBy : IOrderByGetter { public string Property { get; set; } public OrderMode OrderMode { get; set; } public IEnumerable<OrderBy> OrderBys { get { return new OrderBy[] { this }; } } } }
Caspar12/Csharp
src/Zh.DAL.Base.Define/Query/OrderBy.cs
C#
mit
375
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 3793, 1025, 3415, 15327, 1062, 2232, 1012, 17488, 1012, 2918, 1012, 9375, 1012, 23032, 1063, 2270, 2465, 2344, 3762, 1024, 22834, 26764, 3762, 18150, 3334...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php if (!defined('THINK_PATH')) exit();?><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/admin.css" /> <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.1.js"></script> <script type="text/javascript" src="__PUBLIC__/js/public.js"></script> <script> $(function(){ $('.inp').each(function(){ val = $(this).val(); if (val == ''){ $(this).val('000000'); } if (val != 000000){ $(this).css('color','green'); } }).click(function(){ if ($(this).val() == '000000'){ $(this).val(''); } }).blur(function(){ if ($(this).val() == ''){ $(this).val('000000'); } if ($(this).val()!='000000'){ $(this).css('color','green'); } }) }) </script> <style type="text/css"> .inp{color:#999999; padding-left:6px;} </style> </head> <body> <div id="main"> <div class="title">网站配置</div> <div class="content"> <span> <form method="post" action="<?php echo U('editQq');?>"> <table width="98%" border="0" cellpadding="0" cellspacing="0" class="mytab"> <tr> <td colspan="4" class="tit">客服QQ管理</td> </tr> <tr> <td width="8%">&nbsp;</td> <td width="20%" align="center"><b>类型</b></td> <td width="28%" align="center"><b>QQ号码</b></td> <td width="44%">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="center">·客服<input type="hidden" name="kf1" value="kf1"/></td> <td><input type="text" class="inp" name="kf11" value="<?php echo (($list["kf11"])?($list["kf11"]):''); ?>"/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="center">·客服<input type="hidden" name="kf2" value="kf2"/></td> <td><input type="text" class="inp" name="kf22" value="<?php echo (($list["kf22"])?($list["kf22"]):''); ?>"/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="center">·客服<input type="hidden" name="kf3" value="kf3"/></td> <td><input type="text" class="inp" name="kf33" value="<?php echo (($list["kf33"])?($list["kf33"]):''); ?>"/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="center">·客服<input type="hidden" name="kf4" value="kf4"/></td> <td><input type="text" class="inp" name="kf44" value="<?php echo (($list["kf44"])?($list["kf44"]):''); ?>"/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="center">·投诉<input type="hidden" name="ts1" value="ts1"/></td> <td><input type="text" class="inp" name="ts11" value="<?php echo (($list["ts11"])?($list["ts11"]):''); ?>"/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="center">·建议<input type="hidden" name="jy1" value="jy1"/></td> <td><input type="text" class="inp" name="jy11" value="<?php echo (($list["jy11"])?($list["jy11"]):''); ?>"/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><input type="submit" value="保存">&nbsp;<input type="button" onClick="history.back()" value="返回上一步"></td> <td></td> </tr> </table> </form> </span> </div> </div> </body> </html>
iiling/ywt
admin/Runtime/Cache/701740c1d8f193fbb2ae73fba26f0fd5.php
PHP
mit
3,118
[ 30522, 1026, 1029, 25718, 2065, 1006, 999, 4225, 1006, 1005, 2228, 1035, 4130, 1005, 1007, 1007, 6164, 1006, 1007, 1025, 1029, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 8299, 1011, 1041, 15549, 2615, 1027, 1000, 4180, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# carb.is A minimalist business card site, built with Jekyll. See http://carb.is/.
lukecarbis/carb.is
README.md
Markdown
gpl-2.0
85
[ 30522, 1001, 2482, 2497, 1012, 2003, 1037, 10124, 2923, 2449, 4003, 2609, 1010, 2328, 2007, 15333, 4801, 3363, 1012, 2156, 8299, 1024, 1013, 1013, 2482, 2497, 1012, 2003, 1013, 1012, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the Apache License Version 2.0. // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* package com.microsoft.uprove; import java.util.Arrays; /** * Specifies a U-Prove token. */ public class UProveToken { private byte[] issuerParametersUID; private byte[] publicKey; private byte[] tokenInformation; private byte[] proverInformation; private byte[] sigmaZ; private byte[] sigmaC; private byte[] sigmaR; private boolean isDeviceProtected = false; /** * Constructs a new U-Prove token. */ public UProveToken() { super(); } /** * Constructs a new U-Prove token. * @param issuerParametersUID an issuer parameters UID. * @param publicKey a public key. * @param tokenInformation a token information value. * @param proverInformation a prover information value. * @param sigmaZ a sigmaZ value. * @param sigmaC a sigmaC value. * @param sigmaR a sigmaR value. * @param isDeviceProtected indicates if the token is Device-protected. */ public UProveToken(byte[] issuerParametersUID, byte[] publicKey, byte[] tokenInformation, byte[] proverInformation, byte[] sigmaZ, byte[] sigmaC, byte[] sigmaR, boolean isDeviceProtected) { super(); this.issuerParametersUID = issuerParametersUID; this.publicKey = publicKey; this.tokenInformation = tokenInformation; this.proverInformation = proverInformation; this.sigmaZ = sigmaZ; this.sigmaC = sigmaC; this.sigmaR = sigmaR; this.isDeviceProtected = isDeviceProtected; } /** * Gets the issuer parameters UID value. * @return the issuerParameters UID value. */ public byte[] getIssuerParametersUID() { return issuerParametersUID; } /** * Sets the issuer parameters UID value. * @param issuerParametersUID the issuerParameters UID value to set. */ public void setIssuerParametersUID(byte[] issuerParametersUID) { this.issuerParametersUID = issuerParametersUID; } /** * Gets the public key value. * @return the publicKey value. */ public byte[] getPublicKey() { return publicKey; } /** * Sets the public key value. * @param publicKey the public key value to set. */ public void setPublicKey(byte[] publicKey) { this.publicKey = publicKey; } /** * Gets the token information value. * @return the token information value. */ public byte[] getTokenInformation() { return tokenInformation; } /** * Sets the token information value. * @param tokenInformation the token information value to set. */ public void setTokenInformation(byte[] tokenInformation) { this.tokenInformation = tokenInformation; } /** * Gets the prover information value. * @return the prover information value. */ public byte[] getProverInformation() { return proverInformation; } /** * Sets the prover information value. * @param proverInformation the prover information value to set. */ public void setProverInformation(byte[] proverInformation) { this.proverInformation = proverInformation; } /** * Gets the sigmaZ value. * @return the sigmaZ value. */ public byte[] getSigmaZ() { return sigmaZ; } /** * Sets the sigmaZ value. * @param sigmaZ the sigmaZ value to set. */ public void setSigmaZ(byte[] sigmaZ) { this.sigmaZ = sigmaZ; } /** * Gets the sigmaC value. * @return the sigmaC value. */ public byte[] getSigmaC() { return sigmaC; } /** * Sets the sigmaC value. * @param sigmaC the sigmaC value to set. */ public void setSigmaC(byte[] sigmaC) { this.sigmaC = sigmaC; } /** * Gets the sigmaR value. * @return the sigmaR value. */ public byte[] getSigmaR() { return sigmaR; } /** * Sets the sigmaR value. * @param sigmaR the sigmaR value to set. */ public void setSigmaR(byte[] sigmaR) { this.sigmaR = sigmaR; } /** * Returns true if the token is Device-protected, false otherwise. * @return the Device-protected boolean. */ boolean isDeviceProtected() { return isDeviceProtected; } /** * Sets the boolean indicating if the token is Device-protected. * @param isDeviceProtected true if the token is Device-protected. */ void setIsDeviceProtected(boolean isDeviceProtected) { this.isDeviceProtected = isDeviceProtected; } /** * Indicates whether some other object is "equal to" this one. * @param o the reference object with which to compare. * @return <code>true</code> if this object is the same as the * <code>o</code> argument; <code>false</code> otherwise. */ public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof UProveToken)) { return false; } UProveToken upt = (UProveToken) o; return Arrays.equals(this.issuerParametersUID, upt.issuerParametersUID) && Arrays.equals(this.publicKey, upt.publicKey) && Arrays.equals(this.tokenInformation, upt.tokenInformation) && Arrays.equals(this.proverInformation, upt.proverInformation) && Arrays.equals(this.sigmaZ, upt.sigmaZ) && Arrays.equals(this.sigmaC, upt.sigmaC) && Arrays.equals(this.sigmaR, upt.sigmaR) && this.isDeviceProtected == upt.isDeviceProtected; } /** * Returns a hash code value for the object. * @return a hash code value for the object. */ public int hashCode() { int result = 237; result = 201 * result + Arrays.hashCode(this.issuerParametersUID); result = 201 * result + Arrays.hashCode(this.publicKey); result = 201 * result + Arrays.hashCode(this.tokenInformation); result = 201 * result + Arrays.hashCode(this.proverInformation); result = 201 * result + Arrays.hashCode(this.sigmaZ); result = 201 * result + Arrays.hashCode(this.sigmaC); result = 201 * result + Arrays.hashCode(this.sigmaR); result = result + (this.isDeviceProtected ? 201 : 0); return result; } }
albdum/uprove
src/main/java/com/microsoft/uprove/UProveToken.java
Java
apache-2.0
6,515
[ 30522, 1013, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.PHONY: all clean deps distclean doc test compile REBAR ?= ./rebar all: compile test: compile @$(REBAR) skip_deps=true eunit deps: rebar @$(REBAR) get-deps clean: @$(REBAR) clean distclean: clean @$(REBAR) delete-deps doc: @$(REBAR) doc compile: deps @$(REBAR) compile rebar: curl http://cloud.github.com/downloads/basho/rebar/rebar > rebar chmod +x $@
studzien/jacket
Makefile
Makefile
gpl-2.0
370
[ 30522, 1012, 6887, 16585, 1024, 2035, 4550, 2139, 4523, 4487, 3367, 14321, 2319, 9986, 3231, 4012, 22090, 2128, 8237, 1029, 1027, 1012, 1013, 2128, 8237, 2035, 1024, 4012, 22090, 3231, 1024, 4012, 22090, 1030, 1002, 1006, 2128, 8237, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ function drawSctDiagram(concept, parentDiv) { parentDiv.svg({settings: {width: '600px', height: '500px'}}); var svg = parentDiv.svg('get'); loadDefs(svg); rect1 = drawSctBox(parentDiv, 10, 10, "<span class='sct-box-id'>12676007<br></span>Fracture of radius", "sct-defined-concept"); circle1 = drawEquivalentNode(svg, 120,130); drawSubsumedByNode(svg, 120,230); drawSubsumesNode(svg, 120,330); drawSctBox(parentDiv, 100, 400, "&lt;slot&gt;", "sct-slot"); connectElements(svg, rect1, circle1, 'center', 'left'); circle2 = drawConjunctionNode(svg, 200, 130); connectElements(svg, circle1, circle2, 'right', 'left'); rect2 = drawSctBox(parentDiv, 250, 100, "<span class='sct-box-id'>65966004<br></span>Fracture of forearm", "sct-defined-concept"); connectElements(svg, circle2, rect2, 'bottom', 'left', 'ClearTriangle'); rect3 = drawSctBox(parentDiv, 250, 200, "<span class='sct-box-id'>429353004<br></span>Injury of radius", "sct-defined-concept"); connectElements(svg, circle2, rect3, 'bottom', 'left', 'ClearTriangle'); circle3 = drawAttributeGroupNode(svg, 250, 330); connectElements(svg, circle2, circle3, 'bottom', 'left'); circle4 = drawConjunctionNode(svg, 300, 330); connectElements(svg, circle3, circle4, 'right', 'left'); rect4 = drawSctBox(parentDiv, 350, 300, "<span class='sct-box-id'>116676008<br></span>Associated morphology", "sct-attribute"); connectElements(svg, circle4, rect4, 'right', 'left'); rect5 = drawSctBox(parentDiv, 550, 300, "<span class='sct-box-id'>72704001<br></span>Fracture", "sct-primitive-concept"); connectElements(svg, rect4, rect5, 'right', 'left'); rect6 = drawSctBox(parentDiv, 350, 400, "<span class='sct-box-id'>363698007<br></span>Finding site", "sct-attribute"); connectElements(svg, circle4, rect6, 'bottom', 'left'); rect7 = drawSctBox(parentDiv, 550, 400, "<span class='sct-box-id'>62413002<br></span>Bone structure of radius", "sct-primitive-concept"); connectElements(svg, rect6, rect7, 'right', 'left'); } function toggleIds() { $('.sct-box-id').toggle(); }
termMed/ihtsdo-daily-build-browser
js/diagramsTest.js
JavaScript
apache-2.0
2,348
[ 30522, 1013, 1008, 1008, 2000, 2689, 2023, 6105, 20346, 1010, 5454, 6105, 20346, 2015, 1999, 2622, 5144, 1012, 1008, 2000, 2689, 2023, 23561, 5371, 1010, 5454, 5906, 1064, 23561, 2015, 1008, 1998, 2330, 30524, 1024, 1005, 5174, 2361, 2595, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// https://github.com/OptimalBits/node_acl/blob/master/Readme.md import Acl = require('acl'); import redis = require('redis'); declare var client: redis.RedisClient; // Using the redis backend var acl = new Acl(new Acl.redisBackend(client, 'acl_')); // guest is allowed to view blogs acl.allow('guest', 'blogs', 'view'); // allow function accepts arrays as any parameter acl.allow('member', 'blogs', ['edit','view', 'delete']);
zuzusik/DefinitelyTyped
types/acl/test/redisBackend.ts
TypeScript
mit
432
[ 30522, 1013, 1013, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 4012, 1013, 15502, 16313, 2015, 1013, 13045, 1035, 9353, 2140, 1013, 1038, 4135, 2497, 1013, 3040, 1013, 3191, 4168, 1012, 9108, 12324, 9353, 2140, 1027, 5478, 1006, 1005...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# frozen_string_literal: true class Dummy::Atom::Documents < Folio::Atom::Base ATTACHMENTS = %i[documents] STRUCTURE = { title: :string, } ASSOCIATIONS = {} validates :document_placements, presence: true def self.molecule_cell_name "dummy/molecule/documents" end def self.console_icon :insert_drive_file end end # == Schema Information # # Table name: folio_atoms # # id :bigint(8) not null, primary key # type :string # position :integer # created_at :datetime not null # updated_at :datetime not null # placement_type :string # placement_id :bigint(8) # locale :string # data :jsonb # associations :jsonb # data_for_search :text # # Indexes # # index_folio_atoms_on_placement_type_and_placement_id (placement_type,placement_id) #
sinfin/folio
test/dummy/app/models/dummy/atom/documents.rb
Ruby
mit
885
[ 30522, 1001, 7708, 1035, 5164, 1035, 18204, 1024, 2995, 2465, 24369, 1024, 1024, 13787, 1024, 1024, 5491, 1026, 1042, 29401, 1024, 1024, 13787, 1024, 1024, 2918, 14449, 2015, 1027, 1003, 1045, 1031, 5491, 1033, 3252, 1027, 1063, 2516, 1024,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 by # Erwin Marsi and Tilburg University # This file is part of the Pycornetto package. # Pycornetto 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. # Pycornetto is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """ A simple client to connect to the Cornetto database server. Reads queries from standard input and writes results to standard output. """ # BUGS: # - there is no way interrupt a query that goes bad on the server, as obviously # a local Ctrl-C does not work __author__ = 'Erwin Marsi <e.marsi@gmail.com>' __version__ = '0.6.1' # using optparse instead of argparse so client can run stand-alone from sys import stdin, stdout, stderr, exit from optparse import OptionParser, IndentedHelpFormatter import xmlrpclib from pprint import pformat from socket import error as SocketError class MyFormatter(IndentedHelpFormatter): """to prevent optparse from messing up the epilog text""" def format_epilog(self, epilog): return epilog or "" def format_description(self, description): return description.lstrip() epilog = """ Interactive usage: $ cornetto-client.py $ cornetto-client.py -a File processing: $ echo 'ask("pijp")' | cornetto-client.py $ cornetto-client.py <input >output """ try: parser = OptionParser(description=__doc__, version="%(prog)s version " + __version__, epilog=epilog, formatter=MyFormatter()) except TypeError: # optparse in python 2.4 has no epilog keyword parser = OptionParser(description=__doc__ + epilog, version="%(prog)s version " + __version__) parser.add_option("-a", "--ask", action='store_true', help="assume all commands are input the 'ask' function, " "- so you can type 'query' instead of 'ask(\"query\") - '" "but online help is no longer accessible" ) parser.add_option("-H", "--host", default="localhost:5204", metavar="HOST[:PORT]", help="name or IP address of host (default is 'localhost') " "optionally followed by a port number " "(default is 5204)") parser.add_option('-n', '--no-pretty-print', dest="pretty_print", action='store_false', help="turn off pretty printing of output " "(default when standard input is a file)") parser.add_option("-p", "--port", type=int, default=5204, help='port number (default is 5204)') parser.add_option('-P', '--pretty-print', dest="pretty_print", action='store_true', help="turn on pretty printing of output " "(default when standard input is a tty)") parser.add_option("-e", "--encoding", default="utf8", metavar="utf8,latin1,ascii,...", help="character encoding of output (default is utf8)") parser.add_option('-V', '--verbose', action='store_true', help="verbose output for debugging") (opts, args) = parser.parse_args() if opts.host.startswith("http://"): opts.host = opts.host[7:] try: host, port = opts.host.split(":")[:2] except ValueError: host, port = opts.host, None # XMP-RPC requires specification of protocol host = "http://" + (host or "localhost") try: port = int(port or 5204) except ValueError: exit("Error: %s is not a valid port number" % repr(port)) server = xmlrpclib.ServerProxy("%s:%s" % (host, port), encoding="utf-8", verbose=opts.verbose) try: eval('server.echo("test")') except SocketError, inst: print >>stderr, "Error: %s\nCornetto server not running on %s:%s ?" % ( inst, host, port), "See cornetto-server.py -h" exit(1) help_text = """ Type "?" to see his message. Type "help()" for help on available methods. Type "Ctrl-D" to exit. Restart with "cornetto-client.py -h" to see command line options. """ startup_msg = ( "cornetto-client.py (version %s)\n" % __version__ + "Copyright (c) Erwin Marsi\n" + help_text ) if stdin.isatty(): prompt = "$ " if opts.pretty_print is None: opts.pretty_print = True print startup_msg else: prompt = "" if opts.pretty_print is None: opts.pretty_print = False # use of eval might allow arbitrary code execution - probably not entirely safe if opts.ask: process = lambda c: eval('server.ask("%s")' % c.strip()) else: process = lambda c: eval("server." + c.strip()) if opts.pretty_print: formatter = pformat else: formatter = repr # This is nasty way to enforce encoleast_common_subsumers("fiets", "auto")ding of strings embedded in lists or dicts. # For examample [u'plafonnière'] rather than [u"plafonni\xe8re"] encoder = lambda s: s.decode("unicode_escape").encode(opts.encoding, "backslashreplace") while True: try: command = raw_input(prompt) if command == "?": print help_text else: result = process(command) print encoder(formatter(result)) except EOFError: print "\nSee you later alligator!" exit(0) except KeyboardInterrupt: print >>stderr, "\nInterrupted. Latest command may still run on the server though..." except SyntaxError: print >>stderr, "Error: invalid syntax" except NameError, inst: print >>stderr, "Error:", inst, "- use quotes?" except xmlrpclib.Error, inst: print >>stderr, inst except SocketError: print >>stderr, "Error: %s\nCornetto server not running on %s:%s ?\n" % ( inst, host, port), "See cornetto-server.py -h"
emsrc/pycornetto
bin/cornetto-client.py
Python
gpl-3.0
6,265
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 1001, 9385, 1006, 1039, 1007, 2263, 1011, 2286, 2011, 1001, 22209, 7733, 2072, 1998, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.globalaccelerator.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.globalaccelerator.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.protocol.Protocol; import com.amazonaws.annotation.SdkInternalApi; /** * WithdrawByoipCidrRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class WithdrawByoipCidrRequestProtocolMarshaller implements Marshaller<Request<WithdrawByoipCidrRequest>, WithdrawByoipCidrRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.AWS_JSON).requestUri("/") .httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true) .operationIdentifier("GlobalAccelerator_V20180706.WithdrawByoipCidr").serviceName("AWSGlobalAccelerator").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public WithdrawByoipCidrRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<WithdrawByoipCidrRequest> marshall(WithdrawByoipCidrRequest withdrawByoipCidrRequest) { if (withdrawByoipCidrRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<WithdrawByoipCidrRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING, withdrawByoipCidrRequest); protocolMarshaller.startMarshalling(); WithdrawByoipCidrRequestMarshaller.getInstance().marshall(withdrawByoipCidrRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
aws/aws-sdk-java
aws-java-sdk-globalaccelerator/src/main/java/com/amazonaws/services/globalaccelerator/model/transform/WithdrawByoipCidrRequestProtocolMarshaller.java
Java
apache-2.0
2,762
[ 30522, 1013, 1008, 1008, 9385, 2418, 1011, 16798, 2475, 9733, 1012, 4012, 1010, 4297, 1012, 2030, 2049, 18460, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*!*************************************************** * mark.js v8.7.0 * https://github.com/julmot/mark.js * Copyright (c) 2014–2017, Julian Motz * Released under the MIT license https://git.io/vwTVl *****************************************************/ "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } (function (factory, window, document) { if (typeof define === "function" && define.amd) { define([], function () { return factory(window, document); }); } else if ((typeof module === "undefined" ? "undefined" : _typeof(module)) === "object" && module.exports) { module.exports = factory(window, document); } else { factory(window, document); } })(function (window, document) { var Mark = function () { function Mark(ctx) { _classCallCheck(this, Mark); this.ctx = ctx; this.ie = false; var ua = window.navigator.userAgent; if (ua.indexOf("MSIE") > -1 || ua.indexOf("Trident") > -1) { this.ie = true; } } _createClass(Mark, [{ key: "log", value: function log(msg) { var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "debug"; var log = this.opt.log; if (!this.opt.debug) { return; } if ((typeof log === "undefined" ? "undefined" : _typeof(log)) === "object" && typeof log[level] === "function") { log[level]("mark.js: " + msg); } } }, { key: "escapeStr", value: function escapeStr(str) { return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } }, { key: "createRegExp", value: function createRegExp(str) { str = this.escapeStr(str); if (Object.keys(this.opt.synonyms).length) { str = this.createSynonymsRegExp(str); } if (this.opt.ignoreJoiners) { str = this.setupIgnoreJoinersRegExp(str); } if (this.opt.diacritics) { str = this.createDiacriticsRegExp(str); } str = this.createMergedBlanksRegExp(str); if (this.opt.ignoreJoiners) { str = this.createIgnoreJoinersRegExp(str); } str = this.createAccuracyRegExp(str); return str; } }, { key: "createSynonymsRegExp", value: function createSynonymsRegExp(str) { var syn = this.opt.synonyms, sens = this.opt.caseSensitive ? "" : "i"; for (var index in syn) { if (syn.hasOwnProperty(index)) { var value = syn[index], k1 = this.escapeStr(index), k2 = this.escapeStr(value); str = str.replace(new RegExp("(" + k1 + "|" + k2 + ")", "gm" + sens), "(" + k1 + "|" + k2 + ")"); } } return str; } }, { key: "setupIgnoreJoinersRegExp", value: function setupIgnoreJoinersRegExp(str) { return str.replace(/[^(|)\\]/g, function (val, indx, original) { var nextChar = original.charAt(indx + 1); if (/[(|)\\]/.test(nextChar) || nextChar === "") { return val; } else { return val + "\0"; } }); } }, { key: "createIgnoreJoinersRegExp", value: function createIgnoreJoinersRegExp(str) { return str.split("\0").join("[\\u00ad|\\u200b|\\u200c|\\u200d]?"); } }, { key: "createDiacriticsRegExp", value: function createDiacriticsRegExp(str) { var sens = this.opt.caseSensitive ? "" : "i", dct = this.opt.caseSensitive ? ["aàáâãäåāąă", "AÀÁÂÃÄÅĀĄĂ", "cçćč", "CÇĆČ", "dđď", "DĐĎ", "eèéêëěēę", "EÈÉÊËĚĒĘ", "iìíîïī", "IÌÍÎÏĪ", "lł", "LŁ", "nñňń", "NÑŇŃ", "oòóôõöøō", "OÒÓÔÕÖØŌ", "rř", "RŘ", "sšśș", "SŠŚȘ", "tťț", "TŤȚ", "uùúûüůū", "UÙÚÛÜŮŪ", "yÿý", "YŸÝ", "zžżź", "ZŽŻŹ"] : ["aÀÁÂÃÄÅàáâãäåĀāąĄăĂ", "cÇçćĆčČ", "dđĐďĎ", "eÈÉÊËèéêëěĚĒēęĘ", "iÌÍÎÏìíîïĪī", "lłŁ", "nÑñňŇńŃ", "oÒÓÔÕÖØòóôõöøŌō", "rřŘ", "sŠšśŚșȘ", "tťŤțȚ", "uÙÚÛÜùúûüůŮŪū", "yŸÿýÝ", "zŽžżŻźŹ"]; var handled = []; str.split("").forEach(function (ch) { dct.every(function (dct) { if (dct.indexOf(ch) !== -1) { if (handled.indexOf(dct) > -1) { return false; } str = str.replace(new RegExp("[" + dct + "]", "gm" + sens), "[" + dct + "]"); handled.push(dct); } return true; }); }); return str; } }, { key: "createMergedBlanksRegExp", value: function createMergedBlanksRegExp(str) { return str.replace(/[\s]+/gmi, "[\\s]+"); } }, { key: "createAccuracyRegExp", value: function createAccuracyRegExp(str) { var _this = this; var acc = this.opt.accuracy, val = typeof acc === "string" ? acc : acc.value, ls = typeof acc === "string" ? [] : acc.limiters, lsJoin = ""; ls.forEach(function (limiter) { lsJoin += "|" + _this.escapeStr(limiter); }); switch (val) { case "partially": default: return "()(" + str + ")"; case "complementary": return "()([^\\s" + lsJoin + "]*" + str + "[^\\s" + lsJoin + "]*)"; case "exactly": return "(^|\\s" + lsJoin + ")(" + str + ")(?=$|\\s" + lsJoin + ")"; } } }, { key: "getSeparatedKeywords", value: function getSeparatedKeywords(sv) { var _this2 = this; var stack = []; sv.forEach(function (kw) { if (!_this2.opt.separateWordSearch) { if (kw.trim() && stack.indexOf(kw) === -1) { stack.push(kw); } } else { kw.split(" ").forEach(function (kwSplitted) { if (kwSplitted.trim() && stack.indexOf(kwSplitted) === -1) { stack.push(kwSplitted); } }); } }); return { "keywords": stack.sort(function (a, b) { return b.length - a.length; }), "length": stack.length }; } }, { key: "getTextNodes", value: function getTextNodes(cb) { var _this3 = this; var val = "", nodes = []; this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function (node) { nodes.push({ start: val.length, end: (val += node.textContent).length, node: node }); }, function (node) { if (_this3.matchesExclude(node.parentNode)) { return NodeFilter.FILTER_REJECT; } else { return NodeFilter.FILTER_ACCEPT; } }, function () { cb({ value: val, nodes: nodes }); }); } }, { key: "matchesExclude", value: function matchesExclude(el) { return DOMIterator.matches(el, this.opt.exclude.concat(["script", "style", "title", "head", "html"])); } }, { key: "wrapRangeInTextNode", value: function wrapRangeInTextNode(node, start, end) { var hEl = !this.opt.element ? "mark" : this.opt.element, startNode = node.splitText(start), ret = startNode.splitText(end - start); var repl = document.createElement(hEl); repl.setAttribute("data-markjs", "true"); if (this.opt.className) { repl.setAttribute("class", this.opt.className); } repl.textContent = startNode.textContent; startNode.parentNode.replaceChild(repl, startNode); return ret; } }, { key: "wrapRangeInMappedTextNode", value: function wrapRangeInMappedTextNode(dict, start, end, filterCb, eachCb) { var _this4 = this; dict.nodes.every(function (n, i) { var sibl = dict.nodes[i + 1]; if (typeof sibl === "undefined" || sibl.start > start) { var _ret = function () { if (!filterCb(n.node)) { return { v: false }; } var s = start - n.start, e = (end > n.end ? n.end : end) - n.start, startStr = dict.value.substr(0, n.start), endStr = dict.value.substr(e + n.start); n.node = _this4.wrapRangeInTextNode(n.node, s, e); dict.value = startStr + endStr; dict.nodes.forEach(function (k, j) { if (j >= i) { if (dict.nodes[j].start > 0 && j !== i) { dict.nodes[j].start -= e; } dict.nodes[j].end -= e; } }); end -= e; eachCb(n.node.previousSibling, n.start); if (end > n.end) { start = n.end; } else { return { v: false }; } }(); if ((typeof _ret === "undefined" ? "undefined" : _typeof(_ret)) === "object") return _ret.v; } return true; }); } }, { key: "wrapMatches", value: function wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) { var _this5 = this; var matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1; this.getTextNodes(function (dict) { dict.nodes.forEach(function (node) { node = node.node; var match = void 0; while ((match = regex.exec(node.textContent)) !== null && match[matchIdx] !== "") { if (!filterCb(match[matchIdx], node)) { continue; } var pos = match.index; if (matchIdx !== 0) { for (var i = 1; i < matchIdx; i++) { pos += match[i].length; } } node = _this5.wrapRangeInTextNode(node, pos, pos + match[matchIdx].length); eachCb(node.previousSibling); regex.lastIndex = 0; } }); endCb(); }); } }, { key: "wrapMatchesAcrossElements", value: function wrapMatchesAcrossElements(regex, ignoreGroups, filterCb, eachCb, endCb) { var _this6 = this; var matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1; this.getTextNodes(function (dict) { var match = void 0; while ((match = regex.exec(dict.value)) !== null && match[matchIdx] !== "") { var start = match.index; if (matchIdx !== 0) { for (var i = 1; i < matchIdx; i++) { start += match[i].length; } } var end = start + match[matchIdx].length; _this6.wrapRangeInMappedTextNode(dict, start, end, function (node) { return filterCb(match[matchIdx], node); }, function (node, lastIndex) { regex.lastIndex = lastIndex; eachCb(node); }); } endCb(); }); } }, { key: "unwrapMatches", value: function unwrapMatches(node) { var parent = node.parentNode; var docFrag = document.createDocumentFragment(); while (node.firstChild) { docFrag.appendChild(node.removeChild(node.firstChild)); } parent.replaceChild(docFrag, node); if (!this.ie) { parent.normalize(); } else { this.normalizeTextNode(parent); } } }, { key: "normalizeTextNode", value: function normalizeTextNode(node) { if (!node) { return; } if (node.nodeType === 3) { while (node.nextSibling && node.nextSibling.nodeType === 3) { node.nodeValue += node.nextSibling.nodeValue; node.parentNode.removeChild(node.nextSibling); } } else { this.normalizeTextNode(node.firstChild); } this.normalizeTextNode(node.nextSibling); } }, { key: "markRegExp", value: function markRegExp(regexp, opt) { var _this7 = this; this.opt = opt; this.log("Searching with expression \"" + regexp + "\""); var totalMatches = 0, fn = "wrapMatches"; var eachCb = function eachCb(element) { totalMatches++; _this7.opt.each(element); }; if (this.opt.acrossElements) { fn = "wrapMatchesAcrossElements"; } this[fn](regexp, this.opt.ignoreGroups, function (match, node) { return _this7.opt.filter(node, match, totalMatches); }, eachCb, function () { if (totalMatches === 0) { _this7.opt.noMatch(regexp); } _this7.opt.done(totalMatches); }); } }, { key: "mark", value: function mark(sv, opt) { var _this8 = this; this.opt = opt; var totalMatches = 0, fn = "wrapMatches"; var _getSeparatedKeywords = this.getSeparatedKeywords(typeof sv === "string" ? [sv] : sv), kwArr = _getSeparatedKeywords.keywords, kwArrLen = _getSeparatedKeywords.length, sens = this.opt.caseSensitive ? "" : "i", handler = function handler(kw) { var regex = new RegExp(_this8.createRegExp(kw), "gm" + sens), matches = 0; _this8.log("Searching with expression \"" + regex + "\""); _this8[fn](regex, 1, function (term, node) { return _this8.opt.filter(node, kw, totalMatches, matches); }, function (element) { matches++; totalMatches++; _this8.opt.each(element); }, function () { if (matches === 0) { _this8.opt.noMatch(kw); } if (kwArr[kwArrLen - 1] === kw) { _this8.opt.done(totalMatches); } else { handler(kwArr[kwArr.indexOf(kw) + 1]); } }); }; if (this.opt.acrossElements) { fn = "wrapMatchesAcrossElements"; } if (kwArrLen === 0) { this.opt.done(totalMatches); } else { handler(kwArr[0]); } } }, { key: "unmark", value: function unmark(opt) { var _this9 = this; this.opt = opt; var sel = this.opt.element ? this.opt.element : "*"; sel += "[data-markjs]"; if (this.opt.className) { sel += "." + this.opt.className; } this.log("Removal selector \"" + sel + "\""); this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, function (node) { _this9.unwrapMatches(node); }, function (node) { var matchesSel = DOMIterator.matches(node, sel), matchesExclude = _this9.matchesExclude(node); if (!matchesSel || matchesExclude) { return NodeFilter.FILTER_REJECT; } else { return NodeFilter.FILTER_ACCEPT; } }, this.opt.done); } }, { key: "opt", set: function set(val) { this._opt = _extends({}, { "element": "", "className": "", "exclude": [], "iframes": false, "separateWordSearch": true, "diacritics": true, "synonyms": {}, "accuracy": "partially", "acrossElements": false, "caseSensitive": false, "ignoreJoiners": false, "ignoreGroups": 0, "each": function each() {}, "noMatch": function noMatch() {}, "filter": function filter() { return true; }, "done": function done() {}, "debug": false, "log": window.console }, val); }, get: function get() { return this._opt; } }, { key: "iterator", get: function get() { if (!this._iterator) { this._iterator = new DOMIterator(this.ctx, this.opt.iframes, this.opt.exclude); } return this._iterator; } }]); return Mark; }(); var DOMIterator = function () { function DOMIterator(ctx) { var iframes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; _classCallCheck(this, DOMIterator); this.ctx = ctx; this.iframes = iframes; this.exclude = exclude; } _createClass(DOMIterator, [{ key: "getContexts", value: function getContexts() { var ctx = void 0, filteredCtx = []; if (typeof this.ctx === "undefined" || !this.ctx) { ctx = []; } else if (NodeList.prototype.isPrototypeOf(this.ctx)) { ctx = Array.prototype.slice.call(this.ctx); } else if (Array.isArray(this.ctx)) { ctx = this.ctx; } else if (typeof this.ctx === "string") { ctx = Array.prototype.slice.call(document.querySelectorAll(this.ctx)); } else { ctx = [this.ctx]; } ctx.forEach(function (ctx) { var isDescendant = filteredCtx.filter(function (contexts) { return contexts.contains(ctx); }).length > 0; if (filteredCtx.indexOf(ctx) === -1 && !isDescendant) { filteredCtx.push(ctx); } }); return filteredCtx; } }, { key: "getIframeContents", value: function getIframeContents(ifr, successFn) { var errorFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; var doc = void 0; try { var ifrWin = ifr.contentWindow; doc = ifrWin.document; if (!ifrWin || !doc) { throw new Error("iframe inaccessible"); } } catch (e) { errorFn(); } if (doc) { successFn(doc); } } }, { key: "onIframeReady", value: function onIframeReady(ifr, successFn, errorFn) { var _this10 = this; try { (function () { var ifrWin = ifr.contentWindow, bl = "about:blank", compl = "complete", isBlank = function isBlank() { var src = ifr.getAttribute("src").trim(), href = ifrWin.location.href; return href === bl && src !== bl && src; }, observeOnload = function observeOnload() { var listener = function listener() { try { if (!isBlank()) { ifr.removeEventListener("load", listener); _this10.getIframeContents(ifr, successFn, errorFn); } } catch (e) { errorFn(); } }; ifr.addEventListener("load", listener); }; if (ifrWin.document.readyState === compl) { if (isBlank()) { observeOnload(); } else { _this10.getIframeContents(ifr, successFn, errorFn); } } else { observeOnload(); } })(); } catch (e) { errorFn(); } } }, { key: "waitForIframes", value: function waitForIframes(ctx, done) { var _this11 = this; var eachCalled = 0; this.forEachIframe(ctx, function () { return true; }, function (ifr) { eachCalled++; _this11.waitForIframes(ifr.querySelector("html"), function () { if (! --eachCalled) { done(); } }); }, function (handled) { if (!handled) { done(); } }); } }, { key: "forEachIframe", value: function forEachIframe(ctx, filter, each) { var _this12 = this; var end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {}; var ifr = ctx.querySelectorAll("iframe"), open = ifr.length, handled = 0; ifr = Array.prototype.slice.call(ifr); var checkEnd = function checkEnd() { if (--open <= 0) { end(handled); } }; if (!open) { checkEnd(); } ifr.forEach(function (ifr) { if (DOMIterator.matches(ifr, _this12.exclude)) { checkEnd(); } else { _this12.onIframeReady(ifr, function (con) { if (filter(ifr)) { handled++; each(con); } checkEnd(); }, checkEnd); } }); } }, { key: "createIterator", value: function createIterator(ctx, whatToShow, filter) { return document.createNodeIterator(ctx, whatToShow, filter, false); } }, { key: "createInstanceOnIframe", value: function createInstanceOnIframe(contents) { return new DOMIterator(contents.querySelector("html"), this.iframes); } }, { key: "compareNodeIframe", value: function compareNodeIframe(node, prevNode, ifr) { var compCurr = node.compareDocumentPosition(ifr), prev = Node.DOCUMENT_POSITION_PRECEDING; if (compCurr & prev) { if (prevNode !== null) { var compPrev = prevNode.compareDocumentPosition(ifr), after = Node.DOCUMENT_POSITION_FOLLOWING; if (compPrev & after) { return true; } } else { return true; } } return false; } }, { key: "getIteratorNode", value: function getIteratorNode(itr) { var prevNode = itr.previousNode(); var node = void 0; if (prevNode === null) { node = itr.nextNode(); } else { node = itr.nextNode() && itr.nextNode(); } return { prevNode: prevNode, node: node }; } }, { key: "checkIframeFilter", value: function checkIframeFilter(node, prevNode, currIfr, ifr) { var key = false, handled = false; ifr.forEach(function (ifrDict, i) { if (ifrDict.val === currIfr) { key = i; handled = ifrDict.handled; } }); if (this.compareNodeIframe(node, prevNode, currIfr)) { if (key === false && !handled) { ifr.push({ val: currIfr, handled: true }); } else if (key !== false && !handled) { ifr[key].handled = true; } return true; } if (key === false) { ifr.push({ val: currIfr, handled: false }); } return false; } }, { key: "handleOpenIframes", value: function handleOpenIframes(ifr, whatToShow, eCb, fCb) { var _this13 = this; ifr.forEach(function (ifrDict) { if (!ifrDict.handled) { _this13.getIframeContents(ifrDict.val, function (con) { _this13.createInstanceOnIframe(con).forEachNode(whatToShow, eCb, fCb); }); } }); } }, { key: "iterateThroughNodes", value: function iterateThroughNodes(whatToShow, ctx, eachCb, filterCb, doneCb) { var _this14 = this; var itr = this.createIterator(ctx, whatToShow, filterCb); var ifr = [], elements = [], node = void 0, prevNode = void 0, retrieveNodes = function retrieveNodes() { var _getIteratorNode = _this14.getIteratorNode(itr); prevNode = _getIteratorNode.prevNode; node = _getIteratorNode.node; return node; }; while (retrieveNodes()) { if (this.iframes) { this.forEachIframe(ctx, function (currIfr) { return _this14.checkIframeFilter(node, prevNode, currIfr, ifr); }, function (con) { _this14.createInstanceOnIframe(con).forEachNode(whatToShow, eachCb, filterCb); }); } elements.push(node); } elements.forEach(function (node) { eachCb(node); }); if (this.iframes) { this.handleOpenIframes(ifr, whatToShow, eachCb, filterCb); } doneCb(); } }, { key: "forEachNode", value: function forEachNode(whatToShow, each, filter) { var _this15 = this; var done = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {}; var contexts = this.getContexts(); var open = contexts.length; if (!open) { done(); } contexts.forEach(function (ctx) { var ready = function ready() { _this15.iterateThroughNodes(whatToShow, ctx, each, filter, function () { if (--open <= 0) { done(); } }); }; if (_this15.iframes) { _this15.waitForIframes(ctx, ready); } else { ready(); } }); } }], [{ key: "matches", value: function matches(element, selector) { var selectors = typeof selector === "string" ? [selector] : selector, fn = element.matches || element.matchesSelector || element.msMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector; if (fn) { var match = false; selectors.every(function (sel) { if (fn.call(element, sel)) { match = true; return false; } return true; }); return match; } else { return false; } } }]); return DOMIterator; }(); window.Mark = function (ctx) { var _this16 = this; var instance = new Mark(ctx); this.mark = function (sv, opt) { instance.mark(sv, opt); return _this16; }; this.markRegExp = function (sv, opt) { instance.markRegExp(sv, opt); return _this16; }; this.unmark = function (opt) { instance.unmark(opt); return _this16; }; return this; }; return window.Mark; }, window, document);
Asaf-S/jsdelivr
files/mark.js/8.7.0/mark.js
JavaScript
mit
35,152
[ 30522, 1013, 1008, 999, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // smbBuffer.h // test // // Created by trekvn on 4/13/17. // Copyright © 2017 trekvn. All rights reserved. // #ifdef __OBJC__ #import <Foundation/Foundation.h> /*!Hold a pointer and the size of its data */ typedef struct { void *data; /// Data pointed size_t size; /// Size in byte of the pointed } smb_buffer; @interface smbBuffer : NSObject #pragma mark - smbBufferInit /*!Initialize a buffer structure. It'll contain nothing *\param buf Pointer to a buffer to initialize */ void smb_buffer_init(smb_buffer *buf, void *data, size_t size); #pragma mark - smbBufferAlloc /*!Allocate a size long memory area and place it in the buffer structure */ int smb_buffer_alloc(smb_buffer *buf, size_t size); #pragma mark - smbBufferFree /*!Free the data of this buffer if necessary *\param buf Pointer to a buffer to free */ void smb_buffer_free(smb_buffer *buf); @end #endif
fanta1ty/libdsm
libdsm/libdsm/libdsm/smb/smbBuffer/smbBuffer.h
C
apache-2.0
906
[ 30522, 1013, 1013, 1013, 1013, 15488, 10322, 16093, 7512, 1012, 1044, 1013, 1013, 3231, 1013, 1013, 1013, 1013, 2580, 2011, 10313, 16022, 2006, 1018, 1013, 2410, 1013, 2459, 1012, 1013, 1013, 9385, 1075, 2418, 10313, 16022, 1012, 2035, 2916...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html> <body> <p>This test ensures WebKit does not fire click event on a node that has been removed and inserted back in mouseup event.</p> <div id="test"><span id="target" onmouseup="mouseup()" onclick="test.innerHTML = 'FAIL';">click here</span></div> <script> var test = document.getElementById('test'); var target = document.getElementById('target'); function mouseup() { test.appendChild(document.createTextNode('PASS')); test.removeChild(target); test.appendChild(target); } if (window.testRunner) { testRunner.dumpAsText(); if (!window.eventSender) test.innerHTML = 'FAIL - this test requires eventSender'; else { eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth / 2, target.offsetTop + target.offsetHeight / 2); eventSender.mouseDown(); eventSender.leapForward(200); eventSender.mouseUp(); test.removeChild(target); } } </script> </body> </html>
js0701/chromium-crosswalk
third_party/WebKit/LayoutTests/fast/events/remove-target-in-mouseup-insertback.html
HTML
bsd-3-clause
964
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 1028, 1026, 2303, 1028, 1026, 1052, 1028, 2023, 3231, 21312, 4773, 23615, 2515, 2025, 2543, 11562, 2724, 2006, 1037, 13045, 2008, 2038, 2042, 3718, 1998, 12889, 2067, 1999, 8000, 6279...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; namespace Zergatul.IO.Compression { public class BrotliStreamException : Exception { } }
Zergatul/ZergatulLib
Zergatul/IO/Compression/BrotliStreamException.cs
C#
mit
118
[ 30522, 2478, 2291, 1025, 3415, 15327, 27838, 28921, 8525, 2140, 1012, 22834, 1012, 13379, 1063, 2270, 2465, 22953, 19646, 2923, 16416, 4168, 2595, 24422, 1024, 6453, 1063, 1065, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the output module field formatting helper.""" import unittest from dfdatetime import semantic_time as dfdatetime_semantic_time from dfvfs.path import fake_path_spec from plaso.containers import events from plaso.lib import definitions from plaso.output import formatting_helper from tests.containers import test_lib as containers_test_lib from tests.output import test_lib class TestFieldFormattingHelper(formatting_helper.FieldFormattingHelper): """Field formatter helper for testing purposes.""" _FIELD_FORMAT_CALLBACKS = {'zone': '_FormatTimeZone'} class FieldFormattingHelperTest(test_lib.OutputModuleTestCase): """Test the output module field formatting helper.""" # pylint: disable=protected-access _TEST_EVENTS = [ {'data_type': 'test:event', 'filename': 'log/syslog.1', 'hostname': 'ubuntu', 'path_spec': fake_path_spec.FakePathSpec( location='log/syslog.1'), 'text': ( 'Reporter <CRON> PID: 8442 (pam_unix(cron:session): session\n ' 'closed for user root)'), 'timestamp': '2012-06-27 18:17:01', 'timestamp_desc': definitions.TIME_DESCRIPTION_CHANGE}] def testFormatDateTime(self): """Tests the _FormatDateTime function with dynamic time.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '2012-06-27T18:17:01.000000+00:00') output_mediator.SetTimezone('Europe/Amsterdam') date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '2012-06-27T20:17:01.000000+02:00') output_mediator.SetTimezone('UTC') event.date_time = dfdatetime_semantic_time.InvalidTime() date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, 'Invalid') def testFormatDateTimeWithoutDynamicTime(self): """Tests the _FormatDateTime function without dynamic time.""" output_mediator = self._CreateOutputMediator(dynamic_time=False) test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) # Test with event.date_time date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '2012-06-27T18:17:01.000000+00:00') output_mediator.SetTimezone('Europe/Amsterdam') date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '2012-06-27T20:17:01.000000+02:00') output_mediator.SetTimezone('UTC') event.date_time = dfdatetime_semantic_time.InvalidTime() date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '0000-00-00T00:00:00.000000+00:00') # Test with event.timestamp event.date_time = None date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '2012-06-27T18:17:01.000000+00:00') event.timestamp = 0 date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '0000-00-00T00:00:00.000000+00:00') event.timestamp = -9223372036854775808 date_time_string = test_helper._FormatDateTime( event, event_data, event_data_stream) self.assertEqual(date_time_string, '0000-00-00T00:00:00.000000+00:00') def testFormatDisplayName(self): """Tests the _FormatDisplayName function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) display_name_string = test_helper._FormatDisplayName( event, event_data, event_data_stream) self.assertEqual(display_name_string, 'FAKE:log/syslog.1') def testFormatFilename(self): """Tests the _FormatFilename function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) filename_string = test_helper._FormatFilename( event, event_data, event_data_stream) self.assertEqual(filename_string, 'log/syslog.1') def testFormatHostname(self): """Tests the _FormatHostname function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) hostname_string = test_helper._FormatHostname( event, event_data, event_data_stream) self.assertEqual(hostname_string, 'ubuntu') def testFormatInode(self): """Tests the _FormatInode function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) inode_string = test_helper._FormatInode( event, event_data, event_data_stream) self.assertEqual(inode_string, '-') def testFormatMACB(self): """Tests the _FormatMACB function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) macb_string = test_helper._FormatMACB(event, event_data, event_data_stream) self.assertEqual(macb_string, '..C.') def testFormatMessage(self): """Tests the _FormatMessage function.""" output_mediator = self._CreateOutputMediator() formatters_directory_path = self._GetTestFilePath(['formatters']) output_mediator.ReadMessageFormattersFromDirectory( formatters_directory_path) test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) message_string = test_helper._FormatMessage( event, event_data, event_data_stream) expected_message_string = ( 'Reporter <CRON> PID: 8442 (pam_unix(cron:session): session closed ' 'for user root)') self.assertEqual(message_string, expected_message_string) def testFormatMessageShort(self): """Tests the _FormatMessageShort function.""" output_mediator = self._CreateOutputMediator() formatters_directory_path = self._GetTestFilePath(['formatters']) output_mediator.ReadMessageFormattersFromDirectory( formatters_directory_path) test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) message_short_string = test_helper._FormatMessageShort( event, event_data, event_data_stream) expected_message_short_string = ( 'Reporter <CRON> PID: 8442 (pam_unix(cron:session): session closed ' 'for user root)') self.assertEqual(message_short_string, expected_message_short_string) def testFormatSource(self): """Tests the _FormatSource function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) source_string = test_helper._FormatSource( event, event_data, event_data_stream) self.assertEqual(source_string, 'Test log file') def testFormatSourceShort(self): """Tests the _FormatSourceShort function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) source_short_string = test_helper._FormatSourceShort( event, event_data, event_data_stream) self.assertEqual(source_short_string, 'FILE') def testFormatTag(self): """Tests the _FormatTag function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) tag_string = test_helper._FormatTag(None) self.assertEqual(tag_string, '-') event_tag = events.EventTag() event_tag.AddLabel('one') event_tag.AddLabel('two') tag_string = test_helper._FormatTag(event_tag) self.assertEqual(tag_string, 'one two') def testFormatTime(self): """Tests the _FormatTime function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) # Test with event.date_time time_string = test_helper._FormatTime( event, event_data, event_data_stream) self.assertEqual(time_string, '18:17:01') output_mediator.SetTimezone('Europe/Amsterdam') time_string = test_helper._FormatTime( event, event_data, event_data_stream) self.assertEqual(time_string, '20:17:01') output_mediator.SetTimezone('UTC') # Test with event.timestamp event.date_time = None time_string = test_helper._FormatTime( event, event_data, event_data_stream) self.assertEqual(time_string, '18:17:01') event.timestamp = 0 time_string = test_helper._FormatTime( event, event_data, event_data_stream) self.assertEqual(time_string, '--:--:--') event.timestamp = -9223372036854775808 time_string = test_helper._FormatTime( event, event_data, event_data_stream) self.assertEqual(time_string, '--:--:--') def testFormatTimeZone(self): """Tests the _FormatTimeZone function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) zone_string = test_helper._FormatTimeZone( event, event_data, event_data_stream) self.assertEqual(zone_string, 'UTC') def testFormatUsername(self): """Tests the _FormatUsername function.""" output_mediator = self._CreateOutputMediator() test_helper = formatting_helper.FieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) username_string = test_helper._FormatUsername( event, event_data, event_data_stream) self.assertEqual(username_string, '-') # TODO: add coverage for _ReportEventError def testGetFormattedField(self): """Tests the GetFormattedField function.""" output_mediator = self._CreateOutputMediator() test_helper = TestFieldFormattingHelper(output_mediator) event, event_data, event_data_stream = ( containers_test_lib.CreateEventFromValues(self._TEST_EVENTS[0])) zone_string = test_helper.GetFormattedField( 'zone', event, event_data, event_data_stream, None) self.assertEqual(zone_string, 'UTC') if __name__ == '__main__': unittest.main()
kiddinn/plaso
tests/output/formatting_helper.py
Python
apache-2.0
12,029
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 2509, 1001, 1011, 1008, 1011, 16861, 1024, 21183, 2546, 1011, 1022, 1011, 1008, 1011, 1000, 1000, 1000, 5852, 2005, 1996, 6434, 11336, 2492, 4289, 3436, 2393, 2121, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{% extends "base.html" %} {% load addcss %} {% load i18n %} {% load staticfiles %} {% load breadcrumbs %} {% block breadcrumbs %} <div class="breadcrumbs"> <a href="{% url 'index' %}">{% trans 'Home' %}</a> {% breadcrumb_url 'Resources' 'resources' %} {% breadcrumb_url 'Create' 'create-resource' %} </div> {% endblock %} {% block content %} <div class="row" style="margin-top: 20px;"> <div class="col-sm-4 text-center"> <a class="btn btn-lg" href="{% url "create-resource-file" %}{% if collection %}?collection={{collection}}{% endif %}"> <span class="glyphicon glyphicon-open-file"></span> Upload file </a> <p class="text-muted"> Most mainstream file formats are supported. For large files, be sure that you have a reliable connection to the internet. </p> </div> <div class="col-sm-4 text-center"> <a class="btn btn-lg" href="{% url "create-resource-bulk" %}{% if collection %}?collection={{collection}}{% endif %}"> <img class="img" src="{% static "cookies/img/zotero_z.png" %}" style="height: 20px;"></img>&nbsp; Upload from Zotero </a> <p class="text-muted"> JARS supports the Zotero RDF format. Export your collection (including files) to Zotero RDF. </p> </div> <div class="col-sm-4 text-center"> <a class="btn btn-lg" href="{% url "create-resource-url" %}{% if collection %}?collection={{collection}}{% endif %}"> <span class="glyphicon glyphicon-link"></span> Add a remote resource </a> <p class="text-muted"> Add a resource that's already online! Just enter the URL, and you'll be able to add descriptive metadata and incorporate it into your collections. </p> </div> </div> {% endblock %}
diging/jars
cookies/templates/create_resource.html
HTML
gpl-3.0
1,856
[ 30522, 1063, 1003, 8908, 1000, 2918, 1012, 16129, 1000, 1003, 1065, 1063, 1003, 7170, 5587, 6169, 2015, 1003, 1065, 1063, 1003, 7170, 1045, 15136, 2078, 1003, 1065, 1063, 1003, 7170, 10763, 8873, 4244, 1003, 1065, 1063, 1003, 7170, 7852, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*************************************************************************** * Copyright 2015 Kieker Project (http://kieker-monitoring.net) * * 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 kieker.test.common.junit.record.flow.trace.concurrency.monitor; import java.nio.ByteBuffer; import org.junit.Assert; import org.junit.Test; import kieker.common.record.flow.trace.concurrency.monitor.MonitorNotifyEvent; import kieker.common.util.registry.IRegistry; import kieker.common.util.registry.Registry; import kieker.test.common.junit.AbstractKiekerTest; /** * @author Jan Waller * * @since 1.8 */ public class TestMonitorNotifyEvent extends AbstractKiekerTest { private static final long TSTAMP = 987998L; private static final long TRACE_ID = 23444L; private static final int ORDER_INDEX = 234; private static final int LOCK_ID = 13; /** * Default constructor. */ public TestMonitorNotifyEvent() { // empty default constructor } /** * Tests the constructor and toArray(..) methods of {@link MonitorNotifyEvent}. * * Assert that a record instance event1 equals an instance event2 created by serializing event1 to an array event1Array * and using event1Array to construct event2. This ignores a set loggingTimestamp! */ @Test public void testSerializeDeserializeEquals() { final MonitorNotifyEvent event1 = new MonitorNotifyEvent(TSTAMP, TRACE_ID, ORDER_INDEX, LOCK_ID); Assert.assertEquals("Unexpected timestamp", TSTAMP, event1.getTimestamp()); Assert.assertEquals("Unexpected trace ID", TRACE_ID, event1.getTraceId()); Assert.assertEquals("Unexpected order index", ORDER_INDEX, event1.getOrderIndex()); Assert.assertEquals("Unexpected lock id", LOCK_ID, event1.getLockId()); final Object[] event1Array = event1.toArray(); final MonitorNotifyEvent event2 = new MonitorNotifyEvent(event1Array); Assert.assertEquals(event1, event2); Assert.assertEquals(0, event1.compareTo(event2)); } /** * Tests the constructor and writeBytes(..) methods of {@link MonitorNotifyEvent}. */ @Test public void testSerializeDeserializeBinaryEquals() { final MonitorNotifyEvent event1 = new MonitorNotifyEvent(TSTAMP, TRACE_ID, ORDER_INDEX, LOCK_ID); Assert.assertEquals("Unexpected timestamp", TSTAMP, event1.getTimestamp()); Assert.assertEquals("Unexpected trace ID", TRACE_ID, event1.getTraceId()); Assert.assertEquals("Unexpected order index", ORDER_INDEX, event1.getOrderIndex()); Assert.assertEquals("Unexpected lock id", LOCK_ID, event1.getLockId()); final IRegistry<String> stringRegistry = new Registry<String>(); final ByteBuffer buffer = ByteBuffer.allocate(event1.getSize()); event1.writeBytes(buffer, stringRegistry); buffer.flip(); final MonitorNotifyEvent event2 = new MonitorNotifyEvent(buffer, stringRegistry); Assert.assertEquals(event1, event2); Assert.assertEquals(0, event1.compareTo(event2)); } }
HaStr/kieker
kieker-common/test/kieker/test/common/junit/record/flow/trace/concurrency/monitor/TestMonitorNotifyEvent.java
Java
apache-2.0
3,493
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // GRMBrewery.h // GM Taplist // // Created by Daniel Miedema on 11/2/14. // Copyright (c) 2014 Growl Movement. All rights reserved. // #import "GRMBaseObject.h" #import "GRMBeer.h" @interface GRMBrewery : GRMBaseObject @property NSInteger brewery_id; @property NSString * city; @property NSString *logo_url; @property NSString *name; @property NSString *state; @property RLMArray<GRMBeer> *beers; @end
dmiedema/psychic-dubstep
GRMKit/Models/GRMBrewery.h
C
mit
417
[ 30522, 1013, 1013, 1013, 1013, 24665, 19908, 13777, 2100, 1012, 1044, 1013, 1013, 13938, 11112, 9863, 1013, 1013, 1013, 1013, 2580, 2011, 3817, 2771, 14728, 2863, 2006, 2340, 1013, 1016, 1013, 2403, 1012, 1013, 1013, 9385, 1006, 1039, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* High Adventure 3D Game Engine Copyright (C) 2002 Rodney Degracia 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 rodney_degracia(at)elitefrontier.com Rodney Degracia 316 Independence Ave. SE Washington DC 2003 */ #pragma once #include "Vector.h" #include "Geometry.h" #include "GeometryTrait.h" #include "ComponentTrait.h" //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //Forward Declarations template<typename T> class Vector1x3; template<typename T> class Vector3x1; template <typename T, typename ComponentTrait, typename GeometryTrait=StandardEuclidean> class LinearComponent; //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //Distance Calculation Function Template Definitions template <typename T, typename TransformationTrait> T CalcDistance(const HomogeneousCoordinate<T,TransformationTrait>& point1, const HomogeneousCoordinate<T,TransformationTrait>& point2) { HomogeneousCoordinate<T,TransformationTrait> P(point1-point2); return P.Magnitude(); } template <typename T> T CalcDistance(const Vector3x1<T>& point1, const Vector3x1<T>& point2) { Vector3x1<T> P(point1-point2); return P.Magnitude(); } /* template<typename T> T CalcDistance(const Point<T,GeometryTrait>& point, const LinearComponent<T,Ray>& linearcomponent) { T t0=Dot<float,3,3>(linearcomponent.m_M,(point.m_P-linearcomponent.m_B))/ Dot<float>(linearcomponent.m_M,linearcomponent.m_M); if(t0<=0.0f) //Behind the Ray startpoint { typename GeometryTrait::Vector v(point.m_P-linearcomponent.m_B); return (v.Magnitude()); } else //Anywhere in front of the Ray startpoint { typename GeometryTrait::Vector v(point.m_P-(linearcomponent.m_B-(t0*linearcomponent.m_M))); return (v.Magnitude()); } } template<typename T, typename GeometryTrait> T CalcDistance(const Point<T>& point, const LinearComponent<T,Segment>& linearcomponent) { T t0=Dot<float>(linearcomponent.m_M,(point.m_P-linearcomponent.m_B))/ Dot<float>(linearcomponent.m_M,linearcomponent.m_M); if(t0<=0.0f) //Behind the starting point of the segment { typename GeometryTrait::Vector v(point.m_P-linearcomponent.m_B); return (v.Magnitude()); } else if (t0>0 && t0<1) //Within the start and endpoints of the segment { typename GeometryTrait::Vector v(point.m_P-(linearcomponent.m_B-(t0*linearcomponent.m_M))); return (v.Magnitude()); } else //Beyond the endpoint of the segment { typename GeometryTrait::Vector v(point.m_P-(linearcomponent.m_B-linearcomponent.m_M))); return (v.Magnitude()); } } template<typename T, typename class GeometryTrait> T CalcDistance(const Point<T>& point, const LinearComponent<T,Line>& linearcomponent) { T t0=Vector<float,3,1>::Dot(linearcomponent.m_M,(point.m_P-linearcomponent.m_B))/ Vector<float,3,1>::Dot(linearcomponent.m_M,linearcomponent.m_M); //Since we have a line, we don't care if t0 is positive, negative, or zero typename GeometryTrait::Vector v(point.m_P-(linearcomponent.m_B-(t0*linearcomponent.m_M))); return (v.Magnitude()); } template<typename T, typename GeometryTrait> T CalcDistance(const LinearComponent<T,Line>& lc0, const LinearComponent<T,Line>& lc1) { T a=Dot<T>(lc0.m_M,lc0.m_M); T b=-(Dot<T>(lc0.m_M,lc1.m_M)); T c=Dot<T>(lc1.m_M,lc1.m_M); T d=Dot<T>(lc0.m_M,(lc0.m_B-lc1.m_B)); T e=-(Dot<T>(lc1.m_M,(lc0.m_B-lc1.m_B))); T f=Dot<T>((lc0.m_B-lc1.m_B),(lc0.m_B-lc1.m_B)); T det=abs(a*c-b*b); //Always greaterthan or equal to zero assert((det>0)||(det==0)); //TODO: //Check accuracy of det if (det>0) //Lines are not parallel { float invdet=1/det; s=(b*e-c*d)*invdet; t=(b*d-a*e)*invdet; return s*(a*s+b*t+2*d)+t*(b*s+c*t+2*e)+f; } else //Lines are parallel { s=-d/a; t=0; return d*s+f; } } */
rdegraci/high-adventure-engine
engine/Distance.h
C
gpl-2.0
4,802
[ 30522, 1013, 1008, 2152, 6172, 7605, 2208, 3194, 9385, 1006, 1039, 1007, 2526, 13898, 2139, 17643, 7405, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 2009, 2104, 1996, 3408, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * S390 kdump implementation * * Copyright IBM Corp. 2011 * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com> */ #include <linux/crash_dump.h> #include <asm/lowcore.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/gfp.h> #include <linux/slab.h> #include <linux/bootmem.h> #include <linux/elf.h> #include <asm/os_info.h> #include <asm/elf.h> #include <asm/ipl.h> #include <asm/sclp.h> #define PTR_ADD(x, y) (((char *) (x)) + ((unsigned long) (y))) #define PTR_SUB(x, y) (((char *) (x)) - ((unsigned long) (y))) #define PTR_DIFF(x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y)))) struct dump_save_areas dump_save_areas; /* * Allocate and add a save area for a CPU */ struct save_area_ext *dump_save_area_create(int cpu) { struct save_area_ext **save_areas, *save_area; save_area = kmalloc(sizeof(*save_area), GFP_KERNEL); if (!save_area) return NULL; if (cpu + 1 > dump_save_areas.count) { dump_save_areas.count = cpu + 1; save_areas = krealloc(dump_save_areas.areas, dump_save_areas.count * sizeof(void *), GFP_KERNEL | __GFP_ZERO); if (!save_areas) { kfree(save_area); return NULL; } dump_save_areas.areas = save_areas; } dump_save_areas.areas[cpu] = save_area; return save_area; } /* * Return physical address for virtual address */ static inline void *load_real_addr(void *addr) { unsigned long real_addr; asm volatile( " lra %0,0(%1)\n" " jz 0f\n" " la %0,0\n" "0:" : "=a" (real_addr) : "a" (addr) : "cc"); return (void *)real_addr; } /* * Copy up to one page to vmalloc or real memory */ static ssize_t copy_page_real(void *buf, void *src, size_t csize) { size_t size; if (is_vmalloc_addr(buf)) { BUG_ON(csize > PAGE_SIZE); /* If buf is not page aligned, copy first part */ size = min(roundup(__pa(buf), PAGE_SIZE) - __pa(buf), csize); if (size) { if (memcpy_real(load_real_addr(buf), src, size)) return -EFAULT; buf += size; src += size; } /* Copy second part */ size = csize - size; return (size) ? memcpy_real(load_real_addr(buf), src, size) : 0; } else { return memcpy_real(buf, src, csize); } } /* * Pointer to ELF header in new kernel */ static void *elfcorehdr_newmem; /* * Copy one page from zfcpdump "oldmem" * * For pages below HSA size memory from the HSA is copied. Otherwise * real memory copy is used. */ static ssize_t copy_oldmem_page_zfcpdump(char *buf, size_t csize, unsigned long src, int userbuf) { int rc; if (src < sclp_get_hsa_size()) { rc = memcpy_hsa(buf, src, csize, userbuf); } else { if (userbuf) rc = copy_to_user_real((void __force __user *) buf, (void *) src, csize); else rc = memcpy_real(buf, (void *) src, csize); } return rc ? rc : csize; } /* * Copy one page from kdump "oldmem" * * For the kdump reserved memory this functions performs a swap operation: * - [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE] is mapped to [0 - OLDMEM_SIZE]. * - [0 - OLDMEM_SIZE] is mapped to [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE] */ static ssize_t copy_oldmem_page_kdump(char *buf, size_t csize, unsigned long src, int userbuf) { int rc; if (src < OLDMEM_SIZE) src += OLDMEM_BASE; else if (src > OLDMEM_BASE && src < OLDMEM_BASE + OLDMEM_SIZE) src -= OLDMEM_BASE; if (userbuf) rc = copy_to_user_real((void __force __user *) buf, (void *) src, csize); else rc = copy_page_real(buf, (void *) src, csize); return (rc == 0) ? rc : csize; } /* * Copy one page from "oldmem" */ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf) { unsigned long src; if (!csize) return 0; src = (pfn << PAGE_SHIFT) + offset; if (OLDMEM_BASE) return copy_oldmem_page_kdump(buf, csize, src, userbuf); else return copy_oldmem_page_zfcpdump(buf, csize, src, userbuf); } /* * Remap "oldmem" for kdump * * For the kdump reserved memory this functions performs a swap operation: * [0 - OLDMEM_SIZE] is mapped to [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE] */ static int remap_oldmem_pfn_range_kdump(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot) { unsigned long size_old; int rc; if (pfn < OLDMEM_SIZE >> PAGE_SHIFT) { size_old = min(size, OLDMEM_SIZE - (pfn << PAGE_SHIFT)); rc = remap_pfn_range(vma, from, pfn + (OLDMEM_BASE >> PAGE_SHIFT), size_old, prot); if (rc || size == size_old) return rc; size -= size_old; from += size_old; pfn += size_old >> PAGE_SHIFT; } return remap_pfn_range(vma, from, pfn, size, prot); } /* * Remap "oldmem" for zfcpdump * * We only map available memory above HSA size. Memory below HSA size * is read on demand using the copy_oldmem_page() function. */ static int remap_oldmem_pfn_range_zfcpdump(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot) { unsigned long hsa_end = sclp_get_hsa_size(); unsigned long size_hsa; if (pfn < hsa_end >> PAGE_SHIFT) { size_hsa = min(size, hsa_end - (pfn << PAGE_SHIFT)); if (size == size_hsa) return 0; size -= size_hsa; from += size_hsa; pfn += size_hsa >> PAGE_SHIFT; } return remap_pfn_range(vma, from, pfn, size, prot); } /* * Remap "oldmem" for kdump or zfcpdump */ int remap_oldmem_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot) { if (OLDMEM_BASE) return remap_oldmem_pfn_range_kdump(vma, from, pfn, size, prot); else return remap_oldmem_pfn_range_zfcpdump(vma, from, pfn, size, prot); } /* * Copy memory from old kernel */ int copy_from_oldmem(void *dest, void *src, size_t count) { unsigned long copied = 0; int rc; if (OLDMEM_BASE) { if ((unsigned long) src < OLDMEM_SIZE) { copied = min(count, OLDMEM_SIZE - (unsigned long) src); rc = memcpy_real(dest, src + OLDMEM_BASE, copied); if (rc) return rc; } } else { unsigned long hsa_end = sclp_get_hsa_size(); if ((unsigned long) src < hsa_end) { copied = min(count, hsa_end - (unsigned long) src); rc = memcpy_hsa(dest, (unsigned long) src, copied, 0); if (rc) return rc; } } return memcpy_real(dest + copied, src + copied, count - copied); } /* * Alloc memory and panic in case of ENOMEM */ static void *kzalloc_panic(int len) { void *rc; rc = kzalloc(len, GFP_KERNEL); if (!rc) panic("s390 kdump kzalloc (%d) failed", len); return rc; } /* * Get memory layout and create hole for oldmem */ static struct mem_chunk *get_memory_layout(void) { struct mem_chunk *chunk_array; chunk_array = kzalloc_panic(MEMORY_CHUNKS * sizeof(struct mem_chunk)); detect_memory_layout(chunk_array, 0); create_mem_hole(chunk_array, OLDMEM_BASE, OLDMEM_SIZE); return chunk_array; } /* * Initialize ELF note */ static void *nt_init(void *buf, Elf64_Word type, void *desc, int d_len, const char *name) { Elf64_Nhdr *note; u64 len; note = (Elf64_Nhdr *)buf; note->n_namesz = strlen(name) + 1; note->n_descsz = d_len; note->n_type = type; len = sizeof(Elf64_Nhdr); memcpy(buf + len, name, note->n_namesz); len = roundup(len + note->n_namesz, 4); memcpy(buf + len, desc, note->n_descsz); len = roundup(len + note->n_descsz, 4); return PTR_ADD(buf, len); } /* * Initialize prstatus note */ static void *nt_prstatus(void *ptr, struct save_area *sa) { struct elf_prstatus nt_prstatus; static int cpu_nr = 1; memset(&nt_prstatus, 0, sizeof(nt_prstatus)); memcpy(&nt_prstatus.pr_reg.gprs, sa->gp_regs, sizeof(sa->gp_regs)); memcpy(&nt_prstatus.pr_reg.psw, sa->psw, sizeof(sa->psw)); memcpy(&nt_prstatus.pr_reg.acrs, sa->acc_regs, sizeof(sa->acc_regs)); nt_prstatus.pr_pid = cpu_nr; cpu_nr++; return nt_init(ptr, NT_PRSTATUS, &nt_prstatus, sizeof(nt_prstatus), "CORE"); } /* * Initialize fpregset (floating point) note */ static void *nt_fpregset(void *ptr, struct save_area *sa) { elf_fpregset_t nt_fpregset; memset(&nt_fpregset, 0, sizeof(nt_fpregset)); memcpy(&nt_fpregset.fpc, &sa->fp_ctrl_reg, sizeof(sa->fp_ctrl_reg)); memcpy(&nt_fpregset.fprs, &sa->fp_regs, sizeof(sa->fp_regs)); return nt_init(ptr, NT_PRFPREG, &nt_fpregset, sizeof(nt_fpregset), "CORE"); } /* * Initialize timer note */ static void *nt_s390_timer(void *ptr, struct save_area *sa) { return nt_init(ptr, NT_S390_TIMER, &sa->timer, sizeof(sa->timer), KEXEC_CORE_NOTE_NAME); } /* * Initialize TOD clock comparator note */ static void *nt_s390_tod_cmp(void *ptr, struct save_area *sa) { return nt_init(ptr, NT_S390_TODCMP, &sa->clk_cmp, sizeof(sa->clk_cmp), KEXEC_CORE_NOTE_NAME); } /* * Initialize TOD programmable register note */ static void *nt_s390_tod_preg(void *ptr, struct save_area *sa) { return nt_init(ptr, NT_S390_TODPREG, &sa->tod_reg, sizeof(sa->tod_reg), KEXEC_CORE_NOTE_NAME); } /* * Initialize control register note */ static void *nt_s390_ctrs(void *ptr, struct save_area *sa) { return nt_init(ptr, NT_S390_CTRS, &sa->ctrl_regs, sizeof(sa->ctrl_regs), KEXEC_CORE_NOTE_NAME); } /* * Initialize prefix register note */ static void *nt_s390_prefix(void *ptr, struct save_area *sa) { return nt_init(ptr, NT_S390_PREFIX, &sa->pref_reg, sizeof(sa->pref_reg), KEXEC_CORE_NOTE_NAME); } /* * Initialize vxrs high note (full 128 bit VX registers 16-31) */ static void *nt_s390_vx_high(void *ptr, __vector128 *vx_regs) { return nt_init(ptr, NT_S390_VXRS_HIGH, &vx_regs[16], 16 * sizeof(__vector128), KEXEC_CORE_NOTE_NAME); } /* * Initialize vxrs low note (lower halves of VX registers 0-15) */ static void *nt_s390_vx_low(void *ptr, __vector128 *vx_regs) { Elf64_Nhdr *note; u64 len; int i; note = (Elf64_Nhdr *)ptr; note->n_namesz = strlen(KEXEC_CORE_NOTE_NAME) + 1; note->n_descsz = 16 * 8; note->n_type = NT_S390_VXRS_LOW; len = sizeof(Elf64_Nhdr); memcpy(ptr + len, KEXEC_CORE_NOTE_NAME, note->n_namesz); len = roundup(len + note->n_namesz, 4); ptr += len; /* Copy lower halves of SIMD registers 0-15 */ for (i = 0; i < 16; i++) { memcpy(ptr, &vx_regs[i].u[2], 8); ptr += 8; } return ptr; } /* * Fill ELF notes for one CPU with save area registers */ void *fill_cpu_elf_notes(void *ptr, struct save_area *sa, __vector128 *vx_regs) { ptr = nt_prstatus(ptr, sa); ptr = nt_fpregset(ptr, sa); ptr = nt_s390_timer(ptr, sa); ptr = nt_s390_tod_cmp(ptr, sa); ptr = nt_s390_tod_preg(ptr, sa); ptr = nt_s390_ctrs(ptr, sa); ptr = nt_s390_prefix(ptr, sa); if (MACHINE_HAS_VX && vx_regs) { ptr = nt_s390_vx_low(ptr, vx_regs); ptr = nt_s390_vx_high(ptr, vx_regs); } return ptr; } /* * Initialize prpsinfo note (new kernel) */ static void *nt_prpsinfo(void *ptr) { struct elf_prpsinfo prpsinfo; memset(&prpsinfo, 0, sizeof(prpsinfo)); prpsinfo.pr_sname = 'R'; strcpy(prpsinfo.pr_fname, "vmlinux"); return nt_init(ptr, NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo), KEXEC_CORE_NOTE_NAME); } /* * Get vmcoreinfo using lowcore->vmcore_info (new kernel) */ static void *get_vmcoreinfo_old(unsigned long *size) { char nt_name[11], *vmcoreinfo; Elf64_Nhdr note; void *addr; if (copy_from_oldmem(&addr, &S390_lowcore.vmcore_info, sizeof(addr))) return NULL; memset(nt_name, 0, sizeof(nt_name)); if (copy_from_oldmem(&note, addr, sizeof(note))) return NULL; if (copy_from_oldmem(nt_name, addr + sizeof(note), sizeof(nt_name) - 1)) return NULL; if (strcmp(nt_name, "VMCOREINFO") != 0) return NULL; vmcoreinfo = kzalloc_panic(note.n_descsz); if (copy_from_oldmem(vmcoreinfo, addr + 24, note.n_descsz)) return NULL; *size = note.n_descsz; return vmcoreinfo; } /* * Initialize vmcoreinfo note (new kernel) */ static void *nt_vmcoreinfo(void *ptr) { unsigned long size; void *vmcoreinfo; vmcoreinfo = os_info_old_entry(OS_INFO_VMCOREINFO, &size); if (!vmcoreinfo) vmcoreinfo = get_vmcoreinfo_old(&size); if (!vmcoreinfo) return ptr; return nt_init(ptr, 0, vmcoreinfo, size, "VMCOREINFO"); } /* * Initialize ELF header (new kernel) */ static void *ehdr_init(Elf64_Ehdr *ehdr, int mem_chunk_cnt) { memset(ehdr, 0, sizeof(*ehdr)); memcpy(ehdr->e_ident, ELFMAG, SELFMAG); ehdr->e_ident[EI_CLASS] = ELFCLASS64; ehdr->e_ident[EI_DATA] = ELFDATA2MSB; ehdr->e_ident[EI_VERSION] = EV_CURRENT; memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD); ehdr->e_type = ET_CORE; ehdr->e_machine = EM_S390; ehdr->e_version = EV_CURRENT; ehdr->e_phoff = sizeof(Elf64_Ehdr); ehdr->e_ehsize = sizeof(Elf64_Ehdr); ehdr->e_phentsize = sizeof(Elf64_Phdr); ehdr->e_phnum = mem_chunk_cnt + 1; return ehdr + 1; } /* * Return CPU count for ELF header (new kernel) */ static int get_cpu_cnt(void) { int i, cpus = 0; for (i = 0; i < dump_save_areas.count; i++) { if (dump_save_areas.areas[i]->sa.pref_reg == 0) continue; cpus++; } return cpus; } /* * Return memory chunk count for ELF header (new kernel) */ static int get_mem_chunk_cnt(void) { struct mem_chunk *chunk_array, *mem_chunk; int i, cnt = 0; chunk_array = get_memory_layout(); for (i = 0; i < MEMORY_CHUNKS; i++) { mem_chunk = &chunk_array[i]; if (chunk_array[i].type != CHUNK_READ_WRITE && chunk_array[i].type != CHUNK_READ_ONLY) continue; if (mem_chunk->size == 0) continue; cnt++; } kfree(chunk_array); return cnt; } /* * Initialize ELF loads (new kernel) */ static int loads_init(Elf64_Phdr *phdr, u64 loads_offset) { struct mem_chunk *chunk_array, *mem_chunk; int i; chunk_array = get_memory_layout(); for (i = 0; i < MEMORY_CHUNKS; i++) { mem_chunk = &chunk_array[i]; if (mem_chunk->size == 0) continue; if (chunk_array[i].type != CHUNK_READ_WRITE && chunk_array[i].type != CHUNK_READ_ONLY) continue; else phdr->p_filesz = mem_chunk->size; phdr->p_type = PT_LOAD; phdr->p_offset = mem_chunk->addr; phdr->p_vaddr = mem_chunk->addr; phdr->p_paddr = mem_chunk->addr; phdr->p_memsz = mem_chunk->size; phdr->p_flags = PF_R | PF_W | PF_X; phdr->p_align = PAGE_SIZE; phdr++; } kfree(chunk_array); return i; } /* * Initialize notes (new kernel) */ static void *notes_init(Elf64_Phdr *phdr, void *ptr, u64 notes_offset) { struct save_area_ext *sa_ext; void *ptr_start = ptr; int i; ptr = nt_prpsinfo(ptr); for (i = 0; i < dump_save_areas.count; i++) { sa_ext = dump_save_areas.areas[i]; if (sa_ext->sa.pref_reg == 0) continue; ptr = fill_cpu_elf_notes(ptr, &sa_ext->sa, sa_ext->vx_regs); } ptr = nt_vmcoreinfo(ptr); memset(phdr, 0, sizeof(*phdr)); phdr->p_type = PT_NOTE; phdr->p_offset = notes_offset; phdr->p_filesz = (unsigned long) PTR_SUB(ptr, ptr_start); phdr->p_memsz = phdr->p_filesz; return ptr; } /* * Create ELF core header (new kernel) */ int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size) { Elf64_Phdr *phdr_notes, *phdr_loads; int mem_chunk_cnt; void *ptr, *hdr; u32 alloc_size; u64 hdr_off; /* If we are not in kdump or zfcpdump mode return */ if (!OLDMEM_BASE && ipl_info.type != IPL_TYPE_FCP_DUMP) return 0; /* If elfcorehdr= has been passed via cmdline, we use that one */ if (elfcorehdr_addr != ELFCORE_ADDR_MAX) return 0; /* If we cannot get HSA size for zfcpdump return error */ if (ipl_info.type == IPL_TYPE_FCP_DUMP && !sclp_get_hsa_size()) return -ENODEV; mem_chunk_cnt = get_mem_chunk_cnt(); alloc_size = 0x1000 + get_cpu_cnt() * 0x4a0 + mem_chunk_cnt * sizeof(Elf64_Phdr); hdr = kzalloc_panic(alloc_size); /* Init elf header */ ptr = ehdr_init(hdr, mem_chunk_cnt); /* Init program headers */ phdr_notes = ptr; ptr = PTR_ADD(ptr, sizeof(Elf64_Phdr)); phdr_loads = ptr; ptr = PTR_ADD(ptr, sizeof(Elf64_Phdr) * mem_chunk_cnt); /* Init notes */ hdr_off = PTR_DIFF(ptr, hdr); ptr = notes_init(phdr_notes, ptr, ((unsigned long) hdr) + hdr_off); /* Init loads */ hdr_off = PTR_DIFF(ptr, hdr); loads_init(phdr_loads, hdr_off); *addr = (unsigned long long) hdr; elfcorehdr_newmem = hdr; *size = (unsigned long long) hdr_off; BUG_ON(elfcorehdr_size > alloc_size); return 0; } /* * Free ELF core header (new kernel) */ void elfcorehdr_free(unsigned long long addr) { if (!elfcorehdr_newmem) return; kfree((void *)(unsigned long)addr); } /* * Read from ELF header */ ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) { void *src = (void *)(unsigned long)*ppos; src = elfcorehdr_newmem ? src : src - OLDMEM_BASE; memcpy(buf, src, count); *ppos += count; return count; } /* * Read from ELF notes data */ ssize_t elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos) { void *src = (void *)(unsigned long)*ppos; int rc; if (elfcorehdr_newmem) { memcpy(buf, src, count); } else { rc = copy_from_oldmem(buf, src, count); if (rc) return rc; } *ppos += count; return count; }
cneira/ebpf-backports
linux-3.10.0-514.21.1.el7.x86_64/arch/s390/kernel/crash_dump.c
C
gpl-2.0
16,840
[ 30522, 1013, 1008, 1008, 1055, 23499, 2692, 1047, 8566, 8737, 7375, 1008, 1008, 9385, 9980, 13058, 1012, 2249, 1008, 3166, 1006, 1055, 1007, 1024, 2745, 7570, 23858, 5369, 2226, 1026, 7570, 23858, 5369, 2226, 1030, 11603, 1012, 1058, 7159, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>mathcomp-ssreflect: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.8.1 / mathcomp-ssreflect - 1.6</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> mathcomp-ssreflect <small> 1.6 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-12-18 16:46:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-18 16:46:16 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.8.1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.04.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.04.2 Official 4.04.2 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; name: &quot;coq-mathcomp-ssreflect&quot; version: &quot;1.6&quot; maintainer: &quot;Mathematical Components &lt;mathcomp-dev@sympa.inria.fr&gt;&quot; homepage: &quot;http://ssr.msr-inria.inria.fr/&quot; bug-reports: &quot;Mathematical Components &lt;mathcomp-dev@sympa.inria.fr&gt;&quot; license: &quot;CeCILL-B&quot; build: [ make &quot;-C&quot; &quot;mathcomp/ssreflect&quot; &quot;-j&quot; &quot;%{jobs}%&quot; ] install: [ make &quot;-C&quot; &quot;mathcomp/ssreflect&quot; &quot;install&quot; ] remove: [ &quot;sh&quot; &quot;-c&quot; &quot;rm -rf &#39;%{lib}%/coq/user-contrib/mathcomp&#39;&quot; ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.4pl4&quot; &amp; &lt; &quot;8.6~&quot; &amp; != &quot;8.4.6~camlp4&quot;} ] tags: [ &quot;keyword:small scale reflection&quot; &quot;keyword:mathematical components&quot; &quot;keyword:odd order theorem&quot; ] authors: [ &quot;Jeremy Avigad &lt;&gt;&quot; &quot;Andrea Asperti &lt;&gt;&quot; &quot;Stephane Le Roux &lt;&gt;&quot; &quot;Yves Bertot &lt;&gt;&quot; &quot;Laurence Rideau &lt;&gt;&quot; &quot;Enrico Tassi &lt;&gt;&quot; &quot;Ioana Pasca &lt;&gt;&quot; &quot;Georges Gonthier &lt;&gt;&quot; &quot;Sidi Ould Biha &lt;&gt;&quot; &quot;Cyril Cohen &lt;&gt;&quot; &quot;Francois Garillot &lt;&gt;&quot; &quot;Alexey Solovyev &lt;&gt;&quot; &quot;Russell O&#39;Connor &lt;&gt;&quot; &quot;Laurent Théry &lt;&gt;&quot; &quot;Assia Mahboubi &lt;&gt;&quot; ] synopsis: &quot;Small Scale Reflection&quot; description: &quot;&quot;&quot; This library includes the small scale reflection proof language extension and the minimal set of libraries to take advantage of it. This includes libraries on lists (seq), boolean and boolean predicates, natural numbers and types with decidable equality, finite types, finite sets, finite functions, finite graphs, basic arithmetics and prime numbers, big operators&quot;&quot;&quot; url { src: &quot;http://github.com/math-comp/math-comp/archive/mathcomp-1.6.tar.gz&quot; checksum: &quot;md5=038ba80c0d6b430428726ae4d00affcf&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-mathcomp-ssreflect.1.6 coq.8.8.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1). The following dependencies couldn&#39;t be met: - coq-mathcomp-ssreflect -&gt; coq &lt; 8.6~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-ssreflect.1.6</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.04.2-2.0.5/released/8.8.1/mathcomp-ssreflect/1.6.html
HTML
mit
7,986
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "buildinf.h" unsigned long OpenSSL_version_num(void) { return OPENSSL_VERSION_NUMBER; } unsigned int OPENSSL_version_major(void) { return OPENSSL_VERSION_MAJOR; } unsigned int OPENSSL_version_minor(void) { return OPENSSL_VERSION_MINOR; } unsigned int OPENSSL_version_patch(void) { return OPENSSL_VERSION_PATCH; } const char *OPENSSL_version_pre_release(void) { return OPENSSL_VERSION_PRE_RELEASE_STR; } const char *OPENSSL_version_build_metadata(void) { return OPENSSL_VERSION_BUILD_METADATA_STR; } extern char ossl_cpu_info_str[]; const char *OpenSSL_version(int t) { switch (t) { case OPENSSL_VERSION: return OPENSSL_VERSION_TEXT; case OPENSSL_VERSION_STRING: return OPENSSL_VERSION_STR; case OPENSSL_FULL_VERSION_STRING: return OPENSSL_FULL_VERSION_STR; case OPENSSL_BUILT_ON: return DATE; case OPENSSL_CFLAGS: return compiler_flags; case OPENSSL_PLATFORM: return PLATFORM; case OPENSSL_DIR: #ifdef OPENSSLDIR return "OPENSSLDIR: \"" OPENSSLDIR "\""; #else return "OPENSSLDIR: N/A"; #endif case OPENSSL_ENGINES_DIR: #ifdef ENGINESDIR return "ENGINESDIR: \"" ENGINESDIR "\""; #else return "ENGINESDIR: N/A"; #endif case OPENSSL_MODULES_DIR: #ifdef MODULESDIR return "MODULESDIR: \"" MODULESDIR "\""; #else return "MODULESDIR: N/A"; #endif case OPENSSL_CPU_INFO: if (OPENSSL_info(OPENSSL_INFO_CPU_SETTINGS) != NULL) return ossl_cpu_info_str; else return "CPUINFO: N/A"; } return "not available"; }
FriendSoftwareLabs/friendup
libs-ext/openssl/crypto/cversion.c
C
agpl-3.0
1,997
[ 30522, 1013, 1008, 1008, 9385, 2786, 1011, 2355, 1996, 7480, 14540, 2622, 6048, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1012, 2017, 2089, 2025, 2224, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var library = require('./library.js'); var check_cond = function(num, div, start) { var n = ''; for(var i = start; i < start + 3; i++) { n = n + num.toString().charAt(i - 1); } if(parseInt(n) % div === 0) { return true; } return false; } var check_all = function(num) { var all = [2, 3, 5, 7, 11, 13, 17]; for(var i = 0; i < all.length; i += 1) { if(!check_cond(num, all[i], i + 2)) { return false; } } return true; } var solve = function () { var sum = 0; var start = 1234567890; var end = 9876543210; for(var i = start, count = 0; i <= end; i += 1, count += 1) { if(count % 1000000 == 0) { console.log("\$i : " + i); } if(!library.is_pandigital(i, 0)) { continue; } if(!check_all(i)) { continue; } console.log("OK : " + i); sum += i; } }; var check_all_2 = function(num) { var y = num.toString(); var n = [0]; for(var i = 0; i < y.length; i += 1) { n.push(parseInt(y[i])); } if(n[4] % 2 != 0) { return false; } var a = n[3] + n[4] + n[5]; if(a % 3 != 0) { return false; } if(n[6] % 5 != 0) { return false; } var b = n[5] * 10 + n[6] - 2 * n[7]; if(b % 7 != 0) { return false; } var c = n[6] * 10 + n[7] - n[8]; if(c % 11 != 0) { return false; } var d = n[7] * 10 + n[8] + 4 * n[9]; if(d % 13 != 0) { return false; } var e = n[8] * 10 + n[9] - 5 * n[10]; if(e % 17 != 0) { return false; } return true; } var solve_2 = function () { var sum = 0; var start = 1234567890; var end = 9876543210; for(var i = start, count = 0; i <= end; i += 1, count += 1) { if(count % 1000000 == 0) { console.log("\$i : " + i); } if(!check_all_2(i)) { continue; } if(!library.is_pandigital_v2(i, 0)) { continue; } console.log("OK : " + i); sum += i; } }; var sum = solve_2(); console.log(sum); //var num = process.argv[2]; //console.log(check_all_2(num));
xitkov/projecteuler
other-lang/js/solve0043.js
JavaScript
epl-1.0
2,372
[ 30522, 13075, 3075, 1027, 5478, 1006, 1005, 1012, 1013, 3075, 1012, 1046, 2015, 1005, 1007, 1025, 13075, 4638, 1035, 9530, 2094, 1027, 3853, 1006, 16371, 2213, 1010, 4487, 2615, 1010, 2707, 1007, 1063, 13075, 1050, 1027, 1005, 1005, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
table.frontEndTable { width:100%; border:solid 1px #CCC; font-size:11px; } table.frontEndTable th { padding:3px 10px 3px 10px; text-align:left; border: solid 1px #000 !important; font-weight:bold; background-color:#F2CA58; color:#000; } table.frontEndTable tr { border-bottom: solid 1px #ccc; } table.frontEndTable td { padding:5px 10px 5px 10px; }
dertinfo-david/dertinfo-web
Content/styles/Tables.css
CSS
mit
398
[ 30522, 2795, 1012, 2392, 30524, 2595, 1025, 3793, 1011, 25705, 1024, 2187, 1025, 3675, 1024, 5024, 1015, 2361, 2595, 1001, 2199, 999, 2590, 1025, 15489, 1011, 3635, 1024, 7782, 1025, 4281, 1011, 3609, 1024, 1001, 1042, 2475, 3540, 27814, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // ViewController.h // ViewController // // Created by Yun on 13-8-12. // Copyright (c) 2013年 伟平 周. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (nonatomic,retain) UIButton *button; @end
Tiankui/iosPlayGround
ViewController/ViewController/ViewController.h
C
mit
262
[ 30522, 1013, 1013, 1013, 1013, 3193, 8663, 13181, 10820, 1012, 1044, 1013, 1013, 3193, 8663, 13181, 10820, 1013, 1013, 1013, 1013, 2580, 2011, 22854, 2006, 2410, 1011, 1022, 1011, 2260, 1012, 1013, 1013, 9385, 1006, 1039, 1007, 2286, 1840, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using Entity; using DAL; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL { public class ClienteBLL { public static void save(Cliente o) { if (ClienteDAL.val(o.Codigo)) ClienteDAL.set(o); else ClienteDAL.up(o); } public static void del(Int32 codigo) { ClienteDAL.del(codigo); } public static Int32 nextCodigo() { String last = ClienteDAL.getLast().ToString(); return Int32.Parse(last) + 1; } public static Cliente get(Int32 codigo) { return ClienteDAL.get(codigo); } public static List<Cliente> list(String nome) { return ClienteDAL.list(nome); } public static List<Cliente> listAll() { return ClienteDAL.listAll(); } public static List<Cliente> listAll__Contrato_Ativo() { return ClienteDAL.listAll__Contrato_Ativo(); } } }
oraculum/CEF
BLL/ClienteBLL.cs
C#
apache-2.0
1,136
[ 30522, 2478, 9178, 1025, 2478, 17488, 1025, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 3793, 1025, 2478, 2291, 1012, 11689, 2075, 1012, 8518, 1025, 3415, 15327, 1038, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; module('Unit | Adapter | organization cleanup', function(hooks) { setupTest(hooks); // Replace this with your real tests. test('it exists', function(assert) { let adapter = this.owner.lookup('adapter:organization-cleanup'); assert.ok(adapter); }); });
appknox/irene
tests/unit/adapters/organization-cleanup-test.js
JavaScript
agpl-3.0
349
[ 30522, 12324, 1063, 11336, 1010, 3231, 1065, 2013, 1005, 24209, 3490, 2102, 1005, 1025, 12324, 1063, 16437, 22199, 1065, 2013, 1005, 7861, 5677, 1011, 24209, 3490, 2102, 1005, 1025, 11336, 1006, 1005, 3131, 1064, 15581, 2121, 1064, 3029, 27...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /* * Copyright 2013 Johannes M. Schmitt <schmittjoh@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace JMS\Serializer\Annotation; /** * @Annotation * @Target("CLASS") */ class Discriminator { /** @var array<string> */ public $map; /** @var string */ public $field = 'type'; /** @var boolean */ public $disabled = false; /** @var boolean */ public $xmlAttribute = false; }
apa-opensource/serializer
src/JMS/Serializer/Annotation/Discriminator.php
PHP
apache-2.0
952
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 9385, 2286, 12470, 1049, 1012, 8040, 26837, 4779, 1026, 8040, 26837, 4779, 5558, 2232, 1030, 20917, 4014, 1012, 4012, 1028, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2003, Axis Communications AB. */ #include <linux/sched.h> #include <linux/mm.h> #include <linux/kernel.h> #include <linux/signal.h> #include <linux/errno.h> #include <linux/wait.h> #include <linux/ptrace.h> #include <linux/unistd.h> #include <linux/stddef.h> #include <linux/syscalls.h> #include <linux/vmalloc.h> #include <asm/io.h> #include <asm/processor.h> #include <asm/ucontext.h> #include <asm/uaccess.h> #include <asm/arch/ptrace.h> #include <asm/arch/hwregs/cpu_vect.h> extern unsigned long cris_signal_return_page; /* Flag to check if a signal is blockable. */ #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) /* * A syscall in CRIS is really a "break 13" instruction, which is 2 * bytes. The registers is manipulated so upon return the instruction * will be executed again. * * This relies on that PC points to the instruction after the break call. */ #define RESTART_CRIS_SYS(regs) regs->r10 = regs->orig_r10; regs->erp -= 2; /* Signal frames. */ struct signal_frame { struct sigcontext sc; unsigned long extramask[_NSIG_WORDS - 1]; unsigned char retcode[8]; /* Trampoline code. */ }; struct rt_signal_frame { struct siginfo *pinfo; void *puc; struct siginfo info; struct ucontext uc; unsigned char retcode[8]; /* Trampoline code. */ }; void do_signal(int restart, struct pt_regs *regs); void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, struct pt_regs *regs); /* * Swap in the new signal mask, and wait for a signal. Define some * dummy arguments to be able to reach the regs argument. */ int sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof, long srp, struct pt_regs *regs) { mask &= _BLOCKABLE; spin_lock_irq(&current->sighand->siglock); current->saved_sigmask = current->blocked; siginitset(&current->blocked, mask); recalc_sigpending(); spin_unlock_irq(&current->sighand->siglock); current->state = TASK_INTERRUPTIBLE; schedule(); set_thread_flag(TIF_RESTORE_SIGMASK); return -ERESTARTNOHAND; } int sys_sigaction(int signal, const struct old_sigaction *act, struct old_sigaction *oact) { int retval; struct k_sigaction newk; struct k_sigaction oldk; if (act) { old_sigset_t mask; if (!access_ok(VERIFY_READ, act, sizeof(*act)) || __get_user(newk.sa.sa_handler, &act->sa_handler) || __get_user(newk.sa.sa_restorer, &act->sa_restorer)) return -EFAULT; __get_user(newk.sa.sa_flags, &act->sa_flags); __get_user(mask, &act->sa_mask); siginitset(&newk.sa.sa_mask, mask); } retval = do_sigaction(signal, act ? &newk : NULL, oact ? &oldk : NULL); if (!retval && oact) { if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || __put_user(oldk.sa.sa_handler, &oact->sa_handler) || __put_user(oldk.sa.sa_restorer, &oact->sa_restorer)) return -EFAULT; __put_user(oldk.sa.sa_flags, &oact->sa_flags); __put_user(oldk.sa.sa_mask.sig[0], &oact->sa_mask); } return retval; } int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) { return do_sigaltstack(uss, uoss, rdusp()); } static int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) { unsigned int err = 0; unsigned long old_usp; /* Always make any pending restarted system calls return -EINTR */ current_thread_info()->restart_block.fn = do_no_restart_syscall; /* * Restore the registers from &sc->regs. sc is already checked * for VERIFY_READ since the signal_frame was previously * checked in sys_sigreturn(). */ if (__copy_from_user(regs, sc, sizeof(struct pt_regs))) goto badframe; /* Make that the user-mode flag is set. */ regs->ccs |= (1 << (U_CCS_BITNR + CCS_SHIFT)); /* Restore the old USP. */ err |= __get_user(old_usp, &sc->usp); wrusp(old_usp); return err; badframe: return 1; } /* Define some dummy arguments to be able to reach the regs argument. */ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp, struct pt_regs *regs) { sigset_t set; struct signal_frame __user *frame; unsigned long oldspc = regs->spc; unsigned long oldccs = regs->ccs; frame = (struct signal_frame *) rdusp(); /* * Since the signal is stacked on a dword boundary, the frame * should be dword aligned here as well. It it's not, then the * user is trying some funny business. */ if (((long)frame) & 3) goto badframe; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__get_user(set.sig[0], &frame->sc.oldmask) || (_NSIG_WORDS > 1 && __copy_from_user(&set.sig[1], frame->extramask, sizeof(frame->extramask)))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(&current->sighand->siglock); current->blocked = set; recalc_sigpending(); spin_unlock_irq(&current->sighand->siglock); if (restore_sigcontext(regs, &frame->sc)) goto badframe; keep_debug_flags(oldccs, oldspc, regs); return regs->r10; badframe: force_sig(SIGSEGV, current); return 0; } /* Define some dummy variables to be able to reach the regs argument. */ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp, struct pt_regs *regs) { sigset_t set; struct rt_signal_frame __user *frame; unsigned long oldspc = regs->spc; unsigned long oldccs = regs->ccs; frame = (struct rt_signal_frame *) rdusp(); /* * Since the signal is stacked on a dword boundary, the frame * should be dword aligned here as well. It it's not, then the * user is trying some funny business. */ if (((long)frame) & 3) goto badframe; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(&current->sighand->siglock); current->blocked = set; recalc_sigpending(); spin_unlock_irq(&current->sighand->siglock); if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) goto badframe; if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) goto badframe; keep_debug_flags(oldccs, oldspc, regs); return regs->r10; badframe: force_sig(SIGSEGV, current); return 0; } /* Setup a signal frame. */ static int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask) { int err; unsigned long usp; err = 0; usp = rdusp(); /* * Copy the registers. They are located first in sc, so it's * possible to use sc directly. */ err |= __copy_to_user(sc, regs, sizeof(struct pt_regs)); err |= __put_user(mask, &sc->oldmask); err |= __put_user(usp, &sc->usp); return err; } /* Figure out where to put the new signal frame - usually on the stack. */ static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) { unsigned long sp; sp = rdusp(); /* This is the X/Open sanctioned signal stack switching. */ if (ka->sa.sa_flags & SA_ONSTACK) { if (!on_sig_stack(sp)) sp = current->sas_ss_sp + current->sas_ss_size; } /* Make sure the frame is dword-aligned. */ sp &= ~3; return (void __user *)(sp - frame_size); } /* Grab and setup a signal frame. * * Basically a lot of state-info is stacked, and arranged for the * user-mode program to return to the kernel using either a trampiline * which performs the syscall sigreturn(), or a provided user-mode * trampoline. */ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs * regs) { int err; unsigned long return_ip; struct signal_frame __user *frame; err = 0; frame = get_sigframe(ka, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); if (err) goto give_sigsegv; if (_NSIG_WORDS > 1) { err |= __copy_to_user(frame->extramask, &set->sig[1], sizeof(frame->extramask)); } if (err) goto give_sigsegv; /* * Set up to return from user-space. If provided, use a stub * already located in user-space. */ if (ka->sa.sa_flags & SA_RESTORER) { return_ip = (unsigned long)ka->sa.sa_restorer; } else { /* Trampoline - the desired return ip is in the signal return page. */ return_ip = cris_signal_return_page; /* * This is movu.w __NR_sigreturn, r9; break 13; * * WE DO NOT USE IT ANY MORE! It's only left here for historical * reasons and because gdb uses it as a signature to notice * signal handler stack frames. */ err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0)); err |= __put_user(__NR_sigreturn, (short __user*)(frame->retcode+2)); err |= __put_user(0xe93d, (short __user*)(frame->retcode+4)); } if (err) goto give_sigsegv; /* * Set up registers for signal handler. * * Where the code enters now. * Where the code enter later. * First argument, signo. */ regs->erp = (unsigned long) ka->sa.sa_handler; regs->srp = return_ip; regs->r10 = sig; /* Actually move the USP to reflect the stacked frame. */ wrusp((unsigned long)frame); return 0; give_sigsegv: if (sig == SIGSEGV) ka->sa.sa_handler = SIG_DFL; force_sig(SIGSEGV, current); return -EFAULT; } static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs * regs) { int err; unsigned long return_ip; struct rt_signal_frame __user *frame; err = 0; frame = get_sigframe(ka, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; /* TODO: what is the current->exec_domain stuff and invmap ? */ err |= __put_user(&frame->info, &frame->pinfo); err |= __put_user(&frame->uc, &frame->puc); err |= copy_siginfo_to_user(&frame->info, info); if (err) goto give_sigsegv; /* Clear all the bits of the ucontext we don't use. */ err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext)); err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); if (err) goto give_sigsegv; /* * Set up to return from user-space. If provided, use a stub * already located in user-space. */ if (ka->sa.sa_flags & SA_RESTORER) { return_ip = (unsigned long) ka->sa.sa_restorer; } else { /* Trampoline - the desired return ip is in the signal return page. */ return_ip = cris_signal_return_page + 6; /* * This is movu.w __NR_rt_sigreturn, r9; break 13; * * WE DO NOT USE IT ANY MORE! It's only left here for historical * reasons and because gdb uses it as a signature to notice * signal handler stack frames. */ err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0)); err |= __put_user(__NR_rt_sigreturn, (short __user*)(frame->retcode+2)); err |= __put_user(0xe93d, (short __user*)(frame->retcode+4)); } if (err) goto give_sigsegv; /* * Set up registers for signal handler. * * Where the code enters now. * Where the code enters later. * First argument is signo. * Second argument is (siginfo_t *). * Third argument is unused. */ regs->erp = (unsigned long) ka->sa.sa_handler; regs->srp = return_ip; regs->r10 = sig; regs->r11 = (unsigned long) &frame->info; regs->r12 = 0; /* Actually move the usp to reflect the stacked frame. */ wrusp((unsigned long)frame); return 0; give_sigsegv: if (sig == SIGSEGV) ka->sa.sa_handler = SIG_DFL; force_sig(SIGSEGV, current); return -EFAULT; } /* Invoke a singal handler to, well, handle the signal. */ static inline int handle_signal(int canrestart, unsigned long sig, siginfo_t *info, struct k_sigaction *ka, sigset_t *oldset, struct pt_regs * regs) { int ret; /* Check if this got called from a system call. */ if (canrestart) { /* If so, check system call restarting. */ switch (regs->r10) { case -ERESTART_RESTARTBLOCK: case -ERESTARTNOHAND: /* * This means that the syscall should * only be restarted if there was no * handler for the signal, and since * this point isn't reached unless * there is a handler, there's no need * to restart. */ regs->r10 = -EINTR; break; case -ERESTARTSYS: /* * This means restart the syscall if * there is no handler, or the handler * was registered with SA_RESTART. */ if (!(ka->sa.sa_flags & SA_RESTART)) { regs->r10 = -EINTR; break; } /* Fall through. */ case -ERESTARTNOINTR: /* * This means that the syscall should * be called again after the signal * handler returns. */ RESTART_CRIS_SYS(regs); break; } } /* Set up the stack frame. */ if (ka->sa.sa_flags & SA_SIGINFO) ret = setup_rt_frame(sig, ka, info, oldset, regs); else ret = setup_frame(sig, ka, oldset, regs); if (ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; if (ret == 0) { spin_lock_irq(&current->sighand->siglock); sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask); if (!(ka->sa.sa_flags & SA_NODEFER)) sigaddset(&current->blocked, sig); recalc_sigpending(); spin_unlock_irq(&current->sighand->siglock); } return ret; } /* * Note that 'init' is a special process: it doesn't get signals it doesn't * want to handle. Thus you cannot kill init even with a SIGKILL even by * mistake. * * Also note that the regs structure given here as an argument, is the latest * pushed pt_regs. It may or may not be the same as the first pushed registers * when the initial usermode->kernelmode transition took place. Therefore * we can use user_mode(regs) to see if we came directly from kernel or user * mode below. */ void do_signal(int canrestart, struct pt_regs *regs) { int signr; siginfo_t info; struct k_sigaction ka; sigset_t *oldset; /* * The common case should go fast, which is why this point is * reached from kernel-mode. If that's the case, just return * without doing anything. */ if (!user_mode(regs)) return; if (test_thread_flag(TIF_RESTORE_SIGMASK)) oldset = &current->saved_sigmask; else oldset = &current->blocked; signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { /* Whee! Actually deliver the signal. */ if (handle_signal(canrestart, signr, &info, &ka, oldset, regs)) { /* a signal was successfully delivered; the saved * sigmask will have been stored in the signal frame, * and will be restored by sigreturn, so we can simply * clear the TIF_RESTORE_SIGMASK flag */ if (test_thread_flag(TIF_RESTORE_SIGMASK)) clear_thread_flag(TIF_RESTORE_SIGMASK); } return; } /* Got here from a system call? */ if (canrestart) { /* Restart the system call - no handlers present. */ if (regs->r10 == -ERESTARTNOHAND || regs->r10 == -ERESTARTSYS || regs->r10 == -ERESTARTNOINTR) { RESTART_CRIS_SYS(regs); } if (regs->r10 == -ERESTART_RESTARTBLOCK){ regs->r10 = __NR_restart_syscall; regs->erp -= 2; } } /* if there's no signal to deliver, we just put the saved sigmask * back */ if (test_thread_flag(TIF_RESTORE_SIGMASK)) { clear_thread_flag(TIF_RESTORE_SIGMASK); sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); } } asmlinkage void ugdb_trap_user(struct thread_info *ti, int sig) { if (((user_regs(ti)->exs & 0xff00) >> 8) != SINGLE_STEP_INTR_VECT) { /* Zero single-step PC if the reason we stopped wasn't a single step exception. This is to avoid relying on it when it isn't reliable. */ user_regs(ti)->spc = 0; } /* FIXME: Filter out false h/w breakpoint hits (i.e. EDA not withing any configured h/w breakpoint range). Synchronize with what already exists for kernel debugging. */ if (((user_regs(ti)->exs & 0xff00) >> 8) == BREAK_8_INTR_VECT) { /* Break 8: subtract 2 from ERP unless in a delay slot. */ if (!(user_regs(ti)->erp & 0x1)) user_regs(ti)->erp -= 2; } sys_kill(ti->task->pid, sig); } void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, struct pt_regs *regs) { if (oldccs & (1 << Q_CCS_BITNR)) { /* Pending single step due to single-stepping the break 13 in the signal trampoline: keep the Q flag. */ regs->ccs |= (1 << Q_CCS_BITNR); /* S flag should be set - complain if it's not. */ if (!(oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT)))) { printk("Q flag but no S flag?"); } regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT)); /* Assume the SPC is valid and interesting. */ regs->spc = oldspc; } else if (oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT))) { /* If a h/w bp was set in the signal handler we need to keep the S flag. */ regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT)); /* Don't keep the old SPC though; if we got here due to a single-step, the Q flag should have been set. */ } else if (regs->spc) { /* If we were single-stepping *before* the signal was taken, we don't want to restore that state now, because GDB will have forgotten all about it. */ regs->spc = 0; regs->ccs &= ~(1 << (S_CCS_BITNR + CCS_SHIFT)); } } /* Set up the trampolines on the signal return page. */ int __init cris_init_signal(void) { u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL); /* This is movu.w __NR_sigreturn, r9; break 13; */ data[0] = 0x9c5f; data[1] = __NR_sigreturn; data[2] = 0xe93d; /* This is movu.w __NR_rt_sigreturn, r9; break 13; */ data[3] = 0x9c5f; data[4] = __NR_rt_sigreturn; data[5] = 0xe93d; /* Map to userspace with appropriate permissions (no write access...) */ cris_signal_return_page = (unsigned long) __ioremap_prot(virt_to_phys(data), PAGE_SIZE, PAGE_SIGNAL_TRAMPOLINE); return 0; } __initcall(cris_init_signal);
JonnyH/pandora-kernel
arch/cris/arch-v32/kernel/signal.c
C
gpl-2.0
17,823
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2494, 1010, 8123, 4806, 11113, 1012, 1008, 1013, 1001, 2421, 1026, 11603, 1013, 8040, 9072, 1012, 1044, 1028, 1001, 2421, 1026, 11603, 1013, 3461, 1012, 1044, 1028, 1001, 2421, 1026, 11603, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.player-container { background: white; padding: 5px; display: flex; flex-direction: row; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); border-radius: 3px; margin-bottom: 5px; cursor: pointer; } .player-image { height: auto; max-width: 100px; vertical-align: middle; } .player-image-container, .player-stats { display: inline-block; } .player-stats { padding: 5px 10px; width: 100%; } .displayName { text-align: center; font-weight: bold; } .stat { width: 100%; text-align: left; }
erincook/tenball
build/src/templates/pages/players/players.css
CSS
apache-2.0
533
[ 30522, 1012, 2447, 1011, 11661, 1063, 4281, 1024, 2317, 1025, 11687, 4667, 1024, 1019, 2361, 2595, 1025, 4653, 1024, 23951, 1025, 23951, 1011, 3257, 1024, 5216, 1025, 3482, 1011, 5192, 1024, 1014, 1015, 2361, 2595, 1017, 2361, 2595, 1054, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Created by shuyi.wu on 2015/4/1. */ 'use strict'; var gulp = require('gulp'), uglify = require('gulp-uglify'), rename = require('gulp-rename'), del = require('del'), webpack = require('gulp-webpack'); gulp.task('compileES6', function () { return gulp.src('./assets/js-es6/functions.js') .pipe(webpack({ module: { loaders: [ {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'} ] } })) .pipe(rename('build.js')) .pipe(gulp.dest('./assets/js/')); }); gulp.task('watch-compileES6', function () { return gulp.src('./assets/js-es6/functions.js') .pipe(webpack({ watch: true, module: { loaders: [ {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'} ] } })) .pipe(rename('build.js')) .pipe(gulp.dest('./assets/js/')); }); gulp.task('min', ['compileES6'], function () { return gulp.src('./assets/js/build.js') .pipe(uglify()) .pipe(rename('build.min.js')) .pipe(gulp.dest('./assets/js/')); }); gulp.task('clean', function (cb) { del('./assets/js/**', cb); }); gulp.task('default', ['clean', 'min']);
wushuyi/CSSFilters
gulpfile.js
JavaScript
bsd-2-clause
1,314
[ 30522, 1013, 1008, 1008, 1008, 2580, 2011, 18454, 10139, 1012, 8814, 2006, 2325, 1013, 1018, 1013, 1015, 1012, 1008, 1013, 1005, 2224, 9384, 1005, 1025, 13075, 26546, 1027, 5478, 1006, 1005, 26546, 1005, 1007, 1010, 1057, 25394, 12031, 1027...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace DbLocalizationProvider.Tests.KnownAttributesTests { [LocalizedModel] public class ModelWithCustomAttributesDuplicates { [FancyHelpText] [FancyHelpText] public string UserName { get; set; } } }
ShadowLaurus/LocalizationProvider
Tests/DbLocalizationProvider.Tests/KnownAttributesTests/ModelWithCustomAttributesDuplicates.cs
C#
mit
245
[ 30522, 3415, 15327, 16962, 4135, 9289, 3989, 21572, 17258, 2121, 1012, 5852, 1012, 2124, 19321, 3089, 8569, 22199, 4355, 2015, 1063, 1031, 22574, 5302, 9247, 1033, 2270, 2465, 2944, 24415, 7874, 20389, 19321, 3089, 8569, 4570, 8566, 24759, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
## Tutorials Practical Android Exploitation: http://theroot.ninja/PAE.pdf Android Application Security Tutorial Series: http://manifestsecurity.com/android-application-security/ Smartphone OS Security: http://www.csc.ncsu.edu/faculty/enck/csc591-s12/index.html ExploitMe Mobile Android Labs: http://securitycompass.github.com/AndroidLabs/ ExploitMe Mobile iPhone Labs: http://securitycompass.github.com/iPhoneLabs/ Server for the two labs above: https://github.com/securitycompass/LabServer DFRWS 2011 Forensics Challenge: http://dfrws.org/2011/challenge/index.shtml Android Forensics & Security Testing: http://opensecuritytraining.info/AndroidForensics.html Introduction to ARM: http://opensecuritytraining.info/IntroARM.html Mobile App Security Certification: https://viaforensics.com/services/training/mobile-app-security-certification/
lovelyshaking/wiki.secmobi.com
pages/publications/Tutorials.md
Markdown
unlicense
851
[ 30522, 1001, 1001, 14924, 26340, 6742, 11924, 14427, 1024, 8299, 1024, 1013, 1013, 1996, 3217, 4140, 1012, 14104, 1013, 6643, 2063, 1012, 11135, 11924, 4646, 3036, 14924, 4818, 2186, 1024, 8299, 1024, 1013, 1013, 19676, 3366, 10841, 15780, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace Maticsoft.ZipLib.Tar { using System; using System.IO; public class TarBuffer { private int blockFactor = 20; public const int BlockSize = 0x200; private int currentBlockIndex; private int currentRecordIndex; public const int DefaultBlockFactor = 20; public const int DefaultRecordSize = 0x2800; private Stream inputStream; private bool isStreamOwner_ = true; private Stream outputStream; private byte[] recordBuffer; private int recordSize = 0x2800; protected TarBuffer() { } public void Close() { if (this.outputStream != null) { this.WriteFinalRecord(); if (this.isStreamOwner_) { this.outputStream.Close(); } this.outputStream = null; } else if (this.inputStream != null) { if (this.isStreamOwner_) { this.inputStream.Close(); } this.inputStream = null; } } public static TarBuffer CreateInputTarBuffer(Stream inputStream) { if (inputStream == null) { throw new ArgumentNullException("inputStream"); } return CreateInputTarBuffer(inputStream, 20); } public static TarBuffer CreateInputTarBuffer(Stream inputStream, int blockFactor) { if (inputStream == null) { throw new ArgumentNullException("inputStream"); } if (blockFactor <= 0) { throw new ArgumentOutOfRangeException("blockFactor", "Factor cannot be negative"); } TarBuffer buffer = new TarBuffer { inputStream = inputStream, outputStream = null }; buffer.Initialize(blockFactor); return buffer; } public static TarBuffer CreateOutputTarBuffer(Stream outputStream) { if (outputStream == null) { throw new ArgumentNullException("outputStream"); } return CreateOutputTarBuffer(outputStream, 20); } public static TarBuffer CreateOutputTarBuffer(Stream outputStream, int blockFactor) { if (outputStream == null) { throw new ArgumentNullException("outputStream"); } if (blockFactor <= 0) { throw new ArgumentOutOfRangeException("blockFactor", "Factor cannot be negative"); } TarBuffer buffer = new TarBuffer { inputStream = null, outputStream = outputStream }; buffer.Initialize(blockFactor); return buffer; } [Obsolete("Use BlockFactor property instead")] public int GetBlockFactor() { return this.blockFactor; } [Obsolete("Use CurrentBlock property instead")] public int GetCurrentBlockNum() { return this.currentBlockIndex; } [Obsolete("Use CurrentRecord property instead")] public int GetCurrentRecordNum() { return this.currentRecordIndex; } [Obsolete("Use RecordSize property instead")] public int GetRecordSize() { return this.recordSize; } private void Initialize(int archiveBlockFactor) { this.blockFactor = archiveBlockFactor; this.recordSize = archiveBlockFactor * 0x200; this.recordBuffer = new byte[this.RecordSize]; if (this.inputStream != null) { this.currentRecordIndex = -1; this.currentBlockIndex = this.BlockFactor; } else { this.currentRecordIndex = 0; this.currentBlockIndex = 0; } } public static bool IsEndOfArchiveBlock(byte[] block) { if (block == null) { throw new ArgumentNullException("block"); } if (block.Length != 0x200) { throw new ArgumentException("block length is invalid"); } for (int i = 0; i < 0x200; i++) { if (block[i] != 0) { return false; } } return true; } [Obsolete("Use IsEndOfArchiveBlock instead")] public bool IsEOFBlock(byte[] block) { if (block == null) { throw new ArgumentNullException("block"); } if (block.Length != 0x200) { throw new ArgumentException("block length is invalid"); } for (int i = 0; i < 0x200; i++) { if (block[i] != 0) { return false; } } return true; } public byte[] ReadBlock() { if (this.inputStream == null) { throw new TarException("TarBuffer.ReadBlock - no input stream defined"); } if ((this.currentBlockIndex >= this.BlockFactor) && !this.ReadRecord()) { throw new TarException("Failed to read a record"); } byte[] destinationArray = new byte[0x200]; Array.Copy(this.recordBuffer, this.currentBlockIndex * 0x200, destinationArray, 0, 0x200); this.currentBlockIndex++; return destinationArray; } private bool ReadRecord() { long num3; if (this.inputStream == null) { throw new TarException("no input stream stream defined"); } this.currentBlockIndex = 0; int offset = 0; for (int i = this.RecordSize; i > 0; i -= (int) num3) { num3 = this.inputStream.Read(this.recordBuffer, offset, i); if (num3 <= 0L) { break; } offset += (int) num3; } this.currentRecordIndex++; return true; } public void SkipBlock() { if (this.inputStream == null) { throw new TarException("no input stream defined"); } if ((this.currentBlockIndex >= this.BlockFactor) && !this.ReadRecord()) { throw new TarException("Failed to read a record"); } this.currentBlockIndex++; } public void WriteBlock(byte[] block) { if (block == null) { throw new ArgumentNullException("block"); } if (this.outputStream == null) { throw new TarException("TarBuffer.WriteBlock - no output stream defined"); } if (block.Length != 0x200) { throw new TarException(string.Format("TarBuffer.WriteBlock - block to write has length '{0}' which is not the block size of '{1}'", block.Length, 0x200)); } if (this.currentBlockIndex >= this.BlockFactor) { this.WriteRecord(); } Array.Copy(block, 0, this.recordBuffer, this.currentBlockIndex * 0x200, 0x200); this.currentBlockIndex++; } public void WriteBlock(byte[] buffer, int offset) { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (this.outputStream == null) { throw new TarException("TarBuffer.WriteBlock - no output stream stream defined"); } if ((offset < 0) || (offset >= buffer.Length)) { throw new ArgumentOutOfRangeException("offset"); } if ((offset + 0x200) > buffer.Length) { throw new TarException(string.Format("TarBuffer.WriteBlock - record has length '{0}' with offset '{1}' which is less than the record size of '{2}'", buffer.Length, offset, this.recordSize)); } if (this.currentBlockIndex >= this.BlockFactor) { this.WriteRecord(); } Array.Copy(buffer, offset, this.recordBuffer, this.currentBlockIndex * 0x200, 0x200); this.currentBlockIndex++; } private void WriteFinalRecord() { if (this.outputStream == null) { throw new TarException("TarBuffer.WriteFinalRecord no output stream defined"); } if (this.currentBlockIndex > 0) { int index = this.currentBlockIndex * 0x200; Array.Clear(this.recordBuffer, index, this.RecordSize - index); this.WriteRecord(); } this.outputStream.Flush(); } private void WriteRecord() { if (this.outputStream == null) { throw new TarException("TarBuffer.WriteRecord no output stream defined"); } this.outputStream.Write(this.recordBuffer, 0, this.RecordSize); this.outputStream.Flush(); this.currentBlockIndex = 0; this.currentRecordIndex++; } public int BlockFactor { get { return this.blockFactor; } } public int CurrentBlock { get { return this.currentBlockIndex; } } public int CurrentRecord { get { return this.currentRecordIndex; } } public bool IsStreamOwner { get { return this.isStreamOwner_; } set { this.isStreamOwner_ = value; } } public int RecordSize { get { return this.recordSize; } } } }
51zhaoshi/myyyyshop
Maticsoft.ZipLib_Source/Maticsoft.ZipLib.Tar/TarBuffer.cs
C#
gpl-3.0
10,590
[ 30522, 3415, 15327, 13523, 6558, 15794, 1012, 14101, 29521, 1012, 16985, 1063, 2478, 2291, 1025, 2478, 2291, 1012, 22834, 1025, 2270, 2465, 16985, 8569, 12494, 1063, 2797, 20014, 3796, 7011, 16761, 1027, 2322, 1025, 2270, 9530, 3367, 20014, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Jeeps wrapper for Garmin serial protocol. Copyright (C) 2002, 2003, 2004, 2005, 2006 Robert Lipe, robertlipe@usa.net 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 USA */ #include <ctype.h> #include <limits.h> #include "defs.h" #include "grtcirc.h" #include "jeeps/gps.h" #include "garmin_tables.h" #include "garmin_fs.h" #include "garmin_device_xml.h" #define SOON 1 #define MYNAME "GARMIN" static const char *portname; static short_handle mkshort_handle; static GPS_PWay *tx_routelist; static GPS_PWay *cur_tx_routelist_entry; static GPS_PTrack *tx_tracklist; static GPS_PTrack *cur_tx_tracklist_entry; static int my_track_count = 0; static char *getposn = NULL; static char *poweroff = NULL; static char *resettime = NULL; static char *snlen = NULL; static char *snwhiteopt = NULL; static char *deficon = NULL; static char *category = NULL; static char *categorybitsopt = NULL; static int categorybits; static int receiver_must_upper = 1; static ff_vecs_t *gpx_vec; #define MILITANT_VALID_WAYPT_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" /* Technically, even this is a little loose as spaces arent allowed */ static const char *valid_waypt_chars = MILITANT_VALID_WAYPT_CHARS " "; static arglist_t garmin_args[] = { { "snlen", &snlen, "Length of generated shortnames", NULL, ARGTYPE_INT, "1", NULL }, { "snwhite", &snwhiteopt, "Allow whitespace synth. shortnames", NULL, ARGTYPE_BOOL, ARG_NOMINMAX}, { "deficon", &deficon, "Default icon name", NULL, ARGTYPE_STRING, ARG_NOMINMAX }, { "get_posn", &getposn, "Return current position as a waypoint", NULL, ARGTYPE_BOOL, ARG_NOMINMAX}, { "power_off", &poweroff, "Command unit to power itself down", NULL, ARGTYPE_BOOL, ARG_NOMINMAX}, { "resettime", &resettime, "Sync GPS time to computer time", NULL, ARGTYPE_BOOL, ARG_NOMINMAX}, { "category", &category, "Category number to use for written waypoints", NULL, ARGTYPE_INT, "1", "16"}, { "bitscategory", &categorybitsopt, "Bitmap of categories", NULL, ARGTYPE_INT, "1", "65535"}, ARG_TERMINATOR }; static const char * d103_symbol_from_icon_number(unsigned int n); static int d103_icon_number_from_symbol(const char *s); static void rw_init(const char *fname) { int receiver_short_length; int receiver_must_upper = 1; char * receiver_charset = NULL; if (!mkshort_handle) mkshort_handle = mkshort_new_handle(); if (global_opts.debug_level > 0) { GPS_Enable_Warning(); GPS_Enable_User(); } if (global_opts.debug_level > 1) { GPS_Enable_Diagnose(); } GPS_Enable_Error(); if (poweroff) { GPS_Command_Off(fname); return; } /* * THis is Gross. The B&W Vista sometimes sets its time decades into * the future with no way to reset it. This apparently can "cure" * an affected unit. */ if (resettime) { GPS_Command_Send_Time(fname, current_time()); return; } if (categorybitsopt) { categorybits = strtol(categorybitsopt, NULL, 0); } if (GPS_Init(fname) < 0) { fatal(MYNAME ":Can't init %s\n", fname); } portname = fname; /* * Grope the unit we're talking to to set setshort_length to * 20 for the V, * 10 for Street Pilot, (old) Rhino, 76 * 6 for the III, 12, emap, and etrex * Fortunately, getting this "wrong" only results in ugly names * when we're using the synthesize_shortname path. */ receiver_short_length = 10; switch ( gps_waypt_type ) /* waypoint type as defined by jeeps */ { case 0: fatal("Garmin unit %d does not support waypoint xfer.", gps_save_id); break; case 100: /* The GARMIN GPS Interface Specification, */ case 101: /* says these waypoint types use an ident */ case 102: /* length of 6. Waypoint types 106, 108 */ case 103: /* and 109 are all variable length */ case 104: case 105: case 107: case 150: case 151: case 152: case 154: case 155: receiver_short_length = 6; break; case 106: /* Waypoint types with variable ident length */ case 108: /* Need GPSr id to know the actual length */ case 109: case 110: switch ( gps_save_id ) { case 130: /* Garmin Etrex (yellow) */ receiver_short_length = 6; break; case 295: /* eTrex (yellow, fw v. 3.30) */ case 696: /* eTrex HC */ case 574: /* Geko 201 */ receiver_short_length = 6; valid_waypt_chars = MILITANT_VALID_WAYPT_CHARS " +-"; setshort_badchars(mkshort_handle, "\"$.,'!"); break; case 155: /* Garmin V */ case 404: /* SP2720 */ case 520: /* SP2820 */ receiver_short_length = 20; break; case 382: /* C320 */ receiver_short_length = 30; receiver_must_upper = 0; break; case 292: /* (60|76)C[S]x series */ case 421: /* Vista|Legend Cx */ case 694: /* Legend HCx */ case 695: /* Vista HC */ case 786: /* HC model */ receiver_short_length = 14; snwhiteopt = xstrdup("1"); receiver_must_upper = 0; /* This might be 8859-1 */ receiver_charset = CET_CHARSET_MS_ANSI; break; case 291: /* GPSMAP 60CS, probably others */ receiver_short_length = 10; valid_waypt_chars = MILITANT_VALID_WAYPT_CHARS " +-"; setshort_badchars(mkshort_handle, "\"$.,'!"); break; case 231: /* Quest */ case 463: /* Quest 2 */ receiver_must_upper = 0; receiver_short_length = 30; receiver_charset = CET_CHARSET_MS_ANSI; break; case 577: // Rino 530HCx Version 2.50 receiver_must_upper = 0; receiver_short_length = 14; break; case 260: /* GPSMap 296 */ default: break; } break; default: break; } if (global_opts.debug_level > 0) { fprintf(stderr, "Waypoint type: %d\n" "Chosen waypoint length %d\n", gps_waypt_type, receiver_short_length); if (gps_category_type) { fprintf(stderr, "Waypoint category type: %d\n", gps_category_type); } } /* * If the user provided a short_length, override the calculated value. */ if (snlen) setshort_length(mkshort_handle, atoi(snlen)); else setshort_length(mkshort_handle, receiver_short_length); if (snwhiteopt) setshort_whitespace_ok(mkshort_handle, atoi(snwhiteopt)); /* * Until Garmins documents how to determine valid character space * for the new models, we just release this safety check manually. */ if (receiver_must_upper) { setshort_goodchars(mkshort_handle, valid_waypt_chars); } else { setshort_badchars(mkshort_handle, ""); } setshort_mustupper(mkshort_handle, receiver_must_upper); if (receiver_charset) cet_convert_init(receiver_charset, 1); } static void rd_init(const char *fname) { if (setjmp(gdx_jmp_buf)) { char *vec_opts = NULL; const gdx_info *gi = gdx_get_info(); gpx_vec = find_vec("gpx", &vec_opts); gpx_vec->rd_init(gi->from_device.canon); } else { gpx_vec = NULL; rw_init(fname); } } static void rw_deinit(void) { if (mkshort_handle) { mkshort_del_handle(&mkshort_handle); } } static int waypt_read_cb(int total_ct, GPS_PWay *way) { static int i; if (global_opts.verbose_status) { i++; waypt_status_disp(total_ct, i); } return 0; } static void waypt_read(void) { int i,n; GPS_PWay *way = NULL; if (getposn) { waypoint *wpt = waypt_new(); wpt->latitude = gps_save_lat; wpt->longitude = gps_save_lon; wpt->shortname = xstrdup("Position"); if (gps_save_time) wpt->creation_time = gps_save_time; waypt_add(wpt); return; } if ((n = GPS_Command_Get_Waypoint(portname, &way, waypt_read_cb)) < 0) { fatal(MYNAME ":Can't get waypoint from %s\n", portname); } for (i = 0; i < n; i++) { waypoint *wpt_tmp = waypt_new(); wpt_tmp->shortname = xstrdup(way[i]->ident); wpt_tmp->description = xstrdup(way[i]->cmnt); rtrim(wpt_tmp->shortname); rtrim(wpt_tmp->description); wpt_tmp->longitude = way[i]->lon; wpt_tmp->latitude = way[i]->lat; if (gps_waypt_type == 103) { wpt_tmp->icon_descr = d103_symbol_from_icon_number( way[i]->smbl); } else { int dyn = 0; wpt_tmp->icon_descr = gt_find_desc_from_icon_number( way[i]->smbl, PCX, &dyn); wpt_tmp->wpt_flags.icon_descr_is_dynamic = dyn; } /* * If a unit doesn't store altitude info (i.e. a D103) * gpsmem will default the alt to INT_MAX. Other units * (I can't recall if it was the V (D109) hor the Vista (D108) * return INT_MAX+1, contrary to the Garmin protocol doc which * says they should report 1.0e25. So we'll try to trap * all the cases here. Yes, libjeeps should probably * do this and not us... */ if ((way[i]->alt == (float) (1U<<31)) || (way[i]->alt == INT_MAX) || (way[i]->alt >= (float) 1.0e20) ) { wpt_tmp->altitude = unknown_alt; } else { wpt_tmp->altitude = way[i]->alt; } if (way[i]->time_populated) { wpt_tmp->creation_time = way[i]->time; } #if SOON garmin_fs_garmin_after_read(way[i], wpt_tmp, gps_waypt_type); #endif waypt_add(wpt_tmp); GPS_Way_Del(&way[i]); } if (way) { xfree(way); } } static int lap_read_nop_cb(int n, struct GPS_SWay** dp) { return 0; } // returns 1 if the waypoint's start_time can be found // in the laps array, 0 otherwise unsigned int checkWayPointIsAtSplit(waypoint *wpt, GPS_PLap *laps, int nlaps) { int result = 0; if ((laps != NULL) && (nlaps > 0)) { int i; for (i=(nlaps-1); i >= 0; i--) { GPS_PLap lap = laps[i]; time_t delta = lap->start_time - wpt->creation_time; if ((delta >= -1) && (delta <= 1)) { result = 1; break; // as an optimization this will stop going through // the lap array when the negative delta gets too // big. It assumes that laps is sorted by time in // ascending order (which appears to be the case for // Forerunners. Don't know about other devices. } else if (delta < -1) { break; } } } return result; } static void track_read(void) { int32 ntracks; GPS_PTrack *array; route_head *trk_head = NULL; int trk_num = 0; int i; int trk_seg_num = 1; char trk_seg_num_buf[10]; char *trk_name = ""; GPS_PLap* laps = NULL; int nlaps = 0; if (gps_lap_type != -1) { nlaps = GPS_Command_Get_Lap(portname, &laps, &lap_read_nop_cb); } ntracks = GPS_Command_Get_Track(portname, &array, waypt_read_cb); if ( ntracks <= 0 ) return; for(i = 0; i < ntracks; i++) { waypoint *wpt; /* * This is probably always in slot zero, but the Garmin * serial spec says these can appear anywhere. Toss them * out so we don't treat it as an extraneous trackpoint. */ if (array[i]->ishdr) { trk_name = array[i]->trk_ident; if (!trk_name) trk_name = ""; trk_seg_num = 1; } if ((trk_head == NULL) || array[i]->tnew) { trk_head = route_head_alloc(); trk_head->rte_num = trk_num; if (trk_seg_num == 1) { trk_head->rte_name = xstrdup(trk_name); } else { /* name in the form TRACKNAME #n */ snprintf(trk_seg_num_buf, sizeof(trk_seg_num_buf), "%d", trk_seg_num); trk_head->rte_name = xmalloc(strlen(trk_name)+strlen(trk_seg_num_buf)+3); sprintf(trk_head->rte_name, "%s #%s", trk_name, trk_seg_num_buf); } trk_seg_num++; trk_num++; track_add_head(trk_head); } if (array[i]->no_latlon || array[i]->ishdr) { continue; } wpt = waypt_new(); wpt->longitude = array[i]->lon; wpt->latitude = array[i]->lat; wpt->altitude = array[i]->alt; wpt->heartrate = array[i]->heartrate; wpt->cadence = array[i]->cadence; wpt->shortname = xstrdup(array[i]->trk_ident); wpt->creation_time = array[i]->Time; wpt->wpt_flags.is_split = checkWayPointIsAtSplit(wpt, laps, nlaps); track_add_wpt(trk_head, wpt); } while(ntracks) { GPS_Track_Del(&array[--ntracks]); } xfree(array); } static void route_read(void) { int32 nroutepts; int i; GPS_PWay *array; /* TODO: Fixes warning but is it right? * RJL: No, the warning isn't right; GCC's flow analysis is broken. * still, it's good taste... */ route_head *rte_head = NULL; nroutepts = GPS_Command_Get_Route(portname, &array); // fprintf(stderr, "Routes %d\n", (int) nroutepts); #if 1 for (i = 0; i < nroutepts; i++) { if (array[i]->isrte) { char *csrc = NULL; /* What a horrible API has libjeeps for making this * my problem. */ switch (array[i]->rte_prot) { case 201: csrc = array[i]->rte_cmnt; break; case 202: csrc = array[i]->rte_ident; break; default: break; } rte_head = route_head_alloc(); route_add_head(rte_head); if (csrc) { rte_head->rte_name = xstrdup(csrc); } } else { if (array[i]->islink) { continue; } else { waypoint *wpt_tmp = waypt_new(); wpt_tmp->latitude = array[i]->lat; wpt_tmp->longitude = array[i]->lon; wpt_tmp->shortname = array[i]->ident; route_add_wpt(rte_head, wpt_tmp); } } } #else GPS_Fmt_Print_Route(array, nroutepts, stderr); #endif } #if 0 static void lap_read_as_track(void) { int32 ntracks; GPS_PLap *array; route_head *trk_head = NULL; int trk_num = 0; int index; int i; ntracks = GPS_Command_Get_Lap(portname, &array, waypt_read_cb); if ( ntracks <= 0 ) return; for (i = 0; i < ntracks; i++) { waypoint *wpt; if (array[i]->index == -1){ index=i; } else { index=array[i]->index; index=i; } if ((trk_head == NULL) || (i == 0) || /* D906 - last track:index is the track index */ (array[i]->index == -1 && array[i]->track_index != 255) || /* D10xx - no real separator, use begin/end time to guess */ (abs(array[i-1]->start_time + array[i]->total_time/100-array[i]->start_time) > 2) ) { static struct tm * stmp; stmp = gmtime(&array[i]->start_time); trk_head = route_head_alloc(); /*For D906, we would like to use the track_index in the last packet instead...*/ trk_head->rte_num = ++trk_num; trk_head->rte_name = xmalloc(32); strftime(trk_head->rte_name, 32, "%Y-%m-%dT%H:%M:%SZ", stmp); track_add_head(trk_head); wpt = waypt_new(); wpt->longitude = array[i]->begin_lon; wpt->latitude = array[i]->begin_lat; wpt->heartrate = array[i]->avg_heart_rate; wpt->cadence = array[i]->avg_cadence; wpt->speed = array[i]->max_speed; wpt->creation_time = array[i]->start_time; wpt->microseconds = 0; wpt->shortname = xmalloc(8); sprintf(wpt->shortname, "#%d-0", index); wpt->description = xmalloc(128); sprintf(wpt->description, "D:%f Cal:%d MS:%f AH:%d MH:%d AC:%d I:%d T:%d", array[i]->total_distance, array[i]->calories, array[i]->max_speed, array[i]->avg_heart_rate, array[i]->max_heart_rate, array[i]->avg_cadence, array[i]->intensity, array[i]->trigger_method); track_add_wpt(trk_head, wpt); } /*Allow even if no correct location, no skip if invalid */ /* if (array[i]->no_latlon) { * continue; * } */ wpt = waypt_new(); wpt->longitude = array[i]->end_lon; wpt->latitude = array[i]->end_lat; wpt->heartrate = array[i]->avg_heart_rate; wpt->cadence = array[i]->avg_cadence; wpt->speed = array[i]->max_speed; wpt->creation_time = array[i]->start_time + array[i]->total_time/100; wpt->microseconds = 10000*(array[i]->total_time % 100); /*Add fields with no mapping in the description */ wpt->shortname = xmalloc(8); sprintf(wpt->shortname, "#%d", index); wpt->description = xmalloc(128); sprintf(wpt->description, "D:%f Cal:%d MS:%f AH:%d MH:%d AC:%d I:%d T:%d (%f,%f)", array[i]->total_distance, array[i]->calories, array[i]->max_speed, array[i]->avg_heart_rate, array[i]->max_heart_rate, array[i]->avg_cadence, array[i]->intensity, array[i]->trigger_method, array[i]->begin_lon, array[i]->begin_lat); track_add_wpt(trk_head, wpt); } while(ntracks) { GPS_Lap_Del(&array[--ntracks]); } xfree(array); } #endif /* * Rather than propogate Garmin-specific data types outside of the Garmin * code, we convert the PVT (position/velocity/time) data from the receiver * to the data type we use throughout. Yes, we do lose some data that way. */ static void pvt2wpt(GPS_PPvt_Data pvt, waypoint *wpt) { double wptime, wptimes; wpt->altitude = pvt->alt; wpt->latitude = pvt->lat; wpt->longitude = pvt->lon; WAYPT_SET(wpt,course,1); WAYPT_SET(wpt,speed,1); /* convert to true course in degrees */ if ( pvt->east >= 0.0 ) wpt->course = 90 - DEG(atan(pvt->north/pvt->east)); else wpt->course = 270 - DEG(atan(pvt->north/pvt->east)); #if 0 /* velocity in m/s */ wpt->speed = sqrt(pvt->north*pvt->north + pvt->east*pvt->east); wpt->vs = pvt->up; #endif /* * The unit reports time in three fields: * 1) The # of days to most recent Sun. since 1989-12-31 midnight UTC. * 2) The number of seconds (fractions allowed) since that Sunday. * 3) The number of leap seconds that offset the current UTC and GPS * reference clocks. */ wptime = 631065600.0 + pvt->wn_days * 86400.0 + pvt->tow - pvt->leap_scnds; wptimes = floor(wptime); wpt->creation_time = wptimes; wpt->microseconds = 1000000.0 * (wptime - wptimes); /* * The Garmin spec fifteen different models that use a different * table for 'fix' without a really good way to tell if the model * we're talking to happens to be one of those...By inspection, * it looks like even though the models (Summit, Legend, etc.) may * be popular, it's older (2001 and earlier or so) versions that * are affected and I think there are relatively few readers of * the fix field anyway. Time will tell if this is a good plan. */ switch (pvt->fix) { case 0: wpt->fix = fix_unknown;break; case 1: wpt->fix = fix_none;break; case 2: wpt->fix = fix_2d;break; case 3: wpt->fix = fix_3d;break; case 4: wpt->fix = fix_dgps;break; /* 2D_diff */ case 5: wpt->fix = fix_dgps;break; /* 3D_diff */ default: /* undocumented type. */ break; } } static gpsdevh *pvt_fd; static void pvt_init(const char *fname) { rw_init(fname); GPS_Command_Pvt_On(fname, &pvt_fd); } static waypoint * pvt_read(posn_status *posn_status) { waypoint *wpt = waypt_new(); GPS_PPvt_Data pvt = GPS_Pvt_New(); if (GPS_Command_Pvt_Get(&pvt_fd, &pvt)) { pvt2wpt(pvt, wpt); GPS_Pvt_Del(&pvt); wpt->shortname = xstrdup("Position"); if (gps_errno && posn_status) { posn_status->request_terminate = 1; } return wpt; } /* * If the caller has not given us a better way to return the * error, do it now. */ if (gps_errno) { fatal(MYNAME ": Fatal error reading position.\n"); } waypt_free(wpt); GPS_Pvt_Del(&pvt); return NULL; } static void data_read(void) { if (gpx_vec) { gpx_vec->read(); return; } if (poweroff) { return; } if (global_opts.masked_objective & WPTDATAMASK) waypt_read(); if (global_opts.masked_objective & TRKDATAMASK) track_read(); if (global_opts.masked_objective & RTEDATAMASK) route_read(); if (!(global_opts.masked_objective & (WPTDATAMASK | TRKDATAMASK | RTEDATAMASK | POSNDATAMASK))) fatal(MYNAME ": Nothing to do.\n"); } static GPS_PWay sane_GPS_Way_New(void) { GPS_PWay way; way = GPS_Way_New(); if (!way) { fatal(MYNAME ":not enough memory\n"); } /* * Undo less than helpful defaults from Way_New. */ way->rte_ident[0] = 0; way->rte_cmnt[0] = 0; way->rte_link_subclass[0] = 0; way->rte_link_ident[0] = 0; way->city[0] = 0; way->state[0] = 0; way->facility[0] = 0; way->addr[0] = 0; way->cross_road[0] = 0; way->cross_road[0] = 0; way->dpth = 1.0e25f; way->wpt_class = 0; return way; } static int waypt_write_cb(GPS_PWay *way) { static int i; int n = waypt_count(); if (global_opts.verbose_status) { i++; waypt_status_disp(n, i); } return 0; } /* * If we're using smart names, try to put the cache info in the * description. */ const char * get_gc_info(waypoint *wpt) { if (global_opts.smart_names) { if (wpt->gc_data->type == gt_virtual) return "V "; if (wpt->gc_data->type == gt_unknown) return "? "; if (wpt->gc_data->type == gt_multi) return "Mlt "; if (wpt->gc_data->type == gt_earth) return "EC "; if (wpt->gc_data->type == gt_event) return "Ev "; if (wpt->gc_data->container == gc_micro) return "M "; if (wpt->gc_data->container == gc_small) return "S "; } return ""; } static void waypoint_write(void) { int i; int32 ret; int n = waypt_count(); queue *elem, *tmp; extern queue waypt_head; GPS_PWay *way; int icon; way = xcalloc(n,sizeof(*way)); for (i = 0; i < n; i++) { way[i] = sane_GPS_Way_New(); } i = 0; QUEUE_FOR_EACH(&waypt_head, elem, tmp) { waypoint *wpt; char *ident; char *src = NULL; char obuf[256]; wpt = (waypoint *) elem; if(wpt->description) src = wpt->description; if(wpt->notes) src = wpt->notes; /* * mkshort will do collision detection and namespace * cleaning */ ident = mkshort(mkshort_handle, global_opts.synthesize_shortnames ? src : wpt->shortname); /* Should not be a strcpy as 'ident' isn't really a C string, * but rather a garmin "fixed length" buffer that's padded * to the end with spaces. So this is NOT (strlen+1). */ memcpy(way[i]->ident, ident, strlen(ident)); if (global_opts.synthesize_shortnames) { xfree(ident); } way[i]->ident[sizeof(way[i]->ident)-1] = 0; // If we were explictly given a comment from GPX, use that. if (wpt->description) { memcpy(way[i]->cmnt, wpt->description, strlen(wpt->description)); } else { if (global_opts.smart_names && wpt->gc_data->diff && wpt->gc_data->terr) { #if 0 xasprintf(&src, "%s %s", &wpt->shortname[2], src); #endif snprintf(obuf, sizeof(obuf), "%s%d/%d %s", get_gc_info(wpt), wpt->gc_data->diff, wpt->gc_data->terr, src); memcpy(way[i]->cmnt, obuf, strlen(obuf)); } else { memcpy(way[i]->cmnt, src, strlen(src)); } } way[i]->lon = wpt->longitude; way[i]->lat = wpt->latitude; if (deficon) { icon = gt_find_icon_number_from_desc(deficon, PCX); } else { if (get_cache_icon(wpt)) { icon = gt_find_icon_number_from_desc(get_cache_icon(wpt), PCX); } else { icon = gt_find_icon_number_from_desc(wpt->icon_descr, PCX); } } /* For units that support tiny numbers of waypoints, just * overwrite that and go very literal. */ if (gps_waypt_type == 103) { icon = d103_icon_number_from_symbol(wpt->icon_descr); } way[i]->smbl = icon; if (wpt->altitude == unknown_alt) { way[i]->alt_is_unknown = 1; way[i]->alt = 0; } else { way[i]->alt = wpt->altitude; } if (wpt->creation_time) { way[i]->time = wpt->creation_time; way[i]->time_populated = 1; } if (category) { way[i]->category = 1 << (atoi(category) - 1); } if (categorybits) { way[i]->category = categorybits; } #if SOON garmin_fs_garmin_before_write(wpt, way[i], gps_waypt_type); #endif i++; } if ((ret = GPS_Command_Send_Waypoint(portname, way, n, waypt_write_cb)) < 0) { fatal(MYNAME ":communication error sending wayoints..\n"); } for (i = 0; i < n; ++i) { GPS_Way_Del(&way[i]); } if (global_opts.verbose_status) { fprintf(stdout, "\r\n"); fflush(stdout); } xfree(way); } static void route_hdr_pr(const route_head *rte) { (*cur_tx_routelist_entry)->rte_num = rte->rte_num; (*cur_tx_routelist_entry)->isrte = 1; if (rte->rte_name) { strncpy((*cur_tx_routelist_entry)->rte_ident, rte->rte_name, sizeof ((*cur_tx_routelist_entry)->rte_ident)); } } static void route_waypt_pr(const waypoint *wpt) { GPS_PWay rte = *cur_tx_routelist_entry; char *s, *d; /* * As stupid as this is, libjeeps seems to want an empty * waypoint between every link in a route that has nothing * but the 'islink' member set. Rather than "fixing" libjeeps, * we just double them up (sigh) and do that here. */ rte->islink = 1; rte->lon = wpt->longitude; rte->lat = wpt->latitude; cur_tx_routelist_entry++; rte = *cur_tx_routelist_entry; rte->lon = wpt->longitude; rte->lat = wpt->latitude; rte->smbl = gt_find_icon_number_from_desc(wpt->icon_descr, PCX); if (wpt->altitude != unknown_alt) { rte->alt = wpt->altitude; } else { rte->alt_is_unknown = 1; rte->alt = 0; } // Garmin protocol spec says no spaces, no lowercase, etc. in a route. // enforce that here, since jeeps doesn't. // // This was strncpy(rte->ident, wpt->shortname, sizeof(rte->ident)); d = rte->ident; for (s = wpt->shortname; *s; s++) { int c = *s; if (receiver_must_upper && isalpha(c)) c = toupper(c); if (strchr(valid_waypt_chars, c)) { *d++ = c; } } rte->ident[sizeof(rte->ident)-1] = 0; if (wpt->description) { strncpy(rte->cmnt, wpt->description, sizeof(rte->cmnt)); rte->cmnt[sizeof(rte->cmnt)-1] = 0; } else { rte->cmnt[0] = 0; } cur_tx_routelist_entry++; } static void route_noop(const route_head *wp) { } static void route_write(void) { int i; int n = 2 * route_waypt_count(); /* Doubled for the islink crap. */ tx_routelist = xcalloc(n,sizeof(GPS_PWay)); cur_tx_routelist_entry = tx_routelist; for (i = 0; i < n; i++) { tx_routelist[i] = sane_GPS_Way_New(); } route_disp_all(route_hdr_pr, route_noop, route_waypt_pr); GPS_Command_Send_Route(portname, tx_routelist, n); } static void track_hdr_pr(const route_head *trk_head) { (*cur_tx_tracklist_entry)->tnew = gpsTrue; (*cur_tx_tracklist_entry)->ishdr = gpsTrue; if ( trk_head->rte_name ) { strncpy((*cur_tx_tracklist_entry)->trk_ident, trk_head->rte_name, sizeof((*cur_tx_tracklist_entry)->trk_ident)); (*cur_tx_tracklist_entry)->trk_ident[sizeof((*cur_tx_tracklist_entry)->trk_ident)-1] = 0; } else { sprintf((*cur_tx_tracklist_entry)->trk_ident, "TRACK%02d", my_track_count); } cur_tx_tracklist_entry++; my_track_count++; } static void track_waypt_pr(const waypoint *wpt) { (*cur_tx_tracklist_entry)->lat = wpt->latitude; (*cur_tx_tracklist_entry)->lon = wpt->longitude; (*cur_tx_tracklist_entry)->alt = wpt->altitude; (*cur_tx_tracklist_entry)->Time = wpt->creation_time; if ( wpt->shortname ) { strncpy((*cur_tx_tracklist_entry)->trk_ident, wpt->shortname, sizeof((*cur_tx_tracklist_entry)->trk_ident)); (*cur_tx_tracklist_entry)->trk_ident[sizeof((*cur_tx_tracklist_entry)->trk_ident)-1] = 0; } cur_tx_tracklist_entry++; } static void track_write(void) { int i; int n = track_waypt_count() + track_count(); tx_tracklist = xcalloc(n, sizeof(GPS_PTrack)); cur_tx_tracklist_entry = tx_tracklist; for (i = 0; i < n; i++) { tx_tracklist[i] = GPS_Track_New(); } my_track_count = 0; track_disp_all(track_hdr_pr, route_noop, track_waypt_pr); GPS_Command_Send_Track(portname, tx_tracklist, n); for (i = 0; i < n; i++) { GPS_Track_Del(&tx_tracklist[i]); } xfree(tx_tracklist); } static void data_write(void) { if (poweroff) { return; } if (global_opts.masked_objective & WPTDATAMASK) waypoint_write(); if (global_opts.masked_objective & RTEDATAMASK) route_write(); if (global_opts.masked_objective & TRKDATAMASK) track_write(); } ff_vecs_t garmin_vecs = { ff_type_serial, FF_CAP_RW_ALL, rd_init, rw_init, rw_deinit, rw_deinit, data_read, data_write, NULL, garmin_args, CET_CHARSET_ASCII, 0, { pvt_init, pvt_read, rw_deinit, NULL, NULL, NULL } }; static const char *d103_icons[16] = { "dot", "house", "gas", "car", "fish", "boat", "anchor", "wreck", "exit", "skull", "flag", "camp", "circle_x", "deer", "1st_aid", "back-track" }; static const char * d103_symbol_from_icon_number(unsigned int n) { if (n <= 15) return d103_icons[n]; else return "unknown"; } static int d103_icon_number_from_symbol(const char *s) { unsigned int i; if (NULL == s) { return 0; } for (i = 0; i < sizeof(d103_icons) / sizeof(d103_icons[0]); i++) { if (0 == case_ignore_strcmp(s, d103_icons[i])) return i; } return 0; }
twpayne/gpsbabel-flytec
garmin.c
C
gpl-2.0
28,718
[ 30522, 1013, 1008, 14007, 2015, 10236, 4842, 2005, 11721, 27512, 7642, 8778, 1012, 9385, 1006, 1039, 1007, 2526, 1010, 2494, 1010, 2432, 1010, 2384, 1010, 2294, 2728, 5423, 2063, 1010, 2728, 15000, 2063, 1030, 3915, 1012, 5658, 2023, 2565, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
\section{Discussão} \begin{itemize} \item Consideração sobre comportamento e peculiaridades do Clang \item Pressuposto uma vulnerabilidade por arquivo \item Percentual baixo, porém comum \item Maioria dos arquivos não obtiveram report \end{itemize} As vulnerabilidades e suas nomenclaturas identificadas pela ferramenta \"scan-build\" (presente na ferramenta Clang) não estão alinhadas com as determinadas pelo NIST, sendo necessária, para este trabalho, uma aproximação. Foi levantada a hipotése de existência de apenas uma vulnerabilidade por arquivo de teste. Deste modo, há a possibilidade de que a quantidade de ocorrências de vulnerabilidades esperadas não corresponda à real. Entretanto, o modo de abordagem utilizado diminui o impacto dessa possível discrepância. O percentual de vulnerabilidades encontradas equivalentes as esperadas foi relativamente baixo, contudo, não foi uma surpresa, já que a grande maioria das ferramentas possuem tal desempenho. O fato de não ter encontrado nenhuma vulnerabilidade na grande maioria dos casos de teste influenciou bastante para o baixo percentual obtido, não estando, este fato, relacionado a uma interpretação errônea, realmente apresentando um mal desempenho da ferramenta. No contexto dos casos de testes que foram identificadas vulnerabilidades, pode ou não ter inconsistências, dependendo da acurácia da hipótese levantada. No espaço amostral das arquivos que foram encontradas vulnerabilidades, cerca de um quinto das vulnerabilidades encontradas foram equivalentes as esperadas, o que pode-se dizer satisfatório.
Analizo-UnB/security_report
artigo-latex/discussao.tex
TeX
gpl-3.0
1,580
[ 30522, 1032, 2930, 1063, 6848, 7113, 1065, 1032, 4088, 1063, 8875, 4697, 1065, 1032, 8875, 5136, 19629, 2080, 17540, 2890, 4012, 6442, 24996, 2080, 1041, 14099, 27893, 2229, 2079, 6338, 2290, 1032, 8875, 2811, 6279, 14122, 2080, 8529, 2050,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<pm-header></pm-header> <div class="container"> <legalMenu></legalMenu> <div class="body"> <h1>Extension to the slamby api commercial license for royalty free distribution (oem)</h1> <h2>1. Definitions</h2> <p>When used in this Agreement, the following terms shall have the respective meanings indicated, such meanings to be applicable to both the singular and plural forms of the terms defined:</p> <ul> <li>“We” or “Us” or “Slamby” or “Our” or the “Company” refers to Slamby-Semantics Ltd.</li> <li>“You” and “Your” and “User” refers to the entity and/or individual person, natural or legal, consenting to, and entering into, this Agreement.</li> <li>"Licensor" means Slamby.</li> <li>"Software" means (a) all of the contents of the files, disk(s), disk image(s), Docker containers or other media with which this Agreement is provided, including but not limited to ((i) digital images (ii) related explanatory written materials or files ("Documentation"); and (iii) fonts; and (b) upgrades, modified versions, updates, additions, and copies of the Software, if any, licensed to you by Slamby (collectively, "Updates").</li> <li>"Use" or "Using" means to access, install, download, copy or otherwise benefit from using the functionality of the Software.</li> <li>"Licensee" means You or Your Company, unless otherwise indicated.</li> <li>"System" means Windows OS, GNU/Linux or Mac OS X, Docker or any virtual machine.</li> </ul> <h2>2. General Use</h2> <p>As long as the Licensee complies with the terms of this extension of End User License Agreement (the "Agreement") and the Agreement itself, the Licensor grants the Licensee a non-exclusive right to install and Use the Software for the purposes described in the Documentation under the following conditions:</p> <p>The Software may be installed and used by the Licensee for business, commercial and money-earning purposes.</p> <p>This License can be deployed on any number of systems.</p> <p>The Software under this License may be incorporated into software/hardware projects sold by the Licensee.</p> <p>The Licensee may physically or electronically distribute the Software to his manufacturing and service partners but only as an intermediary product, requiring incorporation of the Software into the software or hardware developed by the Licensee in cases when the manufacturing process involves the Licensee's partner's job to complete the project before distributing it to end-users.</p> <p>The Licensee or his manufacturing and service partners may reproduce and physically or electronically distribute the Software only as an integral part of or incorporated into their software or hardware product.</p> <p>This License entitles the Licensee to the unlimited redistribution of the Licensor's technology as a part of the Licensee's product.</p> <p>This License is royalty-free, i.e. the Licensee does not need to pay a fee per every order of his product with the incorporated Licensor's technology.</p> <p>This License cannot be used by the Licensee to develop a software application that would compete with products marketed by the Licensor.</p> <h2>3. Intellectual Property Rights</h2> <p>3.1 This License does not transmit any intellectual rights on the Software. The Software and any copies that the Licensee is authorized by the Licensor to make are the intellectual property of and are owned by the Licensor.</p> <p>3.2 The Software is protected by copyright, including without limitation by Copyright Law and international treaty provisions.</p> <p>3.3 Any copies that the Licensee is permitted to make pursuant to this Agreement must contain the same copyright and other proprietary notices that appear on or in the Software.</p> <p>3.4 Any information supplied by the Licensor or obtained by the Licensee, as permitted hereunder, may only be used by the Licensee for the purpose described herein and may not be disclosed to any third party or used to create any software which is substantially similar to the expression of the Software.</p> <p>3.5 Trademarks shall be used in accordance with accepted trademark practice, including identification of trademarks owners' names. Trademarks can only be used to identify printed output produced by the Software and such use of any trademark does not give the Licensee any rights of ownership in that trademark.</p> <h2>License Transfer</h2> <p>4.1 This License is non-transferable. The Licensee may not transfer the rights to Use the Software to third parties (another person or legal entity).</p> <p>4.2 The Licensee may not rent, lease, sub-license, lend or transfer any versions or copies of the Software to third parties (another person or legal entity).</p> <p>4.3 The Licensee may make a back-up copy of the Software, provided a backup copy is not installed or used on any system not belonging to the Licensee. The Licensee may not transfer the rights to install or use a backup copy of the Software to third parties (another person or legal entity).</p> </div> </div>
slamby/slamby-website
src/app/legal/commercial-license-oem.component.html
HTML
apache-2.0
5,319
[ 30522, 1026, 7610, 1011, 20346, 1028, 1026, 1013, 7610, 1011, 20346, 1028, 1026, 4487, 2615, 2465, 1027, 1000, 11661, 1000, 1028, 1026, 3423, 3549, 2226, 1028, 1026, 1013, 3423, 3549, 2226, 1028, 1026, 4487, 2615, 2465, 1027, 1000, 2303, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php use_helper('Pagination'); ?> <script type="text/javascript" src="/js/jquery.lightbox-0.5.js"></script> <link rel="stylesheet" type="text/css" href="/css/jquery.lightbox-0.5.css" media="screen" /> <script type="text/javascript"> $(function() { $('a.lightbox').lightBox(); // Select all links with lightbox class }); </script> <div id="doc4" class="yui-t7" style="padding-top:10px;-moz-border-radius: 3px;-webkit-border-radius: 3px;background: rgba(10, 10, 10, 0.7); "> <?php include_partial('header',array('action_name' => $action_name)) ?> <div id="bd" role="main"> <div class="yui-g"> <!-- TOP BREADCRUMB/PAGINATION CONTAINER --> <div style="width:100%;margin:5px 0 5px 0"> <!-- BREADCRUMB --> <div class="gallery_container"> <h3><a href="<?php echo url_for("@homepage");?>">Home</a> >> Photo Gallery</h3> </div> <!-- PAGINATION --> <div style="float:right;margin:0 10px 0 0"> <?php echo pager_navigation($pager, '@gallery_page') ?> </div> <div style="clear:both"></div> </div> <div class="gallery_container"> <h2>Photo Gallery</h2> <?php $photo_counter = 1; ?> <?php foreach ($pager->getResults() as $photo) { ?> <?php $photo_counter = 1; ?> <div class="<?php echo ($photo_counter == 1 )?"photo_first":"photo"; ?>"> <a title="<?php echo $photo->getName();?>" href="<?php print $photo->getHomePagePhotoLightbox();?>" class="lightbox"><img class="img_border" src="/images.php?img=<?php print $photo->getHomePagePhoto();?>"/> <p style="font-size:10px;margin: 0px; color: #fff;"><?php echo $photo->getName();?></p></a> </div> <?php $photo_counter++ ?> <?php } ?> <div style="clear:both"></div> </div> <!-- BOTTOM BREADCRUMB/PAGINATION CONTAINER --> <?php if($pager->count() > 10) { ?> <div class="gallery_container" > <!-- PAGINATION --> <div style="float:right;margin:0 10px 0 0"> <?php echo pager_navigation($pager, '@gallery_page') ?> </div> <div style="clear:both"></div> </div> <?php } ?> </div> </div> <?php include_partial('footer') ?> </div>
phpchap/symfony14-beauty-salon
apps/frontend/modules/content/templates/gallerySuccess.php
PHP
mit
2,587
[ 30522, 1026, 1029, 25718, 2224, 1035, 2393, 2121, 1006, 1005, 6643, 20876, 3508, 1005, 1007, 1025, 1029, 1028, 1026, 5896, 2828, 1027, 1000, 3793, 1013, 9262, 22483, 1000, 5034, 2278, 1027, 1000, 1013, 1046, 2015, 1013, 1046, 4226, 2854, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* String.h - String ** https://github.com/hubenchang0515/Luminous ** ** Copyright (C) 2017 hubenchang0515 ** Date : 2017-8-23 ** E-mail : hubenchang0515@outlook.com ** Blog : blog.kurukurumi.com ** LISENCE : LGPL v3.0 */ #ifndef LUMINOUS_STRING_H #define LUMINOUS_STRING_H #include "core.h" #ifdef __cplusplus extern "C" { #endif typedef struct StringInfo* String; typedef struct StringInfo StringInfo; struct StringInfo { size_t space; // space of String char* data; // pointer to first character }; /* Create String */ String stringCreate(const char* cstr); /* Delete String */ void stringDelete(String string); /* Length of String */ size_t stringLength(String string); /* Resize space of String */ bool_t stringResize(String string, size_t size); /* Reduce space of String */ void stringReduce(String string); /* Copy a String */ String stringCopy(String string); /* Return C style String of String */ const char* stringValue(String string); /* Return data pointer of String */ char* stringData(String string); /* Set Value */ bool_t stringSetValue(String string, const char* cstr); /* Get value */ void stringGetValue(String string, char* cstr, size_t len); /* Remove some data */ bool_t stringRemove(String string, size_t site, size_t len); /* Append C style String */ bool_t stringAppend(String string, const char* cstr); /* Insert C style String */ bool_t stringInsert(String string, size_t site, const char* cstr); /* Repalce by C style String */ bool_t stringReplace(String string, size_t site, size_t len, const char* cstr); /* Append String */ bool_t stringAppendL(String string, String lstr); /* Insert String */ bool_t stringInsertL(String string, String lstr); /* Repalce by String */ bool_t stringReplaceL(String string, size_t site, size_t len, String lstr); /* Set String as sprintf */ bool_t stringSprintf(String string, const char* fmt,...); #ifdef __cplusplus } #endif #endif // LUMINOUS_STRING_H
hubenchang0515/Luminous
string.h
C
lgpl-3.0
1,974
[ 30522, 1013, 1008, 5164, 1012, 1044, 1011, 5164, 1008, 1008, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 4012, 1013, 9594, 2368, 22305, 2692, 22203, 2629, 1013, 25567, 1008, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2418, 9594, 2368,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from PyQt5 import QtWidgets from view.analysis_widget import AnalysisWidget # noinspection PyPep8Naming class TemporalAnalysisWidget(AnalysisWidget): # noinspection PyArgumentList def __init__(self, mplCanvas): """ Construct the Temporal Analysis page in the main window. |br| A ``ScatterPlot.mplCanvas`` will be shown on this page. :param mplCanvas: The ``ScatterPlot.mplCanvas`` widget. """ super().__init__() upperLabel = QtWidgets.QLabel("Temporal Distribution &Graph:") upperLabel.setMargin(1) upperLabel.setBuddy(mplCanvas) lowerLabel = QtWidgets.QLabel("Temporal Correlation &Quotient:") lowerLabel.setMargin(1) lowerLabel.setBuddy(self.tableWidget) mainLayout = QtWidgets.QVBoxLayout() mainLayout.addWidget(upperLabel) mainLayout.addWidget(mplCanvas) mainLayout.addWidget(lowerLabel) mainLayout.addWidget(self.tableWidget) self.setLayout(mainLayout)
yuwen41200/biodiversity-analysis
src/view/temporal_analysis_widget.py
Python
gpl-3.0
1,068
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 2509, 30524, 7542, 1052, 18863, 2361, 2620, 28987, 3070, 2465, 15850, 25902, 9148, 24291, 1006, 4106, 9148, 24291, 1007, 1024, 1001, 2053, 7076, 5051, 7542, 1052, 1338...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// syncwatcher_test.go package main import ( "os" "path/filepath" "strconv" "strings" "testing" "time" ) var ( slash = string(os.PathSeparator) testDirectory = "test" + slash ) func init() { // setupLogging(4, 2); // For debugging } func clearTestDir() { os.RemoveAll(testDirectory) } func initTestDir() { clearTestDir() os.MkdirAll(testDirectory, 0755) } func createTestPaths(t *testing.T, fs ...string) []string { rs := make([]string, len(fs)) for i, f := range fs { rs[i] = createTestPath(t, f) } return rs } func createTestPath(t *testing.T, f string) string { if strings.HasSuffix(f, slash) { err := os.MkdirAll(testDirectory+f, 0755) if err != nil && !os.IsExist(err) { t.Error("Failed to create test directory", err) } return strings.TrimSuffix(f, slash) } else { err := os.MkdirAll(filepath.Dir(testDirectory+f), 0755) if err != nil && !os.IsExist(err) { t.Error("Failed to create test directory", err) } } h, err := os.Create(testDirectory + f) if err != nil { t.Error("Failed to create test file", err) } h.Close() return f } func TestDebouncedFileWatch(t *testing.T) { // Log file change testOK := false testRepo := "test1" testFile := "a" + slash + "file1" testFiles := createTestPaths(t, testFile) defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 10 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != testFile { t.Errorf("Invalid result for file change: (%v) %#v", repo, sub) } testOK = true return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not triggered") } } func TestDebouncedDirectoryWatch(t *testing.T) { // Log directory change testOK := false testRepo := "test1" testFile := createTestPath(t, "a"+slash) testDebounceTimeout := time.Second testDirVsFiles := 10 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != testFile { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } testOK = true return nil } fsChan <- testDirectory + testFile go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not triggered") } } func TestDebouncedParentDirectoryWatch(t *testing.T) { // Convert a/file1.txt a/file2 a/file3.ogg to a testOK := false testRepo := "test1" testChangeDir := "a" + slash testFiles := createTestPaths(t, testChangeDir+"file1.txt", testChangeDir+"file2", testChangeDir+"file3.ogg") defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 2 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != "a" { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } testOK = true return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not triggered") } } func TestDebouncedParentDirectoryWatch2(t *testing.T) { // Convert a a/file1.txt a/file2 b a/file3.ogg to a b testOK := 0 testRepo := "test1" testChangeDir1 := "a" + slash testChangeDir2 := "b" + slash testFiles := createTestPaths(t, testChangeDir1, testChangeDir1+"file1.txt", testChangeDir1+"file2", testChangeDir2, testChangeDir1+"file3.ogg") defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 10 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 2 || sub[0] != "a" { t.Errorf("Invalid result for directory change 1: (%v) %#v", repo, sub) } if repo != testRepo || sub[1] != "b" { t.Errorf("Invalid result for directory change 2: (%v) %#v", repo, sub) } testOK = len(sub) return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if testOK != 2 { t.Error("Callback not correctly triggered") } } func TestDebouncedParentDirectoryWatch3(t *testing.T) { // Don't convert a/b/file1.txt a/c/file2 a/d/file3.ogg testOK := 0 testRepo := "test1" testFiles := createTestPaths(t, "a"+slash+"b"+slash+"file1.txt", "a"+slash+"c"+slash+"file2", "a"+slash+"d"+slash+"file3.ogg") defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 3 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } for i, s := range sub { if repo != testRepo || s != testFiles[i] { t.Errorf("Invalid result for directory change %t : (%v) %#v", testOK, repo, s) } } testOK = len(sub) return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if testOK != 3 { t.Error("Callback not correctly triggered") } } func TestDebouncedParentDirectoryWatch4(t *testing.T) { // Convert a/e a/b/d a/b/file1.txt a/b/file2 a/b/file3.ogg a/b/c/file4 to a/b a/e testOK := 0 testRepo := "test1" testFiles := createTestPaths(t, "a"+slash+"e", "a"+slash+"b"+slash+"d", "a"+slash+"b"+slash+"file1.txt", "a"+slash+"b"+slash+"file2", "a"+slash+"b"+slash+"file3.ogg", "a"+slash+"b"+slash+"c"+slash+"file4") defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 3 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 2 || sub[0] != "a"+slash+"b" { t.Errorf("Invalid result for directory change %t : (%v) %#v", testOK, repo, sub) } if repo != testRepo || sub[1] != "a"+slash+"e" { t.Errorf("Invalid result for directory change %t : (%v) %#v", testOK, repo, sub) } testOK = len(sub) return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if testOK != 2 { t.Error("Callback not correctly triggered") } } func TestDebouncedParentDirectoryWatch5(t *testing.T) { // Convert a/b a/c file1 file2 file3 to _ (main folder) testOK := false testRepo := "test1" testFiles := createTestPaths(t, "a"+slash+"b"+slash, "a"+slash+"c"+slash, "file1", "file2", "file3") defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 3 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != "" { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } testOK = true return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not correctly triggered") } } func TestDebouncedParentDirectoryWatch6(t *testing.T) { // Convert a/b/c a/b/c/f1 a/b/c/f2 a/b/c/f3 to a/b/c testOK := 0 testRepo := "test1" testChangeDir := "a" + slash + "b" + slash + "c" + slash testFiles := createTestPaths(t, testChangeDir, testChangeDir+"file1.txt", testChangeDir+"file2", testChangeDir+"file3.ogg") defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 10 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != strings.TrimSuffix(testChangeDir, slash) { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } testOK += 1 return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if testOK != 1 { t.Error("Callback not correctly triggered") } } func TestDebouncedParentDirectoryRemovedWatch(t *testing.T) { // Convert a a/b a/b/test.txt into a testOK := 0 testRepo := "test1" testFiles := createTestPaths(t, "a"+slash, "a"+slash+"b"+slash, "a"+slash+"b"+slash+"file1.txt") clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 10 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != "a" { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } testOK += 1 return nil } for i := range testFiles { fsChan <- testDirectory + testFiles[i] } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if testOK != 1 { t.Error("Callback not correctly triggered") } } func TestSTEvents(t *testing.T) { // Ignore notifications if ST created them testOK := true testRepo := "test1" testFiles := createTestPaths(t, "file1", "file2", "file3") defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 10 stChan := make(chan STEvent, 10) fsChan := make(chan string, 10) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 0 { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } testOK = false return nil } stChan <- STEvent{Path: ""} for i := range testFiles { stChan <- STEvent{Path: testDirectory + testFiles[i], Finished: false} fsChan <- testDirectory + testFiles[i] stChan <- STEvent{Path: testDirectory + testFiles[i], Finished: true} } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not correctly triggered") } } func TestFilesAggregation(t *testing.T) { nrFiles := 50 testOK := false testRepo := "test1" testFiles := make([]string, nrFiles) for i := 0; i < nrFiles; i++ { testFiles[i] = createTestPath(t, "a"+slash+strconv.Itoa(i)) } defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := nrFiles + 1 stop := make(chan int, 1) stChan := make(chan STEvent, nrFiles) fsChan := make(chan string, nrFiles) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 50 || sub[0] != "a"+slash+"0" { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } if testOK { t.Error("Callback triggered multiple times") } testOK = true stop <- 1 return nil } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout / 10) for _, testFile := range testFiles { fsChan <- testDirectory + testFile } <-stop time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not triggered") } } func TestManyFilesAggregation(t *testing.T) { nrFiles := 5000 testOK := false testRepo := "test1" testFiles := make([]string, nrFiles) for i := 0; i < nrFiles; i++ { testFiles[i] = createTestPath(t, "a"+slash+strconv.Itoa(i)) } defer clearTestDir() testDebounceTimeout := time.Second testDirVsFiles := 10 stop := make(chan int, 1) stChan := make(chan STEvent, nrFiles) fsChan := make(chan string, nrFiles) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != "" { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } if testOK { t.Error("Callback triggered multiple times") } testOK = true stop <- 1 return nil } for _, testFile := range testFiles { fsChan <- testDirectory + testFile } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) <-stop time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not triggered") } } func TestDeletesAggregation(t *testing.T) { nrFiles := 50 testOK := false testRepo := "test1" testFiles := make([]string, nrFiles) for i := 0; i < nrFiles; i++ { testFiles[i] = "a" + slash + strconv.Itoa(i) } testDebounceTimeout := time.Second testDirVsFiles := 10 stop := make(chan int, 1) stChan := make(chan STEvent, nrFiles) fsChan := make(chan string, nrFiles) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 50 || sub[0] != "a"+slash+"0" { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } if testOK { t.Error("Callback triggered multiple times") } testOK = true stop <- 1 return nil } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) time.Sleep(testDebounceTimeout / 10) for _, testFile := range testFiles { fsChan <- testDirectory + testFile } <-stop time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not triggered") } } func TestManyDeletesAggregation(t *testing.T) { nrFiles := 5000 testOK := false testRepo := "test1" testFiles := make([]string, nrFiles) for i := 0; i < nrFiles; i++ { testFiles[i] = "a" + slash + strconv.Itoa(i) } testDebounceTimeout := time.Second testDirVsFiles := 10 stop := make(chan int, 1) stChan := make(chan STEvent, nrFiles) fsChan := make(chan string, nrFiles) fileChange := func(repo string, sub []string) error { if len(sub) == 1 && sub[0] == ".stfolder" { return nil } if repo != testRepo || len(sub) != 1 || sub[0] != "" { t.Errorf("Invalid result for directory change: (%v) %#v", repo, sub) } if testOK { t.Error("Callback triggered multiple times") } testOK = true stop <- 1 return nil } for _, testFile := range testFiles { fsChan <- testDirectory + testFile } go accumulateChanges(testDebounceTimeout, testRepo, testDirectory, testDirVsFiles, stChan, fsChan, fileChange) <-stop time.Sleep(testDebounceTimeout * 2) if !testOK { t.Error("Callback not triggered") } } func slicesEqual(left, right []string) bool { if left == nil && right == nil { return true } if left == nil || right == nil { return false } if len(left) != len(right) { return false } for i := range left { if left[i] != right[i] { return false } } return true } func TestAggregateChanges(t *testing.T) { pathStat := func(path string) PathStatus { if strings.Contains(path, "deleted") { return deletedPath } else if strings.Contains(path, "file") { return filePath } else { return directoryPath } } checkAggregation := func(dirVsFiles int, paths []string, expected []string) { changes := aggregateChanges("/path/to/folder", dirVsFiles, paths, pathStat) if !slicesEqual(changes, expected) { t.Errorf("Expected: %#v, got: %#v", expected, changes) } } checkAggregation(3, nil, nil) checkAggregation(3, []string{}, nil) checkAggregation(3, []string{"file1"}, []string{"file1"}) checkAggregation(3, []string{"a" + slash + "file1"}, []string{"a" + slash + "file1"}) checkAggregation(3, []string{"a" + slash + "file1", "a" + slash + "file2", "a" + slash + "file3", "b" + slash + "file1", "b" + slash + "file2"}, []string{"a", "b" + slash + "file1", "b" + slash + "file2"}) checkAggregation(3, []string{"a" + slash + "deleted1", "a" + slash + "deleted2", "a" + slash + "deleted3", "a" + slash + "deleted4", "b" + slash + "deleted1", "b" + slash + "deleted2"}, []string{"a" + slash + "deleted1", "a" + slash + "deleted2", "a" + slash + "deleted3", "a" + slash + "deleted4", "b" + slash + "deleted1", "b" + slash + "deleted2"}) checkAggregation(3, []string{"file1", "file2"}, []string{"file1", "file2"}) checkAggregation(3, []string{"file1", "file2", "file3", "file4"}, []string{""}) checkAggregation(3, []string{"file1", "file2", "file3", "file4", "a" + slash + "file1", "a" + slash + "file2"}, []string{""}) }
syncthing/syncthing-inotify
syncwatcher_test.go
GO
mpl-2.0
17,597
[ 30522, 1013, 1013, 26351, 18866, 2121, 1035, 3231, 1012, 2175, 7427, 2364, 12324, 1006, 1000, 9808, 1000, 1000, 4130, 1013, 5371, 15069, 1000, 1000, 2358, 29566, 2078, 2615, 1000, 1000, 7817, 1000, 1000, 5604, 1000, 1000, 2051, 1000, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
{% extends "cms/base.html" %} {% load wagtailcore_tags %} {% block main %} {% block index_page_introduction %} {% include "cms/includes/introduction.html" with introduction=self.intro only %} {% endblock %} {% block index_page_children %} {% include "cms/includes/index_page_children.html" with title="In this section" %} {% endblock %} {% block related_links %} {% include "cms/includes/related_links.html" with related_links=self.related_links.all title="Related links" %} {% endblock %} {% endblock %}
kingsdigitallab/gssn-django
cms/templates/cms/resources_index_page.html
HTML
gpl-2.0
509
[ 30522, 1063, 1003, 8908, 1000, 4642, 2015, 1013, 2918, 1012, 16129, 1000, 1003, 1065, 1063, 1003, 7170, 11333, 13512, 12502, 17345, 1035, 22073, 1003, 1065, 1063, 1003, 3796, 2364, 1003, 1065, 1063, 1003, 3796, 5950, 1035, 3931, 1035, 4955,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#pragma once #include "Region.h" class ClusterElement { public: ClusterElement(); virtual ~ClusterElement(); virtual bool Init(const Rect& box, bool isPrimary=false, bool doubleBuffer=false); virtual void SetVisible(bool visible); virtual bool GetVisible() { return mVisible; }; // Invalidate the area of this element indicated by the rectangle. // NOTE : 'box' is in screen coordinates virtual void Invalidate(const Rect& box); // Invalidate the area of this element indicated by the region. // NOTE : 'region' is in screen coordinates virtual void Invalidate(const Region& region); // Set the location of this element virtual void SetLocation(const Point& loc); virtual Region Update(); virtual Region Draw(); virtual void DrawLabel(); virtual void DrawLabelImage(); void AddGradientStop(float position, uint8_t a, uint8_t r, uint8_t g, uint8_t b); void SetGradientAngle(int16_t angle); GraphicsContext& GetGraphicsContext() { return mGfx; }; Rect GetClientRect() { return mClientRect; }; void SetLabelText(std::string label) { mLabelText = label; }; void SetLabelCenter(Point loc) { mLabelCenter = loc; }; void SetTextColor(Color32 color) { mTextColor = color; }; void SetLabelImage(BMPImage* image) { mLabelImage = image; }; void SetImage(BMPImage* image) { mImage = image; }; void SetImageAlpha(uint8_t alpha) { mImageAlpha = alpha; }; void SetLabelImageCenter(Point loc) { mLabelImageCenter = loc; }; protected: bool mVisible; // NOTE : the "ALIGN" below. ARM does not like un-aligned memory access Rect mClientRect ALIGN; //!< The bounds for this element in client space (upper left is 0,0) GraphicsContext mGfx; Region mForegroundDirtyRegion; //!< The portion of our foreground that needs to be redrawn Region mBackgroundDirtyRegion; //!< The portion of our background that needs to be redrawn Region mScreenDirtyRegion; //!< The portion of the object below us that needs to be redrawn //!< NOTE : this is in screen coordinates, not client Region mTempRegion; //!< Temp storage region. Never assume this contains anything valid! std::vector<GradientStop> mGradientStops; bool mStateChanged; int16_t mGradientAngle ALIGN; std::string mLabelText; //!< The text label for this element Point mLabelCenter; //!< The location of the center of the label Color32 mTextColor; //!< Color for text - labels, etc. BMPImage* mLabelImage; //!< The label image for this element Point mLabelImageCenter; //!< The location of the center of the label image BMPImage* mImage; //!< The image for this element (if any) uint8_t mImageAlpha; //!< Global alpha value to apply to image, or eOpaque int16_t mImageAlphaCurrent; //!< If we are fading in/out, this is the current val };
asicerik/PiCluster
source/ClusterElement.h
C
unlicense
2,847
[ 30522, 1001, 10975, 8490, 2863, 2320, 1001, 2421, 1000, 2555, 1012, 1044, 1000, 2465, 9324, 12260, 3672, 1063, 2270, 1024, 9324, 12260, 3672, 1006, 1007, 1025, 7484, 1066, 9324, 12260, 3672, 1006, 1007, 1025, 7484, 22017, 2140, 1999, 4183, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import React from 'react'; import IconBase from './../components/IconBase/IconBase'; export default class IosAnalytics extends React.Component { render() { if(this.props.bare) { return <g> <path d="M256,32C141.174,32,46.544,118.404,33.54,229.739C32.534,238.354,32,247.114,32,256c0,1.783,0.026,3.561,0.067,5.333 C34.901,382.581,134.071,480,256,480c105.255,0,193.537-72.602,217.542-170.454c1.337-5.451,2.474-10.979,3.404-16.579 C478.943,280.939,480,268.594,480,256C480,132.288,379.712,32,256,32z M462.585,280.352c-7.265-7.807-13.064-16.09-15.702-20.429 c-0.871-1.47-21.682-35.994-52.828-35.994c-27.937,0-42.269,26.269-51.751,43.65c-1.415,2.593-2.75,5.041-3.978,7.118 c-11.566,19.587-27.693,30.608-43.105,29.541c-13.586-0.959-25.174-11.403-32.628-29.41c-9.331-22.54-29.551-46.812-53.689-50.229 c-11.428-1.619-28.553,0.866-45.325,21.876c-3.293,4.124-6.964,9.612-11.215,15.967c-10.572,15.804-26.549,39.686-38.653,41.663 c-21.02,3.438-35.021-12.596-35.583-13.249l-0.487-0.58l-0.587-0.479c-0.208-0.17-15.041-12.417-29.047-33.334 c0-0.155-0.006-0.31-0.006-0.464c0-28.087,5.497-55.325,16.339-80.958c10.476-24.767,25.476-47.013,44.583-66.12 s41.354-34.107,66.12-44.583C200.675,53.497,227.913,48,256,48s55.325,5.497,80.958,16.339 c24.767,10.476,47.013,25.476,66.12,44.583s34.107,41.354,44.583,66.12C458.503,200.675,464,227.913,464,256 C464,264.197,463.518,272.318,462.585,280.352z"></path> </g>; } return <IconBase> <path d="M256,32C141.174,32,46.544,118.404,33.54,229.739C32.534,238.354,32,247.114,32,256c0,1.783,0.026,3.561,0.067,5.333 C34.901,382.581,134.071,480,256,480c105.255,0,193.537-72.602,217.542-170.454c1.337-5.451,2.474-10.979,3.404-16.579 C478.943,280.939,480,268.594,480,256C480,132.288,379.712,32,256,32z M462.585,280.352c-7.265-7.807-13.064-16.09-15.702-20.429 c-0.871-1.47-21.682-35.994-52.828-35.994c-27.937,0-42.269,26.269-51.751,43.65c-1.415,2.593-2.75,5.041-3.978,7.118 c-11.566,19.587-27.693,30.608-43.105,29.541c-13.586-0.959-25.174-11.403-32.628-29.41c-9.331-22.54-29.551-46.812-53.689-50.229 c-11.428-1.619-28.553,0.866-45.325,21.876c-3.293,4.124-6.964,9.612-11.215,15.967c-10.572,15.804-26.549,39.686-38.653,41.663 c-21.02,3.438-35.021-12.596-35.583-13.249l-0.487-0.58l-0.587-0.479c-0.208-0.17-15.041-12.417-29.047-33.334 c0-0.155-0.006-0.31-0.006-0.464c0-28.087,5.497-55.325,16.339-80.958c10.476-24.767,25.476-47.013,44.583-66.12 s41.354-34.107,66.12-44.583C200.675,53.497,227.913,48,256,48s55.325,5.497,80.958,16.339 c24.767,10.476,47.013,25.476,66.12,44.583s34.107,41.354,44.583,66.12C458.503,200.675,464,227.913,464,256 C464,264.197,463.518,272.318,462.585,280.352z"></path> </IconBase>; } };IosAnalytics.defaultProps = {bare: false}
fbfeix/react-icons
src/icons/IosAnalytics.js
JavaScript
mit
2,687
[ 30522, 12324, 10509, 2013, 1005, 10509, 1005, 1025, 12324, 12696, 15058, 2013, 1005, 1012, 1013, 1012, 1012, 1013, 6177, 1013, 12696, 15058, 1013, 12696, 15058, 1005, 1025, 9167, 12398, 2465, 16380, 27953, 21252, 2015, 8908, 10509, 1012, 6922...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "GuiManager.h" #include "Shader.h" #include "TextureData.h" #include "Component.h" #if defined(GLES2) #include <GLES2/gl2.h> #elif defined(GLES3) #include <GLES3/gl3.h> #else #include <GL/glew.h> #endif #include <glm/gtx/transform.hpp> TextureData *m_textureData; Shader *m_shader; static int g_AttribLocationPosition = 0, g_AttribLocationUV = 0, g_AttribLocationColor = 0; static unsigned int g_VboHandle = 0, g_VaoHandle = 0, g_ElementsHandle = 0; void GuiManager::addInputCharactersUTF8(const char *text) { ImGuiIO &io = ImGui::GetIO(); io.AddInputCharactersUTF8(text); } void GuiManager::setKeyEvent(int key, bool keydown) { ImGuiIO &io = ImGui::GetIO(); io.KeysDown[key] = keydown; } void GuiManager::renderDrawLists(ImDrawData *draw_data) { // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates) ImGuiIO &io = ImGui::GetIO(); int fb_width = (int)(io.DisplaySize.x * io.DisplayFramebufferScale.x); int fb_height = (int)(io.DisplaySize.y * io.DisplayFramebufferScale.y); if (fb_width == 0 || fb_height == 0) return; draw_data->ScaleClipRects(io.DisplayFramebufferScale); // Backup GL state GLint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, &last_program); GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture); GLint last_active_texture; glGetIntegerv(GL_ACTIVE_TEXTURE, &last_active_texture); GLint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer); GLint last_element_array_buffer; glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &last_element_array_buffer); #if !defined(GLES2) GLint last_vertex_array; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array); GLint last_blend_src; glGetIntegerv(GL_BLEND_SRC, &last_blend_src); GLint last_blend_dst; glGetIntegerv(GL_BLEND_DST, &last_blend_dst); #endif GLint last_blend_equation_rgb; glGetIntegerv(GL_BLEND_EQUATION_RGB, &last_blend_equation_rgb); GLint last_blend_equation_alpha; glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &last_blend_equation_alpha); GLint last_viewport[4]; glGetIntegerv(GL_VIEWPORT, last_viewport); GLboolean last_enable_blend = glIsEnabled(GL_BLEND); GLboolean last_enable_cull_face = glIsEnabled(GL_CULL_FACE); GLboolean last_enable_depth_test = glIsEnabled(GL_DEPTH_TEST); GLboolean last_enable_scissor_test = glIsEnabled(GL_SCISSOR_TEST); // Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled glEnable(GL_BLEND); glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_CULL_FACE); glDisable(GL_DEPTH_TEST); glEnable(GL_SCISSOR_TEST); glActiveTexture(GL_TEXTURE0); // Setup orthographic projection matrix glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height); auto ortho_projection = glm::ortho(0.0f, io.DisplaySize.x, io.DisplaySize.y, 0.0f); m_shader->bind(); m_shader->setUniform1i("Texture", 0); m_shader->setUniformMatrix4f("ProjMtx", ortho_projection); #if !defined(GLES2) glBindVertexArray(g_VaoHandle); #else glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle); glEnableVertexAttribArray(g_AttribLocationPosition); glEnableVertexAttribArray(g_AttribLocationUV); glEnableVertexAttribArray(g_AttribLocationColor); #define OFFSETOF(TYPE, ELEMENT) ((size_t) & (((TYPE *)0)->ELEMENT)) glVertexAttribPointer(g_AttribLocationPosition, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid *)OFFSETOF(ImDrawVert, pos)); glVertexAttribPointer(g_AttribLocationUV, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid *)OFFSETOF(ImDrawVert, uv)); glVertexAttribPointer(g_AttribLocationColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid *)OFFSETOF(ImDrawVert, col)); #undef OFFSETOF #endif for (int n = 0; n < draw_data->CmdListsCount; n++) { const ImDrawList *cmd_list = draw_data->CmdLists[n]; const ImDrawIdx *idx_buffer_offset = 0; glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle); glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)cmd_list->VtxBuffer.size() * sizeof(ImDrawVert), (GLvoid *)&cmd_list->VtxBuffer.front(), GL_STREAM_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ElementsHandle); glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)cmd_list->IdxBuffer.size() * sizeof(ImDrawIdx), (GLvoid *)&cmd_list->IdxBuffer.front(), GL_STREAM_DRAW); for (const ImDrawCmd *pcmd = cmd_list->CmdBuffer.begin(); pcmd != cmd_list->CmdBuffer.end(); pcmd++) { if (pcmd->UserCallback) { pcmd->UserCallback(cmd_list, pcmd); } else { m_textureData->bind(0); glScissor((int)pcmd->ClipRect.x, (int)(fb_height - pcmd->ClipRect.w), (int)(pcmd->ClipRect.z - pcmd->ClipRect.x), (int)(pcmd->ClipRect.w - pcmd->ClipRect.y)); glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset); } idx_buffer_offset += pcmd->ElemCount; } } #if defined(GLES2) glDisableVertexAttribArray(g_AttribLocationPosition); glDisableVertexAttribArray(g_AttribLocationUV); glDisableVertexAttribArray(g_AttribLocationColor); #endif // Restore modified GL state glUseProgram(last_program); glActiveTexture(last_active_texture); glBindTexture(GL_TEXTURE_2D, last_texture); #if !defined(GLES2) glBindVertexArray(last_vertex_array); #endif glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, last_element_array_buffer); glBlendEquationSeparate(last_blend_equation_rgb, last_blend_equation_alpha); #if !defined(GLES2) glBlendFunc(last_blend_src, last_blend_dst); #endif if (last_enable_blend) glEnable(GL_BLEND); else glDisable(GL_BLEND); if (last_enable_cull_face) glEnable(GL_CULL_FACE); else glDisable(GL_CULL_FACE); if (last_enable_depth_test) glEnable(GL_DEPTH_TEST); else glDisable(GL_DEPTH_TEST); if (last_enable_scissor_test) glEnable(GL_SCISSOR_TEST); else glDisable(GL_SCISSOR_TEST); glViewport(last_viewport[0], last_viewport[1], (GLsizei)last_viewport[2], (GLsizei)last_viewport[3]); } void GuiManager::invalidateDeviceObjects(void) { #if !defined(GLES2) if (g_VaoHandle) glDeleteVertexArrays(1, &g_VaoHandle); #endif if (g_VboHandle) glDeleteBuffers(1, &g_VboHandle); if (g_ElementsHandle) glDeleteBuffers(1, &g_ElementsHandle); g_VaoHandle = g_VboHandle = g_ElementsHandle = 0; delete m_shader; } void GuiManager::createDeviceObjects(void) { m_shader = new Shader("shaders/gui"); m_shader->link(); m_shader->createUniform("Texture"); m_shader->createUniform("ProjMtx"); g_AttribLocationPosition = glGetAttribLocation(m_shader->getProgram(), "Position"); g_AttribLocationUV = glGetAttribLocation(m_shader->getProgram(), "UV"); g_AttribLocationColor = glGetAttribLocation(m_shader->getProgram(), "Color"); glGenBuffers(1, &g_VboHandle); glGenBuffers(1, &g_ElementsHandle); #if !defined(GLES2) glGenVertexArrays(1, &g_VaoHandle); glBindVertexArray(g_VaoHandle); glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle); glEnableVertexAttribArray(g_AttribLocationPosition); glEnableVertexAttribArray(g_AttribLocationUV); glEnableVertexAttribArray(g_AttribLocationColor); #define OFFSETOF(TYPE, ELEMENT) ((size_t) & (((TYPE *)0)->ELEMENT)) glVertexAttribPointer(g_AttribLocationPosition, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid *)OFFSETOF(ImDrawVert, pos)); glVertexAttribPointer(g_AttribLocationUV, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid *)OFFSETOF(ImDrawVert, uv)); glVertexAttribPointer(g_AttribLocationColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid *)OFFSETOF(ImDrawVert, col)); #undef OFFSETOF #endif } GuiManager::GuiManager(const glm::vec2 &drawableSize, const glm::vec2 &displaySize, SDL_Window *sdlWindow) { m_sdlWindow = sdlWindow; showProps = true; ImGuiIO &io = ImGui::GetIO(); io.KeyMap[ImGuiKey_Tab] = SDLK_TAB; // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array. io.KeyMap[ImGuiKey_LeftArrow] = SDL_SCANCODE_LEFT; io.KeyMap[ImGuiKey_RightArrow] = SDL_SCANCODE_RIGHT; io.KeyMap[ImGuiKey_UpArrow] = SDL_SCANCODE_UP; io.KeyMap[ImGuiKey_DownArrow] = SDL_SCANCODE_DOWN; io.KeyMap[ImGuiKey_PageUp] = SDL_SCANCODE_PAGEUP; io.KeyMap[ImGuiKey_PageDown] = SDL_SCANCODE_PAGEDOWN; io.KeyMap[ImGuiKey_Home] = SDL_SCANCODE_HOME; io.KeyMap[ImGuiKey_End] = SDL_SCANCODE_END; io.KeyMap[ImGuiKey_Delete] = SDLK_DELETE; io.KeyMap[ImGuiKey_Backspace] = SDLK_BACKSPACE; io.KeyMap[ImGuiKey_Enter] = SDLK_RETURN; io.KeyMap[ImGuiKey_Escape] = SDLK_ESCAPE; io.KeyMap[ImGuiKey_A] = SDLK_a; io.KeyMap[ImGuiKey_C] = SDLK_c; io.KeyMap[ImGuiKey_V] = SDLK_v; io.KeyMap[ImGuiKey_X] = SDLK_x; io.KeyMap[ImGuiKey_Y] = SDLK_y; io.KeyMap[ImGuiKey_Z] = SDLK_z; io.RenderDrawListsFn = GuiManager::renderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer. io.SetClipboardTextFn = Window::setClipboardText; io.GetClipboardTextFn = Window::getClipboardText; //#ifdef _WIN32 // SDL_SysWMinfo wmInfo; // SDL_VERSION(&wmInfo.version); // SDL_GetWindowWMInfo(m_sdlWindow, &wmInfo); // io.ImeWindowHandle = wmInfo.info.win.window; //#endif createDeviceObjects(); unsigned char *pixels; int width, height; io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bits for OpenGL3 demo because it is more likely to be compatible with user's existing shader. m_textureData = new TextureData(width, height, pixels, GL_TEXTURE_2D, GL_LINEAR); io.DisplaySize = ImVec2(displaySize.x, displaySize.y); io.DisplayFramebufferScale = ImVec2(displaySize.x > 0 ? (drawableSize.x / displaySize.x) : 0, displaySize.y > 0 ? (drawableSize.y / displaySize.y) : 0); } GuiManager::~GuiManager(void) { invalidateDeviceObjects(); delete m_textureData; ImGui::Shutdown(); } void GuiManager::tick(Window *window, std::chrono::microseconds delta) { ImGuiIO &io = ImGui::GetIO(); io.DeltaTime = std::chrono::duration_cast<std::chrono::duration<float>>(delta).count(); glm::vec2 mousePos = window->getInput()->getMousePosition(); io.MousePos = ImVec2(mousePos.x, mousePos.y); io.MouseDown[0] = window->getInput()->mouseIsPressed(SDL_BUTTON_LEFT); io.MouseDown[1] = window->getInput()->mouseIsPressed(SDL_BUTTON_RIGHT); io.MouseDown[2] = window->getInput()->mouseIsPressed(SDL_BUTTON_MIDDLE); io.MouseWheel = window->getInput()->getMouseWheel().y / 15.0f; io.KeyShift = (window->getInput()->getKeyModState() & KMOD_SHIFT) != 0; io.KeyCtrl = (window->getInput()->getKeyModState() & KMOD_CTRL) != 0; io.KeyAlt = (window->getInput()->getKeyModState() & KMOD_ALT) != 0; io.KeySuper = (window->getInput()->getKeyModState() & KMOD_GUI) != 0; window->drawCursor(io.MouseDrawCursor ? false : true); // Start the frame ImGui::NewFrame(); } void renderComponent(Component *component) { ImGui::PushID(component); ImGui::AlignFirstTextHeightToWidgets(); ImGui::PushStyleColor(ImGuiCol_Text, ImColor(1.0f, 0.78f, 0.58f, 1.0f)); bool node_open = ImGui::TreeNodeEx("Component", ImGuiTreeNodeFlags_DefaultOpen, "%s_%u", "component", component); ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text(component->getType()); ImGui::PopStyleColor(); ImGui::NextColumn(); int id = 0; if (node_open) { for (auto &property : component->m_properties) { ImGui::PushID(id++); ImGui::AlignFirstTextHeightToWidgets(); ImGui::Bullet(); ImGui::PushStyleColor(ImGuiCol_Text, ImColor(0.78f, 0.58f, 1.0f, 1.0f)); ImGui::Selectable(property.first); ImGui::NextColumn(); ImGui::PushItemWidth(-1); switch (property.second.type) { case FLOAT: ImGui::SliderFloat("##value", (float *)property.second.p, property.second.min, property.second.max); break; case FLOAT3: ImGui::SliderFloat3("##value", (float *)property.second.p, property.second.min, property.second.max); break; case BOOLEAN: ImGui::Checkbox("##value", (bool *)property.second.p); break; case COLOR: ImGui::ColorEdit3("##value", (float *)property.second.p); break; case ANGLE: ImGui::SliderAngle("##value", (float *)property.second.p, property.second.min, property.second.max); break; } ImGui::PopStyleColor(); ImGui::PopItemWidth(); ImGui::NextColumn(); ImGui::PopID(); } ImGui::TreePop(); } ImGui::PopID(); } void renderSceneGraph(Entity *sceneGraph) { ImGui::PushID(sceneGraph); ImGui::AlignFirstTextHeightToWidgets(); ImGui::PushStyleColor(ImGuiCol_Text, ImColor(0.78f, 1.0f, 0.58f, 1.0f)); bool node_open = ImGui::TreeNodeEx("Node", ImGuiTreeNodeFlags_DefaultOpen, "%s_%u", "node", sceneGraph); ImGui::PopStyleColor(); ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); ImGui::NextColumn(); int id = 0; if (node_open) { ImGui::PushID(id); ImGui::PushStyleColor(ImGuiCol_Text, ImColor(0.0f, 0.8f, 1.0f, 1.0f)); ImGui::AlignFirstTextHeightToWidgets(); ImGui::Bullet(); ImGui::Selectable("translation"); ImGui::NextColumn(); ImGui::PushItemWidth(-1); ImGui::SliderFloat3("##value", &(sceneGraph->getTransform().m_position.x), -10.0f, 10.0f); ImGui::PopItemWidth(); ImGui::NextColumn(); ImGui::PopID(); ImGui::PushID(++id); ImGui::Bullet(); ImGui::Selectable("rotation"); ImGui::NextColumn(); ImGui::PushItemWidth(-1); ImGui::SliderFloat4("##value", &(sceneGraph->getTransform().m_rotation.x), -1.0f, 1.0f); ImGui::PopItemWidth(); ImGui::NextColumn(); ImGui::PopID(); ImGui::PushID(++id); ImGui::Bullet(); ImGui::Selectable("scale"); ImGui::NextColumn(); ImGui::PushItemWidth(-1); ImGui::SliderFloat3("##value", &(sceneGraph->getTransform().m_scale.x), 0.0f, 10.0f); ImGui::PopItemWidth(); ImGui::NextColumn(); ImGui::PopStyleColor(); ImGui::PopID(); for (auto component : sceneGraph->getComponents()) { renderComponent(component.get()); } for (auto entity : sceneGraph->getChildren()) { renderSceneGraph(entity.get()); } ImGui::TreePop(); } ImGui::PopID(); } void GuiManager::togglePropertyEditor(void) { showProps = !showProps; } void GuiManager::render(Entity *sceneGraph) { if (showProps) { ImGui::SetNextWindowPos(ImVec2(10, 10)); ImGui::SetNextWindowSize(ImVec2(500, 0), ImGuiSetCond_FirstUseEver); if (!ImGui::Begin("Example: Fixed Overlay", nullptr, ImVec2(0, 0), 0.3f, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings)) { ImGui::End(); return; } ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2)); ImGui::Separator(); ImGui::Columns(2); renderSceneGraph(sceneGraph); ImGui::Columns(1); ImGui::Separator(); ImGui::PopStyleVar(); ImGui::End(); // ImGui::ShowTestWindow(); ImGui::Render(); } }
Shervanator/Engine
src/engine/GuiManager.cpp
C++
gpl-3.0
15,379
[ 30522, 1001, 2421, 1000, 26458, 24805, 4590, 1012, 1044, 1000, 1001, 2421, 1000, 8703, 2099, 1012, 1044, 1000, 1001, 2421, 1000, 14902, 2850, 2696, 1012, 1044, 1000, 1001, 2421, 1000, 6922, 1012, 1044, 1000, 1001, 2065, 4225, 1006, 1043, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace Esthar.Data { public enum JsmCommand { NOP, CAL, JMP, JPF, GJMP, LBL, RET, PSHN_L, PSHI_L, POPI_L, PSHM_B, POPM_B, PSHM_W, POPM_W, PSHM_L, POPM_L, PSHSM_B, PSHSM_W, PSHSM_L, PSHAC, REQ, REQSW, REQEW, PREQ, PREQSW, PREQEW, UNUSE, DEBUG, HALT, SET, SET3, IDLOCK, IDUNLOCK, EFFECTPLAY2, FOOTSTEP, JUMP, JUMP3, LADDERUP, LADDERDOWN, LADDERUP2, LADDERDOWN2, MAPJUMP, MAPJUMP3, SETMODEL, BASEANIME, ANIME, ANIMEKEEP, CANIME, CANIMEKEEP, RANIME, RANIMEKEEP, RCANIME, RCANIMEKEEP, RANIMELOOP, RCANIMELOOP, LADDERANIME, DISCJUMP, SETLINE, LINEON, LINEOFF, WAIT, MSPEED, MOVE, MOVEA, PMOVEA, CMOVE, FMOVE, PJUMPA, ANIMESYNC, ANIMESTOP, MESW, MES, MESSYNC, MESVAR, ASK, WINSIZE, WINCLOSE, UCON, UCOFF, MOVIE, MOVIESYNC, SETPC, DIR, DIRP, DIRA, PDIRA, SPUREADY, TALKON, TALKOFF, PUSHON, PUSHOFF, ISTOUCH, MAPJUMPO, MAPJUMPON, MAPJUMPOFF, SETMESSPEED, SHOW, HIDE, TALKRADIUS, PUSHRADIUS, AMESW, AMES, GETINFO, THROUGHON, THROUGHOFF, BATTLE, BATTLERESULT, BATTLEON, BATTLEOFF, KEYSCAN, KEYON, AASK, PGETINFO, DSCROLL, LSCROLL, CSCROLL, DSCROLLA, LSCROLLA, CSCROLLA, SCROLLSYNC, RMOVE, RMOVEA, RPMOVEA, RCMOVE, RFMOVE, MOVESYNC, CLEAR, DSCROLLP, LSCROLLP, CSCROLLP, LTURNR, LTURNL, CTURNR, CTURNL, ADDPARTY, SUBPARTY, CHANGEPARTY, REFRESHPARTY, SETPARTY, ISPARTY, ADDMEMBER, SUBMEMBER, ISMEMBER, LTURN, CTURN, PLTURN, PCTURN, JOIN, MESFORCUS, BGANIME, RBGANIME, RBGANIMELOOP, BGANIMESYNC, BGDRAW, BGOFF, BGANIMESPEED, SETTIMER, DISPTIMER, SHADETIMER, SETGETA, SETROOTTRANS, SETVIBRATE, STOPVIBRATE, MOVIEREADY, GETTIMER, FADEIN, FADEOUT, FADESYNC, SHAKE, SHAKEOFF, FADEBLACK, FOLLOWOFF, FOLLOWON, GAMEOVER, ENDING, SHADELEVEL, SHADEFORM, FMOVEA, FMOVEP, SHADESET, MUSICCHANGE, MUSICLOAD, FADENONE, POLYCOLOR, POLYCOLORALL, KILLTIMER, CROSSMUSIC, DUALMUSIC, EFFECTPLAY, EFFECTLOAD, LOADSYNC, MUSICSTOP, MUSICVOL, MUSICVOLTRANS, MUSICVOLFADE, ALLSEVOL, ALLSEVOLTRANS, ALLSEPOS, ALLSEPOSTRANS, SEVOL, SEVOLTRANS, SEPOS, SEPOSTRANS, SETBATTLEMUSIC, BATTLEMODE, SESTOP, BGANIMEFLAG, INITSOUND, BGSHADE, BGSHADESTOP, RBGSHADELOOP, DSCROLL2, LSCROLL2, CSCROLL2, DSCROLLA2, LSCROLLA2, CSCROLLA2, DSCROLLP2, LSCROLLP2, CSCROLLP2, SCROLLSYNC2, SCROLLMODE2, MENUENABLE, MENUDISABLE, FOOTSTEPON, FOOTSTEPOFF, FOOTSTEPOFFALL, FOOTSTEPCUT, PREMAPJUMP, USE, SPLIT, ANIMESPEED, RND, DCOLADD, DCOLSUB, TCOLADD, TCOLSUB, FCOLADD, FCOLSUB, COLSYNC, DOFFSET, LOFFSETS, COFFSETS, LOFFSET, COFFSET, OFFSETSYNC, RUNENABLE, RUNDISABLE, MAPFADEOFF, MAPFADEON, INITTRACE, SETDRESS, GETDRESS, FACEDIR, FACEDIRA, FACEDIRP, FACEDIRLIMIT, FACEDIROFF, SARALYOFF, SARALYON, SARALYDISPOFF, SARALYDISPON, MESMODE, FACEDIRINIT, FACEDIRI, JUNCTION, SETCAMERA, BATTLECUT, FOOTSTEPCOPY, WORLDMAPJUMP, RFACEDIRI, RFACEDIR, RFACEDIRA, RFACEDIRP, RFACEDIROFF, FACEDIRSYNC, COPYINFO, PCOPYINFO, RAMESW, BGSHADEOFF, AXIS, AXISSYNC, MENUNORMAL, MENUPHS, BGCLEAR, GETPARTY, MENUSHOP, DISC, DSCROLL3, LSCROLL3, CSCROLL3, MACCEL, MLIMIT, ADDITEM, SETWITCH, SETODIN, RESETGF, MENUNAME, REST, MOVECANCEL, PMOVECANCEL, ACTORMODE, MENUSAVE, SAVEENABLE, PHSENABLE, HOLD, MOVIECUT, SETPLACE, SETDCAMERA, CHOICEMUSIC, GETCARD, DRAWPOINT, PHSPOWER, KEY, CARDGAME, SETBAR, DISPBAR, KILLBAR, SCROLLRATIO2, WHOAMI, MUSICSTATUS, MUSICREPLAY, DOORLINEOFF, DOORLINEON, MUSICSKIP, DYING, SETHP, GETHP, MOVEFLUSH, MUSICVOLSYNC, PUSHANIME, POPANIME, KEYSCAN2, KEYON2, PARTICLEON, PARTICLEOFF, KEYSIGHNCHANGE, ADDGIL, ADDPASTGIL, ADDSEEDLEVEL, PARTICLESET, SETDRAWPOINT, MENUTIPS, LASTIN, LASTOUT, SEALEDOFF, MENUTUTO, OPENEYES, CLOSEEYES, BLINKEYES, SETCARD, HOWMANYCARD, WHERECARD, ADDMAGIC, SWAP, SETPARTY2, SPUSYNC, BROKEN, Unknown1, Unknown2, Unknown3, Unknown4, Unknown5, Unknown6, Unknown7, Unknown8, Unknown9, Unknown10, Unknown11, Unknown12, Unknown13, Unknown14, Unknown15, Unknown16, Unknown17, Unknown18 } }
Albeoris/Esthar
Esthar.Data/JSM, SYM/JsmOperationCode.cs
C#
mit
6,772
[ 30522, 3415, 15327, 9765, 8167, 1012, 2951, 1063, 2270, 4372, 2819, 1046, 6491, 9006, 2386, 2094, 1063, 2053, 2361, 1010, 10250, 1010, 1046, 8737, 1010, 16545, 2546, 1010, 1043, 24703, 2361, 1010, 6053, 2140, 1010, 2128, 2102, 1010, 8827, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package mqttpubsub import ( "encoding/json" "fmt" "sync" "time" log "github.com/Sirupsen/logrus" "github.com/brocaar/loraserver/api/gw" "github.com/brocaar/lorawan" "github.com/eclipse/paho.mqtt.golang" ) // Backend implements a MQTT pub-sub backend. type Backend struct { conn mqtt.Client txPacketChan chan gw.TXPacketBytes gateways map[lorawan.EUI64]struct{} mutex sync.RWMutex } // NewBackend creates a new Backend. func NewBackend(server, username, password string) (*Backend, error) { b := Backend{ txPacketChan: make(chan gw.TXPacketBytes), gateways: make(map[lorawan.EUI64]struct{}), } opts := mqtt.NewClientOptions() opts.AddBroker(server) opts.SetUsername(username) opts.SetPassword(password) opts.SetOnConnectHandler(b.onConnected) opts.SetConnectionLostHandler(b.onConnectionLost) log.WithField("server", server).Info("backend: connecting to mqtt broker") b.conn = mqtt.NewClient(opts) if token := b.conn.Connect(); token.Wait() && token.Error() != nil { return nil, token.Error() } return &b, nil } // Close closes the backend. func (b *Backend) Close() { b.conn.Disconnect(250) // wait 250 milisec to complete pending actions } // TXPacketChan returns the TXPacketBytes channel. func (b *Backend) TXPacketChan() chan gw.TXPacketBytes { return b.txPacketChan } // SubscribeGatewayTX subscribes the backend to the gateway TXPacketBytes // topic (packets the gateway needs to transmit). func (b *Backend) SubscribeGatewayTX(mac lorawan.EUI64) error { defer b.mutex.Unlock() b.mutex.Lock() topic := fmt.Sprintf("gateway/%s/tx", mac.String()) log.WithField("topic", topic).Info("backend: subscribing to topic") if token := b.conn.Subscribe(topic, 0, b.txPacketHandler); token.Wait() && token.Error() != nil { return token.Error() } b.gateways[mac] = struct{}{} return nil } // UnSubscribeGatewayTX unsubscribes the backend from the gateway TXPacketBytes // topic. func (b *Backend) UnSubscribeGatewayTX(mac lorawan.EUI64) error { defer b.mutex.Unlock() b.mutex.Lock() topic := fmt.Sprintf("gateway/%s/tx", mac.String()) log.WithField("topic", topic).Info("backend: unsubscribing from topic") if token := b.conn.Unsubscribe(topic); token.Wait() && token.Error() != nil { return token.Error() } delete(b.gateways, mac) return nil } // PublishGatewayRX publishes a RX packet to the MQTT broker. func (b *Backend) PublishGatewayRX(mac lorawan.EUI64, rxPacket gw.RXPacketBytes) error { topic := fmt.Sprintf("gateway/%s/rx", mac.String()) return b.publish(topic, rxPacket) } // PublishGatewayStats publishes a GatewayStatsPacket to the MQTT broker. func (b *Backend) PublishGatewayStats(mac lorawan.EUI64, stats gw.GatewayStatsPacket) error { topic := fmt.Sprintf("gateway/%s/stats", mac.String()) return b.publish(topic, stats) } func (b *Backend) publish(topic string, v interface{}) error { bytes, err := json.Marshal(v) if err != nil { return err } log.WithField("topic", topic).Info("backend: publishing packet") if token := b.conn.Publish(topic, 0, false, bytes); token.Wait() && token.Error() != nil { return token.Error() } return nil } func (b *Backend) txPacketHandler(c mqtt.Client, msg mqtt.Message) { log.WithField("topic", msg.Topic()).Info("backend: packet received") var txPacket gw.TXPacketBytes if err := json.Unmarshal(msg.Payload(), &txPacket); err != nil { log.Errorf("backend: decode tx packet error: %s", err) return } b.txPacketChan <- txPacket } func (b *Backend) onConnected(c mqtt.Client) { defer b.mutex.RUnlock() b.mutex.RLock() log.Info("backend: connected to mqtt broker") if len(b.gateways) > 0 { for { log.WithField("topic_count", len(b.gateways)).Info("backend: re-registering to gateway topics") topics := make(map[string]byte) for k := range b.gateways { topics[fmt.Sprintf("gateway/%s/tx", k)] = 0 } if token := b.conn.SubscribeMultiple(topics, b.txPacketHandler); token.Wait() && token.Error() != nil { log.WithField("topic_count", len(topics)).Errorf("backend: subscribe multiple failed: %s", token.Error()) time.Sleep(time.Second) continue } return } } } func (b *Backend) onConnectionLost(c mqtt.Client, reason error) { log.Errorf("backend: mqtt connection error: %s", reason) }
kumara0093/loraserver
backend/mqttpubsub/backend.go
GO
mit
4,289
[ 30522, 7427, 1049, 4160, 4779, 14289, 5910, 12083, 12324, 1006, 1000, 17181, 1013, 1046, 3385, 1000, 1000, 4718, 2102, 1000, 1000, 26351, 1000, 1000, 2051, 1000, 8833, 1000, 21025, 2705, 12083, 1012, 4012, 1013, 2909, 22264, 2368, 1013, 883...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...